Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
76,500
String (@NotNull VirtualFile file, @NotNull Project project) { VirtualFile dir = file.isDirectory() ? file : file.getParent(); if (dir == null) return null; return StringUtil.getQualifiedName(PackageIndex.getInstance(project).getPackageNameByDirectory(dir), file.getNameWithoutExtension()); }
getPackageName
76,501
PackageSet () { return new PatternPackageSet(myAspectJSyntaxPattern, myScope, myModulePatternText); }
createCopy
76,502
int () { return 0; }
getNodePriority
76,503
String () { StringBuilder buf = new StringBuilder(); if (myScope != Scope.ANY) { buf.append(myScope.myId); } if (myModulePattern != null || myModuleGroupPattern != null) { buf.append("[").append(myModulePatternText).append("]"); } if (!buf.isEmpty()) { buf.append(':'); } buf.append(myAspectJSyntaxPattern); return buf.t...
getText
76,504
boolean (String oldQName) { return Comparing.strEqual(oldQName, myAspectJSyntaxPattern) || //class qname Comparing.strEqual(oldQName + "..*", myAspectJSyntaxPattern) || //package req Comparing.strEqual(oldQName + ".*", myAspectJSyntaxPattern); //package }
isOn
76,505
PatternBasedPackageSet (@NotNull String oldName, @NotNull String newName) { return new PatternPackageSet(myAspectJSyntaxPattern.replace(oldName, newName), myScope, myModulePatternText); }
updatePattern
76,506
PatternBasedPackageSet (@NotNull String oldName, @NotNull String newName) { return new PatternPackageSet(myAspectJSyntaxPattern, myScope, myModulePatternText.replace(oldName, newName)); }
updateModulePattern
76,507
String () { return myAspectJSyntaxPattern; }
getPattern
76,508
PsiType (PsiElement element, PsiElement context) { //if(!element.isValid()) return null; if(element instanceof PsiType){ return (PsiType)element; } if(element instanceof PsiClass){ return JavaPsiFacade.getElementFactory(element.getProject()).createType((PsiClass)element); } if(element instanceof PsiMethod){ if (((PsiMe...
getTypeByElement
76,509
PsiType (PsiElement context, final String keyword) { if(PsiKeyword.CLASS.equals(keyword)){ return PsiType.getJavaLangClass(context.getManager(), context.getResolveScope()); } else if(PsiKeyword.TRUE.equals(keyword) || PsiKeyword.FALSE.equals(keyword)){ return PsiTypes.booleanType(); } else if(PsiKeyword.THIS.equals(key...
getKeywordItemType
76,510
PsiElement (final PsiElement element, boolean skipReference) { PsiElement prev = element; if(element != null){ if(skipReference){ prev = FilterPositionUtil.searchNonSpaceNonCommentBack(element); while(prev != null && prev.getParent() instanceof PsiJavaCodeReferenceElement){ prev = FilterPositionUtil.searchNonSpaceNonCo...
getPreviousElement
76,511
ElementFilter () { return myFilter; }
getFilter
76,512
boolean (Class hintClass) { return myFilter.isClassAcceptable(hintClass); }
isClassAcceptable
76,513
boolean (Object element, PsiElement context) { if(element instanceof CandidateInfo candidateInfo) { final PsiElement psiElement = candidateInfo.getElement(); return myFilter.isAcceptable(psiElement, context); } else if(element instanceof PsiElement) return myFilter.isAcceptable(element, context); return false; }
isAcceptable
76,514
String () { return getFilter().toString(); }
toString
76,515
String (final Object element) { if (element instanceof XmlTag) { return ((XmlTag)element).getLocalName(); } else if (element instanceof PsiType) { return ((PsiType) element).getPresentableText(); } else { return super.getTextByElement(element); } }
getTextByElement
76,516
boolean (Object element, PsiElement context) { if (element instanceof PsiMethodCallExpression callExpression) { String name = callExpression.getMethodExpression().getReferenceName(); if (name == null || !myMethodNames.contains(name)) { return false; } final PsiMethod psiMethod = callExpression.resolveMethod(); return p...
isAcceptable
76,517
boolean (Class hintClass) { return PsiMethodCallExpression.class.isAssignableFrom(hintClass); }
isClassAcceptable
76,518
String () { return "methodcall(" + myClassName + "." + myMethodNames + ")"; }
toString
76,519
boolean (Object element, @Nullable PsiElement context) { // Do not suggest final/sealed library classes return !(element instanceof PsiClass) || !(element instanceof PsiCompiledElement) || !((PsiClass)element).hasModifierProperty(PsiModifier.FINAL) && !((PsiClass)element).hasModifierProperty(PsiModifier.SEALED); }
isAcceptable
76,520
boolean (Class hintClass) { return ReflectionUtil.isAssignable(PsiClass.class, hintClass); }
isClassAcceptable
76,521
ElementFilter () { return myFilter; }
getFilter
76,522
boolean (Object classElement, PsiElement place) { if(classElement instanceof PsiClass){ Project project = ((PsiClass)classElement).getProject(); final PsiClass[] inners = ((PsiClass)classElement).getInnerClasses(); for (final PsiClass inner : inners) { if (inner.hasModifierProperty(PsiModifier.STATIC) && PsiUtil.isAcce...
isAcceptable
76,523
boolean (Class hintClass) { return true; }
isClassAcceptable
76,524
String () { return "any-inner(" + getFilter().toString() + ")"; }
toString
76,525
boolean (Class hintClass) { return ReflectionUtil.isAssignable(PsiClass.class, hintClass); }
isClassAcceptable
76,526
boolean (Object element, PsiElement context) { if (myCurrentContext.get() != context) { myCurrentContext = new SoftReference<>(context); myCachedClass = new SoftReference<>(PsiTreeUtil.getContextOfType(context, false, PsiClass.class)); } PsiClass curClass = myCachedClass.get(); if (curClass == null) return false; PsiCl...
isAcceptable
76,527
boolean (@NotNull PsiClass curClass, @NotNull PsiClass candidate) { String qualifiedName = curClass.getQualifiedName(); return qualifiedName != null && (qualifiedName.equals(candidate.getQualifiedName()) || candidate.isInheritor(curClass, true)); }
checkInheritance
76,528
String () { return "assignable-from-context"; }
toString
76,529
boolean (@Nullable PsiClass psiClass) { if (psiClass == null) { return false; } for (PsiClass placeClass : myPlaceClasses) { if (InheritanceUtil.isInheritorOrSelf(placeClass, psiClass, true)) { return false; } } return true; }
mayProcessMembers
76,530
void (final Consumer<? super LookupElement> results, @Nullable final PsiClass where, final boolean acceptMethods, final boolean searchInheritors) { if (where == null || isPrimitiveClass(where)) return; String qualifiedName = where.getQualifiedName(); final boolean searchFactoryMethods = searchInheritors && !CommonClass...
processMembers
76,531
boolean (PsiClass where) { String qname = where.getQualifiedName(); if (qname == null || !qname.startsWith("java.lang.")) return false; return CommonClassNames.JAVA_LANG_STRING.equals(qname) || InheritanceUtil.isInheritor(where, CommonClassNames.JAVA_LANG_NUMBER); }
isPrimitiveClass
76,532
void (boolean acceptMethods, Consumer<? super LookupElement> results, boolean isExpectedTypeMember, PsiClass origClass, Collection<? extends PsiElement> declarations) { for (final PsiElement result : declarations) { if (result instanceof PsiMember member && !(result instanceof PsiClass)) { if (member instanceof PsiMeth...
doProcessMembers
76,533
List<PsiExpression> (PsiElement context) { boolean first = true; final List<PsiExpression> expressions = new ArrayList<>(); final PsiElementFactory factory = JavaPsiFacade.getElementFactory(context.getProject()); PsiElement prev = context; context = context.getContext(); while(context != null){ if(context instanceof Ps...
getThisExpressionVariants
76,534
void (boolean searchInheritors, final Consumer<? super LookupElement> results) { if (MagicCompletionContributor.getAllowedValues(myParameters.getPosition()) != null) { return; } addKnownConstants(results); addConstantsFromTargetClass(results, searchInheritors); if (myExpectedType instanceof PsiPrimitiveType && PsiTypes...
addMembers
76,535
record (@NotNull String constantContainingClass, @NotNull LanguageLevel languageLevel, @Nullable String priorityConstant) { }
ConstantClass
76,536
void (Consumer<? super LookupElement> results) { PsiFile file = myParameters.getOriginalFile(); ConstantClass constantClass = CONSTANT_SUGGESTIONS.get(myExpectedType.getCanonicalText()); if (constantClass != null && PsiUtil.getLanguageLevel(file).isAtLeast(constantClass.languageLevel)) { PsiClass charsetsClass = JavaPs...
addKnownConstants
76,537
void (final Consumer<? super LookupElement> results) { if (!JavaCompletionContributor.IN_SWITCH_LABEL.accepts(myPlace)) return; PsiSwitchBlock block = Objects.requireNonNull(PsiTreeUtil.getParentOfType(myPlace, PsiSwitchBlock.class)); final Set<PsiField> fields = ReferenceExpressionCompletionContributor.findConstantsUs...
addConstantsFromReferencedClassesInSwitch
76,538
void (Consumer<? super LookupElement> results, boolean searchInheritors) { PsiElement parent = myPlace.getParent(); if (!(parent instanceof PsiReferenceExpression)) { return; } PsiElement prev = parent; parent = parent.getParent(); while (parent instanceof PsiBinaryExpression binaryExpression) { final IElementType op =...
addConstantsFromTargetClass
76,539
PsiClass (@Nullable PsiElement call) { if (call instanceof PsiMethodCallExpression) { for (final JavaResolveResult result : ((PsiMethodCallExpression)call).getMethodExpression().multiResolve(true)) { final PsiElement element = result.getElement(); if (element instanceof PsiMethod) { final PsiClass aClass = ((PsiMethod)...
getCalledClass
76,540
LookupElement (@NotNull PsiField field, @NotNull PsiClass origClass) { if (!myExpectedType.isAssignableFrom(field.getType())) { return null; } return new VariableLookupItem(field, false) .qualifyIfNeeded(ObjectUtils.tryCast(myParameters.getPosition().getParent(), PsiJavaCodeReferenceElement.class), origClass); }
createFieldElement
76,541
LookupElement (@NotNull PsiMethod method, @NotNull PsiClass origClass) { JavaMethodCallElement item = new JavaMethodCallElement(method, false, false); item.setInferenceSubstitutorFromExpectedType(myPlace, myExpectedType); PsiType type = item.getType(); if (type == null || !myExpectedType.isAssignableFrom(type)) { retur...
createMethodElement
76,542
String () { return myPresentableText + ".class"; }
getLookupString
76,543
void (@NotNull LookupElementPresentation presentation) { presentation.setItemText(getLookupString()); presentation.setIcon(myExpr.getIcon(0)); String pkg = StringUtil.getPackageName(myCanonicalText); if (StringUtil.isNotEmpty(pkg)) { presentation.setTailText(" (" + pkg + ")", true); } }
renderElement
76,544
PsiElement () { return myClass == null ? null : myClass.getElement(); }
getPsiElement
76,545
Object () { return myExpr; }
getObject
76,546
PsiType () { return myExpr.getType(); }
getType
76,547
boolean (Object o) { if (this == o) return true; if (!(o instanceof ClassLiteralLookupElement)) return false; return myCanonicalText.equals(((ClassLiteralLookupElement)o).myCanonicalText); }
equals
76,548
int () { return myCanonicalText.hashCode(); }
hashCode
76,549
void (@NotNull InsertionContext context) { final Document document = context.getEditor().getDocument(); int offset = context.getTailOffset(); String replacement = myCanonicalText + DOT_CLASS; if (document.getTextLength() > offset + DOT_CLASS.length() && document.getText(TextRange.from(offset, DOT_CLASS.length())).equal...
handleInsert
76,550
void (@NotNull final JavaSmartCompletionParameters parameters, @NotNull Consumer<? super LookupElement> result, final PrefixMatcher matcher) { PsiType expectedType = parameters.getDefaultType(); if (!InheritanceUtil.isInheritor(expectedType, CommonClassNames.JAVA_LANG_CLASS)) { expectedType = parameters.getExpectedType...
addCompletions
76,551
void (final PsiFile context, final PsiType classParameter, final Consumer<? super LookupElement> result, PrefixMatcher matcher) { final String canonicalText = classParameter.getCanonicalText(); if (CommonClassNames.JAVA_LANG_OBJECT.equals(canonicalText) && StringUtil.isEmpty(matcher.getPrefix())) { return; } CodeInsigh...
addInheritorClassLiterals
76,552
void (@Nullable final PsiType type, final Consumer<? super LookupElement> resultSet, final PsiFile context) { if (type instanceof PsiClassType && PsiUtil.resolveClassInType(type) != null && !((PsiClassType)type).hasParameters() && !(((PsiClassType)type).resolve() instanceof PsiTypeParameter)) { try { resultSet.consume(...
addClassLiteralLookupElement
76,553
boolean (Class hintClass) { return true; }
isClassAcceptable
76,554
boolean (Object element, PsiElement context) { PsiType type = myType; if (type == null) { JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(context.getProject()); final PsiClass aClass = psiFacade.findClass(myClassName, context.getResolveScope()); if (aClass != null) { type = psiFacade.getElementFactory().createType(...
isAcceptable
76,555
boolean (PsiElement element, PsiElement context, PsiType expectedType, PsiSubstitutor substitutor) { if (element instanceof PsiMethod && isReturnTypeInferrable((PsiMethod)element, context, expectedType, substitutor)) { return true; } PsiType typeByElement = FilterUtil.getTypeByElement(element, context); if (typeByEleme...
isAcceptable
76,556
boolean (PsiElement place) { final PsiElement parent = place.getParent(); if (parent.getParent() instanceof PsiSynchronizedStatement statement && parent.equals(statement.getLockExpression())) { return false; } return true; }
allowBoxing
76,557
boolean (PsiMethod method, PsiElement place, PsiType expectedType, @Nullable PsiSubstitutor substitutor) { final PsiResolveHelper helper = JavaPsiFacade.getInstance(method.getProject()).getResolveHelper(); PsiTypeParameter[] typeParameters = method.getTypeParameters(); if (typeParameters.length == 0) return false; PsiT...
isReturnTypeInferrable
76,558
boolean (@Nullable PsiClass psiClass) { if (psiClass instanceof PsiTypeParameter) { PsiClassType[] supers = psiClass.getExtendsListTypes(); if (supers.length > 1) { return isImpossibleIntersection(PsiIntersectionType.createIntersection(supers)); } } return false; }
extendsImpossibleIntersection
76,559
boolean (PsiType intersection) { return intersection instanceof PsiIntersectionType && ((PsiIntersectionType)intersection).getConflictingConjunctsMessage() != null; }
isImpossibleIntersection
76,560
String () { return "assignable-from(" + (myType != null ? myType : myClassName) + ")"; }
toString
76,561
boolean (Class hintClass) { return true; }
isClassAcceptable
76,562
boolean (Object element, PsiElement context) { if(element == null) return false; if (element instanceof PsiType) return myType.isAssignableFrom((PsiType) element); PsiSubstitutor substitutor = null; if(element instanceof CandidateInfo info){ substitutor = info.getSubstitutor(); element = info.getElement(); } PsiType ty...
isAcceptable
76,563
String () { return "assignable-to(" + myType + ")"; }
toString
76,564
boolean (Object element, PsiElement context) { PsiElement cachedVar = context; if(myCurrentContext.get() != context){ myCurrentContext = new SoftReference<>(context); while(cachedVar != null && !(getFilter().isAcceptable(cachedVar, cachedVar.getContext()))) cachedVar = cachedVar.getContext(); myCachedVar = new SoftRefe...
isAcceptable
76,565
boolean (final PsiMethod method, final PsiMethod candidate) { if (method.getManager().areElementsEquivalent(method, candidate)) return false; if (!MethodSignatureUtil.areSignaturesEqual(method,candidate)) return false; final PsiClass candidateContainingClass = candidate.getContainingClass(); return candidateContainingC...
isOverridingMethod
76,566
PsiReferenceExpression (PsiElement position) { PsiElement each = position; while (each != null && !(each instanceof PsiFile)) { if (each instanceof PsiExpressionList || each instanceof PsiPrefixExpression || each instanceof PsiPolyadicExpression) { return null; } if (each instanceof PsiAssignmentExpression assignment) ...
getAssignedReference
76,567
boolean (Object element, PsiElement context) { if(!(element instanceof PsiElement)) return true; PsiReferenceExpression referenceExpression = getAssignedReference(context); if (referenceExpression != null && referenceExpression.isReferenceTo((PsiElement)element)) { return false; } return true; }
isAcceptable
76,568
boolean (Class hintClass) { return true; }
isClassAcceptable
76,569
boolean (@NotNull final ASTNode node) { return (node.getElementType() == JavaDocTokenType.DOC_COMMENT_DATA || node.getElementType() == JavaDocTokenType.DOC_TAG_VALUE_TOKEN) && node.getText().trim().isEmpty(); }
containsWhitespacesOnly
76,570
Block (@NotNull final List<? extends ASTNode> subNodes, final Wrap wrap, @Nullable final Alignment alignment) { final ArrayList<Block> subBlocks = new ArrayList<>(); final ASTNode firstNode = subNodes.get(0); if (firstNode.getElementType() == JavaTokenType.DOT) { AlignmentStrategy strategy = AlignmentStrategy.getNullSt...
create
76,571
List<Block> (@NotNull final List<? extends ASTNode> subNodes) { final ArrayList<Block> result = new ArrayList<>(); for (ASTNode node : subNodes) { Indent indent = Indent.getContinuationWithoutFirstIndent(myIndentSettings.USE_RELATIVE_INDENTS); result.add(newJavaBlock(node, mySettings, myJavaSettings, indent, null, Alig...
createJavaBlocks
76,572
boolean (final IElementType type) { return false; }
shouldWrap
76,573
WrappingStrategy (Wrap wrap) { return new WrappingStrategy(wrap) { @Override protected boolean shouldWrap(final IElementType type) { return type != JavaTokenType.COMMA && type != JavaTokenType.SEMICOLON; } }; }
createDoNotWrapCommaStrategy
76,574
boolean (final IElementType type) { return type != JavaTokenType.COMMA && type != JavaTokenType.SEMICOLON; }
shouldWrap
76,575
Wrap (IElementType type) { if (shouldWrap(type)) { return myWrap; } else { return null; } }
getWrap
76,576
List<Block> (ASTNode node, BlockFactory factory) { List<Block> blocks = new ArrayList<>(); for (ASTNode child : node.getChildren(null)) { if (FormatterUtil.isWhitespaceOrEmpty(child) || child.getTextLength() == 0) { continue; } Alignment alignment = myConfig.getAlignment(child); IElementType type = child.getElementType...
buildNodeChildBlocks
76,577
ChildrenBlocksBuilder () { return new ChildrenBlocksBuilder(this); }
createBuilder
76,578
Config (Alignment alignment) { myDefaultAlignment = alignment; return this; }
setDefaultAlignment
76,579
Config (Wrap wrap) { myDefaultWrap = wrap; return this; }
setDefaultWrap
76,580
Config (Indent indent) { myDefaultIndent = indent; return this; }
setDefaultIndent
76,581
Config (@NotNull IElementType elementType, @NotNull Alignment alignment) { myAlignments.put(elementType, alignment); return this; }
setAlignment
76,582
Config (IElementType elementType) { myAlignments.put(elementType, NO_ALIGNMENT); return this; }
setNoAlignment
76,583
Config (IElementType elementType, Predicate<? super ASTNode> applyAlignCondition) { myNoneAlignmentCondition.put(elementType, applyAlignCondition); return this; }
setNoAlignmentIf
76,584
Config (IElementType elementType, Indent indent) { myIndents.put(elementType, indent); return this; }
setIndent
76,585
Indent (IElementType elementType) { Indent indent = myIndents.get(elementType); return indent != null ? indent : myDefaultIndent; }
getIndent
76,586
Alignment (ASTNode node) { IElementType elementType = node.getElementType(); Predicate<? super ASTNode> noneAlignmentCondition = myNoneAlignmentCondition.get(elementType); if (noneAlignmentCondition != null && noneAlignmentCondition.test(node)) { return null; } Alignment alignment = myAlignments.get(elementType); if (a...
getAlignment
76,587
Wrap (IElementType elementType) { Wrap wrap = myWraps.get(elementType); if (wrap == NO_WRAP) return null; return wrap != null ? wrap : myDefaultWrap; }
getWrap
76,588
Config (IElementType elementType) { myWraps.put(elementType, NO_WRAP); return this; }
setNoWrap
76,589
FormattingMode () { return myFormattingMode; }
getFormattingMode
76,590
Config (FormattingMode formattingMode) { myFormattingMode = formattingMode; return this; }
setFormattingMode
76,591
boolean (@NotNull ASTNode node) { if (node.getElementType() != JavaElementType.FIELD) { return false; } ASTNode firstChild = node.getFirstChildNode(); if (firstChild == null || firstChild.getElementType() != JavaTokenType.IDENTIFIER) { return false; } ASTNode prev = node.getTreePrev(); return prev == null || !JavaJspEl...
compoundFieldPart
76,592
ASTNode (@NotNull final ASTNode child) { PsiElement psi = child.getPsi(); if (psi == null) { return child; } final PsiTypeElement typeElement = ((PsiVariable)psi).getTypeElement(); if (typeElement == null) return child; ASTNode lastChildNode = child.getLastChildNode(); if (lastChildNode == null) return child; if (lastC...
findLastFieldInGroup
76,593
List<Block> () { final List<Block> result = new ArrayList<>(); myInjectedBlockBuilder.addInjectedBlocks(result, myNode, myWrap, myAlignment, Indent.getNoneIndent()); return result; }
buildChildren
76,594
boolean () { return false; }
isLeaf
76,595
ChildAttributes (int newChildIndex) { return new ChildAttributes(Indent.getNormalIndent(), null); }
getChildAttributes
76,596
Spacing (Block child1, @NotNull Block child2) { return null; }
getSpacing
76,597
CodeStyleSettings () { return mySettings.getRootSettings(); }
getSettings
76,598
boolean (String text, ASTNode injectionHost) { return true; }
canProcessFragment
76,599
Block (ASTNode node, Wrap wrap, Alignment alignment, Indent indent, final TextRange range) { return new PartialCommentBlock(node, wrap, alignment, indent, range); }
createBlockBeforeInjection