mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
psi viewer: extract method
This commit is contained in:
+10
-4
@@ -234,6 +234,15 @@ public class StubViewerPsiBasedTree implements ViewerPsiBasedTree {
|
||||
ASTNode treeNode = myFile.findTreeForStub(stubTree, stubElement);
|
||||
if (treeNode == null) return;
|
||||
|
||||
PsiElement result = findElementForNode(treeNode);
|
||||
|
||||
if (result != null) {
|
||||
myUpdater.updatePsiTree(result, myStubTree.hasFocus() ? result.getTextRange() : null);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private PsiElement findElementForNode(@NotNull ASTNode treeNode) {
|
||||
PsiElement result = null;
|
||||
if (treeNode.getTextLength() > 0) {
|
||||
result = CodeInsightUtilCore
|
||||
@@ -254,10 +263,7 @@ public class StubViewerPsiBasedTree implements ViewerPsiBasedTree {
|
||||
result = elementAt;
|
||||
}
|
||||
}
|
||||
|
||||
if (result != null) {
|
||||
myUpdater.updatePsiTree(result, myStubTree.hasFocus() ? result.getTextRange() : null);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user