-
-
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
Make type lenses plugin configurable #1491
Conversation
Wow, impressive work, many thanks There would be a generic config option to enable or disable code lenses for the plugin, if ghcide plugins honour the generic configuration (and they should be imo, see #1321) Add such a generic configuration maybe is out of the scope of this pr but maybe we should design the options taking in account the plugin will have enable/disable at some point. So the options could be
|
What about some test negating the ghc warnings, to check no type lens is emitted? |
Yeah, that makes sense.
Agree, we need update tests to run against each mode. |
There appears to be a space in the config string in the video. Is that intentional? Necessary? |
@isovector Ah, good catch. It's not intentional, but works coincidentally because of the |
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.
great work, tests looks great too
3 issues closed in a row, amazing 👏 |
This PR is rebased on #1471, so we could close #1471 in favour of this (if it looks good).
Closes #1477
Closes #1468
Closes #622
Demo
output.mp4
Previously, we set
Opt_WarnMissingSignatures
andOpt_WarnMissingPatternSynonymSignatures
for each module to produce hidden diagnostics and generate code lenses. By contrast, types of global bindings are derived from results of typecheck, instead of parsing diagnostic messages.There are four working modes introduced in generic plugin config:
Enabled
Always
-- always displays type lenses of global bindings, no matter what GHC flags are set by usersExported
-- similar toEnabled
, but only shows for exported global bindingsDiagnostics
-- follows error messages produced by GHC, users can control the display of code lenses by setting GHC flags in this mode*Disabled
-- fully disabledFor local bindings, corrsponding type lenses show only when
Opt_WarnMissingLocalSignatures
is set and works inAlways
mode.