haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 211 forks source link

LANGUAGE pragma completion doesn't work on subsequent lines #1365

Open masaeedu opened 5 years ago

masaeedu commented 5 years ago

When I write:

{#- LANGUAGE GAD

I get an autocomplete suggestion for the GADT language extension.

But if I do:

{#- LANGUAGE
    GAD

I don't get any suggestions. I prefer to wrap the list of pragmas onto separate lines, so this causes some issues.

fendor commented 5 years ago

IIRC, this happens because HIE is actually not aware of the Context in this case. How this currently works: If the line starts with {#- LANGUAGE then auto complete the plugin list. To make this work, we either have to reparse lines that are before the one we want to auto-complete in, or add more Context information. Imo, the latter is the more future-proof solution, however, the implementation might prove tricky.