Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
33,000
boolean (@NotNull PsiElement place, @Nullable PsiElement lastParent, @NotNull PsiScopeProcessor processor, @NotNull PsiElement scope, @NotNull ResolveState state) { //state = ResolveState.initial(); if (scope instanceof GrTypeDefinition) { if (!processNonCodeMembers(createPsiType((GrTypeDefinition)scope), processor, pl...
processScopeNonCodeMembers
33,001
PsiClassType (@NotNull PsiClass psiClass) { PsiElementFactory factory = JavaPsiFacade.getElementFactory(psiClass.getProject()); return factory.createType(psiClass); }
createPsiType
33,002
boolean (@NotNull PsiScopeProcessor processor, @NotNull PsiNamedElement namedElement, @NotNull ResolveState state) { NameHint nameHint = processor.getHint(NameHint.KEY); String name = nameHint == null ? null : nameHint.getName(state); if (name == null || name.equals(namedElement.getName())) { return processor.execute(n...
processElement
33,003
boolean (@NotNull PsiType type, @NotNull PsiScopeProcessor processor, boolean processNonCodeMembers, @NotNull PsiElement place) { return processAllDeclarations(type, processor, initialState(processNonCodeMembers), place); }
processAllDeclarations
33,004
boolean (@NotNull PsiType type, @NotNull PsiScopeProcessor processor, @NotNull ResolveState state, @NotNull PsiElement place) { return processReceiverType(type, processor, state, place); }
processAllDeclarations
33,005
boolean (@NotNull PsiType type, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { if (type instanceof PsiEllipsisType) { type = ((PsiEllipsisType)type).toArrayType(); } return NonCodeMembersContributor.runContributors(type, processor, place, state); }
processNonCodeMembers
33,006
void (PsiType type, Set<? super String> visited, Project project) { String qName = rawCanonicalText(type); if (!(type instanceof PsiClassType && ((PsiClassType)type).resolve() instanceof PsiTypeParameter)) { if (!visited.add(qName)) { return; } } final PsiType[] superTypes = type.getSuperTypes(); for (PsiType superType...
collectSuperTypes
33,007
PsiType (Project project, Key<PsiType> key, String text) { final PsiElementFactory factory = JavaPsiFacade.getElementFactory(project); PsiType type = project.getUserData(key); if (type == null) { type = factory.createTypeFromText(text, null); project.putUserData(key, type); } return type; }
createTypeFromText
33,008
Set<String> (@NotNull PsiType base, final Project project) { final Map<String, Set<String>> cache = CachedValuesManager.getManager(project).getCachedValue(project, () -> { final Map<String, Set<String>> result = new ConcurrentHashMap<>(); return CachedValueProvider.Result.create(result, PsiModificationTracker.MODIFICAT...
getAllSuperTypes
33,009
String (@NotNull PsiType type) { if (type instanceof PsiClassType) { String qname = TypesUtil.getQualifiedName(type); if (qname != null) { return qname; } } return TypeConversionUtil.erasure(type).getCanonicalText(); }
rawCanonicalText
33,010
GroovyPsiElement (GroovyPsiElement place, String name) { PropertyResolverProcessor processor = new PropertyResolverProcessor(name, place); return resolveExistingElement(place, processor, GrVariable.class, GrReferenceExpression.class); }
resolveProperty
33,011
boolean (PsiElement element, String labelName) { return ((element instanceof GrLabeledStatement && labelName.equals(((GrLabeledStatement)element).getName()))); }
isApplicableLabelStatement
33,012
boolean (@NotNull PsiElement place, @NotNull PsiScopeProcessor processor, @NotNull ResolveState state) { PsiElement run = place; PsiElement lastParent = null; while (run != null) { ProgressManager.checkCanceled(); if (run instanceof GrStatementOwner) { if (!GdkMethodUtil.processMixinToMetaclass((GrStatementOwner)run, p...
processCategoryMembers
33,013
PsiElement[] (GroovyResolveResult[] candidates) { return PsiUtil.mapElements(candidates); }
mapToElements
33,014
GroovyResolveResult[] (Collection<? extends GroovyResolveResult> candidates) { if (candidates.size() == 0) return GroovyResolveResult.EMPTY_ARRAY; if (candidates.size() == 1) return candidates.toArray(GroovyResolveResult.EMPTY_ARRAY); final List<GroovyResolveResult> result = new ArrayList<>(); final Iterator<? extends ...
filterSameSignatureCandidates
33,015
String (PsiMethod method) { int parameters = method.getParameters().length; String name = method.getName(); return parameters + "_" + name; }
getKey
33,016
boolean (PsiMethod method1, PsiSubstitutor substitutor1, PsiMethod method2, PsiSubstitutor substitutor2) { //method1 has more general parameter types then method2 if (!method1.getName().equals(method2.getName())) return false; PsiParameter[] params1 = method1.getParameterList().getParameters(); PsiParameter[] params2 =...
dominated
33,017
GroovyResolveResult[] (GroovyPsiElement place) { final PsiElement parent = place.getParent(); GroovyResolveResult[] variants = GroovyResolveResult.EMPTY_ARRAY; if (parent instanceof GrCallExpression) { variants = ((GrCallExpression)parent).getCallVariants(place instanceof GrExpression ? (GrExpression)place : null); } e...
getCallVariants
33,018
GroovyResolveResult[] (PsiMethod[] constructors, PsiElement place) { GroovyResolveResult[] variants = new GroovyResolveResult[constructors.length]; for (int i = 0; i < constructors.length; i++) { final boolean isAccessible = PsiUtil.isAccessible(constructors[i], place, null); variants[i] = new GroovyResolveResultImpl(c...
getConstructorResolveResult
33,019
boolean (GrReferenceExpression ref) { if (!(ref.getParent() instanceof GrIndexProperty) && org.jetbrains.plugins.groovy.lang.psi.util.PsiUtil.isCall(ref)) return false; // TODO separate element for spread expression if (ref.getDotTokenType() == GroovyTokenTypes.mSPREAD_DOT) return false; return ref.resolve() instanceof...
isKeyOfMap
33,020
boolean (@Nullable PsiType type, PsiType @Nullable [] argTypes, @NotNull PsiElement place) { if (!(type instanceof GrClosureType)) { if (type instanceof GroovyClosureType) { throw new RuntimeException(); } return false; } if (argTypes == null) return true; final List<GrSignature> signature = ((GrClosureType)type).getSi...
isApplicableClosureType
33,021
boolean (PsiReference ref, String name, String qName) { PsiElement resolved = ref.resolve(); if (!(resolved instanceof PsiEnumConstant)) return false; if (!name.equals(((PsiEnumConstant)resolved).getName())) return false; PsiClass aClass = ((PsiEnumConstant)resolved).getContainingClass(); if (aClass == null) return fal...
isEnumConstant
33,022
boolean (GrVariable var) { PsiElement parent = var.getParent(); return parent instanceof GrVariableDeclaration && isScriptFieldDeclaration(((GrVariableDeclaration)parent)); }
isScriptField
33,023
boolean (@NotNull GrVariableDeclaration declaration) { PsiFile containingFile = declaration.getContainingFile(); if (!(containingFile instanceof GroovyFile) || !((GroovyFile)containingFile).isScript()) return false; GrMember member = PsiTreeUtil.getParentOfType(declaration, GrTypeDefinition.class, GrMethod.class); if (...
isScriptFieldDeclaration
33,024
boolean (@NotNull GrVariableDeclaration declaration) { return declaration.getParent() instanceof GrTypeDefinitionBody || isScriptFieldDeclaration(declaration); }
isFieldDeclaration
33,025
PsiNamedElement (@NotNull GrVariable variable) { if (isScriptField(variable)) { final String name = variable.getName(); final GroovyScriptClass script = (GroovyScriptClass)((GroovyFile)variable.getContainingFile()).getScriptClass(); assert script != null; List<GrField> duplicates = ContainerUtil.filter(script.getFields...
findDuplicate
33,026
boolean (final GrReferenceExpression ref) { GrExpression qualifier = ref.getQualifier(); if (qualifier instanceof GrReferenceExpression) { final PsiElement resolvedQualifier = ((GrReferenceExpression)qualifier).resolve(); return resolvedQualifier instanceof PsiClass || resolvedQualifier instanceof PsiPackage; } else { ...
canBeClassOrPackage
33,027
boolean (ElementClassHint classHint) { return classHint == null || classHint.shouldProcess(DeclarationKind.CLASS); }
shouldProcessClasses
33,028
boolean (ElementClassHint classHint) { return classHint == null || classHint.shouldProcess(DeclarationKind.METHOD); }
shouldProcessMethods
33,029
boolean (ElementClassHint classHint) { return classHint == null || classHint.shouldProcess(DeclarationKind.VARIABLE) || classHint.shouldProcess(DeclarationKind.FIELD) || classHint.shouldProcess(DeclarationKind.ENUM_CONST); }
shouldProcessProperties
33,030
boolean (@NotNull PsiScopeProcessor resolver, @NotNull PsiFile file, @NotNull ResolveState state, @NotNull PsiElement place) { if (!shouldProcessMethods(resolver.getHint(ElementClassHint.KEY))) return true; return file.processDeclarations(new GrDelegatingScopeProcessorWithHints(resolver, null, ClassHint.RESOLVE_KINDS_M...
processStaticImports
33,031
boolean (@NotNull PsiElement element, @NotNull ResolveState _state) { if (_state.get(ClassHint.RESOLVE_CONTEXT) instanceof GrImportStatement) { super.execute(element, _state); } return true; }
execute
33,032
boolean (@Nullable PsiElement expression) { if (!(expression instanceof GrQualifiedReference)) return false; return isClassReference(expression) || ((GrQualifiedReference<?>)expression).resolve() instanceof PsiClass; }
resolvesToClass
33,033
boolean (@NotNull PsiElement expression) { if (!(expression instanceof GrReferenceExpression ref)) return false; GrExpression qualifier = ref.getQualifier(); if (!"class".equals(ref.getReferenceName())) return false; return qualifier != null && getClassReferenceFromExpression(qualifier) != null; }
isClassReference
33,034
boolean (@NotNull PsiElement place, @NotNull PsiNamedElement namedElement) { if (namedElement instanceof GrField field) { if (org.jetbrains.plugins.groovy.lang.psi.util.PsiUtil.isAccessible(place, field)) { return true; } for (GrAccessorMethod method : field.getGetters()) { if (org.jetbrains.plugins.groovy.lang.psi.uti...
isAccessible
33,035
boolean (@NotNull PsiElement place, @NotNull PsiNamedElement element, @Nullable PsiElement resolveContext, boolean filterStaticAfterInstanceQualifier) { if (resolveContext instanceof GrImportStatement) return true; if (element instanceof PsiModifierListOwner) { return GrStaticChecker.isStaticsOK((PsiModifierListOwner)e...
isStaticsOK
33,036
boolean (@NotNull GrReferenceExpression ref) { assert !ref.hasMemberPointer(); return ref.getParent() instanceof GrMethodCall; }
canResolveToMethod
33,037
boolean (@NotNull PsiClass scope, @NotNull PsiScopeProcessor processor, @NotNull ResolveState state, @Nullable PsiElement lastParent, @NotNull PsiElement place) { for (PsiScopeProcessor each : MultiProcessor.allProcessors(processor)) { if (!scope.processDeclarations(each, state, lastParent, place)) return false; } retu...
processClassDeclarations
33,038
String () { return GROOVY_LANG_CLOSURE; }
getParentClassName
33,039
void (@NotNull PsiType qualifierType, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { final PsiElement context = state.get(ClassHint.RESOLVE_CONTEXT); if (!(context instanceof GrClosableBlock)) return; processMembers((GrClosableBlock)context, processor, place, state); }
processDynamicElements
33,040
PsiType () { List<GrStatement> returns = ControlFlowUtils.collectReturns(myBlock); if (returns.isEmpty()) return PsiTypes.voidType(); PsiType result = null; PsiManager manager = myBlock.getManager(); for (GrStatement returnStatement : returns) { GrExpression value = null; if (returnStatement instanceof GrReturnStatemen...
compute
33,041
void (@NotNull PsiReferenceRegistrar registrar) { registrar.registerReferenceProvider(GroovyPatterns.stringLiteral(), new MyProvider()); }
registerReferenceProviders
33,042
PsiReference[] (@NotNull PsiElement element, GrNamedArgument namedArgument, @NotNull ProcessingContext context) { String labelName = namedArgument.getLabelName(); if (labelName == null) return PsiReference.EMPTY_ARRAY; if (!GroovyMethodInfo.getAllSupportedNamedArguments().contains(labelName)) { // Optimization: avoid u...
createReferencesForNamedArgument
33,043
TextRange (@NotNull final GrLiteralContainer element) { if (element instanceof GrStringContent) { return TextRange.from(0, element.getTextLength()); } final String text = element.getText(); if (!(element.getValue() instanceof String)) { return super.getRangeInElement(element); } return getLiteralRange(text); }
getRangeInElement
33,044
TextRange (String text) { int start = 1; int fin = text.length(); String begin = text.substring(0, 1); if (text.startsWith("$/")) { start = 2; if (text.endsWith("/$")) { return new TextRange(start, Math.max(1, fin - 2)); } else { return new TextRange(start, fin); } } if (text.startsWith("\"\"\"") || text.startsWith("''...
getLiteralRange
33,045
boolean (@NotNull VirtualFile file) { return StringUtil.endsWith(file.getNameSequence(), HELPER_SUFFIX); }
acceptInput
33,046
Collection<TraitFieldDescriptor> (@NotNull FileContent inputData) { return index(inputData.getContent()); }
computeValue
33,047
SingleEntryIndexer<Collection<TraitFieldDescriptor>> () { return INDEXER; }
getIndexer
33,048
DataExternalizer<Collection<TraitFieldDescriptor>> () { return this; }
getValueExternalizer
33,049
InputFilter () { return FILTER; }
getInputFilter
33,050
int () { return 5; }
getVersion
33,051
Collection<TraitFieldDescriptor> (byte[] fileContents) { final Collection<TraitFieldDescriptor> values = new ArrayList<>(); new ClassReader(fileContents).accept(new ClassVisitor(Opcodes.API_VERSION) { @Override public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { return...
index
33,052
FieldVisitor (int access, String name, String desc, String signature, Object value) { return new FieldVisitor(Opcodes.API_VERSION) { private final List<String> annotations = new SmartList<>(); @Override public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) { return StubBuildingVisitor.getAnnotati...
visitField
33,053
AnnotationVisitor (String descriptor, boolean visible) { return StubBuildingVisitor.getAnnotationTextCollector(descriptor, annotations::add); }
visitAnnotation
33,054
void () { processField(access, name, desc, signature, annotations); }
visitEnd
33,055
void (int access, String name, String desc, String signature, List<String> annotations) { if ((access & ACC_SYNTHETIC) == 0) return; final boolean isStatic; final boolean isPublic; Pair<Boolean, String> p; if ((p = parse(STATIC_PREFIX, INSTANCE_PREFIX, name)).first != null) { isStatic = p.first; name = p.second; } else...
processField
33,056
String (String desc, String signature) { if (signature != null) { try { return SignatureParsing.parseTypeStringToTypeInfo(new SignatureParsing.CharIterator(signature), StubBuildingVisitor.GUESSING_PROVIDER).text(); } catch (ClsFormatException ignored) { } } String raw = Type.getType(desc).getClassName(); return StubBui...
fieldType
33,057
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TraitFieldDescriptor that = (TraitFieldDescriptor)o; if (flags != that.flags) return false; if (!typeString.equals(that.typeString)) return false; if (!name.equals(that.name)) return false; return true; }
equals
33,058
int () { int result = flags; result = 31 * result + typeString.hashCode(); result = 31 * result + name.hashCode(); return result; }
hashCode
33,059
int () { return ClassFileStubBuilder.STUB_VERSION + 6; }
getVersion
33,060
InputFilter () { return new DefaultFileTypeSpecificInputFilter(JavaClassFileType.INSTANCE) { @Override public boolean acceptInput(@NotNull VirtualFile file) { return StringUtil.endsWith(file.getNameSequence(), HELPER_SUFFIX); } }; }
getInputFilter
33,061
boolean (@NotNull VirtualFile file) { return StringUtil.endsWith(file.getNameSequence(), HELPER_SUFFIX); }
acceptInput
33,062
SingleEntryIndexer<ByteArraySequence> () { return new SingleEntryIndexer<>(false) { @Override protected ByteArraySequence computeValue(@NotNull FileContent inputData) { @Nullable PsiJavaFileStub stub = index(inputData.getFile(), inputData.getContent()); if (stub == null) return null; BufferExposingByteArrayOutputStream...
getIndexer
33,063
ByteArraySequence (@NotNull FileContent inputData) { @Nullable PsiJavaFileStub stub = index(inputData.getFile(), inputData.getContent()); if (stub == null) return null; BufferExposingByteArrayOutputStream buffer = new BufferExposingByteArrayOutputStream(); myStubTreeSerializer.serialize(stub, buffer); return buffer.toB...
computeValue
33,064
DataExternalizer<ByteArraySequence> () { return new DataExternalizer<>() { @Override public void save(@NotNull DataOutput out, ByteArraySequence value) throws IOException { int length = value.length(); DataInputOutputUtil.writeINT(out, length); out.write(value.getInternalBuffer(), value.getOffset(), length); } @Overrid...
getValueExternalizer
33,065
PsiJavaFileStub (@NotNull VirtualFile file, byte @NotNull [] content) { try { PsiJavaFileStub root = new PsiJavaFileStubImpl("", true); new ClassReader(content).accept(new GrTraitMethodVisitor(file, root), EMPTY_ATTRIBUTES, ClassReader.SKIP_CODE); new StubTree(root); // to ensure stubs are stored in DFS order return ro...
index
33,066
void (int version, int access, String name, String signature, String superName, String[] interfaces) { super.visit(version, access, "gr_trait_helper", null, null, null); }
visit
33,067
void (String source, String debug) { }
visitSource
33,068
void (String owner, String name, String desc) { }
visitOuterClass
33,069
AnnotationVisitor (String desc, boolean visible) { return null; }
visitAnnotation
33,070
void (String name, String outerName, String innerName, int access) { }
visitInnerClass
33,071
FieldVisitor (int access, String name, String desc, String signature, Object value) { return null; }
visitField
33,072
MethodVisitor (int access, String name, String desc, String signature, String[] exceptions) { if ((access & ACC_SYNTHETIC) == 0 && (access & ACC_STATIC) != 0 && name != null) { Type[] args = Type.getArgumentTypes(desc); if (args.length > 0 && args[0].getSort() == Type.OBJECT && CommonClassNames.JAVA_LANG_CLASS.equals(a...
visitMethod
33,073
Collection<PsiMethod> (@NotNull ClsClassImpl trait) { PsiFile psiFile = trait.getContainingFile(); if (!(psiFile instanceof PsiJavaFile)) return Collections.emptyList(); VirtualFile traitFile = psiFile.getVirtualFile(); if (traitFile == null) return Collections.emptyList(); VirtualFile helperFile = traitFile.getParent(...
getStaticTraitMethods
33,074
void (@NotNull NonCodeMembersContributor extension, @NotNull PluginDescriptor pluginDescriptor) { dropCache(); }
extensionAdded
33,075
void (@NotNull NonCodeMembersContributor extension, @NotNull PluginDescriptor pluginDescriptor) { dropCache(); }
extensionRemoved
33,076
void (@NotNull PsiType qualifierType, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { throw new RuntimeException("One of two 'processDynamicElements()' methods must be implemented"); }
processDynamicElements
33,077
void (@NotNull PsiType qualifierType, @Nullable PsiClass aClass, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { processDynamicElements(qualifierType, processor, place, state); }
processDynamicElements
33,078
boolean () { return true; }
unwrapMultiprocessor
33,079
String () { return null; }
getParentClassName
33,080
Collection<String> () { String className = getParentClassName(); return ContainerUtil.createMaybeSingletonList(className); }
getClassNames
33,081
void () { cache = null; PatternCompilerFactory.getFactory().dropCache(); }
dropCache
33,082
void () { if (cache != null) return; final Collection<NonCodeMembersContributor> allTypeContributors = new ArrayList<>(); final MultiMap<String, NonCodeMembersContributor> contributorMap = new MultiMap<>(); for (final NonCodeMembersContributor contributor : EP_NAME.getExtensions()) { Collection<String> fqns = contribut...
ensureInit
33,083
Iterable<NonCodeMembersContributor> (@Nullable PsiClass clazz) { final List<NonCodeMembersContributor> result = new ArrayList<>(); if (clazz != null) { for (String superClassName : ClassUtil.getSuperClassesWithCache(clazz).keySet()) { result.addAll(cache.classSpecifiedContributors.get(superClassName)); } } ContainerUti...
getApplicableContributors
33,084
boolean (@NotNull PsiType qualifierType, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { ensureInit(); final PsiClass aClass = PsiTypesUtil.getPsiClass(qualifierType); final Iterable<? extends PsiScopeProcessor> unwrappedOriginals = MultiProcessor.allProcessors(processor)...
runContributors
33,085
boolean (@NotNull PsiElement element, @NotNull ResolveState state) { if (!wantMore) { return false; } wantMore = super.execute(element, state); return wantMore; }
execute
33,086
void (@NotNull TransformationContext context) { GrTypeDefinition typeDefinition = context.getCodeClass(); if (typeDefinition.getName() == null) return; PsiModifierList modifierList = typeDefinition.getModifierList(); if (modifierList == null) return; final PsiAnnotation tupleConstructor = context.getAnnotation(GroovyCo...
applyTransformation
33,087
List<GrLightMethodBuilder> (@NotNull GrTypeDefinition typeDefinition, String originInfo, @NotNull TransformationContext context) { if (GroovyConfigUtils.isAtLeastGroovy25(typeDefinition)) { PsiAnnotation mapConstructorAnno = typeDefinition.getAnnotation(GroovyCommonClassNames.GROOVY_TRANSFORM_MAP_CONSTRUCTOR); if (mapC...
generateMapConstructor
33,088
GrLightMethodBuilder (@NotNull TransformationContext context, @Nullable PsiAnnotation tupleConstructor, boolean immutable, boolean canonical, @NotNull String originInfo) { final GrTypeDefinition typeDefinition = context.getCodeClass(); final GrLightMethodBuilder fieldsConstructor = new GrLightMethodBuilder(typeDefiniti...
generateFieldConstructor
33,089
void (@NotNull TransformationContext context,@NotNull GrLightMethodBuilder constructor) { GrTypeDefinition codeClass = context.getCodeClass(); var modifierList = codeClass.getModifierList(); if (modifierList == null || context.hasModifierProperty(modifierList, PsiModifier.STATIC)) { return; } PsiClass containingClass =...
checkContainingClass
33,090
void (@NotNull TransformationContext context) { GrModifierList modifierList = context.getCodeClass().getModifierList(); if (modifierList == null) return; for (GrAnnotation annotation : modifierList.getAnnotations()) { String qname = annotation.getQualifiedName(); String logger = ourLoggers.get(qname); if (logger != nul...
applyTransformation
33,091
Collection<PsiMethod> () { return Collections.emptyList(); }
getMethods
33,092
Collection<GrField> () { return Collections.emptyList(); }
getFields
33,093
Collection<PsiClass> () { return Collections.emptyList(); }
getClasses
33,094
Collection<PsiClassType> () { return Collections.emptyList(); }
getImplementsTypes
33,095
void (@NotNull Members other) { // do nothing }
addFrom
33,096
Members () { return new Members() { private final Collection<PsiMethod> methods = new ArrayList<>(); private final Collection<GrField> fields = new ArrayList<>(); private final Collection<PsiClass> classes = new ArrayList<>(); private final Collection<PsiClassType> implementsTypes = new ArrayList<>(); @NotNull @Overrid...
create
33,097
Collection<PsiMethod> () { return methods; }
getMethods
33,098
Collection<GrField> () { return fields; }
getFields
33,099
Collection<PsiClass> () { return classes; }
getClasses