mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
visitor for GrTypeParameter
This commit is contained in:
+2
-3
@@ -21,7 +21,6 @@ import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiIdentifier;
|
||||
import com.intellij.psi.PsiWhiteSpace;
|
||||
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
|
||||
import com.intellij.psi.formatter.FormatterUtil;
|
||||
@@ -285,8 +284,8 @@ public class GroovySpacingProcessor extends GroovyElementVisitor {
|
||||
|
||||
public void visitTypeDefinition(GrTypeDefinition typeDefinition) {
|
||||
if (myType2 == CLASS_BODY) {
|
||||
PsiIdentifier nameIdentifier = typeDefinition.getNameIdentifier();
|
||||
int dependenceStart = nameIdentifier == null ? myParent.getTextRange().getStartOffset() : nameIdentifier.getTextRange().getStartOffset();
|
||||
PsiElement nameIdentifier = typeDefinition.getNameIdentifierGroovy();
|
||||
int dependenceStart = nameIdentifier.getTextRange().getStartOffset();
|
||||
createSpaceBeforeLBrace(mySettings.SPACE_BEFORE_CLASS_LBRACE, mySettings.CLASS_BRACE_STYLE, new TextRange(dependenceStart, myChild1.getTextRange().getEndOffset()), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,4 +443,8 @@ public abstract class GroovyElementVisitor {
|
||||
public void visitClassInitializer(GrClassInitializer initializer) {
|
||||
visitElement(initializer);
|
||||
}
|
||||
|
||||
public void visitTypeParameter(GrTypeParameter typeParameter) {
|
||||
visitTypeDefinition(typeParameter);
|
||||
}
|
||||
}
|
||||
|
||||
-4
@@ -1067,10 +1067,6 @@ public class ControlFlowBuilder extends GroovyRecursiveElementVisitor {
|
||||
collectVars(block.getControlFlow());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitTypeDefinition(GrTypeDefinition typeDefinition) {
|
||||
typeDefinition.acceptChildren(this);
|
||||
}
|
||||
});
|
||||
|
||||
PsiField[] fields = typeDefinition.getAllFields();
|
||||
|
||||
+6
-1
@@ -29,6 +29,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.lang.groovydoc.psi.api.GrDocComment;
|
||||
import org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes;
|
||||
import org.jetbrains.plugins.groovy.lang.parser.GroovyElementTypes;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyElementVisitor;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.GrModifierList;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrClassInitializer;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrField;
|
||||
@@ -394,5 +395,9 @@ public class GrTypeParameterImpl extends GrStubElementBase<GrTypeParameterStub>
|
||||
public PsiAnnotation[] getApplicableAnnotations() {
|
||||
return getAnnotations();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void accept(GroovyElementVisitor visitor) {
|
||||
visitor.visitTypeParameter(this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user