-
-
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
Code action to add existing, unused pragma #1390
Comments
This is a known bug: #1165 (comment) |
If blocked upstream - what is the upstream report link? |
the linked #1165 is from this repo, maybe it was moved from ghcide? |
Link probably should be: https://gitlab.haskell.org/ghc/ghc/-/issues/18516, but I need to ask people in the thread to be sure. |
Oh yeah, structured errors in ghc will help a lot to fix this (and other issues for sure), as described in the linked comment in the merged pr. The relevant comment in the pr is:
(or (and " -X\\([A-Z][A-Za-z]+\\)"
(not "\\([A-Z][A-Za-z]+\\) is deprecated"))
"[Uu]se \\([A-Z][A-Za-z]+\\)"
"Using \\([A-Z][A-Za-z]+\\) might"
"You need \\([A-Z][A-Za-z]+\\)"
"Try \\(?:enabling \\)?\\([A-Z][A-Za-z]+\\)"
"intended to use \\([A-Z][A-Za-z]+\\)"
"Enable \\(?:the \\)?\\([A-Z][A-Za-z]+\\)"
"need \\([A-Z][A-Za-z]+\\) turned on"
"extension '\\([A-Z][A-Za-z]+\\)'") (I'm sure the regexp can be optimised, it's just something that grew organically.) However, this is rather ad-hoc and will get out of date when an error message is added/changed in GHC. |
I have a file with pragmas at the top
DeriveAnyClass is unused, and hlint reports this. But I get a code action to add it.
Your environment
Output of
haskell-language-server --probe-tools
orhaskell-language-server-wrapper --probe-tools
:haskell-language-server version: 0.9.0.0 (GHC: 8.8.4) (PATH: /Users/alanzimm/.cabal/store/ghc-8.8.4/hskll-lngg-srvr-0.9.0.0-a8c1156a/bin/haskell-language-server) 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: emacs lsp-mode
HLS at a065cd6
The text was updated successfully, but these errors were encountered: