-
-
Notifications
You must be signed in to change notification settings - Fork 390
hls-explicit-fixity-plugin #2941
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
Conversation
5eeb0c5
to
ea8dc5d
Compare
The license missing... will upload it tomorrow... |
-- Get fixity from HscEnv for local defined operator will crash the plugin, | ||
-- we first try to use ModIface to get fixities, and then use | ||
-- HscEnv if ModIface doesn't available. |
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.
Did you look into getting the fixity from the HieAst ?
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.
I tried HieAst but found nothing, it would be appreciated if you can leave some hints :)
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.
cc @wz1000
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.
I think you need to add the testsuite to CI
plugins/hls-explicit-fixity-plugin/src/Ide/Plugin/ExplicitFixity.hs
Outdated
Show resolved
Hide resolved
ea8dc5d
to
e5fe94a
Compare
I think we should consider rolling this into the main hover code. While theoretically we can have multiple hover plugins, the hovers get concatenated together which isn't the best way of doing things. I think fixity is uncontroversially useful enough that we could just make it part of the default hover. It might save a bunch of code, too. |
plugins/hls-explicit-fixity-plugin/src/Ide/Plugin/ExplicitFixity.hs
Outdated
Show resolved
Hide resolved
plugins/hls-explicit-fixity-plugin/src/Ide/Plugin/ExplicitFixity.hs
Outdated
Show resolved
Hide resolved
plugins/hls-explicit-fixity-plugin/src/Ide/Plugin/ExplicitFixity.hs
Outdated
Show resolved
Hide resolved
plugins/hls-explicit-fixity-plugin/src/Ide/Plugin/ExplicitFixity.hs
Outdated
Show resolved
Hide resolved
It turns out I'm a little fear of the performance requirements of ghcide. And it not easy to make 'show fixity' configurable, I can move this to ghcide if we reach a consensus on this plugin's performance and decide it must be in hover. |
One more step, I even want |
Configuration is bad :) The best option is for it to be fast enough and on by default! |
I'll move this to ghcide later if nobody suspects the performance of the current implementation. |
I am not worried about the performance, but I would prefer if we fixed how hover plugins get combined rather than putting all the hovers in ghcide. |
I think it's not too bad, I just think that in this instance, since it's such a core piece of information, we might as well put it in the main hover. If e.g. someone actually writes code to show strictness signatures in a hover, that should definitely go in a plugin! |
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.
Maybe we should land this now and move it to ghcide once we are 100% happy with it
I've been busy with graduation these days, and I'll pick up my opened prs later :) |
did we end up putting this hover in ghcide? |
I initially want close this after #2973 is merged. |
Continue in this thread because #2973 (comment) |
4cddad0
to
f0bb1c1
Compare
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.
Thank you for the implementation! Looks good to me overall.
Here are my two cents.
plugins/hls-explicit-fixity-plugin/src/Ide/Plugin/ExplicitFixity.hs
Outdated
Show resolved
Hide resolved
plugins/hls-explicit-fixity-plugin/src/Ide/Plugin/ExplicitFixity.hs
Outdated
Show resolved
Hide resolved
* init hls-explicit-fixity-plugin * Update dependencies * Refactor: Prevent block on startup * Run pre-commit * Compatibility: Add emptyMessages * Remove unused ModIface * Comment why to make this plugin a lower priority * Provide hover content while testing fail * Avoid lambda * 4 space indent * Pass Text instead of Name Co-authored-by: Pepe Iborra <[email protected]>
Close #2019.
This plugin will show available fixity explicitly while hovering.
The basic code is done, tests will come soon...Done