IDEA-154443 Speed search is broken in Structure popup

This commit is contained in:
Sergey Malenkov
2016-04-13 17:51:51 +03:00
parent dbc4fab689
commit 7aabf4a69d
2 changed files with 6 additions and 2 deletions
@@ -66,7 +66,10 @@ public abstract class NodeDescriptor<E> {
public abstract E getElement();
public String toString() {
return String.valueOf(myName);
// NB!: this method may return null if node is not valid
// it contradicts the specification, but the fix breaks existing behaviour
// see com.intellij.ide.util.FileStructurePopup#getSpeedSearchText
return myName;
}
/**
@@ -996,7 +996,8 @@ public class FileStructurePopup implements Disposable, TreeActionsOwner {
}
return text;
}
// NB!: this point is achievable if the following method returns null
// see com.intellij.ide.util.treeView.NodeDescriptor.toString
if (userObject instanceof StructureViewComponent.StructureViewTreeElementWrapper) {
return ApplicationManager.getApplication().runReadAction(new Computable<String>() {
@Nullable