Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
37,700
void (@NotNull VirtualFile vfile, @NotNull Status status, @NlsSafe @Nullable String error) { DslActivationStatus.Entry entry = DslActivationStatus.getInstance().getGdslFileInfoOrCreate(vfile); entry.status = status; entry.error = error; }
setStatusAndError
37,701
GroovyDslExecutor (@NotNull final VirtualFile file, final long stamp) { final Pair<GroovyDslExecutor, Long> pair = file.getUserData(CACHED_EXECUTOR); if (pair == null || pair.second.longValue() != stamp) { return null; } return pair.first; }
getCachedExecutor
37,702
PsiClassType (@NotNull GroovyFile scriptFile) { if (!scriptFile.isScript()) return null; final VirtualFile virtualFile = scriptFile.getOriginalFile().getVirtualFile(); if (virtualFile == null) return null; final String filePath = virtualFile.getPath(); List<Trinity<String, String, GroovyDslScript>> supers = new ArrayLi...
processScriptSuperClasses
37,703
boolean ( @NotNull PsiClassType psiType, @NotNull PsiElement place, @NotNull PairProcessor<? super CustomMembersHolder, ? super GroovyClassDescriptor> processor ) { if (insideAnnotation(place)) { // Basic filter, all DSL contexts are applicable for reference expressions only return true; } final PsiFile placeFile = pla...
processExecutors
37,704
boolean (@Nullable PsiElement place) { while (place != null) { if (place instanceof PsiAnnotation) return true; if (place instanceof GrClosableBlock || place instanceof GrTypeDefinition || place instanceof PsiFile) { return false; } place = place.getParent(); } return false; }
insideAnnotation
37,705
List<VirtualFile> (final Project project) { final List<VirtualFile> result = new ArrayList<>(bundledGdslFiles.getValue()); if (TrustedProjects.isTrusted(project)) { result.addAll(getProjectGdslFiles(project)); } return result; }
getGdslFiles
37,706
List<VirtualFile> (Project project) { final List<VirtualFile> result = new ArrayList<>(); final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex(); final GlobalSearchScope scope = GlobalSearchScope.allScope(project); for (VirtualFile vfile : FileTypeIndex.getFiles(GdslFileType.INSTANCE,...
getProjectGdslFiles
37,707
Set<File> () { final GdslScriptProvider[] extensions = GdslScriptProvider.EP_NAME.getExtensions(); final Set<Class<?>> classes = new HashSet<>(ContainerUtil.map(extensions, GdslScriptProvider::getClass)); classes.add(GdslScriptProvider.class); // for default extension Set<File> scriptFolders = new LinkedHashSet<>(); fo...
getBundledScriptFolders
37,708
List<GroovyDslScript> (final Project project) { return CachedValuesManager.getManager(project).getCachedValue(project, SCRIPTS_CACHE, () -> { if (GdslUtil.ourGdslStopped) { return CachedValueProvider.Result.create(Collections.emptyList(), ModificationTracker.NEVER_CHANGED); } // eagerly initialize some services used by...
getDslScripts
37,709
void (final LinkedBlockingQueue<Pair<VirtualFile, GroovyDslExecutor>> queue, final Project project, final VirtualFile vfile, final long stamp, final String text) { final String fileUrl = vfile.getUrl(); final Runnable parseScript = () -> { GroovyDslExecutor executor = getCachedExecutor(vfile, stamp); try { if (executor...
scheduleParsing
37,710
GroovyDslExecutor (String text, VirtualFile vfile, final Project project) { if (GdslUtil.ourGdslStopped) { return null; } try { return GroovyDslExecutor.createAndRunExecutor(text, vfile.getName()); } catch (final Throwable e) { if (project.isDisposed()) { LOG.error(e); return null; } if (ApplicationManager.getApplicati...
createExecutor
37,711
void (@NotNull List<? extends @NotNull VFileEvent> events) { for (VFileEvent event : events) { if (event instanceof VFileContentChangeEvent && !event.isFromRefresh()) { VirtualFile file = event.getFile(); if (!GdslUtil.GDSL_FILTER.value(file) || getStatus(file) != Status.ACTIVE) { continue; } disableFile(file, Status.M...
after
37,712
boolean (GroovyClassDescriptor descriptor, ProcessingContext ctx) { return myPointcut.matches(descriptor, ctx) != null; }
isApplicable
37,713
PsiElement () { return myDescriptor.getPlace(); }
getPlace
37,714
PsiClass () { return getPsiClass(); }
getClassType
37,715
PsiType () { return myDescriptor.getPsiType(); }
getPsiType
37,716
PsiClass () { return myDescriptor.getPsiClass(); }
getPsiClass
37,717
GlobalSearchScope () { return myDescriptor.getResolveScope(); }
getResolveScope
37,718
Project () { return myDescriptor.getProject(); }
getProject
37,719
List<CustomMembersHolder> () { if (!myDeclarations.isEmpty()) { addMemberHolder(new CustomMembersHolderImpl(myDeclarations)); } return myMemberHolders; }
getMembersHolder
37,720
void (CustomMembersHolder holder) { myMemberHolders.add(holder); }
addMemberHolder
37,721
Object[] (Object[] args) { final Object[] newArgs = new Object[args.length + 1]; //noinspection ManualArrayCopy for (int i = 0; i < args.length; i++) { newArgs[i] = args[i]; } newArgs[args.length] = this; return newArgs; }
constructNewArgs
37,722
void (Map<Object, Object> args) { if (args == null) return; String name = (String)args.get("name"); Object type = args.get("type"); Object doc = args.get("doc"); Object docUrl = args.get("docUrl"); Boolean isStatic = (Boolean)args.get("isStatic"); Map<@NonNls Object, Object> getter = new HashMap<>(); getter.put("name",...
property
37,723
void (Map<Object, Object> args) { if (args == null) return; args.put("constructor", true); method(args); }
constructor
37,724
NamedParameterDescriptor (Map<?, ?> args) { return parseNamedParameter(args); }
parameter
37,725
void (Map<?, ?> args) { if (args == null) { return; } myDeclarations = myDeclarations.prepend(parseMethod(args)); }
method
37,726
void (Closure<Map<Object, Object>> generator) { PsiElement place = myDescriptor.getPlace(); PsiElement parent = place.getParent(); if (isMethodCall(place, parent)) { assert parent instanceof GrMethodCall && place instanceof GrReferenceExpression; GrReferenceExpression ref = (GrReferenceExpression)place; PsiType[] argTy...
methodCall
37,727
boolean (PsiElement place, PsiElement parent) { return place instanceof GrReferenceExpression && parent instanceof GrMethodCall && ((GrMethodCall)parent).getInvokedExpression() == place; }
isMethodCall
37,728
void (Map<Object, Object> args) { if (args == null) { return; } ClosureDescriptor descriptor = parseClosure(args); if (descriptor == null) { return; } myDeclarations = myDeclarations.prepend(descriptor); }
closureInMethod
37,729
void (Map<Object, Object> args) { if (args == null) { return; } myDeclarations = myDeclarations.prepend(parseVariable(args)); }
variable
37,730
Object (String name, Object args) { final Object[] newArgs = constructNewArgs((Object[])args); // Get other DSL methods from extensions for (GdslMembersProvider provider : PROVIDERS) { final List<MetaMethod> variants = DefaultGroovyMethods.getMetaClass(provider).respondsTo(provider, name, newArgs); if (variants.size() ...
methodMissing
37,731
Object (String name) { if (myBindings != null) { final List list = myBindings.get(name); if (list != null) { return list; } } return null; }
propertyMissing
37,732
ContextFilter (ElementPattern pattern) { return (descriptor, ctx) -> { PsiType type = descriptor.getPsiType(); return type instanceof PsiClassType && pattern.accepts(((PsiClassType)type).resolve()); }; }
fromClassPattern
37,733
ContextFilter (String typeText) { return (descriptor, ctx) -> isSubtype(descriptor.getPsiType(), descriptor.justGetPlaceFile(), typeText); }
subtypeOf
37,734
boolean (PsiType checked, PsiFile placeFile, String typeText) { final boolean isClassType = checked instanceof PsiClassType; if (isClassType) { final PsiClass psiClass = ((PsiClassType)checked).resolve(); if (psiClass != null) { final int i = typeText.indexOf("<"); String rawName = i > 0 ? typeText.substring(0, i) : ty...
isSubtype
37,735
PsiType (String typeText, PsiFile context) { Map<String, PsiType> map = context.getUserData(CACHED_TYPES); if (map == null) { map = new ConcurrentHashMap<>(); context.putUserData(CACHED_TYPES, map); } PsiType type = map.get(typeText); if (type == null || !type.isValid()) { type = JavaPsiFacade.getElementFactory(context...
getCachedType
37,736
boolean (GroovyClassDescriptor descriptor, ProcessingContext ctx) { return myPattern.accepts(descriptor.getPlace(), ctx); }
isApplicable
37,737
boolean (GroovyClassDescriptor descriptor, ProcessingContext ctx) { return myPattern.accepts(descriptor.getPlaceFile(), ctx); }
isApplicable
37,738
boolean (GroovyClassDescriptor descriptor, ProcessingContext ctx) { PsiFile file = descriptor.getPlaceFile(); if (file instanceof GroovyFile && ((GroovyFile)file).isScript()) { return myScriptType.contains(getScriptTypeId((GroovyFile)file)); } return false; }
isApplicable
37,739
String (@NotNull GroovyFile script) { GroovyScriptType scriptType = GroovyScriptTypeDetector.getScriptType(script); return scriptType == null ? "default" : scriptType.getId(); }
getScriptTypeId
37,740
boolean (GroovyClassDescriptor descriptor, ProcessingContext ctx) { if (getPossibleAnnotations(descriptor.getPlaceFile()).get(StringUtil.getShortName(myAnnoQName)) != Boolean.TRUE) { return false; } return findContextAnnotation(descriptor.getPlace(), myAnnoQName) != null; }
isApplicable
37,741
boolean (GroovyClassDescriptor descriptor, ProcessingContext ctx) { for (ContextFilter filter : myFilters) { if (myAnd != filter.isApplicable(descriptor, ctx)) { return !myAnd; } } return myAnd; }
isApplicable
37,742
ContextFilter (@NotNull List<? extends ContextFilter> filters, boolean and) { if (filters.size() == 1) { return filters.get(0); } return new CompositeContextFilter(filters, and); }
compose
37,743
void (ContextFilter cl) { myFilters.add(cl); }
addFilter
37,744
ContextFilter () { if (myFilters.size() == 1) { return myFilters.get(0); } return CompositeContextFilter.compose(myFilters, true); }
getFilter
37,745
List<ContextFilter> (Map args) { List<ContextFilter> result = new ArrayList<>(); result.add(new PlaceContextFilter(PlatformPatterns.psiElement().inside(GrClosableBlock.class))); final ClosureScope scope = (ClosureScope)args.get("scope"); if (scope.isArg()) { result.add(new PlaceContextFilter( PlatformPatterns.psiElemen...
createFilters
37,746
boolean () { return arg; }
getArg
37,747
boolean () { return arg; }
isArg
37,748
String () { return methodName; }
getMethodName
37,749
String () { return annotationName; }
getAnnotationName
37,750
List<ContextFilter> (Map args) { List<ContextFilter> result = new ArrayList<>(); if (annoQName != null && !annoQName.isEmpty()) { result.add(new AnnotatedContextFilter(annoQName)); } return result; }
createFilters
37,751
String () { return annoQName; }
getAnnoQName
37,752
List<ContextFilter> (Map args) { List<ContextFilter> result = new ArrayList<>(); if (namePattern != null && !namePattern.isEmpty()) { StringPattern match = StandardPatterns.string().matches(namePattern); result.add(new PlaceContextFilter(PlatformPatterns.psiElement().inside( StandardPatterns.or(PsiJavaPatterns.psiClass...
createFilters
37,753
List<ContextFilter> (Map args) { List<ContextFilter> result = new ArrayList<>(); PsiFilePattern.Capture<GroovyFile> scriptPattern = GroovyPatterns.groovyScript(); if (extension != null && !extension.isEmpty()) { scriptPattern = scriptPattern.withVirtualFile(PlatformPatterns.virtualFile().withExtension(extension)); } re...
createFilters
37,754
PsiClassPattern (PsiClassPattern psiClass, ElementPattern synt) { return psiClass.and(synt); }
doAnd
37,755
String () { return namePattern; }
getNamePattern
37,756
String () { return extension; }
getExtension
37,757
PsiClass (String fqn, GdslMembersHolderConsumer consumer) { final JavaPsiFacade facade = JavaPsiFacade.getInstance(consumer.getProject()); return facade.findClass(fqn, GlobalSearchScope.allScope(consumer.getProject())); }
findClass
37,758
void (@Nullable PsiElement elem, GdslMembersHolderConsumer consumer) { if (elem instanceof PsiClass clazz) { final NonCodeMembersHolder holder = new NonCodeMembersHolder(); if (clazz instanceof GrTypeDefinition) { final PsiClassType type = JavaPsiFacade.getElementFactory(consumer.getProject()).createType(clazz); final ...
delegatesTo
37,759
PsiMember (PsiMember member, GdslMembersHolderConsumer consumer) { final NonCodeMembersHolder holder = new NonCodeMembersHolder(); holder.addDeclaration(member); consumer.addMemberHolder(holder); return member; }
add
37,760
GrCall (String name, GdslMembersHolderConsumer consumer) { final PsiElement place = consumer.getPlace(); if (place == null) return null; GrCall call = PsiTreeUtil.getParentOfType(place, GrCall.class, true); if (call == null) return null; while (call != null && !name.equals(getInvokedMethodName(call))) { call = PsiTreeU...
enclosingCall
37,761
PsiMethod (GdslMembersHolderConsumer consumer) { final PsiElement place = consumer.getPlace(); if (place == null) return null; return PsiTreeUtil.getParentOfType(place, PsiMethod.class, true); }
enclosingMethod
37,762
PsiMember (GdslMembersHolderConsumer consumer) { final PsiElement place = consumer.getPlace(); if (place == null) return null; final PsiMember member = PsiTreeUtil.getParentOfType(place, PsiMember.class, true); if (member instanceof PsiClass) return null; return member; }
enclosingMember
37,763
PsiClass (GdslMembersHolderConsumer consumer) { final PsiElement place = consumer.getPlace(); if (place == null) return null; return PsiTreeUtil.getParentOfType(place, PsiClass.class, true); }
enclosingClass
37,764
String (GrCall call) { if (call instanceof GrMethodCall) { final GrExpression expr = ((GrMethodCall)call).getInvokedExpression(); if (expr instanceof GrReferenceExpression) { return ((GrReferenceExpression)expr).getReferenceName(); } } return null; }
getInvokedMethodName
37,765
boolean (GroovyClassDescriptor descriptor, PsiScopeProcessor processor, ResolveState state) { return true; }
processMembers
37,766
void (GroovyClassDescriptor descriptor, Consumer<? super ClosureDescriptor> consumer) {}
consumeClosureDescriptors
37,767
CustomMembersHolder (@NotNull List<CustomMembersHolder> holders) { List<CustomMembersHolder> nonEmptyHolders = ContainerUtil.filter(holders, it -> it != EMPTY); if (nonEmptyHolders.isEmpty()) { return EMPTY; } else if (nonEmptyHolders.size() == 1) { return nonEmptyHolders.get(0); } else { return new CompoundMembersHold...
create
37,768
NonCodeMembersHolder (@NotNull List<? extends Descriptor> methods, @NotNull PsiFile file) { Map<List<? extends Descriptor>, NonCodeMembersHolder> map = CachedValuesManager.getCachedValue( file, () -> { final Map<List<? extends Descriptor>, NonCodeMembersHolder> map1 = CollectionFactory.createConcurrentSoftMap(); return...
generateMembers
37,769
void (@NotNull PsiElement element) { if (element instanceof PsiMethod) { myMethods.add((PsiMethod)element); } else if (element instanceof PsiVariable) { myVariables.add((PsiVariable)element); } else { LOG.error("Unknown declaration: " + element); } }
addDeclaration
37,770
PsiVariable (@NotNull VariableDescriptor descriptor, PsiElement place, PsiManager manager) { String name = descriptor.getName(); final String type = descriptor.getType(); return new GrLightVariable(manager, name, type, Collections.emptyList(), place.getContainingFile()); }
createVariable
37,771
GrLightMethodBuilder (@NonNls MethodDescriptor descriptor, PsiElement place, PsiManager manager) { final GrLightMethodBuilder method = new GrLightMethodBuilder(manager, descriptor.getName()).addModifier(PsiModifier.PUBLIC); if (descriptor.isConstructor()) { method.setConstructor(true); } else { method.setReturnType(con...
createMethod
37,772
boolean (@NotNull PsiType type, @NotNull GroovyPsiElement context) { return ClassContextFilter.isSubtype(type, context.getContainingFile(), typeString); }
checkType
37,773
PsiType (String type, PsiElement place) { return JavaPsiFacade.getElementFactory(place.getProject()).createTypeFromText(type, place); }
convertToPsiType
37,774
boolean (GroovyClassDescriptor descriptor, PsiScopeProcessor _processor, ResolveState state) { String hint = ResolveUtil.getNameHint(_processor); ElementClassHint classHint = _processor.getHint(ElementClassHint.KEY); if (shouldProcessMethods(classHint)) { for (PsiMethod declaration : myMethods) { if (checkName(hint, de...
processMembers
37,775
boolean (String hint, PsiNamedElement declaration) { if (hint != null && !isConstructor(declaration)) { return hint.equals(declaration.getName()); } return true; }
checkName
37,776
boolean (PsiElement declaration) { return declaration instanceof PsiMethod && ((PsiMethod)declaration).isConstructor(); }
isConstructor
37,777
void (GroovyClassDescriptor descriptor, Consumer<? super ClosureDescriptor> consumer) { myClosureDescriptors.forEach(consumer); }
consumeClosureDescriptors
37,778
boolean (GroovyClassDescriptor descriptor, PsiScopeProcessor processor, ResolveState state) { for (CustomMembersHolder holder : myHolders) { if (!holder.processMembers(descriptor, processor, state)) return false; } return true; }
processMembers
37,779
void (GroovyClassDescriptor descriptor, Consumer<? super ClosureDescriptor> consumer) { for (CustomMembersHolder holder : myHolders) { holder.consumeClosureDescriptors(descriptor, consumer); } }
consumeClosureDescriptors
37,780
Collection<GrExpression> (GrCallExpression call) { return Arrays.asList(call.getExpressionArguments()); }
getArguments
37,781
PsiClass (GrExpression expr) { final PsiType type = expr.getType(); if (type instanceof PsiClassType classType) { return classType.resolve(); } else { final String text = type.getPresentableText(); final Project project = expr.getProject(); final JavaPsiFacade facade = JavaPsiFacade.getInstance(project); return facade....
getClassType
37,782
PsiElement (PsiElement element) { PsiElement elem = element instanceof GrMethodCall ? ((GrMethodCall)element).getInvokedExpression() : element; final PsiReference ref = elem.getReference(); return ref == null ? null : ref.resolve(); }
bind
37,783
PsiElement (PsiElement elem) { if (elem instanceof GrReferenceExpression) { return ((GrReferenceExpression)elem).getQualifierExpression(); } return null; }
getQualifier
37,784
Object (PsiElement elem) { if (elem instanceof GrLiteral literal) { return literal.getValue(); } return elem; }
eval
37,785
Collection<PsiMethod> (PsiClass clazz) { return Arrays.asList(clazz.getAllMethods()); }
getMethods
37,786
String (PsiClass clazz) { return clazz.getQualifiedName(); }
getQualName
37,787
boolean (PsiMember clazz, String annotName) { if (annotName == null) return false; final PsiModifierList list = clazz.getModifierList(); if (list == null) return false; for (PsiAnnotation annotation : list.getAnnotations()) { if (annotName.equals(annotation.getQualifiedName())) return true; } return false; }
hasAnnotation
37,788
PsiAnnotation (PsiMember clazz, String annotName) { if (annotName == null) return null; final PsiModifierList list = clazz.getModifierList(); if (list == null) return null; for (PsiAnnotation annotation : list.getAnnotations()) { if (annotName.equals(annotation.getQualifiedName())) return annotation; } return null; }
getAnnotation
37,789
Collection<PsiAnnotation> (PsiMember clazz, String annotName) { final ArrayList<PsiAnnotation> list = new ArrayList<>(); if (annotName == null) return list; final PsiModifierList mlist = clazz.getModifierList(); if (mlist == null) return list; for (PsiAnnotation annotation : mlist.getAnnotations()) { if (annotName.equa...
getAnnotations
37,790
PsiClass (GrExpression expr) { final PsiType type = expr.getType(); return PsiCategoryUtil.getClassType(type, expr); }
getClassType
37,791
Collection<GrExpression> (GrCall call) { final GrArgumentList argumentList = call.getArgumentList(); if (argumentList != null) { return Arrays.asList(argumentList.getExpressionArguments()); } return Collections.emptyList(); }
getArguments
37,792
PsiClass (PsiField field) { final PsiType type = field.getType(); return PsiCategoryUtil.getClassType(type, field); }
getClassType
37,793
Map (PsiMethod method) { Map result = new LinkedHashMap<>(); int idx = 1; for (PsiParameter p : method.getParameterList().getParameters()) { result.put("value" + idx, p.getType().getCanonicalText()); idx++; } return result; }
getParamStringVector
37,794
PsiClass (PsiType type, PsiElement place) { if (type instanceof PsiClassType classType) { return classType.resolve(); } else if (type instanceof PsiPrimitiveType) { final PsiClassType boxed = ((PsiPrimitiveType)type).getBoxedType(place); if (boxed != null) return boxed.resolve(); else return null; } else { return null;...
getClassType
37,795
void (@NotNull MethodReferencesSearch.SearchParameters p, @NotNull Processor<? super PsiReference> consumer) { processConstructorUsages(p.getMethod(), p.getEffectiveSearchScope(), consumer, p.getOptimizer(), !p.isStrictSignatureSearch()); }
processQuery
37,796
void (final PsiMethod constructor, final SearchScope searchScope, final Processor<? super PsiReference> consumer, final SearchRequestCollector collector, final boolean includeOverloads) { if (!constructor.isConstructor()) return; final PsiClass clazz = constructor.getContainingClass(); if (clazz == null) return; Search...
processConstructorUsages
37,797
boolean (PsiClass inheritor) { if (inheritor instanceof GrTypeDefinition) { if (!processConstructors(constructor, consumer, inheritor, false)) return false; } return true; }
processInReadAction
37,798
void (final PsiClass clazz, final SearchScope scope, SearchRequestCollector collector, final Processor<? super GrNewExpression> newExpressionProcessor, final LiteralConstructorSearcher literalProcessor) { ReferencesSearch.searchOptimized(clazz, scope, false, collector, true, (ref, collector1) -> { final PsiElement elem...
processGroovyClassUsages
37,799
boolean (GrCodeReferenceElement element, final Processor<? super GrNewExpression> newExpressionProcessor, final LiteralConstructorSearcher literalProcessor) { PsiElement parent = element.getParent(); if (parent instanceof GrAnonymousClassDefinition) { parent = parent.getParent(); } if (parent instanceof GrNewExpression...
processGroovyConstructorUsages