eclipse-xtext / eclipse-xtext/xtext
XtextRenameResourceParticipant is unnecessarily loaded for rename actions
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 831
- Forks
- 330
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 12
Description
XtextRenameResourceParticipant.initialize(..) returns true by default, without checking if the renamed element is relevant for this participant. That causes unnecessary appearances of a refactoring dialog within our Eclipse-based application.
The participant should at least consider the if checks from the addElement(..) method for its return value.
So instead of:
@Override
protected boolean initialize(Object element) {
addElement(element, getArguments());
return true;
}
It should be something like:
@Override
protected boolean initialize(Object element) {
if (arguments instanceof RenameArguments && element instanceof IResource) {
addElement(element, getArguments());
return true;
}
return false;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate XtextRenameResourceParticipant and inspect initialize(..) alongside addElement(..), especially the checks involving RenameArguments and IResource. Adjust the initialization decision so irrelevant elements are rejected, then verify that rename actions for those elements no longer open the refactoring dialog while relevant resource renames still do.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100