Skip to content

XtextRenameResourceParticipant is unnecessarily loaded for rename actions #3668

@MWI-msg

Description

@MWI-msg

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; 
       }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions