Skip to content

vscode-java allows you to attempt to rename words in comments #2873

Description

@datho7561

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
  • 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
  1. Make a java file with a comment
  2. 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

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions