Find usages dialog freezes/deadlocks upon rename
Hi, simple question: what would cause rename to show the find uses dialogue, complete the progress bar and then freeze, spinning the ball? pausing the debugger shows nothing interesting except everybody's parked. All I did was make identifier nodes implement PsiNamedElement. could not be simpler:
public class IdentifierPSIElement extends LeafPsiElement implements PsiNamedElement {
protected String name = null; // an override to input text ID if we rename via intellij
public IdentifierPSIElement(IElementType type, CharSequence text) {
super(type, text);
}
@Override
public String getName() {
if ( name!=null ) return name;
return getText();
}
@Override
public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException {
this.name = name;
return this;
}
...
}
any ideas why the ide freezes?
thanks!
Ter
Please sign in to leave a comment.
More data: when I implement a simple find usages provider, find usages operations complete with no problem. subsequent rename attempts fail and lock the GUI thread.
Ter
Ugh. I have no idea why but solving another problem, setting text range of my named element, prevented the freeze:
This is a strange implementation of setName(). setName() is supposed to update the actual text of the file according to the new name passed to the method as a parameter. Simply storing the name in a field without updating the text is going to lead to all sorts of inconsistencies.
Thanks Dimtry! I was just trying to get something braindead working but apparently I made it TOO braindead. hahaha. I also got the spinning ball of death when I did a PSI replace. I'll try again now with the range sent up to super.
Ter
even with proper node replacement, unless I set the text range, it freezes. odd but ok, works now.
Ter
For the record, I finally traced the spinning ball of death to the use of Dragon voice recognition for Mac. Dragon has to integrate with the GUI to figure out what your changes to a document are for recognition purposes, but it does not interact well with intellij.