haskell / haskell-ide-engine

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

Linter ignores globally declared QuasiQuotes #842

Open theGhostJW opened 6 years ago

theGhostJW commented 6 years ago

package.yaml

default-extensions:
  -- QuasiQuotes

.hlint.yaml

- arguments:
  - -XQuasiQuotes

hlint will run from the command line with no hints for a file that includes something like:

a =  [absfile|C:\Vids\SystemDesign\VidList.txt|]

but atom (running haskell-hie extension) returns hlint warning (description Parse error ...).

The workaround is to add {-# LANGUAGE QuasiQuotes #-} to the top of each file that utilises QuasiQuotes.

Avi-D-coder commented 5 years ago

Where would I start fixing this issue?

fendor commented 5 years ago

I would start with having a minimal example where this behaviour can be reproduced. Then, I would compare the output with an actual invocation of hlint, make sure this is not a bug upstream. Then, in the plugin ApplyRefact, iirc, you can compare the invocation of the linting command, lintCmd. Maybe there you already would need to specify the active Language Extensions? In particular, the function invocation of parseModuleEx in runLintCmd seems promising for a first investigation.

If you fix it, please add a validating test-case!