You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and you place your cursor on a word and attempt to rename it with F2, it shows the pop up to allow you to rename it, but renaming it doesn't do anything (the word stays the same).
In TypeScript, it prevents you from opening the pop up in locations where it doesn't make sense, such as words in comments or on empty lines. I also checked the Lua and Rust extensions to see if it's an LSP limitation, but they also seem to prevent the pop up.
Environment
Operating System: RHEL 8.7
JDK version: packaged JDK
Visual Studio Code version: 1.74.3
Java extension version: v1.14.2023011003
Steps To Reproduce
Make a java file with a comment
Try to rename one of the words in the comment with F2
Current Result
It opens the pop up to rename the word
Expected Result
It prevents the pop up from appearing and says there's nothing to rename
Additional Informations
The text was updated successfully, but these errors were encountered:
I think the way to resolve this is implementing textDocument/prepareRename support in eclipse.jdt.ls. Angelo recently made a PR to do something similar in lemminx: eclipse-lemminx/lemminx#1435
Took a look and found that attempting to rename a comment now results in a "Renaming this element is not supported." pop-up. I couldn't find any relevant fixes in vscode-java or eclipse.jdt.ls, so I'm assuming updates to some other dependency fixed the issue.
Yup, it looks fixed for me also. David reported it at the start of 2023. The only thing I can think of is maybe eclipse-jdtls/eclipse.jdt.ls#2417 fixed it since that touched the prepareRename logic.
If you have a line or block comment:
// this is a comment|
and you place your cursor on a word and attempt to rename it with
F2
, it shows the pop up to allow you to rename it, but renaming it doesn't do anything (the word stays the same).In TypeScript, it prevents you from opening the pop up in locations where it doesn't make sense, such as words in comments or on empty lines. I also checked the Lua and Rust extensions to see if it's an LSP limitation, but they also seem to prevent the pop up.
Environment
Steps To Reproduce
F2
Current Result
It opens the pop up to rename the word
Expected Result
It prevents the pop up from appearing and says there's nothing to rename
Additional Informations
The text was updated successfully, but these errors were encountered: