Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
37,600
boolean (GrAnnotation annotation) { final PsiElement parent = annotation.getParent(); if (parent instanceof GrModifierList) { final GrAnnotation collector = ContainerUtil.find(((GrModifierList)parent).getRawAnnotations(), annotation1 -> GroovyCommonClassNames.GROOVY_TRANSFORM_ANNOTATION_COLLECTOR.equals( annotation1.ge...
isInAliasDeclaration
37,601
String () { return GroovyBundle.message("second.unsafe.call"); }
getFamilyName
37,602
void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { if (!(element instanceof GrReferenceExpression)) return; final PsiElement newDot = GroovyPsiElementFactory.getInstance(project).createDotToken(GroovyTokenTypes.mOPTIONAL_DOT.toString()); ((GrReferenceExpression) element).repl...
applyFix
37,603
Collection<String> (@NotNull GrExpression qualifier, @Nullable PsiElement resolve) { Pair<ConfigSlurperSupport.PropertiesProvider, List<String>> info = getInfo(qualifier, resolve); if (info == null) return Collections.emptyList(); final Set<String> res = new HashSet<>(); info.first.collectVariants(info.second, (variant...
getKeyVariants
37,604
PsiType (@NotNull GrExpression qualifier, @Nullable PsiElement resolve, @NotNull final String key) { Pair<ConfigSlurperSupport.PropertiesProvider, List<String>> info = getInfo(qualifier, resolve); if (info == null) return null; final Ref<Boolean> res = new Ref<>(); info.first.collectVariants(info.second, (variant, isFi...
getValueType
37,605
PsiType (GrReferenceExpression ref, @Nullable PsiElement resolved) { if (!(resolved instanceof GroovyMapProperty)) return null; GrExpression qualifierExpression = ref.getQualifierExpression(); if (qualifierExpression == null) return null; PsiType mapType = qualifierExpression.getType(); if (!InheritanceUtil.isInheritor...
getReferenceType
37,606
PropertiesProvider (@NotNull PsiElement qualifierResolve) { return null; }
getConfigSlurperInfo
37,607
void (PsiType thisType) { myThisType = thisType; }
setThisType
37,608
PsiType () { return mySuperType; }
getSuperType
37,609
void (PsiType superType) { mySuperType = superType; }
setSuperType
37,610
FileViewProvider () { if (myViewProvider != null) return myViewProvider; return super.getViewProvider(); }
getViewProvider
37,611
String () { if (myImportCollector.isEmpty()) return ""; final StringBuilder buffer = new StringBuilder(); for (GroovyImport anImport : myImportCollector.getAllImports()) { if (anImport instanceof RegularImport) { buffer .append(((RegularImport)anImport).getClassFqn()) .append(':') .append(((RegularImport)anImport).getN...
importsToString
37,612
void (String imports) { myFileImports.drop(); for (String anImport : imports.split(",")) { addImport(anImport); } }
addImportsFromString
37,613
void (@NotNull String importString) { int colon = importString.indexOf(':'); if (colon >= 0) { final String qname = importString.substring(0, colon); final String importedName = importString.substring(colon + 1); final boolean isStatic = JavaPsiFacade.getInstance(getProject()).findClass(qname, getResolveScope()) == nul...
addImport
37,614
void (JavaCodeFragment.VisibilityChecker checker) { }
setVisibilityChecker
37,615
VisibilityChecker () { return VisibilityChecker.EVERYTHING_VISIBLE; }
getVisibilityChecker
37,616
void (ExceptionHandler checker) { myExceptionChecker = checker; }
setExceptionHandler
37,617
ExceptionHandler () { return myExceptionChecker; }
getExceptionHandler
37,618
void (@NotNull IntentionActionsFilter filter) { myFilter = filter; }
setIntentionActionsFilter
37,619
IntentionActionsFilter () { return myFilter; }
getIntentionActionsFilter
37,620
void (GlobalSearchScope scope) { myResolveScope = scope; }
forceResolveScope
37,621
GlobalSearchScope () { return myResolveScope; }
getForcedResolveScope
37,622
boolean (@NotNull PsiClass aClass) { return false; }
importClass
37,623
PsiType () { return myThisType; }
getThisType
37,624
GroovyCodeFragment () { final GroovyCodeFragment clone = (GroovyCodeFragment)cloneImpl((FileElement)calcTreeElement().clone()); clone.myOriginalFile = this; clone.myImportCollector.setFrom(myImportCollector); FileManager fileManager = ((PsiManagerEx)getManager()).getFileManager(); SingleRootFileViewProvider cloneViewPr...
clone
37,625
void () { myFileImports.drop(); myImportCollector.clear(); }
clearImports
37,626
GroovyFileImports () { return myFileImports.getValue(); }
getImports
37,627
DslErrorReporter () { return ApplicationManager.getApplication().getService(DslErrorReporter.class); }
getInstance
37,628
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Entry entry = (Entry)o; if (url != null ? !url.equals(entry.url) : entry.url != null) return false; if (status != entry.status) return false; if (error != null ? !error.equals(entry.error) : entry.error != null) ...
equals
37,629
int () { int result = url != null ? url.hashCode() : 0; result = 31 * result + (status != null ? status.hashCode() : 0); result = 31 * result + (error != null ? error.hashCode() : 0); return result; }
hashCode
37,630
int (Entry o) { return equals(o) ? 0 : url.compareTo(o.url); }
compareTo
37,631
Entry (@NotNull VirtualFile file) { synchronized (myStatus) { return myStatus.get(file); } }
getGdslFileInfo
37,632
Entry (@NotNull VirtualFile file) { Entry entry; synchronized (myStatus) { entry = myStatus.get(file); if (entry == null) { entry = new Entry(file.getUrl(), Status.ACTIVE, null); myStatus.put(file, entry); } } return entry; }
getGdslFileInfoOrCreate
37,633
State () { synchronized (myStatus) { // remove default entries myStatus.entrySet().removeIf(entry -> entry.getValue().status == Status.ACTIVE && entry.getValue().error == null); if (myStatus.isEmpty()) { return new State(Collections.emptyList()); } Entry[] entries = myStatus.values().toArray(new Entry[0]); Arrays.sort(...
getState
37,634
void (@NotNull State state) { synchronized (myStatus) { myStatus.clear(); if (ContainerUtil.isEmpty(state.entries)) { return; } final VirtualFileManager fileManager = VirtualFileManager.getInstance(); for (Entry entry : state.entries) { if (entry.url == null || entry.status == null) continue; final VirtualFile file = f...
loadState
37,635
DslActivationStatus () { return ApplicationManager.getApplication().getService(DslActivationStatus.class); }
getInstance
37,636
String () { return ideaVersion; }
getIdeaVersion
37,637
MultiMap () { return staticInfo; }
getStaticInfo
37,638
Boolean () { try { scriptBody(); } catch (InvalidVersionException ignore) { enhancers.clear(); } return locked = true; }
run
37,639
DslPointcut (String name, Object args) { return DslPointcut.UNKNOWN; }
methodMissing
37,640
void (Object cts, Closure toDo) { cts = handleImplicitBind(cts); if (cts instanceof DslPointcut) { if (((DslPointcut)cts).operatesOn(GroovyClassDescriptor.class)) { PointcutContextFilter filter = new PointcutContextFilter((DslPointcut<? super GroovyClassDescriptor, ?>)cts); addClassEnhancer(List.of(filter), toDo); } el...
contribute
37,641
void (Object cts, Closure toDo) { contribute(cts, toDo); }
contributor
37,642
void (Object ver) { if (!supportsVersion(ver)) throw new InvalidVersionException(); }
assertVersion
37,643
void (Map args) { staticInfo.putValue("scriptSuperClass", args); }
scriptSuperClass
37,644
boolean (Object ver) { if (ver instanceof String) { return StringUtil.compareVersionNumbers(ideaVersion, (String)ver) >= 0; } else if (ver instanceof Map) { String dsl = (String)((Map<?, ?>)ver).get("dsl"); if (dsl != null && !dsl.isEmpty()) { return StringUtil.compareVersionNumbers("1.0", dsl) >= 0; } String intellij ...
supportsVersion
37,645
void (List<? extends ContextFilter> cts, Closure toDo) { assert !locked : "Contributing to GDSL is only allowed at the top-level of the *.gdsl script"; enhancers.add(Pair.create(CompositeContextFilter.compose(cts, false), toDo)); }
addClassEnhancer
37,646
Scope (Map args) { return new ClosureScope(args); }
closureScope
37,647
Scope (Map args) { return new ScriptScope(args); }
scriptScope
37,648
Scope (Map args) { return new ClassScope(args); }
classScope
37,649
Scope (Map args) { return new AnnotatedScope(args); }
annotatedScope
37,650
Context (Map args) { return new Context(args); }
context
37,651
PsiClassPattern (ElementPattern fieldCondition) { return PsiJavaPatterns.psiClass().withField(true, PsiJavaPatterns.psiField().and(fieldCondition)); }
hasField
37,652
PsiClassPattern (ElementPattern methodCondition) { return PsiJavaPatterns.psiClass().withMethod(true, PsiJavaPatterns.psiMethod().and(methodCondition)); }
hasMethod
37,653
DslPointcut (final Object arg) { return DslPointcut.bind(arg); }
bind
37,654
Object (Object arg) { if (arg instanceof Map && ((Map)arg).size() == 1 && ((Map)arg).keySet().iterator().next() instanceof String && ((Map)arg).values().iterator().next() instanceof DslPointcut) { return DslPointcut.bind(arg); } return arg; }
handleImplicitBind
37,655
CustomMembersHolder (@NotNull GroovyClassDescriptor descriptor) { CustomMembersHolder holder = myFactorTree.retrieve(descriptor); try { if (holder == null) { holder = addGdslMembers(descriptor); myFactorTree.cache(descriptor, holder); } return holder; } catch (ProcessCanceledException e) { throw e; } catch (Throwable e...
processExecutor
37,656
CustomMembersHolder (@NotNull GroovyClassDescriptor descriptor) { final ProcessingContext ctx = new ProcessingContext(); ctx.put(GdslUtil.INITIAL_CONTEXT, descriptor); try { if (!isApplicable(executor, descriptor, ctx)) { return CustomMembersHolder.EMPTY; } return executor.processVariants(descriptor, ctx); } catch (Inv...
addGdslMembers
37,657
boolean (@NotNull GroovyDslExecutor executor, GroovyClassDescriptor descriptor, final ProcessingContext ctx) { List<Pair<ContextFilter,Closure>> enhancers = executor.getEnhancers(); if (enhancers == null) { LOG.error("null enhancers"); return false; } for (Pair<ContextFilter, Closure> pair : enhancers) { if (pair.first...
isApplicable
37,658
void (Throwable e) { if (project.isDisposed() || ApplicationManager.getApplication().isUnitTestMode()) { throw new RuntimeException(e); } if (file != null) { DslErrorReporter.getInstance().invokeDslErrorPopup(e, project, file); } else { LOG.info("Error when executing internal GDSL " + myPath, e); GdslUtil.stopGdsl(); }...
handleDslError
37,659
String () { return "GroovyDslScript: " + myPath; }
toString
37,660
MultiMap () { return executor.getStaticInfo(); }
getStaticInfo
37,661
MultiMap () { return myScript.getStaticInfo(); }
getStaticInfo
37,662
CustomMembersHolder (GroovyClassDescriptor descriptor, ProcessingContext ctx) { if (!DefaultGroovyMethods.asBoolean(getEnhancers())) return CustomMembersHolder.EMPTY; List<CustomMembersHolder> holders = new ArrayList<>(); for (Pair<ContextFilter, Closure> pair : getEnhancers()) { ProgressManager.checkCanceled(); ctx.pu...
processVariants
37,663
void (final CustomMembersGenerator generator, final Closure closure) { DefaultGroovyMethods.use(this, cats, new Closure<Object>(this, this) { public Object doCall(Object ignoredIt) { //noinspection unchecked return DefaultGroovyMethods.with(generator, closure); } @SuppressWarnings("unused") public Object doCall() { ret...
doRun
37,664
Object (Object ignoredIt) { //noinspection unchecked return DefaultGroovyMethods.with(generator, closure); }
doCall
37,665
Object () { return doCall(null); }
doCall
37,666
String () { return myFileName; }
toString
37,667
GroovyDslExecutor (String text, String fileName) { CompilerConfiguration configuration = new CompilerConfiguration(); configuration.setScriptBaseClass(GdslScriptBase.class.getName()); GroovyShell shell = new GroovyShell(GroovyDslExecutor.class.getClassLoader(), configuration); GdslScriptBase script = DefaultGroovyMetho...
createAndRunExecutor
37,668
List<Class> () { return cats; }
getCats
37,669
Class (PsiEnhancerCategory it) { return it.getClass(); }
doCall
37,670
Class () { throw new UnsupportedOperationException(); }
doCall
37,671
void (@NotNull PsiElement psiElement, @NotNull AnnotationHolder holder) { if (!(psiElement instanceof GroovyFile groovyFile)) return; if (!GrFileIndexUtil.isGroovySourceFile(groovyFile)) return; final VirtualFile vfile = groovyFile.getVirtualFile(); if (!GdslUtil.GDSL_FILTER.value(vfile)) return; final DslActivationSta...
annotate
37,672
String () { return GroovyBundle.message("intention.name.activate.back"); }
getText
37,673
String () { return GroovyBundle.message("intention.family.name.activate.dsl.descriptor"); }
getFamilyName
37,674
boolean (@NotNull Project project, Editor editor, PsiFile file) { return true; }
isAvailable
37,675
boolean () { return false; }
startInWriteAction
37,676
PsiElement () { return myParent; }
getParent
37,677
String () { return myName; }
getName
37,678
String () { return psiMethod.getName(); }
getName
37,679
void () { ourGdslStopped = true; }
stopGdsl
37,680
boolean (GroovyClassDescriptor descriptor, PsiScopeProcessor processor, ResolveState state) { return NonCodeMembersHolder.generateMembers(ContainerUtil.reverse(myDeclarations), descriptor.justGetPlaceFile()) .processMembers(descriptor, processor, state); }
processMembers
37,681
void (GroovyClassDescriptor descriptor, Consumer<? super ClosureDescriptor> consumer) { NonCodeMembersHolder.generateMembers(ContainerUtil.reverse(myDeclarations), descriptor.justGetPlaceFile()) .consumeClosureDescriptors(descriptor, consumer); }
consumeClosureDescriptors
37,682
String () { return StringUtil.getShortName(getName()); }
getShortName
37,683
String () { PsiType type = psiType; if (type instanceof PsiWildcardType) { type = ((PsiWildcardType)type).getBound(); } if (type instanceof PsiClassType) { final PsiClass resolve = ((PsiClassType)type).resolve(); if (resolve != null) { return resolve.getName(); } final String canonicalText = type.getCanonicalText(); fi...
getName
37,684
Project () { return myProject; }
getProject
37,685
GlobalSearchScope () { //affectingFactors.add(Factor.placeFile); return myPlace.getResolveScope(); }
getResolveScope
37,686
PsiElement () { affectingFactors.add(Factor.placeElement); return myPlace; }
getPlace
37,687
PsiType () { affectingFactors.add(Factor.qualifierType); return myPsiType; }
getPsiType
37,688
PsiClass () { affectingFactors.add(Factor.qualifierType); return myPsiClass; }
getPsiClass
37,689
PsiFile () { affectingFactors.add(Factor.placeFile); return myFile; }
getPlaceFile
37,690
PsiFile () { return myFile; }
justGetPlaceFile
37,691
PsiElement () { return myPlace; }
justGetPlace
37,692
PsiClass () { return myPsiClass; }
justGetPsiClass
37,693
DslPointcut (final Object arg) { assert arg instanceof Map; assert ((Map<?, ?>)arg).size() == 1; final String name = (String)((Map)arg).keySet().iterator().next(); final DslPointcut pct = (DslPointcut)((Map)arg).values().iterator().next(); return new DslPointcut() { @Override List matches(Object src, ProcessingContext ...
bind
37,694
String (VirtualFile file) { DslActivationStatus.Entry info = DslActivationStatus.getInstance().getGdslFileInfo(file); return info == null ? null : info.error; }
getError
37,695
boolean (@NotNull VirtualFile file) { return getStatus(file) == Status.ACTIVE; }
isActivated
37,696
void (final VirtualFile vfile) { setStatusAndError(vfile, Status.ACTIVE, null); clearScriptCache(); }
activate
37,697
Status (@NotNull VirtualFile file) { DslActivationStatus.Entry info = DslActivationStatus.getInstance().getGdslFileInfo(file); return info == null ? Status.ACTIVE : info.status; }
getStatus
37,698
void () { Application app = ApplicationManager.getApplication(); app.invokeLater(() -> { for (Project project : ProjectManager.getInstance().getOpenProjects()) { project.putUserData(SCRIPTS_CACHE, null); PsiManagerEx.getInstanceEx(project).dropPsiCaches(); } }, app.getDisposed()); }
clearScriptCache
37,699
void (@NotNull VirtualFile vfile, @NotNull Status status, @NlsSafe @Nullable String error) { assert status != Status.ACTIVE; setStatusAndError(vfile, status, error); vfile.putUserData(CACHED_EXECUTOR, null); clearScriptCache(); }
disableFile