Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
29,000
GroovyCompilerConfiguration (Project project) { return project.getService(GroovyCompilerConfiguration.class); }
getInstance
29,001
boolean () { return myInvokeDynamic; }
isInvokeDynamic
29,002
void (boolean invokeDynamic) { myInvokeDynamic = invokeDynamic; }
setInvokeDynamic
29,003
String () { return myConfigScript; }
getConfigScript
29,004
void (String configScript) { myConfigScript = configScript; }
setConfigScript
29,005
void () { Disposer.dispose(myExcludeFromStubGeneration); }
dispose
29,006
void (@NotNull final AnActionEvent e) { final PsiFile file = e.getData(CommonDataKeys.PSI_FILE); assert file != null && file.getLanguage() == GroovyLanguage.INSTANCE; doExcludeFromStubGeneration(file); }
actionPerformed
29,007
void (PsiFile file) { final VirtualFile virtualFile = file.getVirtualFile(); assert virtualFile != null; final Project project = file.getProject(); final GroovyCompilerConfigurable configurable = new GroovyCompilerConfigurable(project); ShowSettingsUtil.getInstance().editConfigurable(project, configurable, () -> config...
doExcludeFromStubGeneration
29,008
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
29,009
void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); boolean enabled = isEnabled(e); presentation.setEnabledAndVisible(enabled); }
update
29,010
boolean (AnActionEvent e) { PsiFile file = e.getData(CommonDataKeys.PSI_FILE); if (file == null || file.getLanguage() != GroovyLanguage.INSTANCE) { return false; } final VirtualFile virtualFile = file.getVirtualFile(); return virtualFile != null && !GroovyCompilerConfiguration.getExcludeConfiguration(file.getProject())...
isEnabled
29,011
Set<FileType> () { return Collections.singleton(GroovyFileType.GROOVY_FILE_TYPE); }
getCompilableFileTypes
29,012
void (@NotNull AnActionEvent e) { checkResources(e.getProject(), null, this instanceof Rebuild); }
actionPerformed
29,013
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
29,014
void (Project project, @Nullable CompileStatusNotification callback, boolean rebuild) { ProjectCompileScope scope = new ProjectCompileScope(project); scope.putUserData(GroovyResourceChecker.CHECKING_RESOURCES_REBUILD, rebuild); CompilerManager.getInstance(project).make(scope, callback); }
checkResources
29,015
List<String> () { CompilerConfiguration config = myProject.isDefault() ? null : CompilerConfiguration.getInstance(myProject); if (config instanceof CompilerConfigurationImpl) { BackendCompiler backend = ((CompilerConfigurationImpl)config).getDefaultCompiler(); if (backend != null && backend.getId().equals(GreclipseBuil...
getClassPath
29,016
Iterable<String> () { final Path jarPath = PathManager.getJarForClass(GroovyBuilder.class); if (jarPath != null) { final Supplier<List<String>> roots = lazy(() -> GroovyRtJarPaths.getGroovyRtRoots(jarPath.toFile(), false)); return () -> roots.get().iterator(); } return Collections.emptyList(); }
getAdditionalPluginPaths
29,017
T () { T val = cached; if (val == null) { cached = val = calculation.get(); } return val; }
get
29,018
String () { return GreclipseBuilder.ID; }
getId
29,019
String () { return GreclipseBuilder.ID; }
getPresentableName
29,020
Configurable () { return new GreclipseConfigurable(GreclipseIdeaCompilerSettings.getSettings(myProject)); }
createConfigurable
29,021
Set<FileType> () { return Set.of(JavaFileType.INSTANCE, GroovyFileType.GROOVY_FILE_TYPE); }
getCompilableFileTypes
29,022
CompilerOptions () { return GreclipseIdeaCompilerSettings.getSettings(myProject); }
getOptions
29,023
PsiClass (Project project, VirtualFile stubFile) { final String[] components = StringUtil.trimEnd(stubFile.getPath(), ".java").split("[\\\\/]"); final int stubs = Arrays.asList(components).indexOf(GROOVY_STUBS); if (stubs < 0 || stubs >= components.length - 3) { return null; } final String moduleName = components[stubs...
findClassByStub
29,024
EditorNotificationPanel (final VirtualFile file, final Project project, @NotNull FileEditor fileEditor) { final EditorNotificationPanel panel = new EditorNotificationPanel(fileEditor, EditorNotificationPanel.Status.Info); panel.setText(GroovyBundle.message("generated.stub.message")); panel.createActionLabel(GroovyBundl...
decorateStubFile
29,025
GreclipseSettings () { return mySettings; }
getState
29,026
void (@NotNull GreclipseSettings state) { XmlSerializerUtil.copyBean(state, mySettings); }
loadState
29,027
GreclipseSettings (@NotNull Project project) { return project.getService(GreclipseIdeaCompilerSettings.class).mySettings; }
getSettings
29,028
void (@NotNull Project project, @NotNull String path) { project.getService(GreclipseIdeaCompilerSettings.class).mySettings.greclipsePath = FileUtil.toSystemIndependentName(path); }
setGrEclipsePath
29,029
void (@NotNull Project project, @NotNull String cmdLineParams) { project.getService(GreclipseIdeaCompilerSettings.class).mySettings.cmdLineParams = cmdLineParams; }
setGrCmdParams
29,030
Collection<String> (@NotNull PsiQualifiedReferenceElement ref) { GrImportStatement importStatement = PsiTreeUtil.getParentOfType(ref.getElement(), GrImportStatement.class); //from static imports if (importStatement != null) { String fqn = importStatement.getImportFqn(); return fqn == null ? Collections.emptyList() : Co...
getFqns
29,031
void (@NotNull GrReferenceElement<?> ref, @NotNull QuickFixActionRegistrar registrar) { registrar.register(new GroovyFindJarFix(ref)); }
registerFixes
29,032
PsiElementPredicate () { return new EndOfLineCommentPredicate(); }
getElementPredicate
29,033
void (@NotNull PsiElement element, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { final PsiComment selectedComment = (PsiComment) element; PsiComment firstComment = selectedComment; while (true) { final PsiElement prevComment = getPrevNonWhiteSpace(firstComment); if (!isEndOfLineComment(prevComment))...
processIntention
29,034
PsiElement (PsiElement nextComment) { PsiElement elementToCheck = nextComment; while (true) { final PsiElement sibling = elementToCheck.getNextSibling(); if (sibling == null) { return null; } if (sibling.getText().trim().replace("\n", "").isEmpty()) { elementToCheck = sibling; } else { return sibling; } } }
getNextNonWhiteSpace
29,035
PsiElement (PsiElement nextComment) { PsiElement elementToCheck = nextComment; while (true) { final PsiElement sibling = elementToCheck.getPrevSibling(); if (sibling == null) { return null; } if (sibling.getText().trim().replace("\n", "").isEmpty()) { elementToCheck = sibling; } else { return sibling; } } }
getPrevNonWhiteSpace
29,036
boolean (PsiElement element) { if (!(element instanceof PsiComment comment)) { return false; } final IElementType tokenType = comment.getTokenType(); return GroovyTokenTypes.mSL_COMMENT.equals(tokenType); }
isEndOfLineComment
29,037
String (PsiComment comment) { final String text = comment.getText(); return text.substring(2); }
getCommentContents
29,038
boolean (@NotNull PsiElement element) { if (!(element instanceof PsiComment comment)) { return false; } if (element instanceof PsiDocComment) { return false; } final IElementType type = comment.getTokenType(); return GroovyTokenTypes.mSL_COMMENT.equals(type); }
satisfiedBy
29,039
PsiElementPredicate () { return new ExplicitClosureCallPredicate(); }
getElementPredicate
29,040
void (@NotNull PsiElement element, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { final GrMethodCallExpression expression = (GrMethodCallExpression)element; final GrReferenceExpression invokedExpression = (GrReferenceExpression)expression.getInvokedExpression(); final GrExpression qualifier = invoked...
processIntention
29,041
boolean (@NotNull PsiElement element) { if (!(element instanceof GrForStatement statement)) { return false; } final GrForClause clause = statement.getClause(); if (!(clause instanceof GrForInClause) || ((GrForInClause) clause).getIteratedExpression() == null) { return false; } return !ErrorUtil.containsError(element); ...
satisfiedBy
29,042
boolean (@NotNull PsiElement element) { if (!(element instanceof final GrMethodCallExpression call)) { return false; } final GrExpression invokedExpression = call.getInvokedExpression(); if (!(invokedExpression instanceof final GrReferenceExpression referenceExpression)) { return false; } final String name = referenceE...
satisfiedBy
29,043
PsiElementPredicate () { return new ForToEachPredicate(); }
getElementPredicate
29,044
void (@NotNull PsiElement element, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { final GrForStatement parentStatement = (GrForStatement) element; final GrForInClause clause = (GrForInClause) parentStatement.getClause(); final GrVariable var = clause.getDeclaredVariable(); final GrStatement body = pa...
processIntention
29,045
PsiElementPredicate () { return ImplicitClosureCallPredicate.INSTANCE; }
getElementPredicate
29,046
void (@NotNull PsiElement element, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { final GrMethodCallExpression expression = (GrMethodCallExpression)element; final GrExpression invokedExpression = expression.getInvokedExpression(); final GrArgumentList argList = expression.getArgumentList(); final GrC...
processIntention
29,047
PsiElementPredicate () { return new EachToForPredicate(); }
getElementPredicate
29,048
void (@NotNull PsiElement element, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { final GrMethodCallExpression expression = (GrMethodCallExpression)element; final GrClosableBlock block = expression.getClosureArguments()[0]; final GrParameterList parameterList = block.getParameterList(); final GrParam...
processIntention
29,049
void (GrForStatement forStatement) { GrStatement body = forStatement.getBody(); assert body != null; final Set<String> usedLabels = new HashSet<>(); final Ref<Boolean> needLabel = Ref.create(false); body.accept(new GroovyRecursiveElementVisitor() { private int myLoops = 0; @Override public void visitReturnStatement(@No...
updateReturnStatements
29,050
void (@NotNull GrReturnStatement returnStatement) { if (returnStatement.getReturnValue() != null) return; if (myLoops > 0) needLabel.set(true); }
visitReturnStatement
29,051
void (@NotNull GrLabeledStatement labeledStatement) { super.visitLabeledStatement(labeledStatement); usedLabels.add(labeledStatement.getName()); }
visitLabeledStatement
29,052
void (@NotNull GrForStatement forStatement) { myLoops++; super.visitForStatement(forStatement); myLoops--; }
visitForStatement
29,053
void (@NotNull GrWhileStatement whileStatement) { myLoops++; super.visitWhileStatement(whileStatement); myLoops--; }
visitWhileStatement
29,054
void (@NotNull GrClosableBlock closure) { //don't go into closures }
visitClosure
29,055
void (@NotNull GrAnonymousClassDefinition anonymousClassDefinition) { //don't go into anonymous }
visitAnonymousClassDefinition
29,056
void (@NotNull GrReturnStatement returnStatement) { if (returnStatement.getReturnValue() == null) { returnStatement.replaceWithStatement(continueStatement); } }
visitReturnStatement
29,057
void (@NotNull GrClosableBlock closure) { //don't go into closures }
visitClosure
29,058
void (@NotNull GrAnonymousClassDefinition anonymousClassDefinition) { //don't go into anonymous }
visitAnonymousClassDefinition
29,059
boolean (@NotNull PsiElement element) { if (element instanceof GrMethodCallExpression expression) { // final PsiElement parent = expression.getParent(); // if (parent instanceof GrAssignmentExpression) return false; // if (parent instanceof GrArgumentList) return false; // if (parent instanceof GrReturnStatement) retur...
satisfiedBy
29,060
PsiElementPredicate () { return new MyPredicate(); }
getElementPredicate
29,061
void (@NotNull PsiElement psiElement, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { GrCodeReferenceElement ref = (GrCodeReferenceElement)psiElement; final GrAnonymousClassDefinition anonymous = (GrAnonymousClassDefinition)ref.getParent(); final GrNewExpression newExpr = (GrNewExpression)anonymous.ge...
processIntention
29,062
void (final PsiMethod method, final StringBuilder buffer, @Nullable GrOpenBlock block, GroovyPsiElement context) { final PsiParameterList list = method.getParameterList(); buffer.append("{ "); final PsiParameter[] parameters = list.getParameters(); Set<String> generatedNames = new HashSet<>(); if (parameters.length > 0...
appendClosureTextByMethod
29,063
String (final Set<String> generatedNames, final PsiParameter param, final PsiType type, GroovyPsiElement context) { String name = param.getName(); generatedNames.add(name); return name; }
createName
29,064
boolean (@NotNull PsiElement element) { if (element instanceof GrCodeReferenceElement && element.getParent() instanceof GrAnonymousClassDefinition anonymous) { if (anonymous.getFields().length == 0) { return true; } } return false; }
satisfiedBy
29,065
void (@NotNull PsiElement element, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { if (element instanceof GrReturnStatement returnStatement && returnStatement.getReturnValue() != null) { GrExpression value = returnStatement.getReturnValue(); returnStatement.replaceWithStatement(value); } }
processIntention
29,066
PsiElementPredicate () { return element -> element instanceof GrReturnStatement returnStatement && returnStatement.getReturnValue() != null && ControlFlowBuilderUtil.isCertainlyReturnStatement(returnStatement); }
getElementPredicate
29,067
boolean (@NotNull PsiElement element) { if (element.getLanguage() != GroovyLanguage.INSTANCE) return false; if (!CodeStyleSettingsManager.getInstance(element.getProject()).getCurrentSettings() .getCustomSettings(GroovyCodeStyleSettings.class).USE_FLYING_GEESE_BRACES) { return false; } if (PsiImplUtil.isWhiteSpaceOrNls(...
satisfiedBy
29,068
PsiElement (PsiElement element) { PsiElement prev = PsiUtil.getPreviousNonWhitespaceToken(element); if (prev != null && prev.getNode().getElementType() == GroovyTokenTypes.mNLS) { prev = PsiUtil.getPreviousNonWhitespaceToken(prev); } return prev; }
getPrev
29,069
PsiElement (PsiElement element) { PsiElement next = GeeseUtil.getNextNonWhitespaceToken(element); if (next != null && next.getNode().getElementType() == GroovyTokenTypes.mNLS) next = GeeseUtil.getNextNonWhitespaceToken(next); return next; }
getNext
29,070
void (@NotNull PsiElement element, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { if (PsiImplUtil.isWhiteSpaceOrNls(element)) { element = PsiTreeUtil.prevLeaf(element); } LOG.assertTrue(GeeseUtil.isClosureRBrace(element)); PsiFile file = element.getContainingFile(); Document document = file.getViewPr...
processIntention
29,071
PsiElementPredicate () { return MY_PREDICATE; }
getElementPredicate
29,072
void (@NotNull PsiElement element, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { if (!(element instanceof GrReferenceElement<?> ref)) return; final PsiElement resolved = ref.resolve(); if (!(resolved instanceof PsiClass psiClass)) return; final String qname = psiClass.getQualifiedName(); final GrImp...
processIntention
29,073
PsiElementPredicate () { return new PsiElementPredicate() { @Override public boolean satisfiedBy(@NotNull PsiElement element) { if (!(element instanceof GrReferenceElement<?> ref)) return false; final PsiElement parent = ref.getParent(); if (!(parent instanceof GrReferenceElement)) return false; final PsiElement resolv...
getElementPredicate
29,074
boolean (@NotNull PsiElement element) { if (!(element instanceof GrReferenceElement<?> ref)) return false; final PsiElement parent = ref.getParent(); if (!(parent instanceof GrReferenceElement)) return false; final PsiElement resolved = ref.resolve(); if (resolved == null) return false; return resolved instanceof PsiCl...
satisfiedBy
29,075
void (@NotNull PsiElement element, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { if (element instanceof GrReferenceExpression ref) { ref.replaceWithExpression(ref.getQualifier(), true); } }
processIntention
29,076
PsiElementPredicate () { return element -> element instanceof GrReferenceExpression ref && "class".equals(ref.getReferenceName()) && ref.getQualifier() instanceof GrReferenceExpression qualifier && qualifier.resolve() instanceof PsiClass; }
getElementPredicate
29,077
boolean (@NotNull PsiElement element) { if (element.getLanguage() != GroovyLanguage.INSTANCE) return false; if (!CodeStyleSettingsManager.getInstance(element.getProject()).getCurrentSettings() .getCustomSettings(GroovyCodeStyleSettings.class).USE_FLYING_GEESE_BRACES) { return false; } if (PsiImplUtil.isWhiteSpaceOrNls(...
satisfiedBy
29,078
PsiElement (PsiElement element) { PsiElement prev = PsiUtil.getPreviousNonWhitespaceToken(element); if (prev != null && prev.getNode().getElementType() == GroovyTokenTypes.mNLS) { prev = PsiUtil.getPreviousNonWhitespaceToken(prev); } return prev; }
getPrev
29,079
PsiElement (PsiElement element) { PsiElement next = GeeseUtil.getNextNonWhitespaceToken(element); if (next != null && next.getNode().getElementType() == GroovyTokenTypes.mNLS) next = GeeseUtil.getNextNonWhitespaceToken(next); return next; }
getNext
29,080
void (@NotNull PsiElement element, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { if (PsiImplUtil.isWhiteSpaceOrNls(element)) { element = PsiTreeUtil.prevLeaf(element); } LOG.assertTrue(GeeseUtil.isClosureRBrace(element) && GeeseUtil.isClosureContainLF(element)); PsiFile file = element.getContainingF...
processIntention
29,081
TextRange (PsiElement element) { PsiElement first = null; PsiElement last = null; for (PsiElement cur = element; GeeseUtil.isClosureRBrace(cur) && GeeseUtil.isClosureContainLF(cur); cur = getNext(cur)) { last = cur; } for (PsiElement cur = element; GeeseUtil.isClosureRBrace(cur) && GeeseUtil.isClosureContainLF(cur); cu...
findRange
29,082
PsiElementPredicate () { return MY_PREDICATE; }
getElementPredicate
29,083
void (@NotNull GrReferenceExpression expression) { super.visitReferenceExpression(expression); if (name.equals(expression.getReferenceName())) { PsiElement resolved = expression.resolve(); if (resolved != null) { expression.putUserData(TEMP_REFERENT_USER_DATA, resolved); } } }
visitReferenceExpression
29,084
void (@NotNull GrReferenceExpression expression) { super.visitReferenceExpression(expression); GrTypeArgumentList typeArgumentList = expression.getTypeArgumentList(); if (typeArgumentList != null && typeArgumentList.getFirstChild() != null) { expression.putUserData(TEMP_REFERENT_USER_DATA, null); return; } if (name.equ...
visitReferenceExpression
29,085
boolean (PsiElement resolved, PsiFile containingFile) { boolean isAnythingShortened = false; for (PsiReference reference : ReferencesSearch.search(resolved, new LocalSearchScope(containingFile))) { final PsiElement refElement = reference.getElement(); if (refElement instanceof GrQualifiedReference<?>) { boolean shorten...
shortenUsages
29,086
boolean (PsiElement element) { return super.isStopElement(element) || element instanceof GrReferenceExpression; }
isStopElement
29,087
PsiElementPredicate () { return new PsiElementPredicate() { @Override public boolean satisfiedBy(@NotNull PsiElement element) { final PsiElement resolved = resolve(element); if (resolved == null) return false; return resolved instanceof PsiMember && !(resolved instanceof PsiClass) && ((PsiMember)resolved).hasModifierPr...
getElementPredicate
29,088
boolean (@NotNull PsiElement element) { final PsiElement resolved = resolve(element); if (resolved == null) return false; return resolved instanceof PsiMember && !(resolved instanceof PsiClass) && ((PsiMember)resolved).hasModifierProperty(PsiModifier.STATIC) && ((PsiMember)resolved).getContainingClass() != null; }
satisfiedBy
29,089
PsiElement (PsiElement element) { GrReferenceExpression ref = findRef(element); if (ref == null || ref.getQualifier() == null) return null; return ref.resolve(); }
resolve
29,090
GrReferenceExpression (PsiElement element) { if ((element instanceof GrReferenceExpression)) { return (GrReferenceExpression)element; } else if (element instanceof GrArgumentList) { PsiElement parent = element.getParent(); if (parent instanceof GrMethodCall) { GrExpression invoked = ((GrMethodCall)parent).getInvokedExp...
findRef
29,091
String () { return GroovyBundle.message("add.return.type.to.method.declaration"); }
getFamilyName
29,092
GrMethod (@NotNull PsiElement at, int offset) { if (at.getParent() instanceof GrReturnStatement returnStatement) { final PsiElement word = returnStatement.getReturnWord(); if (!word.getTextRange().contains(offset)) return null; final GroovyPsiElement returnOwner = PsiTreeUtil.getParentOfType(returnStatement, GrClosable...
findMethod
29,093
void (@NotNull ActionContext context, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { final GrMethod method = findMethod(element, context.offset()); if (method == null) return; applyFix(context.project(), method); }
invoke
29,094
void (@NotNull Project project, @NotNull GrMethod method) { PsiType type = method.getInferredReturnType(); if (type == null) type = PsiType.getJavaLangObject(PsiManager.getInstance(project), method.getResolveScope()); type = TypesUtil.unboxPrimitiveTypeWrapper(type); GrReferenceAdjuster.shortenAllReferencesIn(method.se...
applyFix
29,095
void () { String name = getEnteredName(); MultiMap<PsiElement, String> conflicts = new MultiMap<>(); assert name != null; GroovyValidationUtil.validateNewParameterName(firstParam, conflicts, name); if (isClosure) { findClosureConflictUsages(conflicts, occurrences); } if (reportConflicts(conflicts, project)) { performRe...
doOKAction
29,096
void (MultiMap<PsiElement, String> conflicts, Collection<PsiElement> occurrences) { for (PsiElement occurrence : occurrences) { PsiElement origin = occurrence; while (occurrence instanceof GrReferenceExpression) { occurrence = occurrence.getParent(); } if (occurrence instanceof GrArgumentList) { conflicts.putValue(orig...
findClosureConflictUsages
29,097
boolean () { return false; }
startInWriteAction
29,098
void (final PsiElement element, final GrParameterListOwner owner, final Collection<PsiElement> occurrences, final boolean createNewFirstParam, @Nullable final String mapParamName, final boolean specifyMapType) { final GrParameter param = getAppropriateParameter(element); assert param != null; final String paramName = p...
performRefactoring
29,099
GrParameter (final PsiElement element) { if (element instanceof GrParameter) { return (GrParameter)element; } if (element instanceof GrReferenceExpression expr) { final PsiElement resolved = expr.resolve(); LOG.assertTrue(resolved instanceof GrParameter); return ((GrParameter)resolved); } LOG.error("Selected expression...
getAppropriateParameter