-
-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HLint fails to parse code that is invalid in disabled extensions #1279
Comments
@maksbotan yeah, hlint enables by default a bunch of extensions known to be relatively innocuous, but in this (somewhat corner?) case it cant parse the module. |
Yeah, you are right. I've never used HLint on its own, so wasn't aware of this.
|
Would it make sense to make HLint explicitly enable the same set of extensions as passed to GHC for the current module? |
yeah, in fact we are doing it already and we only should remove the default extensions used by hlint |
…#2321) * Rename test data files * Add regression tests * Add regression test for #1279 * Use timeout * Correct waitForProgressDone in ghcide * Remove unnecessary waitForDiagnostics * Mark test broken for hlint on ghclib * Add test over unused extensions * Add test for #2042 * Add data for #2280 * Use waitForAllProgressDone * Add test for #2280 * correct module name * Add reproduction for #2290 * Correct test case * Comment about knownBrokenForHlint* * Correction
This has a regression tes here: haskell-language-server/plugins/hls-hlint-plugin/test/Main.hs Lines 215 to 221 in 95de49b
|
@eddiemundo do you think this could relativley easy to fix? |
Your environment
Output of
haskell-language-server --probe-tools
orhaskell-language-server-wrapper --probe-tools
:$ haskell-language-server-wrapper --probe-tools haskell-language-server version: 0.9.0.0 (GHC: 8.10.1) (PATH: /Users/maksbotan/.local/bin/haskell-language-server-wrapper) (GIT hash: 46d2a3dc7ef49ba57b2706022af1801149ab3f2b) Tool versions found on the $PATH cabal: 3.2.0.0 stack: 2.5.1 ghc: 8.8.4
Which lsp-client do you use:
Describe your project (alternative: link to the project):
Steps to reproduce
Open the above module.
Expected behaviour
No errors.
Actual behaviour
Include debug information
Execute in the root of your project the command
haskell-language-server --debug .
and paste the logs here:Debug output:
Paste the logs from the lsp-client, e.g. for VS Code
LSP logs:
As you can see, HLS enables all extensions for HLint, including
PatternSynonyms
, which makespattern
a reserved keyword. I, however, do not enable it in my Haskell source and am free to use it as I like. Therefore HLint is broken for this file.The text was updated successfully, but these errors were encountered: