-
-
Notifications
You must be signed in to change notification settings - Fork 404
Suggest adding pragmas for parse errors too #1165
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
Conversation
Only errors produced by the type checker were checked for mentions of a pragma that could be enabled. Many parse errors suggest enabling a pragma: * `@` -> `TypeApplications` * `forall` -> `RankNTypes`. Although `ScopedTypeVariables` would be a better suggestion, IMO. * ... Generate suggestions for these too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. But there is one thing needs for attention: If a moudle name contains a pragma name, such as test/testdata/addPragmas/TypeApplications.hs, some diagnostics yield by typecheck would trigger findPragma
, creating code actions which suggest adding the unrelated pragma.
What you are saying is true, but that was already the case before this PR.
|
Awesome, thank you so much! |
Only errors produced by the type checker were checked for mentions of a pragma
that could be enabled. Many parse errors suggest enabling a pragma:
@
->TypeApplications
forall
->RankNTypes
. AlthoughScopedTypeVariables
would be a bettersuggestion, IMO.
Generate suggestions for these too.