VariableInplaceRenameHandler - endless loop

trying to extend it.

took the code from here:

when press F2 (inline rename)
1) a prompt pops up to choose RenameHandler "What would you like to do?" <...> or VariableInplaceRenameHandler ?

so I choose mine (specified in plugin.xml under <renameHandler implementation="...")

then in doRename:

RenameHandler handler = RenameHandlerRegistry.getInstance().getRenameHandler(dataContext);
handler is an instance of this superclass of VariableInplaceRenameHandler
 (the same popup comes up again)
 takes us to 
public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file, final DataContext dataContext)

in this same superclass of VariableInplaceRenameHandler

which calls the same doRename.

so we get this endless loop and also another error:

ERROR - ellij.ide.impl.DataManagerImpl - cannot share data context between Swing events; initial event count = 1983; current event count = 3553
 at com.intellij.openapi.diagnostic.Logger.error(
 at com.intellij.ide.impl.DataManagerImpl$MyDataContext.getData(
 at com.intellij.openapi.actionSystem.DataContextWrapper.getData(
 at com.intellij.openapi.actionSystem.AnActionEvent$1.getData(
 at com.intellij.openapi.actionSystem.DataKey.getData(
 at com.intellij.refactoring.rename.RenameHandlerRegistry.getRenameHandler(

any thoughts?

1 comment
Comment actions Permalink

this could be an answer:

returned false because 
returned null
overriding checkLocalScope fixed it.

I did not realize that in-place renaming checks scopes.

век живи - век учись ;)


Please sign in to leave a comment.