redhat-developer / redhat-developer/lsp4ij

Forbid rename for keyword/string

Open
#226 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

rename
Dominant language
Java
Stars
344
Forks
113
Avg merge
5h 22m
Merged PRs (30d)
15

Description

See https://github.com/redhat-developer/lsp4ij/pull/225#issuecomment-2063373780

To fix that we could use TextMate file info with the following code:

editor.getHighlighter().createIterator(offset).getTextAttributesKeys()[0].getExternalName()

which returns

  • DEFAULT_KEYWORD when keyword tries to be renamed
  • DEFAULT_STRING when string tries to be renamed

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked pull request comment and locating the rename handling that can access editor.getHighlighter().createIterator(offset).getTextAttributesKeys()[0].getExternalName(). Verify the behavior for DEFAULT_KEYWORD and DEFAULT_STRING, then add or update coverage so rename is refused for both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.