-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Lombok rename field support #300
Comments
If lombok is otherwise working I don't think it is a configuration issue. I've noticed that there are cases where eclipse.jdt.ls isn't able to create the rename refactoring, even without lombok. Your approach sounds interesting but I don't think it fits the scope of nvim-jdtls. And I think anything that could be improved or fixed on the server side should be fixed there. |
Good to know it's not an issue with my config 😆
Okay fair enough, in that case I think i will put it into a neovim plugin for people to install if they want to.
I totally agree, and it would probably be faster refactoring aswell. I did consider submitting an issue there, which seamed like the logical place for it to be implemented, however i wanted a quick solution which would 'just work' for now 😆 When i release the plugin would it be okay for me to provide a link to it from this issue? |
There's at least lombok support in the vscode extension, so chances might be good.
Sure |
I've now started the plugin which for now only contains the functionality i was talking about. I will be working on other features which I find would be helpful to a java workflow. |
Not sure if it's the same thing, but maybe eclipse-jdtls/eclipse.jdt.ls#2339 is addressing this |
I think you're right, it looks like exactly the fix needed 🥳 |
Problem Statement
Currently when trying to refactor a field when the lombok jar is enabled as such:
The jdtls server kind of just ignores the request since it does not seem to support such a refactor.
If this is just my mistake in some configuration, i would love to know what i can do.
Ideas or possible solutions
I currently have a working solution bypassing this problem in my local config, which involves performing an lsp references request, and then using that to rename both the fields and getters and setters to match the field name.
Would you be interested in a pull request allowing rename functionality? (This could easily be removed if at some point the lsp starts supporting lombok refactoring)
The rename function would do something like this:
vim.lsp.buf.rename
If at some point the lsp server starts to suppot renaming lombok fields/setters/getters, this implementation could just be removed.
The text was updated successfully, but these errors were encountered: