-
-
Notifications
You must be signed in to change notification settings - Fork 389
Module name codelens suggestion always present (with flickering) #1769
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
Comments
Hi thanks for opening the issue. There is a way to disable plugins but it still is not documented (#1433). To disable the module name plugin you can add the following json snippet where your editor put the lsp configuration (in vscode haskell.plugin.moduleName.globalOn": false |
@jneira this sounds like a bug in the module plugin though. I'm not totally sure why it wants to rename the module (seems dubious to me), but it should definitely not flicker as the code goes in/out of parsing, but should be using the last stale correct value to base its suggestions on. |
yeah, you are right, the code lens should be stable |
@jneira, thanks for the quick response! Adding the setting did the trick. Appreciate the help. |
@azuzunaga thank you for trying and confirming it works, i am gonna let this open to track the solution of the disturbing flickering |
maybe @tittoassini could have some time to take a quick look 🙂 |
The code seems to have changed significantly since I wrote the initial version so I might not be the right person to ask. Anyway I had a quick look and the problem is what @ndmitchell suggested, as the code become unparsable the code lens disappears. |
It might be just a matter of changing this line: 141 pm <- MaybeT . runAction "ModuleName.GetParsedModule" state $ use GetParsedModule nfp to 141 pm <- MaybeT . runAction "ModuleName.GetParsedModule" state $ useWithStale GetParsedModule nfp I will have a look soon. |
Yes, that solves the problem. Of course if we use stale information, that might lead to incorrect code actions. If for example:
But that's life for you (btw this happens with all plugins that rely on stale info, for example the 'imports' one). |
So what you want? What you really really want? Correctness or Aesthetics? Can't have both I am afraid (or maybe you can? any suggestion?) |
Hmm both if possible :-) |
I see that useWithStale returns a PositionMapping, is that meant to be used in conjunction with a diff to update the position of a code lens edit? that would fix the problem (a minimal problem for sure, possibly not worth fixing). I am far from my computer for a few days, I will look into this again next sunday, in the meantime any suggestion is welcome. |
The recommendation here still seems good, just need someone to implement. |
The codelens hint at the top of the editor always suggests a module name if the existing module name doesn't match the dir/filename structure. However, the hint collapses and is displayed again while typing, making the editor scroll up and down the screen.
Is there a way to turn module name hints off? It is possible to disable all codelens hints via the settings, but I'd like to preserve the other hints.
Here is a screen recording demonstrating the jumping around:
The text was updated successfully, but these errors were encountered: