-
-
Notifications
You must be signed in to change notification settings - Fork 388
Code action to define undefined variables includes suggestions in type signature #3795
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Looks like a bug in the regex for parsing stuff out of the GHC error message... |
Stumbled upon this while checking for some easy bugs to fix.
This shouldn't be that hard to fix, but I wonder if it's worth trying to make the regexes more robust, or try to use the new structured erros for this (which were only introduced in recent GHCs, something like 9.6+?) @michaelpj any opinions? |
I think using the structured errors is a whole project, I'm planning to propose it as a GSoC project. So probably not a quick fix. Whereas fixing the regex is a patch, but at least should be quick. What would be extremely helpful in any case would be writing a test that shows the problem! |
Fixed in #4016 so this can be closed. |
Thanks! |
Your environment
MacOS
GHC 9.4.5 from ghcup
cabal
emacs+lsp-mode
HLS v2.2.0.0 from ghcup
Steps to reproduce
Write some code with an undefined variable, e.g.:
Invoke the code action
Define plus...
Result:
Expected behaviour
The suggestion should not be in the type signature, possibly it could be a comment before/after the type signature.
Actual behaviour
Suggestion in the signature, causing a parse error.
The text was updated successfully, but these errors were encountered: