Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
69,500
void () { doTest(false, "missspelling"); }
testDisabled
69,501
void () { //todo[batrak] ((CodeInsightTestFixtureImpl)myFixture).myDisabledInspections.add(SpellCheckingInspection.SPELL_CHECKING_INSPECTION_TOOL_NAME); testEnabled(); }
testEnabledEvenIfDisabledInMainProfile
69,502
void (boolean enabled, String document) { InspectionProfileImpl.INIT_INSPECTIONS = true; try { myFixture.configureByText(PlainTextFileType.INSTANCE, document); myFixture.enableInspections(new SpellCheckingInspection()); EditorCustomization customization = SpellCheckingEditorCustomizationProvider.getInstance().getCustom...
doTest
69,503
void () { myFixture.enableInspections(new SpellCheckingInspection()); var customization = SpellCheckingEditorCustomizationProvider.getInstance().getEnabledCustomization(); assertNotNull(customization); var field = EditorTextFieldProvider.getInstance().getEditorField(PlainTextLanguage.INSTANCE, getProject(), Set.of(cust...
testHighlightingWorksInEditorTextFieldWithCustomization
69,504
boolean (String key) { return INSTANCE.containsKey(key); }
contains
69,505
boolean (String key) { return INSTANCE.containsKey(key); }
contains
69,506
boolean () { return myPreview; }
isPreview
69,507
String () { return myPresentableText.get(); }
getPresentableText
69,508
boolean (@NotNull LanguageLevel level) { return compareTo(level) >= 0; }
isAtLeast
69,509
boolean (@NotNull LanguageLevel level) { return compareTo(level) < 0; }
isLessThan
69,510
JavaVersion () { return myVersion; }
toJavaVersion
69,511
LanguageLevel (@Nullable String compilerComplianceOption) { if (compilerComplianceOption != null) { JavaSdkVersion sdkVersion = JavaSdkVersion.fromVersionString(compilerComplianceOption); if (sdkVersion != null) { return sdkVersion.getMaxLanguageLevel(); } } return null; }
parse
69,512
String () { return "Java"; }
getDisplayName
69,513
boolean () { return true; }
isCaseSensitive
69,514
LanguageLevelProjectExtension (Project project) { return project.getService(LanguageLevelProjectExtension.class); }
getInstance
69,515
Boolean () { return myDefault; }
getDefault
69,516
void (@Nullable Boolean value) { myDefault = value; }
setDefault
69,517
boolean () { return myDefault != null && myDefault; }
isDefault
69,518
void () { }
languageLevelsChanged
69,519
LanguageLevel () { return myMaxLanguageLevel; }
getMaxLanguageLevel
69,520
boolean (@NotNull JavaSdkVersion version) { return compareTo(version) >= 0; }
isAtLeast
69,521
JavaSdkVersion (@NotNull String versionString) { JavaVersion version = JavaVersion.tryParse(versionString); return version != null ? fromJavaVersion(version) : null; }
fromVersionString
69,522
JavaSdkVersion (@NotNull JavaVersion version) { JavaSdkVersion[] values = values(); return version.feature < values.length ? values[version.feature] : null; }
fromJavaVersion
69,523
int (@NotNull PsiElement expression) { String[] lines = getTextBlockLines(expression); if (lines == null) return -1; return getTextBlockIndent(lines); }
getTextBlockIndent
69,524
boolean (char c) { return c == ' ' || c == '\t' || c == '\f'; }
isTextBlockWhiteSpace
69,525
int (String @NotNull [] lines) { return getTextBlockIndent(lines, false, false); }
getTextBlockIndent
69,526
int (String @NotNull [] lines, boolean preserveContent, boolean ignoreLastLine) { int prefix = Integer.MAX_VALUE; for (int i = 0; i < lines.length && prefix != 0; i++) { String line = lines[i]; int indent = 0; while (indent < line.length() && Character.isWhitespace(line.charAt(indent))) indent++; if (indent == line.len...
getTextBlockIndent
69,527
boolean () { return myLeftBound; }
isLeftBound
69,528
IElementType () { return JavaDocTokenType.DOC_COMMENT_START; }
commentStart
69,529
IElementType () { return JavaDocTokenType.DOC_COMMENT_END; }
commentEnd
69,530
IElementType () { return JavaDocTokenType.DOC_COMMENT_DATA; }
commentData
69,531
TokenSet () { return mySpaceCommentsSet; }
spaceCommentsTokenSet
69,532
IElementType () { return JavaDocTokenType.DOC_SPACE; }
space
69,533
IElementType () { return JavaDocTokenType.DOC_TAG_VALUE_TOKEN; }
tagValueToken
69,534
IElementType () { return JavaDocTokenType.DOC_TAG_VALUE_LPAREN; }
tagValueLParen
69,535
IElementType () { return JavaDocTokenType.DOC_TAG_VALUE_RPAREN; }
tagValueRParen
69,536
IElementType () { return JavaDocTokenType.DOC_TAG_VALUE_QUOTE; }
tagValueQuote
69,537
IElementType () { return JavaDocTokenType.DOC_TAG_VALUE_COLON; }
tagValueColon
69,538
IElementType () { return JavaDocTokenType.DOC_TAG_VALUE_SHARP_TOKEN; }
tagValueSharp
69,539
IElementType () { return JavaDocTokenType.DOC_TAG_VALUE_COMMA; }
tagValueComma
69,540
IElementType () { return JavaDocTokenType.DOC_TAG_NAME; }
tagName
69,541
IElementType () { return JavaDocTokenType.DOC_TAG_VALUE_LT; }
tagValueLT
69,542
IElementType () { return JavaDocTokenType.DOC_TAG_VALUE_GT; }
tagValueGT
69,543
IElementType () { return JavaDocTokenType.DOC_INLINE_TAG_START; }
inlineTagStart
69,544
IElementType () { return JavaDocTokenType.DOC_INLINE_TAG_END; }
inlineTagEnd
69,545
IElementType () { return JavaDocTokenType.DOC_COMMENT_BAD_CHARACTER; }
badCharacter
69,546
IElementType () { return JavaDocTokenType.DOC_COMMENT_LEADING_ASTERISKS; }
commentLeadingAsterisks
69,547
JavaBaseRefactoringSupportProvider () { var provider = LanguageRefactoringSupport.INSTANCE.forLanguage(JavaLanguage.INSTANCE); return (JavaBaseRefactoringSupportProvider)provider; }
getRefactoringSupport
69,548
PsiType (@NotNull PsiExpression expr) { PsiElementFactory factory = JavaPsiFacade.getElementFactory(expr.getProject()); PsiType type = getTypeByExpression(expr, factory); if (LambdaUtil.notInferredType(type)) { type = factory.createTypeByFQClassName(CommonClassNames.JAVA_LANG_OBJECT, expr.getResolveScope()); } return t...
getTypeByExpression
69,549
PsiType (PsiExpression expr, final PsiElementFactory factory) { PsiType type = RefactoringChangeUtil.getTypeByExpression(expr); if (PsiTypes.nullType().equals(type)) { ExpectedTypeInfo[] infos = ExpectedTypesProvider.getExpectedTypes(expr, false); if (infos.length > 0) { type = infos[0].getType(); if (type instanceof P...
getTypeByExpression
69,550
boolean (final String sourceRootPackage, final String targetQName) { if (sourceRootPackage == null || !targetQName.startsWith(sourceRootPackage)) return false; if (sourceRootPackage.isEmpty() || targetQName.length() == sourceRootPackage.length()) return true; return targetQName.charAt(sourceRootPackage.length()) == '.'...
canCreateInSourceRoot
69,551
PsiDirectory (PackageWrapper aPackage, final VirtualFile sourceRoot) { final PsiDirectory[] directories = aPackage.getDirectories(); for (PsiDirectory directory : directories) { if (VfsUtilCore.isAncestor(sourceRoot, directory.getVirtualFile(), false)) { return directory; } } String qNameToCreate; try { qNameToCreate =...
findPackageDirectoryInSourceRoot
69,552
boolean (@Nullable PsiElement element) { return element instanceof PsiLoopStatement || element instanceof PsiIfStatement; }
isLoopOrIf
69,553
PsiExpression (PsiExpression expression) { while (expression instanceof PsiParenthesizedExpression) { final PsiExpression innerExpression = ((PsiParenthesizedExpression)expression).getExpression(); if (innerExpression == null) return expression; expression = innerExpression; } return expression; }
unparenthesizeExpression
69,554
void (PsiType type, SuperTypeVisitor visitor) { if (type instanceof PsiPrimitiveType) { int index = PRIMITIVE_TYPES.indexOf(type); if (index >= 0) { for (int i = index + 1; i < PRIMITIVE_TYPES.size(); i++) { visitor.visitType(PRIMITIVE_TYPES.get(i)); } } } else { InheritanceUtil.processSuperTypes(type, false, aType -> ...
processSuperTypes
69,555
List<PsiExpression> (final PsiFile file, final Document document, final int offset, boolean acceptVoid) { CharSequence text = document.getCharsSequence(); int correctedOffset = offset; int textLength = document.getTextLength(); if (offset >= textLength) { correctedOffset = textLength - 1; } else if (!Character.isJavaId...
collectExpressions
69,556
boolean (PsiExpression expression) { if (expression instanceof PsiMethodReferenceExpression) { return true; } else if (!(expression instanceof PsiAssignmentExpression)) { if (!(expression instanceof PsiReferenceExpression)) { return true; } else { if (!(expression.getParent() instanceof PsiMethodCallExpression)) { fina...
isExtractable
69,557
PsiCodeBlock (@NotNull PsiLambdaExpression lambdaExpression) { final PsiElement body = lambdaExpression.getBody(); if (!(body instanceof PsiExpression)) return (PsiCodeBlock)body; @NonNls String newLambdaText = "{"; if (!PsiTypes.voidType().equals(LambdaUtil.getFunctionalInterfaceReturnType(lambdaExpression))) newLambd...
expandExpressionLambdaToCodeBlock
69,558
PsiElement (@Nullable PsiElement place, boolean skipScopingStatements) { PsiElement parent = place; while (true) { if (parent == null) return null; if (parent instanceof PsiStatement) break; if (parent instanceof PsiExpression && parent.getParent() instanceof PsiLambdaExpression) return parent; parent = parent.getParen...
getParentStatement
69,559
PsiStatement (PsiElement container, PsiElement anchorStatement) { if(container instanceof PsiLoopStatement) { return ((PsiLoopStatement) container).getBody(); } else if (container instanceof PsiIfStatement) { final PsiStatement thenBranch = ((PsiIfStatement)container).getThenBranch(); if (thenBranch != null && PsiTreeU...
getLoopBody
69,560
void (final Set<? super PsiTypeParameter> used, final PsiElement element) { collectTypeParameters(used, element, Conditions.alwaysTrue()); }
collectTypeParameters
69,561
void (final Set<? super PsiTypeParameter> used, final PsiElement element, final Condition<? super PsiTypeParameter> filter) { element.accept(new JavaRecursiveElementVisitor() { @Override public void visitReferenceElement(@NotNull PsiJavaCodeReferenceElement reference) { super.visitReferenceElement(reference); if (!refe...
collectTypeParameters
69,562
void (final @NotNull PsiExpression expression) { super.visitExpression(expression); final PsiType type = expression.getType(); if (type != null) { final PsiTypesUtil.TypeParameterSearcher searcher = new PsiTypesUtil.TypeParameterSearcher(); type.accept(searcher); for (PsiTypeParameter typeParam : searcher.getTypeParame...
visitExpression
69,563
boolean (@NotNull PsiVariable variable) { LOG.assertTrue(variable instanceof PsiLocalVariable || variable instanceof PsiParameter); final boolean isReassigned = HighlightControlFlowUtil .isReassigned(variable, new HashMap<>()); return !isReassigned; }
canBeDeclaredFinal
69,564
PsiElement (PsiElement place) { PsiElement parent = place.getUserData(ElementToWorkOn.PARENT); if (place.getUserData(ElementToWorkOn.OUT_OF_CODE_BLOCK) != null) return parent; if (parent == null) parent = place; while (true) { if (isExpressionAnchorElement(parent)) return parent; if (parent instanceof PsiExpression && ...
getParentExpressionAnchorElement
69,565
boolean (PsiElement element) { if (element instanceof PsiDeclarationStatement && element.getParent() instanceof PsiForStatement) return false; return element instanceof PsiStatement || element instanceof PsiClassInitializer || element instanceof PsiField || element instanceof PsiMethod; }
isExpressionAnchorElement
69,566
PsiElement (PsiExpression @NotNull [] occurrences, PsiElement scope) { PsiElement anchor = null; for (PsiExpression occurrence : occurrences) { if (scope != null && !PsiTreeUtil.isAncestor(scope, occurrence, false)) { continue; } PsiElement anchor1 = getParentExpressionAnchorElement(occurrence); if (anchor1 == null) { ...
getAnchorElementForMultipleExpressions
69,567
List<PsiExpression> (final PsiFile file, final Editor editor, final int offset) { return collectExpressions(file, editor, offset, false); }
collectExpressions
69,568
List<PsiExpression> (final PsiFile file, final Editor editor, final int offset, boolean acceptVoid) { return collectExpressions(file, editor.getDocument(), offset, acceptVoid); }
collectExpressions
69,569
SuggestedNameInfo (@Nullable PsiType type, @NotNull final PsiExpression expression) { return getSuggestedName(type, expression, expression); }
getSuggestedName
69,570
SuggestedNameInfo (@Nullable PsiType type, @NotNull final PsiExpression expression, final PsiElement anchor) { final JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(expression.getProject()); final SuggestedNameInfo nameInfo = codeStyleManager.suggestVariableName(VariableKind.LOCAL_VARIABLE, nul...
getSuggestedName
69,571
PsiType (PsiExpression expr) { PsiElementFactory factory = JavaPsiFacade.getElementFactory(expr.getProject()); PsiType typeByExpression = getTypeByExpression(expr, factory); PsiType type = typeByExpression; final boolean isFunctionalType = LambdaUtil.notInferredType(type); PsiType exprType = expr.getType(); final boole...
getTypeByExpressionWithExpectedType
69,572
boolean (PsiElement element, @Nullable final PsiClass aClass) { return PsiUtil.getEnclosingStaticElement(element, aClass) != null; }
isInStaticContext
69,573
PsiExpression (PsiExpression expression) { while (expression.getParent() instanceof PsiParenthesizedExpression) { expression = (PsiParenthesizedExpression)expression.getParent(); } return expression; }
outermostParenthesizedExpression
69,574
PsiMethod (PsiMethod constructor) { final PsiCodeBlock constructorBody = constructor.getBody(); if (constructorBody == null) return null; final PsiStatement[] statements = constructorBody.getStatements(); if (statements.length == 1 && statements[0] instanceof PsiExpressionStatement) { final PsiExpression expression = (...
getChainedConstructor
69,575
PsiTypeParameterList (final PsiElement @NotNull ... elements) { return createTypeParameterListWithUsedTypeParameters(null, elements); }
createTypeParameterListWithUsedTypeParameters
69,576
PsiTypeParameterList (@Nullable final PsiTypeParameterList fromList, final PsiElement @NotNull ... elements) { return createTypeParameterListWithUsedTypeParameters(fromList, Conditions.alwaysTrue(), elements); }
createTypeParameterListWithUsedTypeParameters
69,577
PsiTypeParameterList (@Nullable final PsiTypeParameterList fromList, Condition<? super PsiTypeParameter> filter, final PsiElement @NotNull ... elements) { if (elements.length == 0) return null; final Set<PsiTypeParameter> used = new HashSet<>(); for (final PsiElement element : elements) { if (element == null) continue;...
createTypeParameterListWithUsedTypeParameters
69,578
void (Condition<? super PsiTypeParameter> filter, Set<PsiTypeParameter> used) { Stack<PsiTypeParameter> toProcess = new com.intellij.util.containers.Stack<>(); toProcess.addAll(used); while (!toProcess.isEmpty()) { PsiTypeParameter parameter = toProcess.pop(); HashSet<PsiTypeParameter> dependencies = new HashSet<>(); c...
collectTypeParametersInDependencies
69,579
String (PsiDocTag tag) { LOG.assertTrue("param".equals(tag.getName())); final PsiElement[] dataElements = tag.getDataElements(); if (dataElements.length < 1) return null; return dataElements[0].getText(); }
getNameOfReferencedParameter
69,580
void (@NotNull PsiMethod method, @NotNull PsiDocComment docComment) { PsiFile containingFile = method.getContainingFile(); if (containingFile == null) { return; } // Here we temporarily enable javadoc (we can't produce reasonable javadoc in change signature without formatting) // This is an explicit action which affect...
formatJavadocIgnoringSettings
69,581
PsiDocTag (@NotNull PsiParameter parameter) { return JavaPsiFacade.getElementFactory(parameter.getProject()).createParamTag(parameter.getName(), ""); }
createParamTag
69,582
PsiField (final PsiClass destClass, final PsiField psiField, final PsiElement anchorMember, final PsiField forwardReference) { final PsiClass parentClass = PsiTreeUtil.getParentOfType(anchorMember, PsiClass.class); if (anchorMember instanceof PsiField && anchorMember.getParent() == parentClass && destClass == parentCla...
appendField
69,583
PsiTypeCodeFragment (@Nullable PsiClassType type, @NotNull PsiElement context, @NotNull JavaCodeFragmentFactory factory, boolean allowConjunctions) { return factory.createTypeCodeFragment(type == null ? "" : type.getCanonicalText(), context, true, (allowConjunctions && PsiUtil.isLanguageLevel8OrHigher(context)) ? JavaC...
createTableCodeFragment
69,584
void (final PsiNewExpression arrayCreation) { PsiExpressionList argumentList = (PsiExpressionList)PsiUtil.skipParenthesizedExprUp(arrayCreation.getParent()); if (argumentList == null) return; PsiExpression[] args = argumentList.getExpressions(); PsiArrayInitializerExpression arrayInitializer = arrayCreation.getArrayIni...
inlineArrayCreationForVarargs
69,585
PsiElement (PsiLocalVariable localVar) { if (!(localVar instanceof ImplicitVariable)) { return localVar.getParent().getParent(); } else { return ((ImplicitVariable)localVar).getDeclarationScope(); } }
getVariableScope
69,586
String (String baseName, PsiElement place, PsiField fieldToReplace) { for(int index = 0;;index++) { final String name = index > 0 ? baseName + index : baseName; final PsiManager manager = place.getManager(); PsiResolveHelper helper = JavaPsiFacade.getInstance(manager.getProject()).getResolveHelper(); PsiVariable refVar...
suggestUniqueVariableName
69,587
void (@NotNull PsiClass aClass) { }
visitClass
69,588
void (@NotNull PsiVariable variable) { if (name.equals(variable.getName())) { found[0] = true; stopWalking(); } }
visitVariable
69,589
boolean (PsiType type1, PsiType type2) { if (type1 == type2) return true; if (type1 == null || !type1.equals(type2)) return false; return Objects.equals(type1.getCanonicalText(true), type2.getCanonicalText(true)); }
deepTypeEqual
69,590
boolean (@NotNull final PsiCall callExpression, @NotNull final PsiExpression @NotNull [] arrayElements) { @NotNull final PsiMethod oldRefMethod = Objects.requireNonNull(callExpression.resolveMethod()); if (arrayElements.length == 1) { PsiType type = arrayElements[0].getType(); // change foo(new Object[]{array}) to foo(...
isSafeToFlattenToVarargsCall
69,591
void (final PsiExpression expr) { if (expr instanceof PsiNewExpression newExpression && newExpression.getArrayInitializer() != null && expr.getParent() instanceof PsiExpressionList exprList && exprList.getParent() instanceof PsiCall parentCall) { PsiExpression[] initializers = getArrayInitializersToFlattenInVarargs(par...
tryToInlineArrayCreationForVarargs
69,592
boolean (final PsiClass targetClass, final PsiElement place, final PsiElement[] elements, Set<? super PsiField> usedFields) { if (!PsiUtil.isLocalOrAnonymousClass(targetClass) && (targetClass.getContainingClass() == null || targetClass.hasModifierProperty(PsiModifier.STATIC))) { boolean canBeStatic = true; if (targetCl...
canBeStatic
69,593
void (PsiMember classMember, PsiJavaCodeReferenceElement classMemberReference) { if (classMember instanceof PsiField && !classMember.hasModifierProperty(PsiModifier.STATIC)) { final PsiExpression expression = PsiTreeUtil.getParentOfType(classMemberReference, PsiExpression.class, false); if (expression == null || !PsiUt...
visitClassMemberReferenceElement
69,594
List<PsiMethod> (@NotNull PsiMethod nearest) { List<PsiMethod> enclosingMethods = new ArrayList<>(); enclosingMethods.add(nearest); PsiMethod method = nearest; while(true) { method = PsiTreeUtil.getParentOfType(method, PsiMethod.class, true); if (method == null) break; enclosingMethods.add(method); } if (enclosingMetho...
getEnclosingMethods
69,595
boolean (final PsiMethod method) { return method.hasModifierProperty(PsiModifier.ABSTRACT) && !method.getManager().isInProject(method); }
isLibraryInterfaceMethod
69,596
ElementPresentation (PsiElement psiElement) { if (psiElement == null || !psiElement.isValid()) return new InvalidPresentation(); if (psiElement instanceof PsiDirectory) return new ForDirectory((PsiDirectory)psiElement); if (psiElement instanceof PsiFile) return new ForFile((PsiFile)psiElement); if (psiElement instanceo...
forElement
69,597
ElementPresentation (VirtualFile file) { return new ForVirtualFile(file); }
forVirtualFile
69,598
boolean (VirtualFile virtualFile) { return virtualFile != null && virtualFile.isValid(); }
validNotNull
69,599
Noun () { return myKind; }
getKind