Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
25,800
void () { if (myListenerHighlighter != null && ArrayUtil.contains(myListenerHighlighter, (Object[])myEditor.getMarkupModel().getAllHighlighters())) { myListenerHighlighter.dispose(); myListenerHighlighter = null; } }
clearSelection
25,801
void (@NotNull KeyEvent e) {}
keyTyped
25,802
void (KeyEvent e) {}
keyReleased
25,803
void (@NotNull MouseEvent e) {}
mousePressed
25,804
void (@NotNull MouseEvent e) {}
mouseReleased
25,805
void (@NotNull MouseEvent e) {}
mouseEntered
25,806
void (@NotNull MouseEvent e) {}
mouseExited
25,807
void () { Object source = getSource(); String fileName = "Dummy." + (source instanceof FileType ? ((FileType)source).getDefaultExtension() : "txt"); LightVirtualFile lightFile; if (source instanceof PsiViewerExtension) { lightFile = new LightVirtualFile(fileName, ((PsiViewerExtension)source).getDefaultFileType(), ""); ...
updateEditor
25,808
void (@NotNull PsiElement element) { myStructureTreeModel.select(element, myPsiTree, path -> {}); }
selectElement
25,809
void (@NotNull CaretEvent e) { if (!available() || myEditor.getSelectionModel().hasSelection()) return; PsiElement rootPsiElement = myTreeStructure.getRootPsiElement(); if (rootPsiElement == null) return; PsiElement rootElement = myTreeStructure.getRootPsiElement(); int baseOffset = rootPsiElement.getTextRange().getSta...
caretPositionChanged
25,810
void (@NotNull SelectionEvent e) { if (!available() || !myEditor.getSelectionModel().hasSelection()) return; PsiElement rootElement = myTreeStructure.getRootPsiElement(); if (rootElement == null) return; SelectionModel selection = myEditor.getSelectionModel(); TextRange textRange = rootElement.getTextRange(); int baseO...
selectionChanged
25,811
PsiElement (PsiElement start, PsiElement end) { if (end == null || start == end) { return start; } TextRange endRange = end.getTextRange(); PsiElement parent = start.getContext(); while (parent != null && !parent.getTextRange().contains(endRange)) { parent = parent.getContext(); } return parent; }
findCommonParent
25,812
boolean () { return myLastParsedTextHashCode == myNewDocumentHashCode && myEditor.getContentComponent().hasFocus(); }
available
25,813
void (@NotNull DocumentEvent event) { myNewDocumentHashCode = event.getDocument().getText().hashCode(); }
documentChanged
25,814
void (@NotNull FocusEvent e) { Component from = e.getOppositeComponent(); if (!e.isTemporary() && from != null && !myComboBox.isPopupVisible() && isUnder(from, myParent)) { myComboBox.setPopupVisible(true); } }
focusGained
25,815
boolean (@NotNull Component component, Component parent) { while (component != null) { if (component == parent) return true; component = component.getParent(); } return false; }
isUnder
25,816
String () { return myStub.toString(); }
getName
25,817
void (@Nullable PsiElement rootRootElement, @NotNull String text) { resetStubTree(); buildStubTree(rootRootElement, text); }
reloadTree
25,818
void () { myStubTree.removeAll(); if (myTreeModel != null) { Disposer.dispose(myTreeModelDisposable); myTreeModel = null; myTreeModelDisposable = Disposer.newDisposable(); } myNodeToStubs = new BidirectionalMap<>(); ViewerPsiBasedTree.removeListenerOfClass(myStubTree, StubTreeSelectionListener.class); }
resetStubTree
25,819
JComponent () { if (myPanel != null) return myPanel; JBSplitter splitter = new JBSplitter("StubViewer.showPreviewDetails.proportion", 0.7f); splitter.setFirstComponent(ScrollPaneFactory.createScrollPane(myStubTree, true)); AnAction action = myStubDetailsViewer.addComponent(splitter); ActionToolbarImpl toolbar = new Act...
getComponent
25,820
boolean () { return myStubTree.isFocusOwner(); }
isFocusOwner
25,821
void () { IdeFocusManager.getInstance(myProject).requestFocus(myStubTree, true); }
focusTree
25,822
void () { resetStubTree(); }
dispose
25,823
Stub (Project project, PsiElement rootElement, @NotNull String textToParse) { Stub stub = null; PsiFileWithStubSupport psiFile = (PsiFileWithStubSupport)rootElement; StubTree tree = psiFile.getStubTree(); if (tree != null) { stub = tree.getRoot(); } else if (rootElement instanceof PsiFileImpl) { StubBuilder stubBuilder...
buildStubForElement
25,824
StubBuilder (@NotNull PsiFileImpl rootElement) { IStubFileElementType<?> builder = rootElement.getElementTypeForStubBuilder(); return builder == null ? null : builder.getBuilder(); }
getStubBuilder
25,825
void (@Nullable PsiElement element) { if (myTreeModel == null || element == null) return; final PsiFile file = element.getContainingFile(); if (!(file instanceof PsiFileWithStubSupport)) return; final DefaultMutableTreeNode rootNode = getRoot(); if (rootNode == null) return; StubElement<?> stubElement = myNodeToStubs.g...
selectNodeFromPsi
25,826
void (StubElement<?> stubElement) { TreeNode node = TreeUtil.treeNodeTraverser(getRoot()).traverse().find( (treeNode) -> treeNode instanceof DefaultMutableTreeNode && ((StubTreeNode)((DefaultMutableTreeNode)treeNode).getUserObject()).getStub() == stubElement ); if (node != null) { TreePath path = TreePathUtil.pathToTre...
selectStubElement
25,827
void (TreeSelectionEvent e) { if (myTreeModel == null) return; final StubTreeNode rootNode = (StubTreeNode)getRoot().getUserObject(); StubElement<?> topLevelStub = rootNode == null ? null : rootNode.getStub(); if (!(topLevelStub instanceof PsiFileStub)) return; StubElement<?> stub = getSelectedStub(); if (stub == null)...
valueChanged
25,828
DefaultMutableTreeNode () { return (DefaultMutableTreeNode)myStubTree.getModel().getRoot(); }
getRoot
25,829
PsiElement (StubElement<?> stub) { Ref<PsiElement> result = Ref.create(); myNodeToStubs.forEach((key, value) -> { if (value == stub) { result.set(key.getPsi()); } }); return result.get(); }
getPsiElementForStub
25,830
void (@NotNull PsiFileWithStubSupport rootElement, @NotNull PsiFileStub<?> rootStub) { fillTreeForStub(rootElement, new StubTree(rootStub)); }
fillPsiToStubCache
25,831
void (@NotNull PsiFileWithStubSupport file, @NotNull StubTree tree) { StubBuilder builder = file instanceof PsiFileImpl ? getStubBuilder(((PsiFileImpl)file)) : null; if (builder == null) return; final Iterator<StubElement<?>> stubs = tree.getPlainList().iterator(); final StubElement<?> root = stubs.next(); final ASTNod...
fillTreeForStub
25,832
void (StubBuilder builder, ASTNode tree, final Iterator<StubElement<?>> stubs) { final IElementType type = tree.getElementType(); if (type instanceof IStubElementType && ((IStubElementType<?, ?>)type).shouldCreateStub(tree)) { if (!stubs.hasNext()) { LOG.error("Stub mismatch, " + type); } final StubElement<?> curStub =...
findTreeForStub
25,833
AnAction (JBSplitter splitter) { updateStubDetailsTreeView(PropertiesComponent.getInstance().getBoolean(PROPERTY_NAME, DEFAULT_SHOW_STUB_DETAILS), splitter); return new ToggleAction(DevPsiViewerBundle.message("action.show.stub.details.text"), null, AllIcons.Actions.PreviewDetails) { @Override public boolean isSelected(...
addComponent
25,834
boolean (@NotNull AnActionEvent e) { return PropertiesComponent.getInstance().getBoolean(PROPERTY_NAME, DEFAULT_SHOW_STUB_DETAILS); }
isSelected
25,835
void (@NotNull AnActionEvent e, boolean state) { PropertiesComponent.getInstance().setValue(PROPERTY_NAME, state, DEFAULT_SHOW_STUB_DETAILS); updateStubDetailsTreeView(state, splitter); if (state) { valueChanged(myStubViewerTree.getSelectedStub()); } }
setSelected
25,836
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
25,837
void (boolean isShown, JBSplitter splitter) { myStubDetailsTree.setEnabled(isShown); splitter.setSecondComponent(isShown ? ScrollPaneFactory.createScrollPane(myStubDetailsTree, true) : null); }
updateStubDetailsTreeView
25,838
void (@Nullable StubElement<?> stub) { if (myStubDetailsTree.isEnabled()) { Disposable treeModelDisposable = myStubViewerTree.myTreeModelDisposable; StructureTreeModel<?> model = new StructureTreeModel<>( new StubDetailsTreeStructure(stub), null, Invoker.forEventDispatchThread(treeModelDisposable), treeModelDisposable ...
valueChanged
25,839
Object () { return myRoot; }
getRootElement
25,840
String () { return s; }
getName
25,841
StubTreeNode () { return myRoot; }
getRootElement
25,842
BlockTreeNode () { return myRoot; }
getRootElement
25,843
void (BlockTreeNode root) { myRoot = root; }
setRoot
25,844
Block () { return myBlock; }
getBlock
25,845
void (@NotNull PresentationData presentation) { String name = myBlock.getDebugName(); if (name == null) name = myBlock.getClass().getSimpleName(); if (myBlock instanceof DataLanguageBlockWrapper) { name += " (" + ((DataLanguageBlockWrapper)myBlock).getOriginal().getClass().getSimpleName() + ")"; } presentation.addText(...
update
25,846
boolean () { return myBlock.isLeaf() && myBlock.getSubBlocks().isEmpty(); }
isAlwaysLeaf
25,847
void (@Nullable PsiElement rootRootElement, @NotNull String text) { resetBlockTree(); buildBlockTree(rootRootElement); }
reloadTree
25,848
void (@Nullable PsiElement element) { if (myTreeModel != null && element != null) { BlockTreeNode currentBlockNode = findBlockNode(element); if (currentBlockNode != null) { selectBlockNode(currentBlockNode); } } }
selectNodeFromPsi
25,849
JComponent () { return myBlockStructurePanel; }
getComponent
25,850
boolean () { return myBlockTree.isFocusOwner(); }
isFocusOwner
25,851
void () { IdeFocusManager.getInstance(myProject).requestFocus(myBlockTree, true); }
focusTree
25,852
void () { resetBlockTree(); }
dispose
25,853
void () { myBlockTree.removeAll(); if (myTreeModel != null) { Disposer.dispose(myTreeModelDisposable); myTreeModel = null; myTreeModelDisposable = Disposer.newDisposable(); } myPsiToBlockMap = null; ViewerPsiBasedTree.removeListenerOfClass(myBlockTree, BlockTreeSelectionListener.class); }
resetBlockTree
25,854
void (@Nullable PsiElement rootElement) { Block rootBlock = rootElement == null ? null : buildBlocks(rootElement); if (rootBlock == null) { myTreeModel = null; myBlockTree.setRootVisible(false); myBlockTree.setVisible(false); return; } myBlockTree.setVisible(true); BlockTreeStructure blockTreeStructure = new BlockTreeS...
buildBlockTree
25,855
BlockTreeNode (PsiElement element) { HashMap<PsiElement, BlockTreeNode> psiToBlockMap = myPsiToBlockMap; BlockTreeNode result = psiToBlockMap == null ? null : psiToBlockMap.get(element); if (result == null) { TextRange rangeInHostFile = InjectedLanguageManager.getInstance(myProject).injectedToHost(element, element.getT...
findBlockNode
25,856
TreeVisitor (@NotNull BlockTreeNode currentBlockNode) { Function<Object, BlockTreeNode> converter = el -> el instanceof DefaultMutableTreeNode ? (BlockTreeNode)((DefaultMutableTreeNode)el).getUserObject() : null; Set<SimpleNode> parents = new HashSet<>(); SimpleNode parent = currentBlockNode.getParent(); while (parent ...
createVisitor
25,857
boolean (@NotNull BlockTreeNode pathComponent, @NotNull BlockTreeNode thisComponent) { return parents.contains(pathComponent); }
contains
25,858
void (@Nullable BlockTreeNode currentBlockNode) { if (myTreeModel == null) return; if (currentBlockNode != null) { TreeUtil.promiseSelect(myBlockTree, createVisitor(currentBlockNode)); } else { myBlockTree.getSelectionModel().clearSelection(); } }
selectBlockNode
25,859
void (@NotNull TreeSelectionEvent e) { if (myTreeModel == null) { return; } TreePath path = myBlockTree.getSelectionModel().getSelectionPath(); if (path == null) return; DefaultMutableTreeNode component = (DefaultMutableTreeNode)path.getLastPathComponent(); if (component == null) return; Object item = component.getUser...
valueChanged
25,860
BlockTreeNode (TextRange range) { if (myTreeModel == null || !myBlockStructurePanel.isVisible()) { return null; } DefaultMutableTreeNode root = getRoot(); if (root == null) return null; BlockTreeNode node = (BlockTreeNode)root.getUserObject(); main_loop: while (true) { if (node.getBlock().getTextRange().equals(range)) ...
findBlockNode
25,861
Block (@NotNull PsiElement rootElement) { FormattingModelBuilder formattingModelBuilder = LanguageFormatting.INSTANCE.forContext(rootElement); CodeStyleSettings settings = CodeStyle.getSettings(rootElement.getContainingFile()); if (formattingModelBuilder != null) { FormattingModel formattingModel = formattingModelBuild...
buildBlocks
25,862
void (BlockTreeNode rootBlockNode, PsiElement psiEl) { myPsiToBlockMap = new HashMap<>(); JBTreeTraverser<BlockTreeNode> traverser = JBTreeTraverser.of(BlockTreeNode::getChildren); for (BlockTreeNode block : traverser.withRoot(rootBlockNode)) { PsiElement currentElem = null; if (block.getBlock() instanceof ASTBlock) { ...
initMap
25,863
DefaultMutableTreeNode () { return (DefaultMutableTreeNode)myBlockTree.getModel().getRoot(); }
getRoot
25,864
PsiElementVisitor (@NotNull ProblemsHolder holder) { if (!RegistryManager.getInstance().is("groovy.good.code.is.red")) { return PsiElementVisitor.EMPTY_VISITOR; } GroovyFileBase file = (GroovyFileBase)holder.getFile(); Project project = holder.getProject(); GrAccessibilityChecker accessibilityChecker = new GrAccessibil...
createVisitor
25,865
void (@NotNull PsiElement location, @NotNull @InspectionMessage String description, @NotNull LocalQuickFix @Nullable [] fixes, @NotNull ProblemHighlightType highlightType) { if (highlightType == ProblemHighlightType.GENERIC_ERROR) { holder.registerProblem(location, description); } }
registerError
25,866
void (@NotNull GroovyPsiElement element) { super.visitElement(element); element.accept(typeCheckVisitor); }
visitElement
25,867
void (@NotNull GrReferenceExpression referenceExpression) { super.visitReferenceExpression(referenceExpression); HighlightInfo info = accessibilityChecker.checkReferenceExpression(referenceExpression); if (info != null) { registerProblem(holder, info, referenceExpression); } }
visitReferenceExpression
25,868
void (@NotNull GrCodeReferenceElement refElement) { super.visitCodeReferenceElement(refElement); HighlightInfo info = accessibilityChecker.checkCodeReferenceElement(refElement); if (info != null) { registerProblem(holder, info, refElement); } }
visitCodeReferenceElement
25,869
void (ProblemsHolder holder, HighlightInfo info, PsiElement e) { if (info.getSeverity() == HighlightSeverity.ERROR) { holder.registerProblem(e, info.getDescription()); } }
registerProblem
25,870
Activator () { return plugin; }
getDefault
25,871
ImageDescriptor (String path) { return imageDescriptorFromPlugin(PLUGIN_ID, path); }
getImageDescriptor
25,872
void (IAction action) { MessageDialog.openInformation( window.getShell(), "4 Plug-in", "Hello, Eclipse world"); }
run
25,873
void (IAction action, ISelection selection) { }
selectionChanged
25,874
void () { }
dispose
25,875
void (IWorkbenchWindow window) { this.window = window; }
init
25,876
void () { }
elibMethod
25,877
void () { }
elibMethod
25,878
void () { }
elibMethod
25,879
void () { }
elibMethod
25,880
void () { SourceOne one = new SourceOne(); SourceTwo two = new SourceTwo(); SourceThree three = new SourceThree(); SourceFour four = new SourceFour(); SourceFive five = new SourceFive(); SourceSix six = new SourceSix(); SourceSeven seven = new SourceSeven(); SourceEight eight = new SourceEight(); SourceNine nine = new ...
context
25,881
void () { }
elibMethod
25,882
void () { }
elibMethod
25,883
void () { }
elibMethod
25,884
void () { }
elibMethod
25,885
void () { }
elibMethod
25,886
void () { SourceOne one = new SourceOne(); SourceTwo two = new SourceTwo(); SourceThree three = new SourceThree(); SourceFour four = new SourceFour(); SourceFive five = new SourceFive(); SourceSix six = new SourceSix(); SourceSeven seven = new SourceSeven(); SourceEight eight = new SourceEight(); SourceNine nine = new ...
context
25,887
void () { }
elibMethod
25,888
String () { return PluginPathManager.getPluginHomePath("eclipse") + "/testData/import/settings/"; }
getTestDataPath
25,889
VirtualFile (@NotNull String filename) { Path path = Path.of(getTestDataPath(), filename); VirtualFile found = VfsUtil.findFile(path, false); if (found == null) fail("File '" + path + "' not found." ); return found; }
findTestInputFile
25,890
String (String path) { return path.isEmpty() ? myRootPath : (myRootPath + "/" + path); }
getPathRelativeToRoot
25,891
String (Element element) { final Element attributes = element.getChild(EclipseXml.ATTRIBUTES_TAG); if (attributes != null) { for (Element attributeElement : attributes.getChildren(EclipseXml.ATTRIBUTE_TAG)) { if (EclipseXml.DLL_LINK.equals(attributeElement.getAttributeValue(EclipseXml.NAME_ATTR))) { return attributeEle...
getNativeLibraryRoot
25,892
int (String srcPath) { return srcPath.startsWith("/") ? 1 : 0; }
srcVarStart
25,893
String (@NotNull String path) { return getPresentableName(path, null); }
getPresentableName
25,894
String (@NotNull String path, Set<? super String> names) { String pathComponent = getLastPathComponent(path); if (pathComponent != null && names != null && !names.add(pathComponent)) { return path; } else { return pathComponent == null ? path : pathComponent; } }
getPresentableName
25,895
String (final String path) { final int idx = path.lastIndexOf('/'); return idx < 0 || idx == path.length() - 1 ? null : path.substring(idx + 1); }
getLastPathComponent
25,896
String (@NotNull String var, String path) { return "$" + var + "$" + (path == null ? "" : "/" + path); }
getVariableRelatedPath
25,897
EPathVariable (String pathAttr, int varStart) { int slash = pathAttr.indexOf("/", varStart); if (slash > 0) { return new EPathVariable(pathAttr.substring(varStart, slash), pathAttr.substring(slash + 1)); } else { return new EPathVariable(pathAttr.substring(varStart), null); } }
createEPathVariable
25,898
String (ExpandMacroToPathMap pathMap, String path, int varStart) { EPathVariable var = createEPathVariable(path, varStart); return prepareValidUrlInsideJar(pathMap.substitute(pathToUrl(getVariableRelatedPath(var.myVariable, var.myRelatedPath)), SystemInfo.isFileSystemCaseSensitive)); }
eclipseVariabledPath2Url
25,899
String (String rootPath, final ExpandMacroToPathMap macroMap, final String path) { final EclipseProjectFinder.LinkedResource linkedResource = EclipseProjectFinder.findLinkedResource(rootPath, path); if (linkedResource != null) { if (linkedResource.containsPathVariable()) { final String toPathVariableFormat = getVariabl...
expandLinkedResourcesPath