void (@Nullable SmartPsiElementPointer<PsiElement> pointer, VirtualFile file, boolean requestFocus, VirtualFileFilter filter) { if (SelectInProjectViewImplKt.getLOG().isDebugEnabled()) { SelectInProjectViewImplKt.getLOG().debug( "ScopeViewPane.select: " + "pane=" + this + ", pointer=" + pointer + ", file=" + file + ", requestFocus=" + requestFocus + ", filter=" + filter ); } String subId = filter.toString(); if (!Objects.equals(subId, getSubId())) { if (requestFocus) { if (SelectInProjectViewImplKt.getLOG().isDebugEnabled()) { SelectInProjectViewImplKt.getLOG().debug( "Selected subId=" + getSubId() + ", requested subId=" + subId + ", changing the scope" ); } selectScopeView(subId); } else { if (SelectInProjectViewImplKt.getLOG().isDebugEnabled()) { SelectInProjectViewImplKt.getLOG().debug( "Selected subId=" + getSubId() + ", requested subId=" + subId + ", changing not allowed because requestFocus=false, aborting" ); } return; } } if (LOG.isDebugEnabled()) { LOG.debug("select element: ", (pointer == null ? null : pointer.getElement()), " in file: ", file); } TreeVisitor visitor = AbstractProjectViewPane.createVisitorByPointer(pointer, file); if (visitor == null) { if (SelectInProjectViewImplKt.getLOG().isDebugEnabled()) { SelectInProjectViewImplKt.getLOG().debug("Not selecting anything because both the pointer and file are null"); } return; } JTree tree = myTree; SelectInProjectViewImplKt.getLOG().debug("Start updating the tree. Will continue once updated"); myTreeModel.get().getUpdater().updateImmediately(() -> { SelectInProjectViewImplKt.getLOG().debug("Updated. Start expanding the tree and looking for the path to select"); TreeState.expand(tree, promise -> TreeUtil.visit(tree, visitor, path -> { if (SelectInProjectViewImplKt.getLOG().isDebugEnabled()) { SelectInProjectViewImplKt.getLOG().debug("Expanded. The path to select is " + path); } if (selectPath(tree, path) || pointer == null || Registry.is("async.project.view.support.extra.select.disabled")) { promise.setResult(null); if (SelectInProjectViewImplKt.getLOG().isDebugEnabled()) { SelectInProjectViewImplKt.getLOG().debug("Selected. Done"); } } else { if (SelectInProjectViewImplKt.getLOG().isDebugEnabled()) { SelectInProjectViewImplKt.getLOG().debug("Not selected. Trying to look for the file without the pointer instead"); } // try to search the specified file instead of element, // because Kotlin files cannot represent containing functions TreeUtil.visit(tree, AbstractProjectViewPane.createVisitor(file), path2 -> { selectPath(tree, path2); promise.setResult(null); if (SelectInProjectViewImplKt.getLOG().isDebugEnabled()) { SelectInProjectViewImplKt.getLOG().debug("Found and selected " + path2); } }); } })); }); }