Promise<TreePath> (@NotNull Object element) { AbstractTreeBuilder builder = getTreeBuilder(); if (builder != null) { DefaultMutableTreeNode node = builder.getNodeForElement(element); if (node == null) return Promises.rejectedPromise(); return Promises.resolvedPromise(new TreePath(node.getPath())); } TreeVisitor visitor = createVisitor(element); if (visitor == null || myTree == null) return Promises.rejectedPromise(); return TreeUtil.promiseVisit(myTree, visitor); }