Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
73,300
void (Object @NotNull [] elements) { for (Object element: elements) { CompletionElement completion = new CompletionElement(element, PsiSubstitutor.EMPTY); myResults.put(completion, completion); } }
setCompletionElements
73,301
Iterable<CompletionElement> () { if (mySecondRateResults.size() == myResults.size()) { return mySecondRateResults; } return ContainerUtil.filter(myResults.values(), element -> !mySecondRateResults.contains(element)); }
getResults
73,302
void () { myResults.clear(); mySecondRateResults.clear(); }
clear
73,303
boolean (@NotNull DeclarationKind kind) { return switch (kind) { case CLASS -> myFilter.isClassAcceptable(PsiClass.class); case FIELD -> myFilter.isClassAcceptable(PsiField.class); case METHOD -> myFilter.isClassAcceptable(PsiMethod.class); case PACKAGE -> myFilter.isClassAcceptable(PsiPackage.class); case VARIABLE -> ...
shouldProcess
73,304
Options (boolean checkAccess) { return new Options(checkAccess, filterStaticAfterInstance, showInstanceInStaticContext); }
withCheckAccess
73,305
Options (boolean filterStaticAfterInstance) { return new Options(checkAccess, filterStaticAfterInstance, showInstanceInStaticContext); }
withFilterStaticAfterInstance
73,306
Options (boolean showInstanceInStaticContext) { return new Options(checkAccess, filterStaticAfterInstance, showInstanceInStaticContext); }
withShowInstanceInStaticContext
73,307
void (@NotNull final Project project, @NotNull final Editor editor, @NotNull final PsiFile file) { FeatureUsageTracker.getInstance().triggerFeatureUsed(GotoSuperAction.FEATURE_ID); int offset = editor.getCaretModel().getOffset(); new PsiTargetNavigator<>(() -> Arrays.asList(findSuperElements(file, offset))) .elementsCo...
invoke
73,308
PsiElement (@NotNull PsiFile file, int offset) { return file.findElementAt(offset); }
getElement
73,309
boolean () { return false; }
startInWriteAction
73,310
void (@NotNull Editor editor, @NotNull PsiFile file, Presentation presentation) { update(editor, file, presentation, null); }
update
73,311
void (@NotNull Editor editor, @NotNull PsiFile file, Presentation presentation, @Nullable String actionPlace) { final PsiElement element = getElement(file, editor.getCaretModel().getOffset()); final PsiElement containingElement = PsiTreeUtil.getParentOfType(element, PsiFunctionalExpression.class, PsiMember.class); bool...
update
73,312
boolean (PsiElement e) { if (e instanceof PsiMethod || e instanceof PsiClass && !(e instanceof PsiTypeParameter)) return true; if (e instanceof PsiField) return Registry.is("ide.structural.navigation.visit.fields"); return e instanceof PsiJavaToken && e.getParent() instanceof PsiClass && e.textMatches("}
shouldStopAt
73,313
PsiElement (@Nullable PsiElement elementAt, Editor editor) { if (elementAt instanceof PsiIdentifier) { PsiElement parent = elementAt.getParent(); if (parent instanceof PsiReferenceExpression) { PsiElement gParent = parent.getParent(); if (gParent instanceof PsiMethodCallExpression) { PsiExpression qualifierExpression =...
getGotoDeclarationTarget
73,314
PsiElement (@Nullable PsiElement elementAt, Editor editor) { if (elementAt instanceof PsiKeyword && PsiKeyword.VAR.equals(elementAt.getText())) { PsiElement parent = elementAt.getParent(); if (parent instanceof PsiTypeElement && ((PsiTypeElement)parent).isInferredType()) { return PsiUtil.resolveClassInClassTypeOnly(((P...
getGotoDeclarationTarget
73,315
PsiElement (@Nullable PsiElement elementAt, Editor editor) { if (elementAt instanceof PsiKeyword) { IElementType type = ((PsiKeyword)elementAt).getTokenType(); if (type == JavaTokenType.CONTINUE_KEYWORD) { if (elementAt.getParent() instanceof PsiContinueStatement) { return ((PsiContinueStatement)elementAt.getParent())....
getGotoDeclarationTarget
73,316
PsiElement[] (@NotNull PsiElement symbol) { return getSymbolTypeDeclarations(symbol, null, -1); }
getSymbolTypeDeclarations
73,317
PsiDocCommentOwner (@NotNull PsiMember method) { for (DocumentationDelegateProvider delegator : EP_NAME.getExtensionList()) { PsiDocCommentOwner type = delegator.computeDocumentationDelegate(method); if (type != null) { return type; } } return null; }
findDocumentationDelegate
73,318
JavaDocHighlightingManagerImpl () { return INSTANCE; }
getInstance
73,319
TextAttributes (@NotNull TextAttributesKey attributesKey) { return EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attributesKey); }
resolveAttributes
73,320
TextAttributes (@NotNull PsiClass aClass) { if (aClass.isInterface()) return getInterfaceNameAttributes(); if (aClass.isEnum()) return getEnumNameAttributes(); if (aClass instanceof PsiAnonymousClass) return getAnonymousClassNameAttributes(); if (aClass.hasModifierProperty(PsiModifier.ABSTRACT)) return getAbstractClass...
getClassDeclarationAttributes
73,321
TextAttributes (@NotNull PsiMethod method) { return method.isConstructor() ? getConstructorDeclarationAttributes() : getMethodDeclarationAttributes(); }
getMethodDeclarationAttributes
73,322
TextAttributes (@NotNull PsiField field) { boolean isFinal = field.hasModifierProperty(PsiModifier.FINAL); boolean isStatic = field.hasModifierProperty(PsiModifier.STATIC); boolean isImported = HighlightNamesUtil.isStaticallyImported(field); if (isImported) { return isFinal ? getStaticFinalFieldImportedAttributes() : g...
getFieldDeclarationAttributes
73,323
TextAttributes () { return resolveAttributes(JavaHighlightingColors.INTERFACE_NAME_ATTRIBUTES); }
getInterfaceNameAttributes
73,324
TextAttributes () { return resolveAttributes(JavaHighlightingColors.ENUM_NAME_ATTRIBUTES); }
getEnumNameAttributes
73,325
TextAttributes () { return resolveAttributes(JavaHighlightingColors.ANONYMOUS_CLASS_NAME_ATTRIBUTES); }
getAnonymousClassNameAttributes
73,326
TextAttributes () { return resolveAttributes(JavaHighlightingColors.ABSTRACT_CLASS_NAME_ATTRIBUTES); }
getAbstractClassNameAttributes
73,327
TextAttributes () { return resolveAttributes(JavaHighlightingColors.CLASS_NAME_ATTRIBUTES); }
getClassNameAttributes
73,328
TextAttributes () { return resolveAttributes(JavaHighlightingColors.KEYWORD); }
getKeywordAttributes
73,329
TextAttributes () { return resolveAttributes(JavaHighlightingColors.COMMA); }
getCommaAttributes
73,330
TextAttributes () { return resolveAttributes(JavaHighlightingColors.PARAMETER_ATTRIBUTES); }
getParameterAttributes
73,331
TextAttributes () { return resolveAttributes(JavaHighlightingColors.TYPE_PARAMETER_NAME_ATTRIBUTES); }
getTypeParameterNameAttributes
73,332
TextAttributes () { return resolveAttributes(JavaHighlightingColors.STATIC_FINAL_FIELD_IMPORTED_ATTRIBUTES); }
getStaticFinalFieldImportedAttributes
73,333
TextAttributes () { return resolveAttributes(JavaHighlightingColors.STATIC_FIELD_IMPORTED_ATTRIBUTES); }
getStaticFieldImportedAttributes
73,334
TextAttributes () { return resolveAttributes(JavaHighlightingColors.STATIC_FINAL_FIELD_ATTRIBUTES); }
getStaticFinalFieldAttributes
73,335
TextAttributes () { return resolveAttributes(JavaHighlightingColors.STATIC_FIELD_ATTRIBUTES); }
getStaticFieldAttributes
73,336
TextAttributes () { return resolveAttributes(JavaHighlightingColors.INSTANCE_FINAL_FIELD_ATTRIBUTES); }
getInstanceFinalFieldAttributes
73,337
TextAttributes () { return resolveAttributes(JavaHighlightingColors.INSTANCE_FIELD_ATTRIBUTES); }
getInstanceFieldAttributes
73,338
TextAttributes () { return resolveAttributes(JavaHighlightingColors.OPERATION_SIGN); }
getOperationSignAttributes
73,339
TextAttributes () { return resolveAttributes(JavaHighlightingColors.LOCAL_VARIABLE_ATTRIBUTES); }
getLocalVariableAttributes
73,340
TextAttributes () { return resolveAttributes(JavaHighlightingColors.CONSTRUCTOR_DECLARATION_ATTRIBUTES); }
getConstructorDeclarationAttributes
73,341
TextAttributes () { return resolveAttributes(JavaHighlightingColors.METHOD_DECLARATION_ATTRIBUTES); }
getMethodDeclarationAttributes
73,342
TextAttributes () { return resolveAttributes(JavaHighlightingColors.PARENTHESES); }
getParenthesesAttributes
73,343
TextAttributes () { return resolveAttributes(JavaHighlightingColors.DOT); }
getDotAttributes
73,344
TextAttributes () { return resolveAttributes(JavaHighlightingColors.BRACKETS); }
getBracketsAttributes
73,345
TextAttributes () { return resolveAttributes(JavaHighlightingColors.METHOD_CALL_ATTRIBUTES); }
getMethodCallAttributes
73,346
boolean (String annoQName) { return Flow.class.getName().equals(annoQName); }
isKnownNonDocumented
73,347
String () { return myAnnotation.getQualifiedName(); }
getAnnotationQualifiedName
73,348
boolean () { return AnnotationUtil.isInferredAnnotation(myAnnotation); }
isInferred
73,349
void ( boolean doSyntaxHighlighting, boolean isForRenderedDoc, @NotNull StringBuilder buffer, @NotNull TextAttributesKey attributesKey, @Nullable String value ) { if (doSyntaxHighlighting) { HtmlSyntaxInfoUtil.appendStyledSpan(buffer, attributesKey, value, DocumentationSettings.getHighlightingSaturation(isForRenderedDo...
appendStyledSpan
73,350
void ( boolean doSyntaxHighlighting, boolean isForRenderedDoc, @NotNull StringBuilder buffer, @NotNull Project project, @NotNull Language language, @Nullable String codeSnippet ) { if (doSyntaxHighlighting) { HtmlSyntaxInfoUtil.appendHighlightedByLexerAndEncodedAsHtmlCodeSnippet( buffer, project, language, codeSnippet,...
appendHighlightedByLexerAndEncodedAsHtmlCodeSnippet
73,351
void ( StringBuilder buffer, boolean generateLink, boolean isForRenderedDoc, boolean doSyntaxHighlighting ) { final PsiNameValuePair[] attributes = myAnnotation.getParameterList().getAttributes(); if (attributes.length > 0) { appendStyledSpan(doSyntaxHighlighting, isForRenderedDoc, buffer, JavaHighlightingColors.PARENT...
generateAnnotationAttributes
73,352
void ( StringBuilder buffer, boolean generateLink, PsiNameValuePair pair, boolean isForRenderedDoc, boolean doSyntaxHighlighting ) { final String name = pair.getName(); if (name != null) { appendStyledSpan(doSyntaxHighlighting, isForRenderedDoc, buffer, JavaHighlightingColors.ANNOTATION_ATTRIBUTE_NAME_ATTRIBUTES, name)...
generateAnnotationAttribute
73,353
void ( StringBuilder buffer, PsiAnnotationMemberValue memberValue, boolean generateLink, boolean isForRenderedDoc, boolean doSyntaxHighlighting ) { if (memberValue instanceof PsiQualifiedReferenceElement) { String text = ((PsiQualifiedReferenceElement)memberValue).getCanonicalText(); PsiElement resolve = null; try { re...
appendLinkOrText
73,354
List<AnnotationDocGenerator> (@NotNull PsiAnnotationOwner owner, @NotNull PsiElement context) { if (owner instanceof PsiModifierList) { return getAnnotationsToShow(((PsiModifierListOwner)((PsiModifierList)owner).getParent())); } Set<String> shownAnnotations = new HashSet<>(); return ContainerUtil.mapNotNull(owner.getAn...
getAnnotationsToShow
73,355
List<AnnotationDocGenerator> (@NotNull PsiModifierListOwner owner) { Set<String> shownAnnotations = new HashSet<>(); return StreamEx.of(AnnotationUtil.getAllAnnotations(owner, false, null)) .filter(owner instanceof PsiClass || owner instanceof PsiJavaModule ? Predicates.alwaysTrue() : anno -> !AnnotationTargetUtil.isTy...
getAnnotationsToShow
73,356
JavaDocInfoGeneratorFactory () { return ApplicationManager.getApplication().getService(JavaDocInfoGeneratorFactory.class); }
getInstance
73,357
JavaDocInfoGenerator (@NotNull Project project, @Nullable PsiElement element) { return new JavaDocInfoGenerator( project, element, JavaDocHighlightingManagerImpl.getInstance(), false, DocumentationSettings.isHighlightingOfQuickDocSignaturesEnabled(), DocumentationSettings.isHighlightingOfCodeBlocksEnabled(), Documentat...
createImpl
73,358
JavaDocInfoGenerator (@NotNull Project project, @Nullable PsiElement element) { return getInstance().createImpl(project, element); }
create
73,359
JavaDocInfoGeneratorBuilder (@NotNull Project project) { return getInstance().getBuilderImpl(project); }
getBuilder
73,360
JavaDocInfoGeneratorBuilder (@NotNull Project project) { return new JavaDocInfoGeneratorBuilder(project); }
getBuilderImpl
73,361
JavaDocInfoGeneratorBuilder (@Nullable PsiElement element) { myElement = element; return this; }
setPsiElement
73,362
JavaDocInfoGeneratorBuilder (@NotNull JavaDocHighlightingManager manager) { myManager = manager; return this; }
setHighlightingManager
73,363
JavaDocInfoGeneratorBuilder (boolean isRendered) { myIsRendered = isRendered; myHighlightingSaturation = DocumentationSettings.getHighlightingSaturation(isRendered); return this; }
setIsGenerationForRenderedDoc
73,364
JavaDocInfoGeneratorBuilder (boolean doHighlighting) { myDoHighlightSignatures = doHighlighting; return this; }
setDoHighlightSignatures
73,365
JavaDocInfoGeneratorBuilder (boolean doHighlighting) { myDoHighlightCodeBlocks = doHighlighting; return this; }
setDoHighlightCodeBlocks
73,366
JavaDocInfoGeneratorBuilder (@NotNull InlineCodeHighlightingMode mode) { myInlineCodeBlocksHighlightingMode = mode; return this; }
setDoInlineCodeHighlightingMode
73,367
JavaDocInfoGeneratorBuilder (boolean doHighlightLinks) { myDoSemanticHighlightingOfLinks = doHighlightLinks; return this; }
setDoSemanticHighlightingOfLinks
73,368
JavaDocInfoGeneratorBuilder (float saturationFactor) { myHighlightingSaturation = saturationFactor; return this; }
setHighlightingSaturationFactor
73,369
JavaDocInfoGenerator () { return new JavaDocInfoGenerator( myProject, myElement, myManager, myIsRendered, myDoHighlightSignatures, myDoHighlightCodeBlocks, myInlineCodeBlocksHighlightingMode, myDoSemanticHighlightingOfLinks, myHighlightingSaturation); }
create
73,370
String (String root, String href) { if (BrowserUtil.isAbsoluteURL(href)) { return href; } String reference = JavaDocInfoGenerator.createReferenceForRelativeLink(href, myElement); if (reference == null) { if (href.startsWith("#")) { return root + href; } else { String nakedRoot = ourHtmlFileSuffix.matcher(root).replaceA...
convertReference
73,371
RefConvertor[] () { return myReferenceConverters; }
getRefConverters
73,372
String (@Nls String text) { return text == null ? null : PlatformDocumentationUtil.fixupText(text); }
filterInternalDocInfo
73,373
ParseSettings (@NotNull String url) { return url.endsWith(JavaDocumentationProvider.PACKAGE_SUMMARY_FILE) ? ourPackageInfoSettings : super.getParseSettings(url); }
getParseSettings
73,374
String (@NotNull final Color color) { return DocumentationMarkup.SECTION_HEADER_START + "Preview:" + DocumentationMarkup.SECTION_SEPARATOR + "<p>" + String.format("<div style=\"padding: 1px; width: 52px; height: 32px; background-color: #555555;\"><div style=\"width: 50px; height: 30px; background-color: #%s;\">&nbsp;</...
generatePreviewHtml
73,375
void (final PsiVariable variable, final StringBuilder buffer) { final PsiExpression initializer = variable.getInitializer(); if (initializer != null) { final PsiType type = initializer.getType(); if (type != null && "java.awt.Color".equals(type.getCanonicalText())) { if (initializer instanceof PsiNewExpression) { final...
appendColorPreview
73,376
Consumer<PsiMethod> (PsiClass targetClass, final PsiMethod baseMethod, boolean toCopyJavaDoc, boolean insertOverrideIfPossible) { return result -> OverrideImplementUtil.decorateMethod(targetClass, baseMethod, false, insertOverrideIfPossible, result); }
createDecorator
73,377
PsiElement () { return myContext; }
getContext
73,378
int (@Nullable String region) { var visitor = new SnippetVisitor() { int maxIndent = Integer.MAX_VALUE; @Override public void visitPlainText(@NotNull PlainText plainText, @NotNull List<@NotNull LocationMarkupNode> activeNodes) { if (maxIndent == 0) return; String content = plainText.content(); if (content.isBlank()) re...
getCommonIndent
73,379
void (@NotNull PlainText plainText, @NotNull List<@NotNull LocationMarkupNode> activeNodes) { if (maxIndent == 0) return; String content = plainText.content(); if (content.isBlank()) return; int curIndent = 0; while (curIndent < content.length() && content.charAt(curIndent) != '\n' && Character.isWhitespace(content.cha...
visitPlainText
73,380
boolean (@Nullable String region) { var visitor = new SnippetVisitor() { boolean hasMarkup = false; @Override public void visitPlainText(@NotNull PlainText plainText, @NotNull List<@NotNull LocationMarkupNode> activeNodes) { hasMarkup |= !activeNodes.isEmpty(); } }; visitSnippet(region, visitor); return visitor.hasMark...
hasMarkup
73,381
void (@NotNull PlainText plainText, @NotNull List<@NotNull LocationMarkupNode> activeNodes) { hasMarkup |= !activeNodes.isEmpty(); }
visitPlainText
73,382
void (@NotNull PlainText plainText, @NotNull List<@NotNull LocationMarkupNode> activeNodes) { myRange = myRange == null ? plainText.range() : myRange.union(plainText.range()); }
visitPlainText
73,383
boolean (@NotNull TextRange range) { int nextSetBit = myTextOffsets.nextSetBit(range.getStartOffset()); return nextSetBit != -1 && nextSetBit < range.getEndOffset(); }
isTextPart
73,384
String (@Nullable String region) { StringBuilder result = new StringBuilder(); visitSnippet(region, new SnippetVisitor() { @Override public void visitPlainText(@NotNull PlainText plainText, @NotNull List<@NotNull LocationMarkupNode> activeNodes) { result.append(plainText.content()); } }); return result.toString(); }
getTextWithoutMarkup
73,385
void (@NotNull PlainText plainText, @NotNull List<@NotNull LocationMarkupNode> activeNodes) { result.append(plainText.content()); }
visitPlainText
73,386
Set<String> () { return myRegionStarts.keySet(); }
getRegions
73,387
List<TextRange> (String string) { int pos = 0; List<TextRange> ranges = new ArrayList<>(); while (true) { int nextPos = string.indexOf(substring, pos); if (nextPos == -1) break; ranges.add(TextRange.from(nextPos, substring.length())); pos = nextPos + substring.length() + 1; } return ranges; }
ranges
73,388
List<TextRange> (String string) { Matcher matcher = pattern.matcher(string); List<TextRange> ranges = new ArrayList<>(); while (matcher.find()) { ranges.add(TextRange.create(matcher.start(), matcher.end())); } return ranges; }
ranges
73,389
List<TextRange> (String string) { return List.of(TextRange.create(0, string.length())); }
ranges
73,390
Replace (@NotNull String replacement) { return replacement.equals(this.replacement) ? this : new Replace(range, selector, region, replacement); }
withReplacement
73,391
SnippetMarkup (@NotNull String text) { return parse(preparse(text), new FakePsiElement() { @Override public PsiElement getParent() { return null; } }); }
parse
73,392
PsiElement () { return null; }
getParent
73,393
SnippetMarkup (@NotNull PsiElement element) { if (!(element instanceof PsiFile) && !(element instanceof PsiSnippetDocTagBody)) { throw new IllegalArgumentException(); } return CachedValuesManager.getCachedValue(element, () -> { SnippetMarkup markup = element instanceof PsiSnippetDocTagBody body ? parse(preparse(body), ...
fromElement
73,394
SnippetMarkup (@NotNull List<@NotNull PlainText> preparsed, @NotNull PsiElement context) { return new SnippetMarkup(preparsed.stream().flatMap(SnippetMarkup::parseLine).toList(), context); }
parse
73,395
Stream<MarkupNode> (@NotNull PlainText text) { String content = text.content(); Matcher matcher = MARKUP_SPEC.matcher(content); if (!matcher.find()) return Stream.of(text); int offset = text.range().getStartOffset(); String markupSpec = matcher.group(1).stripTrailing(); boolean hasColon = markupSpec.endsWith(":"); if (...
parseLine
73,396
void (@NotNull List<MarkupNode> markupNodes, @NotNull String tagName, @NotNull Map<String, Attribute> attrs, @NotNull TextRange range) { String region = getRegion(attrs); switch (tagName) { case "start" -> { region = getRequiredString(markupNodes, attrs, tagName, range, "region"); if (region != null) { markupNodes.add(...
validateAndAddTag
73,397
void (@Nullable String region, @NotNull SnippetVisitor visitor) { visitSnippet(region, false, visitor); }
visitSnippet
73,398
void (@Nullable String region, boolean preprocess, @NotNull SnippetVisitor visitor) { Stack<String> regions = new Stack<>(); Map<String, List<LocationMarkupNode>> active = new LinkedHashMap<>(); int commonIndent = preprocess ? getCommonIndent(region) : 0; for (MarkupNode node : myNodes) { if (node instanceof StartRegio...
visitSnippet
73,399
PlainText (PlainText plainText, int commonIndent) { if (commonIndent <= 0) return plainText; String content = plainText.content(); int curIndent = 0; while (curIndent < commonIndent && curIndent < content.length() && content.charAt(curIndent) != '\n' && Character.isWhitespace(content.charAt(curIndent))) { curIndent++; ...
stripIndent