Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
30,100
boolean (@NotNull final GroovyFile scriptFile) { return GroovyScriptUtil.isSpecificScriptFile(scriptFile, GantScriptType.INSTANCE); }
isAppropriateScriptFile
30,101
PsiFile (@NotNull ReferenceType refType, @NotNull final String runtimeName, @NotNull final Project project, @NotNull GlobalSearchScope scope) { try { final String fileName = StringUtil.getShortName(runtimeName); PsiFile[] files = FilenameIndex.getFilesByName(project, fileName + "." + GantScriptType.DEFAULT_EXTENSION, s...
getExtraScriptIfNotFound
30,102
GrArgumentLabel[] (GroovyFile file) { ArrayList<GrArgumentLabel> labels = new ArrayList<>(); for (PsiElement child : file.getChildren()) { if (child instanceof GrMethodCallExpression call) { GrNamedArgument[] arguments = call.getNamedArguments(); if (arguments.length == 1) { GrArgumentLabel label = arguments[0].getLabe...
getScriptTargets
30,103
boolean (final GrArgumentLabel label) { final PsiElement elem = label.getNameElement(); final ASTNode node = elem.getNode(); if (node == null) return false; return node.getElementType() == GroovyTokenTypes.mIDENT; }
isPlainIdentifier
30,104
boolean (VirtualFile file) { if (file != null && file.isDirectory()) { final String path = file.getPath(); if (GroovyUtils.getFilesInDirectoryByPattern(path + "/lib", GANT_JAR_FILE_PATTERN).length > 0) { return true; } if (GroovyUtils.getFilesInDirectoryByPattern(path + "/embeddable", GANT_JAR_FILE_PATTERN).length > 0)...
isGantSdkHome
30,105
boolean (Library library) { if (library == null) return false; return isGantLibrary(library.getFiles(OrderRootType.CLASSES)); }
isSDKLibrary
30,106
boolean (VirtualFile[] files) { for (VirtualFile file : files) { if (isGantJarFile(file.getName())) { return true; } } return false; }
isGantLibrary
30,107
boolean (final String name) { return name.matches(GANT_JAR_FILE_PATTERN); }
isGantJarFile
30,108
String (Library library) { return getGantLibraryHome(library.getFiles(OrderRootType.CLASSES)); }
getGantLibraryHome
30,109
String (VirtualFile[] files) { for (VirtualFile file : files) { if (isGantJarFile(file.getName())) { final VirtualFile parent = LibrariesUtil.getLocalFile(file).getParent(); if (parent != null) { final VirtualFile gantHome = parent.getParent(); if (gantHome != null) { return PathUtil.getLocalPath(gantHome); } } } } ret...
getGantLibraryHome
30,110
String (@Nullable Module module, @NotNull Project project) { if (module != null) { final String fromClasspath = getSdkHomeFromClasspath(module); if (fromClasspath != null) { return fromClasspath; } } final VirtualFile sdkHome = GantSettings.getInstance(project).getSdkHome(); return sdkHome != null ? sdkHome.getPath() :...
getSDKInstallPath
30,111
String (@NotNull Module module) { Library[] libraries = LibrariesUtil.getLibrariesByCondition(module, library1 -> isSDKLibrary(library1)); if (libraries.length != 0) { final String home = getGantLibraryHome(libraries[0]); if (StringUtil.isNotEmpty(home)) { return home; } } return null; }
getSdkHomeFromClasspath
30,112
boolean (@NotNull Module module) { return GantSettings.getInstance(module.getProject()).getSdkHome() != null || getSdkHomeFromClasspath(module) != null; }
isSDKConfiguredToRun
30,113
boolean (final VirtualFile[] libraryFiles) { return GantUtils.isGantLibrary(libraryFiles); }
managesLibrary
30,114
String (final VirtualFile[] libraryFiles) { String version = GantUtils.getGantVersionOrNull(GantUtils.getGantLibraryHome(libraryFiles)); return version == null ? GroovyBundle.message("undefined.library.version") : version; }
getLibraryVersion
30,115
Icon (GroovyLibraryProperties properties) { return JetgroovyIcons.Groovy.Gant_sdk; }
getIcon
30,116
boolean (@NotNull VirtualFile file) { return GantUtils.isGantSdkHome(file); }
isSDKHome
30,117
String () { return GroovyBundle.message("framework.gant"); }
getLibraryCategoryName
30,118
void (String path, LibraryEditor libraryEditor) { File srcRoot = new File(path + "/src/main"); if (srcRoot.exists()) { libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(srcRoot), OrderRootType.SOURCES); } // Add Gant jars File lib = new File(path + "/lib"); File[] jars = lib.exists() ? lib.listFiles() : new File[0]; i...
fillLibrary
30,119
boolean (@NotNull GroovyFile script) { String name = script.getName(); return name.endsWith(GantScriptType.DEFAULT_EXTENSION); }
isSpecificScriptFile
30,120
Icon () { return JetgroovyIcons.Groovy.Gant_16x16; }
getScriptIcon
30,121
GroovyScriptRunner () { return new GantRunner(); }
getRunner
30,122
boolean (@NotNull GroovyScriptRunConfiguration existing, @NotNull Location place) { final String params = existing.getProgramParameters(); final String targetName = getTargetName(place); if (targetName == null) { return StringUtil.isEmpty(params); } return params != null && (params.startsWith(targetName + " ") || param...
isConfigurationByLocation
30,123
String (Location location) { PsiElement parent = location.getPsiElement(); while (!(parent.getParent() instanceof PsiFile) && parent.getParent() != null) { parent = parent.getParent(); } if (parent instanceof GrMethodCallExpression && PsiUtil.isMethodCall((GrMethodCallExpression)parent, "target")) { final GrNamedArgume...
getTargetName
30,124
void (@NotNull GroovyFile file, @NotNull GroovyScriptRunConfiguration configuration, Location location) { String target = getTargetName(location); if (target != null) { configuration.setProgramParameters(target); configuration.setName(configuration.getName() + "." + target); } RunManagerEx.disableTasks(file.getProject(...
tuneConfiguration
30,125
List<VirtualFile> (@NotNull GroovyFile file) { final Module module = ModuleUtilCore.findModuleForPsiElement(file); if (module != null) { final String sdkHome = GantUtils.getSdkHomeFromClasspath(module); if (sdkHome != null) { return Collections.emptyList(); } } final GantSettings gantSettings = GantSettings.getInstance...
additionalScopeFiles
30,126
GlobalSearchScope (@NotNull GroovyFile file, @NotNull GlobalSearchScope baseScope) { return baseScope.uniteWith(new NonClasspathDirectoriesScope(additionalScopeFiles(file))); }
patchResolveScope
30,127
boolean () { return true; }
shouldRefreshAfterFinish
30,128
boolean (@NotNull Module module) { return GantUtils.isSDKConfiguredToRun(module); }
isValidModule
30,129
String (final String gantHome) { String confPath = FileUtil.toSystemDependentName(gantHome + "/conf/gant-starter.conf"); if (new File(confPath).exists()) { return confPath; } return getConfPath(gantHome); }
getGantConfPath
30,130
void (JavaParameters params, Module module, String gantHome) { final File[] groovyJars = GroovyConfigUtils.getGroovyAllJars(gantHome + "/lib/"); if (groovyJars.length > 0) { params.getClassPath().add(groovyJars[0].getAbsolutePath()); } if (module == null) { return; } final String groovyHome = LibrariesUtil.getGroovyHom...
addGroovyAndAntJars
30,131
String (@NotNull PsiDirectory directory, @NotNull String newName) { return GroovyBundle.message("new.gant.script.dialog.title"); }
getActionName
30,132
boolean (DataContext dataContext) { return super.isAvailable(dataContext) && GantUtils.isSDKConfiguredToRun(Objects.requireNonNull(PlatformCoreDataKeys.MODULE.getData(dataContext))); }
isAvailable
30,133
String () { return "reference.settingsdialog.project.gant"; }
getHelpTopic
30,134
boolean (VirtualFile file) { return GantUtils.isGantSdkHome(file); }
isSdkHome
30,135
GantSettings () { return GantSettings.getInstance(myProject); }
getFrameworkSettings
30,136
Set<LightMethodBuilder> (PsiElement place) { final PsiFile file = place.getContainingFile(); if (!(file instanceof GroovyFile)) { return Collections.emptySet(); } return CachedValuesManager.getManager(file.getProject()).getCachedValue(file, GANT_METHODS, () -> { Map<String, Class<?>> antObjects = getAntObjects((GroovyF...
getAntTasks
30,137
Builder (List<Path> files) { return build().files(files).allowLock(false).noPreload().parent(ClassLoader.getPlatformClassLoader()); }
getBuilder
30,138
void (@NotNull PsiType qualifierType, @Nullable PsiClass aClass, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { if (aClass != null && ClassUtil.getSuperClassesWithCache(aClass).containsKey("groovy.util.AntBuilder")) { processAntTasks(processor, place, state); return; } i...
processDynamicElements
30,139
boolean (PsiScopeProcessor processor, PsiElement place, ResolveState state) { if (!ResolveUtilKt.shouldProcessMethods(processor)) return true; for (LightMethodBuilder task : AntTasksProvider.getAntTasks(place)) { if (!ResolveUtil.processElement(processor, task, state)) { return false; } } return true; }
processAntTasks
30,140
PsiElement () { if (myAntClass != null) { final PsiClass psiClass = JavaPsiFacade.getInstance(getProject()).findClass(myAntClass.getName(), myFile.getResolveScope()); if (psiClass != null) { return psiClass; } } return this; }
getNavigationElement
30,141
boolean (PsiScopeProcessor processor) { if (!ResolveUtilKt.shouldProcessMethods(processor)) return true; final AntIntrospector introspector = AntDomExtender.getIntrospector(myAntClass); if (introspector == null) { return true; } final String expectedName = ResolveUtil.getNameHint(processor); final PsiType mapType = Typ...
processNestedElements
30,142
List<LightMethodBuilder> (@NotNull PsiFile file, @NotNull String name, @Nullable Class<?> antClass, @NotNull PsiType mapType, @NotNull PsiType stringType, @NotNull PsiType closureType) { // (Map, String, Closure) // (Map, String) AntBuilderMethod method = new AntBuilderMethod(file, name, antClass); method.addParameter(...
methods
30,143
String () { return "Spock"; }
getName
30,144
String () { return null; }
getLibraryPath
30,145
ExternalLibraryDescriptor () { return SPOCK_DESCRIPTOR; }
getFrameworkLibraryDescriptor
30,146
String () { return SpockUtils.SPEC_CLASS_NAME; }
getDefaultSuperClass
30,147
FileTemplateDescriptor () { return new FileTemplateDescriptor("Spock_SetUp_Method.groovy"); }
getSetUpMethodFileTemplateDescriptor
30,148
FileTemplateDescriptor () { return new FileTemplateDescriptor("Spock cleanup Method.groovy"); }
getTearDownMethodFileTemplateDescriptor
30,149
FileTemplateDescriptor () { return new FileTemplateDescriptor("Spock Test Method.groovy"); }
getTestMethodFileTemplateDescriptor
30,150
boolean (PsiElement element, boolean checkAbstract) { return SpockUtils.isTestMethod(element); }
isTestMethod
30,151
String () { return SpockUtils.SPEC_CLASS_NAME; }
getMarkerClassFQName
30,152
boolean (PsiClass clazz, boolean canBePotential) { return clazz.getLanguage() == GroovyLanguage.INSTANCE && isInheritor(clazz, SpockUtils.SPEC_CLASS_NAME); }
isTestClass
30,153
PsiMethod (@NotNull PsiClass clazz, String methodName) { if (!isTestClass(clazz, false)) return null; for (PsiMethod method : clazz.findMethodsByName(methodName, false)) { if (method.getParameterList().isEmpty()) return method; } return null; }
findSpecificMethod
30,154
PsiMethod (@NotNull PsiClass clazz) { return findSpecificMethod(clazz, SpockConstants.SETUP_METHOD_NAME); }
findSetUpMethod
30,155
PsiMethod (@NotNull PsiClass clazz) { return findSpecificMethod(clazz, SpockConstants.CLEANUP_METHOD_NAME); }
findTearDownMethod
30,156
boolean (Project project, GlobalSearchScope scope) { PsiClass aClass = JavaPsiFacade.getInstance(project).findClass(SpockUtils.SPEC_CLASS_NAME, scope); return aClass != null && AnnotationUtil.isAnnotated(aClass, JUnitUtil.CUSTOM_TESTABLE_ANNOTATION, 0); }
shouldRunSingleClassAsJUnit5
30,157
void (@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet result) { PsiElement position = parameters.getPosition(); if (!DGMUtil.isInDGMFile(position)) return; Map<String, String> map = ((PropertiesFile)position.getContainingFile()).getNamesMap(); for (String key :...
addCompletions
30,158
void (@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull final CompletionResultSet result) { PsiElement position = parameters.getPosition(); if (!DGMUtil.isInDGMFile(position)) return; AllClassesGetter.processJavaClasses(parameters, result.getPrefixMatcher(), true, aClass -> result.a...
addCompletions
30,159
void (@NotNull PsiReferenceRegistrar registrar) { registrar.registerReferenceProvider(PlatformPatterns.psiElement(PropertiesTokenTypes.VALUE_CHARACTERS), new PsiReferenceProvider() { @Override public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) { if (!...
registerReferenceProviders
30,160
int (int i, String text) { while (i < text.length() && Character.isWhitespace(text.charAt(i))) { i++; } return i; }
skipWhiteSpace
30,161
int (int i, String text) { while (i < text.length() && !Character.isWhitespace(text.charAt(i)) && text.charAt(i) != ',') { i++; } return i; }
findWhiteSpaceOrComma
30,162
IntentionAction (GrReferenceExpression expression, PsiType[] types) { return new DynamicMethodFix(expression, types); }
createDynamicMethodFix
30,163
IntentionAction (GrReferenceExpression expression) { return new DynamicPropertyFromRefFix(expression); }
createDynamicPropertyFix
30,164
IntentionAction (GrReferenceElement element) { return new GroovyAddImportAction(element); }
createGroovyAddImportAction
30,165
IntentionAction (GrNewExpression parent) { return CreateClassFix.createClassFromNewAction(parent); }
createClassFromNewAction
30,166
IntentionAction (GrReferenceElement element, GrCreateClassKind anInterface) { return CreateClassFix.createClassFixAction(element, anInterface); }
createClassFixAction
30,167
IntentionAction (GrReferenceExpression expr) { final String referenceName = expr.getReferenceName(); return referenceName == null ? null : new CreateFieldFromUsageFix(expr, referenceName); }
createCreateFieldFromUsageFix
30,168
IntentionAction (GrReferenceExpression expr, PsiClass aClass) { return new CreateGetterFromUsageFix(expr); }
createCreateGetterFromUsageFix
30,169
IntentionAction (GrReferenceExpression expr) { return new CreateSetterFromUsageFix(expr); }
createCreateSetterFromUsageFix
30,170
IntentionAction (GrReferenceExpression expr) { return new CreateMethodFromUsageFix(expr); }
createCreateMethodFromUsageFix
30,171
IntentionAction (GrReferenceExpression expr, GrVariableDeclarationOwner owner) { return new CreateLocalVariableFromUsageFix(expr, owner); }
createCreateLocalVariableFromUsageFix
30,172
IntentionAction (GrReferenceExpression expr) { return new CreateParameterFromUsageFix(expr); }
createCreateParameterFromUsageFix
30,173
IntentionAction (GrMethodCall parent) { return new GroovyStaticImportMethodFix(parent); }
createGroovyStaticImportMethodFix
30,174
GroovyFix () { return new RenameFix(); }
createRenameFix
30,175
LocalQuickFix () { return new ReplaceWithImportFix(); }
createReplaceWithImportFix
30,176
LocalQuickFix (String actual) { return new GrMoveToDirFix(actual); }
createGrMoveToDirFix
30,177
LocalQuickFix (GrTypeDefinition element, GrNamedArgument argument) { return new CreateFieldFromConstructorLabelFix(element, argument); }
createCreateFieldFromConstructorLabelFix
30,178
LocalQuickFix (GrArgumentLabel label, PsiClass element) { return new DynamicPropertyFromLabelFix(label, element); }
createDynamicPropertyFix
30,179
GroovyFix (String methodName, GrTypeDefinition aClass) { return new AddMethodFix(methodName, aClass); }
createAddMethodFix
30,180
GroovyFix (GrTypeDefinition aClass, String comparable) { return new AddClassToExtendsFix(aClass, comparable); }
createAddClassToExtendsFix
30,181
IntentionAction (boolean onTheFly) { return new GroovyOptimizeImportsFix(onTheFly); }
createOptimizeImportsFix
30,182
IntentionAction (GrParameter parameter) { return new RemoveUnusedGrParameterFix(parameter); }
createRemoveUnusedGrParameterFix
30,183
IntentionAction (String reason) { return new InvestigateFix(reason); }
createInvestigateFix
30,184
LocalQuickFix (int size) { return new GrReplaceMultiAssignmentFix(size); }
createMultipleAssignmentFix
30,185
LocalQuickFix (int size) { return new SpreadArgumentFix(size); }
createSpreadArgumentFix
30,186
LocalQuickFix () { return new MapConstructorAttributesFix(); }
createMapConstructorFix
30,187
LocalQuickFix () { return new GrReplaceWithQualifiedExpressionFix(); }
createQualifyExpressionFix
30,188
LocalQuickFix (List<? extends PsiElement> expressions, GrSwitchElement switchElement) { return new GrAddMissingCaseSectionsFix(expressions, switchElement); }
createAddMissingCasesFix
30,189
IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { String originalText = file.getText(); final Runnable optimize = new GroovyImportOptimizer().processFile(file); optimize.run(); String newText = file.getText(); return new IntentionPreviewInfo.CustomDiff(GroovyFileType.GROOV...
generatePreview
30,190
String () { return GroovyBundle.message("optimize.all.imports"); }
getText
30,191
String () { return GroovyBundle.message("optimize.imports"); }
getFamilyName
30,192
boolean () { return false; }
startInWriteAction
30,193
boolean (@NotNull Project project, Editor editor, PsiFile file) { return file instanceof GroovyFile && (!onTheFly || timeToOptimizeImports((GroovyFile)file, editor)); }
isAvailable
30,194
boolean (GroovyFile myFile, Editor editor) { if (!CodeInsightWorkspaceSettings.getInstance(myFile.getProject()).isOptimizeImportsOnTheFly()) { return false; } if (onTheFly && editor != null) { // if we stand inside import statements, do not optimize final VirtualFile vfile = myFile.getVirtualFile(); if (vfile != null &...
timeToOptimizeImports
30,195
boolean (GroovyFile myFile, Document myDocument) { // ignore unresolved imports errors final TextRange ignoreRange; final GrImportStatement[] imports = myFile.getImportStatements(); if (imports.length != 0) { final int start = imports[0].getTextRange().getStartOffset(); final int end = imports[imports.length - 1].getTe...
containsErrorsPreventingOptimize
30,196
void (@NotNull final Runnable runnable, @NotNull final PsiFile file, @NotNull final Editor editor) { final long stamp = editor.getDocument().getModificationStamp(); Project project = file.getProject(); ApplicationManager.getApplication().invokeLater(() -> { if (project.isDisposed() || editor.isDisposed() || editor.getD...
invokeOnTheFlyImportOptimizer
30,197
PsiElementVisitor (@NotNull DependenciesBuilder.DependencyProcessor processor, @NotNull DependencyVisitorFactory.VisitorOptions options) { GroovyElementVisitor visitor = new MyVisitor(processor, options); return new PsiElementVisitor() { @Override public void visitFile(@NotNull PsiFile file) { if (file instanceof Groov...
getVisitor
30,198
void (@NotNull PsiFile file) { if (file instanceof GroovyFile) { ((GroovyFile)file).accept(visitor); } }
visitFile
30,199
void (@NotNull GroovyPsiElement element) { super.visitElement(element); for (PsiReference ref : element.getReferences()) { PsiElement resolved = ref.resolve(); if (resolved != null) { myProcessor.process(ref.getElement(), resolved); } } }
visitElement