diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java index 0ce3941bd63d..d0f4e3966024 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -130,6 +130,29 @@ public class GroovyAnnotator extends GroovyElementVisitor implements Annotator { ((GroovyPsiElement)element).accept(this); myHolder = null; } + else { + final IElementType token = element.getNode().getElementType(); + if (TokenSets.KEYWORDS.contains(token)) { + highlightKeyword(element, holder, token); + } + } + } + + private static void highlightKeyword(PsiElement element, AnnotationHolder holder, IElementType token) { + final PsiElement parent = element.getParent(); + if (parent instanceof GrArgumentLabel) return; //don't highlight: print (void:'foo') + + if (PsiTreeUtil.getParentOfType(element, GrCodeReferenceElement.class) != null) { + if (token == GroovyTokenTypes.kDEF || token == GroovyTokenTypes.kIN || token == GroovyTokenTypes.kAS) { + return; //It is allowed to name packages 'as', 'in' or 'def' + } + } + else if (parent instanceof GrReferenceExpression && element == ((GrReferenceExpression)parent).getReferenceNameElement()) { + return; //don't highlight foo.def + } + + final Annotation annotation = holder.createInfoAnnotation(element, null); + annotation.setTextAttributes(DefaultHighlighter.KEYWORD); } @Override diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/GroovySyntaxHighlighter.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/GroovySyntaxHighlighter.java index 98c94e263715..04c3ee54f85a 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/GroovySyntaxHighlighter.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/GroovySyntaxHighlighter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -193,7 +193,7 @@ public class GroovySyntaxHighlighter extends SyntaxHighlighterBase implements Gr fillMap(ATTRIBUTES, tLINE_COMMENTS, DefaultHighlighter.LINE_COMMENT); fillMap(ATTRIBUTES, tBLOCK_COMMENTS, DefaultHighlighter.BLOCK_COMMENT); fillMap(ATTRIBUTES, tBAD_CHARACTERS, DefaultHighlighter.BAD_CHARACTER); - fillMap(ATTRIBUTES, tKEYWORDS, DefaultHighlighter.KEYWORD); + //fillMap(ATTRIBUTES, tKEYWORDS, DefaultHighlighter.KEYWORD); fillMap(ATTRIBUTES, tNUMBERS, DefaultHighlighter.NUMBER); fillMap(ATTRIBUTES, tGSTRINGS, DefaultHighlighter.GSTRING); fillMap(ATTRIBUTES, tSTRINGS, DefaultHighlighter.STRING); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/GroovyLexer.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/GroovyLexer.java index 7d705c9f8db3..78120390859a 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/GroovyLexer.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/GroovyLexer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,10 +16,8 @@ package org.jetbrains.plugins.groovy.lang.lexer; -import com.intellij.lexer.Lexer; import com.intellij.lexer.LookAheadLexer; import com.intellij.lexer.MergingLexerAdapter; -import com.intellij.psi.tree.IElementType; import com.intellij.psi.tree.TokenSet; import static com.intellij.psi.TokenType.WHITE_SPACE; @@ -43,53 +41,4 @@ public class GroovyLexer extends LookAheadLexer { public GroovyLexer() { super(new MergingLexerAdapter(new GroovyFlexLexer(), tokensToMerge)); } - - @Override - protected void lookAhead(Lexer baseLexer) { - final IElementType type = baseLexer.getTokenType(); - if (TokenSets.DOTS.contains(type) || type == kIMPORT || type == kPACKAGE) { - addToken(type); - baseLexer.advance(); - while (baseLexer.getTokenType() == WHITE_SPACE) { - addToken(WHITE_SPACE); - baseLexer.advance(); - } - if (TokenSets.DOTS.contains(type) && baseLexer.getTokenType()==mAT) { - addToken(mAT); - baseLexer.advance(); - while (baseLexer.getTokenType() == WHITE_SPACE) { - addToken(WHITE_SPACE); - baseLexer.advance(); - } - } - final IElementType token = baseLexer.getTokenType(); - if (shouldBeIdent(type, token)) { - addToken(mIDENT); - baseLexer.advance(); - } - else { - addToken(token); - baseLexer.advance(); - } - } - else { - super.lookAhead(baseLexer); - } - } - - private static boolean shouldBeIdent(IElementType type, IElementType token) { - if (!TokenSets.KEYWORDS.contains(token)) return false; - - if (TokenSets.DOTS.contains(type)) { - return token != kTHIS && token != kSUPER && token != kNEW; - } - else if (type == kIMPORT) { - return token != kSTATIC; - } - else if (type == kPACKAGE) { - return true; - } - - return false; - } } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/TokenSets.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/TokenSets.java index d09ec7ff336d..8fa25ca33ef9 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/TokenSets.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/TokenSets.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -201,4 +201,5 @@ public abstract class TokenSets { ); public static final TokenSet SHIFT_SIGNS = TokenSet.create(COMPOSITE_LSHIFT_SIGN, COMPOSITE_RSHIFT_SIGN, COMPOSITE_TRIPLE_SHIFT_SIGN); + public static TokenSet CODE_REFERENCE_ELEMENT_NAME_TOKENS = TokenSet.create(mIDENT, kDEF, kIN, kAS); } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/expressions/primary/PrimaryExpression.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/expressions/primary/PrimaryExpression.java index 9fdf7265f8c4..8d284aa997b9 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/expressions/primary/PrimaryExpression.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/expressions/primary/PrimaryExpression.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -124,7 +124,7 @@ public class PrimaryExpression implements GroovyElementTypes { if (TokenSets.BUILT_IN_TYPE.contains(builder.getTokenType())) { ParserUtils.eatElement(builder, BUILT_IN_TYPE); } - else if (mIDENT == builder.getTokenType()) { + else if (TokenSets.CODE_REFERENCE_ELEMENT_NAME_TOKENS.contains(builder.getTokenType())) { name = builder.getTokenText(); ReferenceElement.parse(builder, false, true, false, true, true); } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/imports/ImportReference.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/imports/ImportReference.java index 33fd0beb7821..62381a57c72f 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/imports/ImportReference.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/imports/ImportReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package org.jetbrains.plugins.groovy.lang.parser.parsing.statements.imports; import com.intellij.lang.PsiBuilder; import org.jetbrains.plugins.groovy.GroovyBundle; +import org.jetbrains.plugins.groovy.lang.lexer.TokenSets; import org.jetbrains.plugins.groovy.lang.parser.GroovyElementTypes; import org.jetbrains.plugins.groovy.lang.parser.parsing.statements.typeDefinitions.ReferenceElement; import org.jetbrains.plugins.groovy.lang.parser.parsing.util.ParserUtils; @@ -31,7 +32,7 @@ public class ImportReference implements GroovyElementTypes { public static boolean parse(PsiBuilder builder) { - if (!mIDENT.equals(builder.getTokenType())) { + if (!TokenSets.CODE_REFERENCE_ELEMENT_NAME_TOKENS.contains(builder.getTokenType())) { return false; } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/typeDefinitions/ReferenceElement.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/typeDefinitions/ReferenceElement.java index ddfd759b31a3..44cfb76bf8d5 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/typeDefinitions/ReferenceElement.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/typeDefinitions/ReferenceElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ package org.jetbrains.plugins.groovy.lang.parser.parsing.statements.typeDefiniti import com.intellij.codeInsight.completion.CompletionInitializationContext; import com.intellij.lang.PsiBuilder; import com.intellij.psi.tree.IElementType; +import org.jetbrains.plugins.groovy.lang.lexer.TokenSets; import org.jetbrains.plugins.groovy.lang.parser.GroovyElementTypes; import org.jetbrains.plugins.groovy.lang.parser.parsing.types.TypeArguments; import org.jetbrains.plugins.groovy.lang.parser.parsing.util.ParserUtils; @@ -97,7 +98,7 @@ public class ReferenceElement implements GroovyElementTypes { String lastIdentifier = builder.getTokenText(); - if (!ParserUtils.getToken(builder, mIDENT)) { + if (!ParserUtils.getToken(builder, TokenSets.CODE_REFERENCE_ELEMENT_NAME_TOKENS)) { internalTypeMarker.rollbackTo(); return fail; } @@ -127,7 +128,7 @@ public class ReferenceElement implements GroovyElementTypes { lastIdentifier = builder.getTokenText(); - if (!ParserUtils.getToken(builder, mIDENT)) { + if (!ParserUtils.getToken(builder, TokenSets.CODE_REFERENCE_ELEMENT_NAME_TOKENS)) { internalTypeMarker.rollbackTo(); return fail; } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/toplevel/packaging/PackageDefinition.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/toplevel/packaging/PackageDefinition.java index fa6a13e07264..48d539bfd359 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/toplevel/packaging/PackageDefinition.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/toplevel/packaging/PackageDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ package org.jetbrains.plugins.groovy.lang.parser.parsing.toplevel.packaging; import com.intellij.lang.PsiBuilder; import com.intellij.lang.PsiBuilder.Marker; import org.jetbrains.plugins.groovy.GroovyBundle; +import org.jetbrains.plugins.groovy.lang.lexer.TokenSets; import org.jetbrains.plugins.groovy.lang.parser.GroovyElementTypes; import org.jetbrains.plugins.groovy.lang.parser.GroovyParser; import org.jetbrains.plugins.groovy.lang.parser.parsing.auxiliary.modifiers.Modifiers; @@ -40,9 +41,11 @@ public class PackageDefinition implements GroovyElementTypes { pMarker.rollbackTo(); return false; } - if (builder.getTokenType() == mIDENT) { + + if (TokenSets.CODE_REFERENCE_ELEMENT_NAME_TOKENS.contains(builder.getTokenType())) { ReferenceElement.parseForPackage(builder); - } else { + } + else { builder.error(GroovyBundle.message("identifier.expected")); } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrReferenceElementImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrReferenceElementImpl.java index 6ae074d56866..e4ec3da4068e 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrReferenceElementImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrReferenceElementImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.lang.GrReferenceAdjuster; -import org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes; import org.jetbrains.plugins.groovy.lang.parser.GroovyElementTypes; import org.jetbrains.plugins.groovy.lang.psi.GrReferenceElement; import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory; @@ -60,11 +59,6 @@ public abstract class GrReferenceElementImpl extends Groov return null; } - @Nullable - public PsiElement getReferenceNameElement() { - return findChildByType(GroovyTokenTypes.mIDENT); - } - public PsiElement getElement() { return this; } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/types/GrCodeReferenceElementImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/types/GrCodeReferenceElementImpl.java index baea0b8eb846..239e24f42bc7 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/types/GrCodeReferenceElementImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/types/GrCodeReferenceElementImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.lang.completion.GroovyCompletionUtil; import org.jetbrains.plugins.groovy.lang.groovydoc.psi.api.GrDocReferenceElement; +import org.jetbrains.plugins.groovy.lang.lexer.TokenSets; import org.jetbrains.plugins.groovy.lang.parser.GroovyElementTypes; import org.jetbrains.plugins.groovy.lang.psi.GroovyElementVisitor; import org.jetbrains.plugins.groovy.lang.psi.GroovyFile; @@ -92,6 +93,11 @@ public class GrCodeReferenceElementImpl extends GrReferenceElementImplA { - static private class B { - int i - B () { this.i = 42 } - } +class A { +static private class B { +int i +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +B () { this.i = 42 } +} } \ No newline at end of file diff --git a/plugins/groovy/testdata/highlighting/ReassignedHighlighting.groovy b/plugins/groovy/testdata/highlighting/ReassignedHighlighting.groovy index 22ba7339ab32..13e1a4495afa 100644 --- a/plugins/groovy/testdata/highlighting/ReassignedHighlighting.groovy +++ b/plugins/groovy/testdata/highlighting/ReassignedHighlighting.groovy @@ -1,15 +1,30 @@ -def method(int param1, int param2) { - int var1 = 0 - int var2 = 1 - int var3 = 1 - if (param1 == 1) { - param2 = var2 = 2 - var3++ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +def method(int param1, int param2) { +int var1 = 0 +int var2 = 1 +int var3 = 1 +if (param1 == 1) { +param2 = var2 = 2 +var3++ } - println var1 + - var2 + - param1 + - param2 + println var1 + + var2 + +param1 + + param2 } -method(239, 42) \ No newline at end of file +method(239, 42) \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/annotations/classLiteral.test b/plugins/groovy/testdata/parsing/groovy/annotations/classLiteral.test index 15a582580489..f9f1701d9a4f 100644 --- a/plugins/groovy/testdata/parsing/groovy/annotations/classLiteral.test +++ b/plugins/groovy/testdata/parsing/groovy/annotations/classLiteral.test @@ -16,7 +16,7 @@ Groovy script Reference expression PsiElement(identifier)('foo') PsiElement(.)('.') - PsiElement(identifier)('class') + PsiElement(class)('class') PsiElement())(')') PsiElement(new line)('\n') PsiElement(def)('def') diff --git a/plugins/groovy/testdata/parsing/groovy/expressions/path/method/clazz1.test b/plugins/groovy/testdata/parsing/groovy/expressions/path/method/clazz1.test index 7b00da6d057f..e2d193357273 100644 --- a/plugins/groovy/testdata/parsing/groovy/expressions/path/method/clazz1.test +++ b/plugins/groovy/testdata/parsing/groovy/expressions/path/method/clazz1.test @@ -12,4 +12,4 @@ Groovy script PsiElement(Integer)('2') PsiElement())(')') PsiElement(?.)('?.') - PsiElement(identifier)('class') \ No newline at end of file + PsiElement(class)('class') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/expressions/path/method/clazz2.test b/plugins/groovy/testdata/parsing/groovy/expressions/path/method/clazz2.test index 6053265a1f4e..c805f981a0f0 100644 --- a/plugins/groovy/testdata/parsing/groovy/expressions/path/method/clazz2.test +++ b/plugins/groovy/testdata/parsing/groovy/expressions/path/method/clazz2.test @@ -13,7 +13,7 @@ Groovy script PsiElement(Integer)('2') PsiElement())(')') PsiElement(?.)('?.') - PsiElement(identifier)('class') + PsiElement(class)('class') Arguments PsiElement(()('(') Literal diff --git a/plugins/groovy/testdata/parsing/groovy/expressions/path/path10.test b/plugins/groovy/testdata/parsing/groovy/expressions/path/path10.test index 2d6b507182f2..995e8b373e89 100644 --- a/plugins/groovy/testdata/parsing/groovy/expressions/path/path10.test +++ b/plugins/groovy/testdata/parsing/groovy/expressions/path/path10.test @@ -10,4 +10,4 @@ Groovy script 'this' reference expression PsiElement(this)('this') PsiElement(.)('.') - PsiElement(identifier)('final') \ No newline at end of file + PsiElement(final)('final') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/packaging/pack4.test b/plugins/groovy/testdata/parsing/groovy/packaging/pack4.test index dc9bb96feabe..e640b0a94ed6 100644 --- a/plugins/groovy/testdata/parsing/groovy/packaging/pack4.test +++ b/plugins/groovy/testdata/parsing/groovy/packaging/pack4.test @@ -11,6 +11,6 @@ Groovy script Reference element PsiElement(identifier)('a') PsiElement(.)('.') - PsiElement(identifier)('def') + PsiElement(def)('def') PsiElement(.)('.') PsiElement(identifier)('b') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/packaging/pack5.test b/plugins/groovy/testdata/parsing/groovy/packaging/pack5.test index b8ba7afd5001..6d065ed18809 100644 --- a/plugins/groovy/testdata/parsing/groovy/packaging/pack5.test +++ b/plugins/groovy/testdata/parsing/groovy/packaging/pack5.test @@ -10,4 +10,4 @@ Groovy script Reference element PsiElement(identifier)('a') PsiElement(.)('.') - PsiElement(identifier)('def') \ No newline at end of file + PsiElement(def)('def') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/packaging/pack6.test b/plugins/groovy/testdata/parsing/groovy/packaging/pack6.test index 8b00b126b0d7..03a5a7f5796c 100644 --- a/plugins/groovy/testdata/parsing/groovy/packaging/pack6.test +++ b/plugins/groovy/testdata/parsing/groovy/packaging/pack6.test @@ -10,4 +10,4 @@ Groovy script Reference element PsiElement(identifier)('a') PsiElement(.)('.') - PsiElement(identifier)('as') \ No newline at end of file + PsiElement(as)('as') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/packaging/pack7.test b/plugins/groovy/testdata/parsing/groovy/packaging/pack7.test index 573511ec8c5a..d7b5200d0f06 100644 --- a/plugins/groovy/testdata/parsing/groovy/packaging/pack7.test +++ b/plugins/groovy/testdata/parsing/groovy/packaging/pack7.test @@ -7,4 +7,4 @@ Groovy script PsiElement(package)('package') PsiWhiteSpace(' ') Reference element - PsiElement(identifier)('as') \ No newline at end of file + PsiElement(as)('as') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/packaging/pack8.test b/plugins/groovy/testdata/parsing/groovy/packaging/pack8.test index eea087b608bc..23e8c664d534 100644 --- a/plugins/groovy/testdata/parsing/groovy/packaging/pack8.test +++ b/plugins/groovy/testdata/parsing/groovy/packaging/pack8.test @@ -8,6 +8,6 @@ Groovy script PsiWhiteSpace(' ') Reference element Reference element - PsiElement(identifier)('def') + PsiElement(def)('def') PsiElement(.)('.') - PsiElement(identifier)('as') \ No newline at end of file + PsiElement(as)('as') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/statements/typedef/classes/class9.test b/plugins/groovy/testdata/parsing/groovy/statements/typedef/classes/class9.test new file mode 100644 index 000000000000..50d2ad66cc95 --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/statements/typedef/classes/class9.test @@ -0,0 +1,40 @@ +class a extends def.b implements as.foo.def.in.c {} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('a') + PsiWhiteSpace(' ') + Extends clause + PsiElement(extends)('extends') + PsiWhiteSpace(' ') + Reference element + Reference element + PsiElement(def)('def') + PsiElement(.)('.') + PsiElement(identifier)('b') + PsiWhiteSpace(' ') + Implements clause + PsiElement(implements)('implements') + PsiWhiteSpace(' ') + Reference element + Reference element + Reference element + Reference element + Reference element + PsiElement(as)('as') + PsiElement(.)('.') + PsiElement(identifier)('foo') + PsiElement(.)('.') + PsiElement(def)('def') + PsiElement(.)('.') + PsiElement(in)('in') + PsiElement(.)('.') + PsiElement(identifier)('c') + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiElement(})('}') \ No newline at end of file