-
-
Notifications
You must be signed in to change notification settings - Fork 389
Don't reject renames in modules that have implicit exports #3130
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
Regarding the error, I suspect this is a client issue. That log shows that we've returned an error from the code action request, which is really the main way we're supposed to indicate failure. If the client doesn't make that obvious or show the message then there's not much we can do. |
Hello, Sorry for the late response on this. Best effort cross-module renaming can be enabled with |
can anyone tell me how to set haskell.plugin.rename.config.crossModule in neovim please? |
lspconfig.hls.setup{
settings = {
haskell = {
plugin = {
rename = { config = { crossModule = true }}
}
}
}
}
@tri97nguyen you can try adding a "haskell.plugin.rename.config.crossModule" lsp setting in "settings" when you are configuring neovim lsp. more settings of hls are available here at haskell-language-server.readthedocs.io , but not all of them works. |
Having run into this error a lot (and without the message indicating that this config options exists), I'd really prefer if that option were just on by default. Waiting on cross-module renaming to be able to handle all cases seems like letting the perfect be the enemy of the good. Right now, HLS is the odd one out among language servers (which also have weird edge cases where they rename improperly, I'm sure) in that I can try to do a rename action that ends up failing after all, even for e.g. |
The rename plugin is lacking an active maintainer at the moment, so really we need someone keen to step up and work on improving it! |
The The reason this config isn't enabled by default is that with lazy component loading, we cannot be sure that the refactoring will be valid. |
Is your enhancement request related to a problem? Please describe.
I can't use the rename plugin because I often have modules with implicit export lists, and it rejects those, printing this to the server log (this manifests as silently appearing to not do anything as this exclusively ends up in server logs):
Describe the solution you'd like
It would be much more helpful if the rename plugin acted as a more reliable find-and-replace, even if it didn't properly rename references in other modules in the case of implicit exports. A warning would be helpful as well.
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: