Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
34,600 | boolean (@Nullable PsiElement exp) { if (!(exp instanceof GrUnaryExpression prefixExp)) { return false; } final IElementType sign = prefixExp.getOperationTokenType(); return GroovyTokenTypes.mLNOT.equals(sign); } | isNegation |
34,601 | GrExpression (GrExpression exp) { final GrUnaryExpression prefixExp = (GrUnaryExpression) exp; final GrExpression operand = prefixExp.getOperand(); return (GrExpression)PsiUtil.skipParentheses(operand, false); } | getNegated |
34,602 | String (GrExpression condition) { if (isNegation(condition)) { final GrExpression negated = getNegated(condition); return negated.getText(); } else if (ComparisonUtils.isComparison(condition)) { final GrBinaryExpression binaryExpression = (GrBinaryExpression) condition; final IElementType sign = binaryExpression.getOperationTokenType(); final String negatedComparison = ComparisonUtils.getNegatedComparison(sign); final GrExpression lhs = binaryExpression.getLeftOperand(); final GrExpression rhs = binaryExpression.getRightOperand(); assert rhs != null; return lhs.getText() + negatedComparison + rhs.getText(); } else if (ParenthesesUtils.getPrecedence(condition) > ParenthesesUtils.PREFIX_PRECEDENCE) { return "!(" + condition.getText() + ')'; } else { return '!' + condition.getText(); } } | getNegatedExpressionText |
34,603 | int (@NotNull IElementType sign) { Integer result = BINARY_PRECEDENCES.get(sign); return result != null ? result : 0; } | precedenceForBinaryOperator |
34,604 | int (GrExpression expr) { if (expr instanceof GrUnaryExpression) return ((GrUnaryExpression)expr).isPostfix() ? POSTFIX_PRECEDENCE : PREFIX_PRECEDENCE; if (expr instanceof GrTypeCastExpression) return TYPE_CAST_PRECEDENCE; if (expr instanceof GrRangeExpression) return RANGE_PRECEDENCE; if (expr instanceof GrConditionalExpression) return CONDITIONAL_PRECEDENCE; if (expr instanceof GrSafeCastExpression) return SAFE_CAST_PRECEDENCE; if (expr instanceof GrAssignmentExpression) return ASSIGNMENT_PRECEDENCE; if (expr instanceof GrApplicationStatement) return APPLICATION_STMT_PRECEDENCE; if (expr instanceof GrInstanceOfExpression) return INSTANCEOF_PRECEDENCE; if (expr instanceof GrNewExpression) return NEW_EXPR_PRECEDENCE; if (expr instanceof GrParenthesizedExpression) return PARENTHESIZED_PRECEDENCE; if (expr instanceof GrReferenceExpression referenceExpression) { return referenceExpression.getQualifierExpression() == null ? LITERAL_PRECEDENCE : METHOD_CALL_PRECEDENCE; } if (expr instanceof GrBinaryExpression) { final IElementType opToken = ((GrBinaryExpression)expr).getOperationTokenType(); return precedenceForBinaryOperator(opToken); } return 0; } | getPrecedence |
34,605 | GrExpression (@NotNull GrExpression expression) { return parenthesize(expression, null); } | parenthesize |
34,606 | GrExpression (@NotNull GrExpression expression, @Nullable PsiElement context) { GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(expression.getProject()); return factory.createParenthesizedExpr(expression, context); } | parenthesize |
34,607 | GrExpression (@NotNull GrExpression expression) { GrExpression currentExpression = expression; while (currentExpression instanceof GrParenthesizedExpression) { GrExpression operand = ((GrParenthesizedExpression)currentExpression).getOperand(); if (operand != null) { currentExpression = operand; } else { return currentExpression; } } return currentExpression; } | unparenthesize |
34,608 | boolean (int childPrecedence, @NotNull IElementType parentToken, boolean isRhs) { int parentPrecedence = precedenceForBinaryOperator(parentToken); return parentPrecedence < childPrecedence || parentPrecedence == childPrecedence && parentPrecedence != 0 && isRhs; } | checkPrecedenceForBinaryOps |
34,609 | boolean (@NotNull GrExpression newExpr, int parentPrecedence) { return checkPrecedenceForNonBinaryOps(getPrecedence(newExpr), parentPrecedence); } | checkPrecedenceForNonBinaryOps |
34,610 | boolean (int precedence, int parentPrecedence) { return precedence > parentPrecedence; } | checkPrecedenceForNonBinaryOps |
34,611 | boolean (int precedence, @NotNull GrExpression oldExpr) { PsiElement parent = oldExpr.getParent(); if (parent instanceof GrArgumentList) { parent = parent.getParent(); } if (!(parent instanceof GrExpression oldParent)) return false; if (oldParent instanceof GrBinaryExpression binaryExpression) { GrExpression rightOperand = binaryExpression.getRightOperand(); return checkPrecedenceForBinaryOps(precedence, binaryExpression.getOperationTokenType(), oldExpr.equals(rightOperand)); } else { return checkPrecedenceForNonBinaryOps(precedence, getPrecedence(oldParent)); } } | checkPrecedence |
34,612 | boolean (@NotNull GrExpression newExpr, @NotNull GrExpression oldExpr) { return checkPrecedence(getPrecedence(newExpr), oldExpr); } | checkPrecedence |
34,613 | void (Map<GrMethod, List<GrMethod>> map, HashSet<? super GrMethod> duplicateMethodsWarning, HashSet<? super GrMethod> duplicateMethodsErrors) { for (GrMethod method : map.keySet()) { List<GrMethod> duplicateMethods = map.get(method); if (duplicateMethods != null && duplicateMethods.size() > 1) { HashMap<PsiType, GrMethod> duplicateMethodsToReturnTypeMap = new HashMap<>(); for (GrMethod duplicateMethod : duplicateMethods) { GrTypeElement typeElement = duplicateMethod.getReturnTypeElementGroovy(); PsiType methodReturnType; if (typeElement != null) { methodReturnType = typeElement.getType(); } else { methodReturnType = PsiTypes.nullType(); } duplicateMethodsWarning.add(duplicateMethod); GrMethod grMethodWithType = duplicateMethodsToReturnTypeMap.get(methodReturnType); if (grMethodWithType != null) { duplicateMethodsErrors.add(duplicateMethod); duplicateMethodsErrors.add(grMethodWithType); duplicateMethodsWarning.remove(duplicateMethod); duplicateMethodsWarning.remove(grMethodWithType); } duplicateMethodsToReturnTypeMap.put(methodReturnType, duplicateMethod); } } } } | collectMethodDuplicates |
34,614 | GrStatement (GrStatement branch) { if (branch instanceof GrBlockStatement block) { final GrOpenBlock codeBlock = block.getBlock(); final GrStatement[] statements = codeBlock.getStatements(); if (statements.length == 1) { return statements[0]; } else { return block; } } else { return branch; } } | stripBraces |
34,615 | void (@NotNull GroovyElementVisitor visitor) { visitor.visitListOrMap(this); } | accept |
34,616 | String () { return "Generalized list"; } | toString |
34,617 | ASTNode (ASTNode first, ASTNode last, ASTNode anchor, Boolean before) { if (getInitializers().length == 0) { return super.addInternal(first, last, getNode().getFirstChildNode(), false); } final ASTNode lastChild = getNode().getLastChildNode(); getNode().addLeaf(GroovyTokenTypes.mCOMMA, ",", lastChild); return super.addInternal(first, last, lastChild.getTreePrev(), false); } | addInternal |
34,618 | void (@NotNull ASTNode child) { final PsiElement psi = child.getPsi(); if (psi instanceof GrExpression || psi instanceof GrNamedArgument) { PsiElement prev = PsiUtil.getPrevNonSpace(psi); PsiElement next = PsiUtil.getNextNonSpace(psi); if (prev != null && prev.getNode() != null && prev.getNode().getElementType() == GroovyTokenTypes.mCOMMA) { super.deleteChildInternal(prev.getNode()); } else if (next instanceof LeafPsiElement && next.getNode() != null && next.getNode().getElementType() == GroovyTokenTypes.mCOMMA) { super.deleteChildInternal(next.getNode()); } } super.deleteChildInternal(child); } | deleteChildInternal |
34,619 | boolean () { return findChildByType(MAP_LITERAL_TOKEN_SET) != null; } | isMap |
34,620 | boolean () { return getInitializers().length == 0 && getNamedArguments().length == 0; } | isEmpty |
34,621 | PsiElement () { return findNotNullChildByType(GroovyTokenTypes.mLBRACK); } | getLBrack |
34,622 | PsiElement () { return findChildByType(GroovyTokenTypes.mRBRACK); } | getRBrack |
34,623 | GrNamedArgument (@NotNull String label) { return PsiImplUtil.findNamedArgument(this, label); } | findNamedArgument |
34,624 | PsiReference () { return getConstructorReference(); } | getReference |
34,625 | GroovyConstructorReference () { return myConstructorReference.resolveClass() != null ? myConstructorReference : null; } | getConstructorReference |
34,626 | void () { myInitializers = null; myNamedArguments = null; } | subtreeChanged |
34,627 | IElementType () { return GroovyTokenTypes.mIDENT; } | getTokenType |
34,628 | String () { return myText; } | getText |
34,629 | PsiElement () { return new GrLightIdentifier(getManager(), myText); } | copy |
34,630 | String () { return "PsiIdentifier:" + getText(); } | toString |
34,631 | TextRange () { final PsiElement identifier = myStatement.getLabelIdentifier(); if (identifier == null) { return new TextRange(-1, -2); } final int offsetInParent = identifier.getStartOffsetInParent(); return new TextRange(offsetInParent, offsetInParent + identifier.getTextLength()); } | getRangeInElement |
34,632 | boolean (@NotNull PsiElement element) { return resolve() == element; } | isReferenceTo |
34,633 | String () { final String name = myStatement.getLabelName(); if (name == null) return ""; return name; } | getCanonicalText |
34,634 | boolean () { return false; } | isSoft |
34,635 | GrFlowInterruptingStatement () { return myStatement; } | getElement |
34,636 | PsiElement () { return myStatement.resolveLabel(); } | resolve |
34,637 | IElementType () { return GroovyTokenTypes.kTHROWS; } | getKeywordType |
34,638 | void (@NotNull GroovyElementVisitor visitor) { visitor.visitThrowsClause(this); } | accept |
34,639 | String () { return "Throw clause"; } | toString |
34,640 | Role () { return Role.THROWS_LIST; } | getRole |
34,641 | void (@NotNull GroovyElementVisitor visitor) { visitor.visitModifierList(this); } | accept |
34,642 | String () { return "Modifiers"; } | toString |
34,643 | int () { final GrModifierListStub stub = getGreenStub(); if (stub != null) { return stub.getModifiersFlags(); } else { return CachedValuesManager.getCachedValue(this, () -> { int flags = 0; for (PsiElement modifier : findChildrenByType(TokenSets.MODIFIERS)) { flags |= NAME_TO_MODIFIER_FLAG_MAP.getInt(modifier.getText()); } return Result.create(flags, this); }); } } | getModifierFlags |
34,644 | PsiElement (@GrModifierConstant @NotNull @NonNls String name) { return findChildByType(NAME_TO_MODIFIER_ELEMENT_TYPE.get(name)); } | getModifier |
34,645 | boolean () { return GrModifierListUtil.hasExplicitVisibilityModifiers(this); } | hasExplicitVisibilityModifiers |
34,646 | boolean (@NotNull String name) { return GrModifierListUtil.hasModifierProperty(this, name); } | hasModifierProperty |
34,647 | boolean (@NotNull String name) { return GrModifierListUtil.hasExplicitModifier(this, name); } | hasExplicitModifier |
34,648 | void (String name, boolean doSet) { if (doSet) { if (isEmptyModifierList()) { final PsiElement nextSibling = getNextSibling(); if (nextSibling != null && !PsiImplUtil.isWhiteSpaceOrNls(nextSibling)) { getNode().getTreeParent().addLeaf(TokenType.WHITE_SPACE, " ", nextSibling.getNode()); } } PsiElement modifier = GroovyPsiElementFactory.getInstance(getProject()).createModifierFromText(name); PsiElement anchor = findAnchor(name); addAfter(modifier, anchor); } else { final PsiElement[] modifiers = findChildrenByType(TokenSets.MODIFIERS, PsiElement.class); for (PsiElement modifier : modifiers) { if (name.equals(modifier.getText())) { deleteChildRange(modifier, modifier); break; } } if (isEmptyModifierList()) { final PsiElement nextSibling = getNextSibling(); if (nextSibling != null && PsiImplUtil.isWhiteSpaceOrNls(nextSibling)) { nextSibling.delete(); } } } } | setModifierPropertyInternal |
34,649 | ASTNode (ASTNode first, ASTNode last, ASTNode anchor, Boolean before) { final ASTNode node = super.addInternal(first, last, anchor, before); final PsiElement sibling = getNextSibling(); if (sibling != null && sibling.getText().contains("\n")) { sibling.replace(GroovyPsiElementFactory.getInstance(getProject()).createWhiteSpace()); } return node; } | addInternal |
34,650 | boolean () { return getTextLength() == 0 || getModifiers().length == 0 && getRawAnnotations().length == 0; } | isEmptyModifierList |
34,651 | PsiElement (String name) { final int myPriority = PRIORITY.getInt(name); PsiElement anchor = null; for (PsiElement modifier : getModifiers()) { final int otherPriority = PRIORITY.getInt(modifier.getText()); if (otherPriority <= myPriority) { anchor = modifier; } else if (anchor != null) { break; } } return anchor; } | findAnchor |
34,652 | PsiAnnotation (@NotNull @NonNls String qualifiedName) { for (GrAnnotation annotation : getAnnotations()) { if (annotation.hasQualifiedName(qualifiedName)) { return annotation; } } return null; } | findAnnotation |
34,653 | GrAnnotation (@NotNull @NonNls String qualifiedName) { final PsiClass psiClass = JavaPsiFacade.getInstance(getProject()).findClass(qualifiedName, getResolveScope()); final GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(getProject()); GrAnnotation annotation; if (psiClass != null) { annotation = (GrAnnotation)addAfter(factory.createModifierFromText("@xxx"), null); annotation.getClassReference().bindToElement(psiClass); } else { annotation = (GrAnnotation)addAfter(factory.createModifierFromText("@" + qualifiedName), null); } final PsiElement parent = getParent(); if (!(parent instanceof GrParameter)) { final ASTNode node = annotation.getNode(); final ASTNode treeNext = node.getTreeNext(); if (treeNext != null) { getNode().addLeaf(TokenType.WHITE_SPACE, "\n", treeNext); } else { parent.getNode().addLeaf(TokenType.WHITE_SPACE, "\n", getNode().getTreeNext()); } } return annotation; } | addAnnotation |
34,654 | Set<String> (@NotNull List<? super GrAnnotation> list, @NotNull GrAnnotation alias, @NotNull PsiAnnotation annotationCollector) { final PsiModifierList modifierList = (PsiModifierList)annotationCollector.getParent(); Map<String, Map<String, PsiNameValuePair>> annotations = new LinkedHashMap<>(); collectAliasedAnnotationsFromAnnotationCollectorValueAttribute(annotationCollector, annotations); collectAliasedAnnotationsFromAnnotationCollectorAnnotations(modifierList, annotations); final PsiManager manager = alias.getManager(); final GrAnnotationNameValuePair[] attributes = alias.getParameterList().getAttributes(); Set<String> allUsedAttrs = new LinkedHashSet<>(); for (Map.Entry<String, Map<String, PsiNameValuePair>> entry : annotations.entrySet()) { final String qname = entry.getKey(); if (qname.equals(alias.getQualifiedName())) { continue; } final PsiClass resolved = JavaPsiFacade.getInstance(alias.getProject()).findClass(qname, alias.getResolveScope()); if (resolved == null) continue; final GrLightAnnotation annotation = new GrLightAnnotation(manager, alias.getLanguage(), qname, (PsiModifierList)alias.getParent()); Set<String> usedAttrs = new LinkedHashSet<>(); for (GrAnnotationNameValuePair attr : attributes) { final String name = attr.getName() != null ? attr.getName() : "value"; if (resolved.findMethodsByName(name, false).length > 0) { annotation.addAttribute(attr); allUsedAttrs.add(name); usedAttrs.add(name); } } final Map<String, PsiNameValuePair> defaults = entry.getValue(); for (Map.Entry<String, PsiNameValuePair> defa : defaults.entrySet()) { if (!usedAttrs.contains(defa.getKey())) { annotation.addAttribute(defa.getValue()); } } list.add(annotation); } return allUsedAttrs; } | collectAnnotations |
34,655 | void (@NotNull PsiModifierList modifierList, @NotNull Map<String, Map<String, PsiNameValuePair>> annotations) { PsiAnnotation[] rawAnnotations = modifierList instanceof GrModifierList ? ((GrModifierList)modifierList).getRawAnnotations() : modifierList.getAnnotations(); for (PsiAnnotation annotation : rawAnnotations) { final String qname = annotation.getQualifiedName(); if (qname == null || qname.equals(GROOVY_TRANSFORM_ANNOTATION_COLLECTOR) || qname.startsWith("java.lang.annotation")) continue; final PsiNameValuePair[] attributes = annotation.getParameterList().getAttributes(); for (PsiNameValuePair pair : attributes) { Map<String, PsiNameValuePair> map = annotations.get(qname); if (map == null) { map = new LinkedHashMap<>(); annotations.put(qname, map); } map.put(pair.getName() != null ? pair.getName() : "value", pair); } if (attributes.length == 0 && !annotations.containsKey(qname)) { annotations.put(qname, new LinkedHashMap<>()); } } } | collectAliasedAnnotationsFromAnnotationCollectorAnnotations |
34,656 | void (@NotNull PsiAnnotation annotationCollector, @NotNull Map<String, Map<String, PsiNameValuePair>> annotations) { final PsiAnnotationMemberValue annotationsFromValue = annotationCollector.findAttributeValue("value"); if (annotationsFromValue instanceof GrAnnotationArrayInitializer) { for (GrAnnotationMemberValue member : ((GrAnnotationArrayInitializer)annotationsFromValue).getInitializers()) { if (member instanceof GrReferenceExpression) { final PsiElement resolved = ((GrReferenceExpression)member).resolve(); if (resolved instanceof PsiClass && ((PsiClass)resolved).isAnnotationType()) { annotations.put(((PsiClass)resolved).getQualifiedName(), new LinkedHashMap<>()); } } } } } | collectAliasedAnnotationsFromAnnotationCollectorValueAttribute |
34,657 | PsiAnnotation (@Nullable PsiClass clazz) { if (clazz != null) { final PsiModifierList modifierList = clazz.getModifierList(); if (modifierList != null) { PsiAnnotation[] annotations = modifierList instanceof GrModifierList ? ((GrModifierList)modifierList).getRawAnnotations() : modifierList.getAnnotations(); for (PsiAnnotation annotation : annotations) { if (GROOVY_TRANSFORM_ANNOTATION_COLLECTOR.equals(annotation.getQualifiedName())) { return annotation; } } } } return null; } | findAnnotationCollector |
34,658 | PsiAnnotation (@NotNull GrAnnotation annotation) { if (!mayHaveAnnotationCollector(annotation)) { return null; } PsiElement resolved = annotation.getClassReference().resolve(); if (resolved instanceof ClsClassImpl) { return findAnnotationCollector(((ClsClassImpl)resolved).getSourceMirrorClass()); } else if (resolved instanceof PsiClass) { return findAnnotationCollector((PsiClass)resolved); } else { return null; } } | findAnnotationCollector |
34,659 | boolean (GrAnnotation @NotNull [] rawAnnotations) { for (GrAnnotation annotation : rawAnnotations) { if (mayHaveAnnotationCollector(annotation)) { return true; } } return false; } | mayHaveAnnotationCollector |
34,660 | boolean (@NotNull GrAnnotation annotation) { String shortName = annotation.getShortName(); Set<String> allNames = allCollectorNames(annotation.getProject()); return allNames.contains(shortName) || ContainerUtil.exists(getAliasedShortNames(annotation, shortName), allNames::contains); } | mayHaveAnnotationCollector |
34,661 | Set<String> (@NotNull Project project) { return CachedValuesManager.getManager(project).getCachedValue(project, () -> { Set<String> result = new HashSet<>(); GlobalSearchScope scope = GlobalSearchScope.allScope(project); for (PsiClass collector : JavaPsiFacade.getInstance(project).findClasses(GROOVY_TRANSFORM_ANNOTATION_COLLECTOR, scope)) { AnnotatedElementsSearch.searchPsiClasses(collector, scope).forEach(aClass -> { ContainerUtil.addIfNotNull(result, aClass.getName()); return true; }); } return CachedValueProvider.Result.create(result, PsiModificationTracker.MODIFICATION_COUNT); }); } | allCollectorNames |
34,662 | boolean (@NotNull List<? super GrAnnotation> list, @NotNull GrAnnotation alias) { String fqn = alias.getQualifiedName(); if (GROOVY_TRANSFORM_IMMUTABLE.equals(fqn)) { GrImmutableUtils.collectImmutableAnnotations(alias, list); return true; } return collectCompileDynamic(list, alias); } | collectHardcoded |
34,663 | boolean (@NotNull List<? super GrAnnotation> list, @NotNull GrAnnotation alias) { if (GROOVY_TRANSFORM_COMPILE_DYNAMIC.equals(alias.getQualifiedName())) { PsiAnnotationOwner owner = alias.getOwner(); if (owner != null) { GrLightAnnotation annotation = new GrLightAnnotation( owner, alias, GROOVY_TRANSFORM_COMPILE_STATIC, singletonMap("value", "TypeCheckingMode.SKIP") ); list.add(annotation); } return true; } return false; } | collectCompileDynamic |
34,664 | GrLiteral (@NotNull String value, @NotNull PsiElement context) { return (GrLiteral)GroovyPsiElementFactory.getInstance(context.getProject()) .createExpressionFromText("\"" + StringUtil.escapeStringCharacters(value) + "\""); } | createLiteralValue |
34,665 | void (@NotNull GroovyElementVisitor visitor) { visitor.visitAnnotationNameValuePair(this); } | accept |
34,666 | String () { return "Annotation member value pair"; } | toString |
34,667 | String () { GrNameValuePairStub stub = getStub(); if (stub != null) { return stub.getName(); } final PsiElement nameId = getNameIdentifierGroovy(); return nameId != null ? nameId.getText() : null; } | getName |
34,668 | String () { return null; } | getLiteralValue |
34,669 | PsiElement () { PsiElement child = getFirstChild(); if (child == null) return null; IElementType type = child.getNode().getElementType(); if (TokenSets.CODE_REFERENCE_ELEMENT_NAME_TOKENS.contains(type)) return child; return null; } | getNameIdentifierGroovy |
34,670 | PsiIdentifier () { return null; } | getNameIdentifier |
34,671 | PsiAnnotationMemberValue () { GrNameValuePairStub stub = getStub(); if (stub != null) { String text = stub.getValue(); if (text == null) { return null; } PsiAnnotationMemberValue result = dereference(myDetachedValue); if (result == null) { GrAnnotationNameValuePair attribute = GroovyPsiElementFactory.getInstance(getProject()).createAnnotationAttribute(text, this); ((LightVirtualFile)attribute.getContainingFile().getViewProvider().getVirtualFile()).setWritable(false); myDetachedValue = new SoftReference<>(result = attribute.getValue()); } return result; } return getValue(); } | getDetachedValue |
34,672 | void () { super.subtreeChanged(); myDetachedValue = null; } | subtreeChanged |
34,673 | GrAnnotationMemberValue () { return findChildByClass(GrAnnotationMemberValue.class); } | getValue |
34,674 | PsiAnnotationMemberValue (@NotNull PsiAnnotationMemberValue newValue) { GrAnnotationMemberValue value = getValue(); if (value == null) { return (PsiAnnotationMemberValue)add(newValue); } else { return (PsiAnnotationMemberValue)value.replace(newValue); } } | setValue |
34,675 | PsiReference () { return getNameIdentifierGroovy() == null ? null : new GrAnnotationMethodReference(this); } | getReference |
34,676 | void (@NotNull GroovyElementVisitor visitor) { visitor.visitAnnotation(this); } | accept |
34,677 | String () { return "Annotation"; } | toString |
34,678 | GrAnnotationArgumentList () { return getRequiredStubOrPsiChild(GroovyEmptyStubElementTypes.ANNOTATION_ARGUMENT_LIST); } | getParameterList |
34,679 | String () { final GrAnnotationStub stub = getStub(); if (stub != null) { return stub.getPsiElement().getQualifiedName(); } final GrCodeReferenceElement nameRef = getClassReference(); final PsiElement resolved = nameRef.resolve(); if (resolved instanceof PsiClass) return ((PsiClass)resolved).getQualifiedName(); return null; } | getQualifiedName |
34,680 | PsiJavaCodeReferenceElement () { final GroovyResolveResult resolveResult = getClassReference().advancedResolve(); final PsiElement resolved = resolveResult.getElement(); if (!(resolved instanceof PsiClass)) return null; return new LightClassReference(getManager(), getClassReference().getText(), (PsiClass)resolved, resolveResult.getSubstitutor()); } | getNameReferenceElement |
34,681 | PsiAnnotationMemberValue (@Nullable String attributeName) { return PsiImplUtil.findAttributeValue(this, attributeName); } | findAttributeValue |
34,682 | PsiAnnotationMemberValue (@NonNls final String attributeName) { return PsiImplUtil.findDeclaredAttributeValue(this, attributeName); } | findDeclaredAttributeValue |
34,683 | GrCodeReferenceElement () { final GrAnnotationStub stub = getStub(); if (stub != null) { return stub.getPsiElement().getClassReference(); } return findNotNullChildByClass(GrCodeReferenceElement.class); } | getClassReference |
34,684 | String () { final GrAnnotationStub stub = getStub(); if (stub != null) { return PsiAnnotationImpl.getAnnotationShortName(stub.getText()); } final String referenceName = getClassReference().getReferenceName(); assert referenceName != null; return referenceName; } | getShortName |
34,685 | PsiAnnotationOwner () { PsiElement parent = getParent(); return parent instanceof PsiAnnotationOwner ? (PsiAnnotationOwner)parent : null; } | getOwner |
34,686 | boolean (@NotNull String qualifiedName) { return mayHaveQualifiedName(qualifiedName) && qualifiedName.equals(getQualifiedName()); } | hasQualifiedName |
34,687 | boolean (@NotNull String qualifiedName) { String shortName = getShortName(); return shortName.equals(StringUtil.getShortName(qualifiedName)) || getAliasedFullyQualifiedNames(this, shortName).contains(qualifiedName); } | mayHaveQualifiedName |
34,688 | boolean (GrAnnotation annotation, TargetType @NotNull ... elementTypeFields) { return elementTypeFields.length == 0 || AnnotationTargetUtil.findAnnotationTarget(annotation, elementTypeFields) != null; } | isAnnotationApplicableTo |
34,689 | void (@NotNull GroovyElementVisitor visitor) { visitor.visitAnnotationArgumentList(this); } | accept |
34,690 | String () { return "Annotation arguments"; } | toString |
34,691 | ASTNode (ASTNode first, ASTNode last, ASTNode anchor, Boolean before) { if (first.getElementType() == GroovyStubElementTypes.ANNOTATION_MEMBER_VALUE_PAIR && last.getElementType() == GroovyStubElementTypes.ANNOTATION_MEMBER_VALUE_PAIR) { ASTNode lparenth = getNode().getFirstChildNode(); ASTNode rparenth = getNode().getLastChildNode(); if (lparenth == null) { getNode().addLeaf(GroovyTokenTypes.mLPAREN, "(", null); } if (rparenth == null) { getNode().addLeaf(GroovyTokenTypes.mRPAREN, ")", null); } final PsiNameValuePair[] nodes = getAttributes(); if (nodes.length == 1) { final PsiNameValuePair pair = nodes[0]; if (pair.getName() == null) { final String text = pair.getValue().getText(); try { final PsiAnnotation annotation = GroovyPsiElementFactory.getInstance(getProject()).createAnnotationFromText("@AAA(value = " + text + ")"); getNode().replaceChild(pair.getNode(), annotation.getParameterList().getAttributes()[0].getNode()); } catch (IncorrectOperationException e) { LOG.error(e); } } } if (anchor == null && before != null) { anchor = before.booleanValue() ? getNode().getLastChildNode() : getNode().getFirstChildNode(); } if (nodes.length > 0) { var comma = Factory.createSingleLeafElement(GroovyElementTypes.T_COMMA, ",", 0, 1, SharedImplUtil.findCharTableByTree(first), getManager()); super.addInternal(comma, comma, anchor, before); } } return super.addInternal(first, last, anchor, before); } | addInternal |
34,692 | void (@NotNull GroovyElementVisitor visitor) { visitor.visitAnnotationArrayInitializer(this); } | accept |
34,693 | String () { return "Annotation array initializer"; } | toString |
34,694 | ASTNode (ASTNode first, ASTNode last, ASTNode anchor, Boolean before) { final GrAnnotationMemberValue[] initializers = getInitializers(); if (initializers.length == 0) { return super.addInternal(first, last, getNode().getFirstChildNode(), false); } final ASTNode lastChild = getNode().getLastChildNode(); getNode().addLeaf(GroovyTokenTypes.mCOMMA, ",", lastChild); return super.addInternal(first, last, lastChild.getTreePrev(), false); } | addInternal |
34,695 | SearchScope (@NotNull PsiElement element) { if (element instanceof PsiField && ((PsiField)element).hasModifierProperty(PsiModifier.PRIVATE)) { PsiClass containingClass = ((PsiField)element).getContainingClass(); if (containingClass != null && PsiUtil.isLocalOrAnonymousClass(containingClass)) return null; final GlobalSearchScope maximalUseScope = ResolveScopeManager.getElementUseScope(element); return new GrSourceFilterScope(maximalUseScope); } return null; } | getAdditionalUseScope |
34,696 | boolean (@NotNull final VirtualFile file) { return super.contains(file) && (myIndex == null || myIndex.isInSourceContent(file)) && FileTypeRegistry.getInstance().isFileOfType(file, GroovyFileType.GROOVY_FILE_TYPE); } | contains |
34,697 | PsiType () { return myReceiverType; } | getReceiverType |
34,698 | PsiMethod () { return myMethod; } | getStaticMethod |
34,699 | boolean () { return myMethod.hasTypeParameters(); } | hasTypeParameters |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.