diff --git a/compiler/frontend/src/org/jetbrains/kotlin/KtNodeTypes.java b/compiler/frontend/src/org/jetbrains/kotlin/KtNodeTypes.java index 57e704170e4..d197df71c1b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/KtNodeTypes.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/KtNodeTypes.java @@ -33,7 +33,6 @@ public interface KtNodeTypes { KtNodeType TYPEDEF = new KtNodeType("TYPEDEF", KtTypedef.class); IElementType OBJECT_DECLARATION = KtStubElementTypes.OBJECT_DECLARATION; - KtNodeType OBJECT_DECLARATION_NAME = new KtNodeType("OBJECT_DECLARATION_NAME", KtObjectDeclarationName.class); IElementType ENUM_ENTRY = KtStubElementTypes.ENUM_ENTRY; IElementType ANONYMOUS_INITIALIZER = KtStubElementTypes.ANONYMOUS_INITIALIZER; diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java index d9ca0c7f494..4ee92dcf1ca 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java @@ -34,7 +34,6 @@ import java.util.Set; import static org.jetbrains.kotlin.KtNodeTypes.*; import static org.jetbrains.kotlin.lexer.KtTokens.*; import static org.jetbrains.kotlin.parsing.JetParsing.AnnotationParsingMode.DEFAULT; -import static org.jetbrains.kotlin.parsing.JetParsing.DeclarationParsingMode.LOCAL; public class JetExpressionParsing extends AbstractJetParsing { private static final TokenSet WHEN_CONDITION_RECOVERY_SET = TokenSet.create(RBRACE, IN_KEYWORD, NOT_IN, IS_KEYWORD, NOT_IS, ELSE_KEYWORD); @@ -1240,7 +1239,7 @@ public class JetExpressionParsing extends AbstractJetParsing { IElementType keywordToken = tt(); IElementType declType = null; if (keywordToken == CLASS_KEYWORD || keywordToken == INTERFACE_KEYWORD) { - declType = myJetParsing.parseClass(isEnum, LOCAL); + declType = myJetParsing.parseClass(isEnum); } else if (keywordToken == FUN_KEYWORD) { declType = myJetParsing.parseFunction(); @@ -1264,7 +1263,7 @@ public class JetExpressionParsing extends AbstractJetParsing { return null; } - myJetParsing.parseObject(NameParsingMode.REQUIRED, true, LOCAL); + myJetParsing.parseObject(NameParsingMode.REQUIRED, true); declType = OBJECT_DECLARATION; } return declType; @@ -1756,7 +1755,7 @@ public class JetExpressionParsing extends AbstractJetParsing { public void parseObjectLiteral() { PsiBuilder.Marker literal = mark(); PsiBuilder.Marker declaration = mark(); - myJetParsing.parseObject(NameParsingMode.PROHIBITED, false, LOCAL); // Body is not optional because of foo(object : A, B) + myJetParsing.parseObject(NameParsingMode.PROHIBITED, false); // Body is not optional because of foo(object : A, B) declaration.done(OBJECT_DECLARATION); literal.done(OBJECT_LITERAL); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java index 23b80eb3fe8..4c41f37ea25 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java @@ -32,7 +32,6 @@ import java.util.Map; import static org.jetbrains.kotlin.KtNodeTypes.*; import static org.jetbrains.kotlin.lexer.KtTokens.*; import static org.jetbrains.kotlin.parsing.JetParsing.AnnotationParsingMode.*; -import static org.jetbrains.kotlin.parsing.JetParsing.DeclarationParsingMode.*; public class JetParsing extends AbstractJetParsing { private static final Logger LOG = Logger.getInstance(JetParsing.class); @@ -400,7 +399,7 @@ public class JetParsing extends AbstractJetParsing { // } // else if (keywordToken == CLASS_KEYWORD || keywordToken == INTERFACE_KEYWORD) { - declType = parseClass(detector.isEnumDetected(), TOP_LEVEL); + declType = parseClass(detector.isEnumDetected()); } else if (keywordToken == FUN_KEYWORD) { declType = parseFunction(); @@ -412,7 +411,7 @@ public class JetParsing extends AbstractJetParsing { declType = parseTypeAlias(); } else if (keywordToken == OBJECT_KEYWORD) { - parseObject(NameParsingMode.REQUIRED, true, TOP_LEVEL); + parseObject(NameParsingMode.REQUIRED, true); declType = OBJECT_DECLARATION; } else if (at(LBRACE)) { @@ -768,8 +767,7 @@ public class JetParsing extends AbstractJetParsing { boolean object, NameParsingMode nameParsingMode, boolean optionalBody, - boolean enumClass, - DeclarationParsingMode declarationParsingMode + boolean enumClass ) { if (object) { assert _at(OBJECT_KEYWORD); @@ -780,9 +778,7 @@ public class JetParsing extends AbstractJetParsing { advance(); // CLASS_KEYWORD, INTERFACE_KEYWORD or OBJECT_KEYWORD if (nameParsingMode == NameParsingMode.REQUIRED) { - OptionalMarker marker = new OptionalMarker(object); expect(IDENTIFIER, "Name expected", CLASS_NAME_RECOVERY_SET); - marker.done(OBJECT_DECLARATION_NAME); } else { assert object : "Must be an object to be nameless"; @@ -792,9 +788,7 @@ public class JetParsing extends AbstractJetParsing { } else { assert nameParsingMode == NameParsingMode.ALLOWED; - PsiBuilder.Marker marker = mark(); advance(); - marker.done(OBJECT_DECLARATION_NAME); } } } @@ -868,12 +862,12 @@ public class JetParsing extends AbstractJetParsing { return object ? OBJECT_DECLARATION : CLASS; } - IElementType parseClass(boolean enumClass, DeclarationParsingMode declarationParsingMode) { - return parseClassOrObject(false, NameParsingMode.REQUIRED, true, enumClass, declarationParsingMode); + IElementType parseClass(boolean enumClass) { + return parseClassOrObject(false, NameParsingMode.REQUIRED, true, enumClass); } - void parseObject(NameParsingMode nameParsingMode, boolean optionalBody, DeclarationParsingMode declarationParsingMode) { - parseClassOrObject(true, nameParsingMode, optionalBody, false, declarationParsingMode); + void parseObject(NameParsingMode nameParsingMode, boolean optionalBody) { + parseClassOrObject(true, nameParsingMode, optionalBody, false); } /* @@ -947,9 +941,7 @@ public class JetParsing extends AbstractJetParsing { parseModifierList(DEFAULT, TokenSet.create(COMMA, SEMICOLON, RBRACE)); if (!atSet(SOFT_KEYWORDS_AT_MEMBER_START) && at(IDENTIFIER)) { - PsiBuilder.Marker nameAsDeclaration = mark(); advance(); // IDENTIFIER - nameAsDeclaration.done(OBJECT_DECLARATION_NAME); if (at(LPAR)) { // Arguments should be parsed here @@ -1068,7 +1060,7 @@ public class JetParsing extends AbstractJetParsing { IElementType keywordToken = tt(); IElementType declType = null; if (keywordToken == CLASS_KEYWORD || keywordToken == INTERFACE_KEYWORD) { - declType = parseClass(isEnum, CLASS_MEMBER); + declType = parseClass(isEnum); } else if (keywordToken == FUN_KEYWORD) { declType = parseFunction(); @@ -1080,7 +1072,7 @@ public class JetParsing extends AbstractJetParsing { declType = parseTypeAlias(); } else if (keywordToken == OBJECT_KEYWORD) { - parseObject(isDefault ? NameParsingMode.ALLOWED : NameParsingMode.REQUIRED, true, CLASS_MEMBER); + parseObject(isDefault ? NameParsingMode.ALLOWED : NameParsingMode.REQUIRED, true); declType = OBJECT_DECLARATION; } else if (at(INIT_KEYWORD)) { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtClassOrObject.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtClassOrObject.kt index 6e3e747ca3e..09b7601c894 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtClassOrObject.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtClassOrObject.kt @@ -63,9 +63,6 @@ abstract public class KtClassOrObject : public fun getAnonymousInitializers(): List = getBody()?.anonymousInitializers.orEmpty() - public fun getNameAsDeclaration(): KtObjectDeclarationName? = - findChildByType(KtNodeTypes.OBJECT_DECLARATION_NAME) as KtObjectDeclarationName? - public fun getBody(): KtClassBody? = getStubOrPsiChild(KtStubElementTypes.CLASS_BODY) public fun getOrCreateBody(): KtClassBody = getBody() ?: add(KtPsiFactory(this).createEmptyClassBody()) as KtClassBody diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtEnumEntry.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtEnumEntry.java index 34e64eb1ea9..68ebc2bcc15 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtEnumEntry.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtEnumEntry.java @@ -40,29 +40,6 @@ public class KtEnumEntry extends KtClass { super(stub); } - @Override - public String getName() { - KotlinClassOrObjectStub classStub = getStub(); - if (classStub != null) { - return classStub.getName(); - } - - KtObjectDeclarationName nameAsDeclaration = getNameAsDeclaration(); - return nameAsDeclaration == null ? "" : nameAsDeclaration.getName(); - } - - @Override - public PsiElement getNameIdentifier() { - KtObjectDeclarationName nameAsDeclaration = getNameAsDeclaration(); - return nameAsDeclaration == null ? null : nameAsDeclaration.getNameIdentifier(); - } - - @Override - public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException { - KtObjectDeclarationName nameAsDeclaration = getNameAsDeclaration(); - return nameAsDeclaration == null ? null : nameAsDeclaration.setName(name); - } - @NotNull @Override public List getDelegationSpecifiers() { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtObjectDeclaration.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtObjectDeclaration.kt index 83f683bed81..e53ed0de1fc 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtObjectDeclaration.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtObjectDeclaration.kt @@ -32,29 +32,26 @@ public class KtObjectDeclaration : KtClassOrObject { get() = stub as? KotlinObjectStub override fun getName(): String? { - _stub?.name?.let { return it } + super.getName()?.let { return it } - val nameAsDeclaration = getNameAsDeclaration() - if (nameAsDeclaration == null && isCompanion()) { + if (isCompanion() && !isTopLevel()) { //NOTE: a hack in PSI that simplifies writing frontend code return SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT.toString() } - return nameAsDeclaration?.name + + return null } - override fun getNameIdentifier(): PsiElement? = getNameAsDeclaration()?.nameIdentifier - override fun setName(@NonNls name: String): PsiElement { - val declarationName = getNameAsDeclaration() - if (declarationName == null) { + if (nameIdentifier == null) { val psiFactory = KtPsiFactory(project) - val result = addAfter(psiFactory.createObjectDeclarationName(name), getObjectKeyword()) + val result = addAfter(psiFactory.createIdentifier(name), getObjectKeyword()) addAfter(psiFactory.createWhiteSpace(), getObjectKeyword()) return result } else { - return declarationName.setName(name) + return super.setName(name) } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtObjectDeclarationName.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtObjectDeclarationName.java deleted file mode 100644 index 57317f7e932..00000000000 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtObjectDeclarationName.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2010-2015 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. - */ - -package org.jetbrains.kotlin.psi; - -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.search.SearchScope; -import com.intellij.psi.util.PsiTreeUtil; -import com.intellij.util.IncorrectOperationException; -import org.jetbrains.annotations.NonNls; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.kotlin.lexer.KtTokens; - -import static org.jetbrains.kotlin.psi.KtPsiFactoryKt.KtPsiFactory; - -public class KtObjectDeclarationName extends KtExpressionImpl { - public KtObjectDeclarationName(@NotNull ASTNode node) { - super(node); - } - - @Override - @Nullable - public String getName() { - PsiElement identifier = getNameIdentifier(); - if (identifier != null) { - String text = identifier.getText(); - return text != null ? KtPsiUtil.unquoteIdentifier(text) : null; - } - else { - return null; - } - } - - public PsiElement getNameIdentifier() { - return findChildByType(KtTokens.IDENTIFIER); - } - - public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException { - return getNameIdentifier().replace(KtPsiFactory(this).createNameIdentifier(name)); - } - - @Override - public int getTextOffset() { - PsiElement identifier = getNameIdentifier(); - return identifier != null ? identifier.getTextRange().getStartOffset() : getTextRange().getStartOffset(); - } - - @Override - public R accept(@NotNull KtVisitor visitor, D data) { - return visitor.visitObjectDeclarationName(this, data); - } - - @NotNull - @Override - public SearchScope getUseScope() { - KtObjectDeclaration objectDeclaration = PsiTreeUtil.getParentOfType(this, KtObjectDeclaration.class); - return objectDeclaration != null ? objectDeclaration.getUseScope() : super.getUseScope(); - } -} diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt index 9cb319b0433..64cd682ec18 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt @@ -201,10 +201,6 @@ public class KtPsiFactory(private val project: Project) { return (createExpression("0 $name 0") as KtBinaryExpression).getOperationReference() } - public fun createObjectDeclarationName(name: String): KtObjectDeclarationName { - return createDeclaration("object $name").getNameAsDeclaration()!! - } - public fun createIdentifier(name: String): PsiElement { return createSimpleName(name).getIdentifier()!! } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitor.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitor.java index 8db17d51c47..5f9def0902f 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitor.java @@ -414,10 +414,6 @@ public class KtVisitor extends PsiElementVisitor { return visitJetElement(condition, data); } - public R visitObjectDeclarationName(@NotNull KtObjectDeclarationName declarationName, D data) { - return visitExpression(declarationName, data); - } - public R visitStringTemplateEntry(@NotNull KtStringTemplateEntry entry, D data) { return visitJetElement(entry, data); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java index 55c4f946588..921204a52c5 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java @@ -401,10 +401,6 @@ public class KtVisitorVoid extends KtVisitor { super.visitObjectDeclaration(declaration, null); } - public void visitObjectDeclarationName(@NotNull KtObjectDeclarationName declarationName) { - super.visitObjectDeclarationName(declarationName, null); - } - public void visitStringTemplateEntry(@NotNull KtStringTemplateEntry entry) { super.visitStringTemplateEntry(entry, null); } @@ -1006,12 +1002,6 @@ public class KtVisitorVoid extends KtVisitor { return null; } - @Override - public final Void visitObjectDeclarationName(@NotNull KtObjectDeclarationName declarationName, Void data) { - visitObjectDeclarationName(declarationName); - return null; - } - @Override public final Void visitStringTemplateEntry(@NotNull KtStringTemplateEntry entry, Void data) { visitStringTemplateEntry(entry); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoidWithParameter.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoidWithParameter.java index b84b5810899..438b6b01de0 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoidWithParameter.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoidWithParameter.java @@ -398,10 +398,6 @@ public class KtVisitorVoidWithParameter

extends KtVisitor { super.visitObjectDeclaration(declaration, data); } - public void visitObjectDeclarationNameVoid(@NotNull KtObjectDeclarationName declarationName, P data) { - super.visitObjectDeclarationName(declarationName, data); - } - public void visitStringTemplateEntryVoid(@NotNull KtStringTemplateEntry entry, P data) { super.visitStringTemplateEntry(entry, data); } @@ -981,12 +977,6 @@ public class KtVisitorVoidWithParameter

extends KtVisitor { return null; } - @Override - public final Void visitObjectDeclarationName(@NotNull KtObjectDeclarationName declarationName, P data) { - visitObjectDeclarationNameVoid(declarationName, data); - return null; - } - @Override public final Void visitStringTemplateEntry(@NotNull KtStringTemplateEntry entry, P data) { visitStringTemplateEntryVoid(entry, data); diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/missingNames.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/missingNames.kt index 0c666777f67..751d8489e2a 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/missingNames.kt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/missingNames.kt @@ -13,7 +13,7 @@ class { } -object { +object { } @@ -40,7 +40,7 @@ class Outer { } - object { + object { } diff --git a/compiler/testData/diagnostics/tests/recovery/namelessToplevelDeclarations.kt b/compiler/testData/diagnostics/tests/recovery/namelessToplevelDeclarations.kt index 8736f3d1155..7b317d75391 100644 --- a/compiler/testData/diagnostics/tests/recovery/namelessToplevelDeclarations.kt +++ b/compiler/testData/diagnostics/tests/recovery/namelessToplevelDeclarations.kt @@ -17,7 +17,7 @@ interface { } -object { +object { } diff --git a/compiler/testData/psi/CommentsBinding.txt b/compiler/testData/psi/CommentsBinding.txt index 8dea4cf4ce5..e2ae566e2a9 100644 --- a/compiler/testData/psi/CommentsBinding.txt +++ b/compiler/testData/psi/CommentsBinding.txt @@ -350,8 +350,7 @@ JetFile: CommentsBinding.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('A') + PsiElement(IDENTIFIER)('A') PsiElement(COMMA)(',') PsiWhiteSpace(' ') PsiComment(EOL_COMMENT)('// this is A') @@ -363,15 +362,13 @@ JetFile: CommentsBinding.kt PsiElement(KDOC_TEXT)(' This is B ') PsiElement(KDOC_END)('*/') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('B') + PsiElement(IDENTIFIER)('B') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY PsiComment(BLOCK_COMMENT)('/* And this is C */') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('C') + PsiElement(IDENTIFIER)('C') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY @@ -381,8 +378,7 @@ JetFile: CommentsBinding.kt PsiElement(KDOC_TEXT)(' This is X ') PsiElement(KDOC_END)('*/') PsiWhiteSpace('\n ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('X') + PsiElement(IDENTIFIER)('X') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/DefaultKeyword.txt b/compiler/testData/psi/DefaultKeyword.txt index c67863b7ada..09b92129526 100644 --- a/compiler/testData/psi/DefaultKeyword.txt +++ b/compiler/testData/psi/DefaultKeyword.txt @@ -72,8 +72,7 @@ JetFile: DefaultKeyword.kt PsiWhiteSpace(' ') PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('A') + PsiElement(IDENTIFIER)('A') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -96,8 +95,7 @@ JetFile: DefaultKeyword.kt PsiWhiteSpace(' ') PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('A') + PsiElement(IDENTIFIER)('A') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -123,8 +121,7 @@ JetFile: DefaultKeyword.kt PsiWhiteSpace(' ') PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('B') + PsiElement(IDENTIFIER)('B') PsiWhiteSpace('\n') OBJECT_DECLARATION PsiComment(EOL_COMMENT)('//should be error') @@ -133,10 +130,9 @@ JetFile: DefaultKeyword.kt PsiElement(companion)('companion') PsiWhiteSpace(' ') PsiElement(object)('object') + PsiErrorElement:Name expected + PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiErrorElement:Name expected - CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n\n') @@ -145,8 +141,7 @@ JetFile: DefaultKeyword.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('A') + PsiElement(IDENTIFIER)('A') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -187,8 +182,7 @@ JetFile: DefaultKeyword.kt PsiWhiteSpace(' ') PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('C') + PsiElement(IDENTIFIER)('C') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -217,13 +211,11 @@ JetFile: DefaultKeyword.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('A') + PsiElement(IDENTIFIER)('A') PsiElement(COMMA)(',') PsiWhiteSpace(' ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('B') + PsiElement(IDENTIFIER)('B') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') OBJECT_DECLARATION @@ -251,10 +243,9 @@ JetFile: DefaultKeyword.kt PsiWhiteSpace(' ') OBJECT_DECLARATION PsiElement(object)('object') - PsiWhiteSpace('\n') - OBJECT_DECLARATION_NAME - PsiErrorElement:Name expected - + PsiErrorElement:Name expected + + PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n') CLASS @@ -326,13 +317,11 @@ JetFile: DefaultKeyword.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('A') + PsiElement(IDENTIFIER)('A') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('B') + PsiElement(IDENTIFIER)('B') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') OBJECT_DECLARATION @@ -355,13 +344,11 @@ JetFile: DefaultKeyword.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('A') + PsiElement(IDENTIFIER)('A') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('B') + PsiElement(IDENTIFIER)('B') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') OBJECT_DECLARATION @@ -374,4 +361,4 @@ JetFile: DefaultKeyword.kt PsiElement(LBRACE)('{') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumCommas.txt b/compiler/testData/psi/EnumCommas.txt index 2dfea90d695..a9c65488b09 100644 --- a/compiler/testData/psi/EnumCommas.txt +++ b/compiler/testData/psi/EnumCommas.txt @@ -15,25 +15,21 @@ JetFile: EnumCommas.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('NORTH') + PsiElement(IDENTIFIER)('NORTH') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('SOUTH') + PsiElement(IDENTIFIER)('SOUTH') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('WEST') + PsiElement(IDENTIFIER)('WEST') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('EAST') + PsiElement(IDENTIFIER)('EAST') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntryCommaAnnotatedMember.txt b/compiler/testData/psi/EnumEntryCommaAnnotatedMember.txt index ffa1694e364..f01d3ef7c5d 100644 --- a/compiler/testData/psi/EnumEntryCommaAnnotatedMember.txt +++ b/compiler/testData/psi/EnumEntryCommaAnnotatedMember.txt @@ -15,8 +15,7 @@ JetFile: EnumEntryCommaAnnotatedMember.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') + PsiElement(IDENTIFIER)('FIRST') PsiElement(COMMA)(',') PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body diff --git a/compiler/testData/psi/EnumEntryCommaInlineMember.txt b/compiler/testData/psi/EnumEntryCommaInlineMember.txt index 097f02268aa..55fcc1d91c9 100644 --- a/compiler/testData/psi/EnumEntryCommaInlineMember.txt +++ b/compiler/testData/psi/EnumEntryCommaInlineMember.txt @@ -15,8 +15,7 @@ JetFile: EnumEntryCommaInlineMember.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') + PsiElement(IDENTIFIER)('FIRST') PsiElement(COMMA)(',') PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body diff --git a/compiler/testData/psi/EnumEntryCommaMember.txt b/compiler/testData/psi/EnumEntryCommaMember.txt index 26f54245c84..db8deea6389 100644 --- a/compiler/testData/psi/EnumEntryCommaMember.txt +++ b/compiler/testData/psi/EnumEntryCommaMember.txt @@ -15,8 +15,7 @@ JetFile: EnumEntryCommaMember.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') + PsiElement(IDENTIFIER)('FIRST') PsiElement(COMMA)(',') PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body diff --git a/compiler/testData/psi/EnumEntryCommaPublicMember.txt b/compiler/testData/psi/EnumEntryCommaPublicMember.txt index d38ce592aeb..94d1b1121f5 100644 --- a/compiler/testData/psi/EnumEntryCommaPublicMember.txt +++ b/compiler/testData/psi/EnumEntryCommaPublicMember.txt @@ -15,8 +15,7 @@ JetFile: EnumEntryCommaPublicMember.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') + PsiElement(IDENTIFIER)('FIRST') PsiElement(COMMA)(',') PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body diff --git a/compiler/testData/psi/EnumEntrySemicolonInlineMember.txt b/compiler/testData/psi/EnumEntrySemicolonInlineMember.txt index e0d712e96be..18e8b015bc0 100644 --- a/compiler/testData/psi/EnumEntrySemicolonInlineMember.txt +++ b/compiler/testData/psi/EnumEntrySemicolonInlineMember.txt @@ -15,8 +15,7 @@ JetFile: EnumEntrySemicolonInlineMember.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') + PsiElement(IDENTIFIER)('FIRST') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') FUN diff --git a/compiler/testData/psi/EnumEntrySemicolonMember.txt b/compiler/testData/psi/EnumEntrySemicolonMember.txt index 397c03a248a..8129bc9a241 100644 --- a/compiler/testData/psi/EnumEntrySemicolonMember.txt +++ b/compiler/testData/psi/EnumEntrySemicolonMember.txt @@ -15,8 +15,7 @@ JetFile: EnumEntrySemicolonMember.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') + PsiElement(IDENTIFIER)('FIRST') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') FUN diff --git a/compiler/testData/psi/EnumEntrySpaceInlineMember.txt b/compiler/testData/psi/EnumEntrySpaceInlineMember.txt index 6ca12da8cf4..9821366d00a 100644 --- a/compiler/testData/psi/EnumEntrySpaceInlineMember.txt +++ b/compiler/testData/psi/EnumEntrySpaceInlineMember.txt @@ -15,8 +15,7 @@ JetFile: EnumEntrySpaceInlineMember.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') + PsiElement(IDENTIFIER)('FIRST') PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body PsiWhiteSpace('\n\n ') diff --git a/compiler/testData/psi/EnumEntrySpaceMember.txt b/compiler/testData/psi/EnumEntrySpaceMember.txt index b76fbd6f5b0..9854aa07c3b 100644 --- a/compiler/testData/psi/EnumEntrySpaceMember.txt +++ b/compiler/testData/psi/EnumEntrySpaceMember.txt @@ -15,8 +15,7 @@ JetFile: EnumEntrySpaceMember.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') + PsiElement(IDENTIFIER)('FIRST') PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body PsiWhiteSpace('\n\n ') diff --git a/compiler/testData/psi/EnumEntryTwoCommas.txt b/compiler/testData/psi/EnumEntryTwoCommas.txt index d7bdfd26621..88637c68643 100644 --- a/compiler/testData/psi/EnumEntryTwoCommas.txt +++ b/compiler/testData/psi/EnumEntryTwoCommas.txt @@ -15,8 +15,7 @@ JetFile: EnumEntryTwoCommas.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') + PsiElement(IDENTIFIER)('FIRST') PsiElement(COMMA)(',') PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body diff --git a/compiler/testData/psi/EnumIn.txt b/compiler/testData/psi/EnumIn.txt index d55855a9547..8d65a84c4b0 100644 --- a/compiler/testData/psi/EnumIn.txt +++ b/compiler/testData/psi/EnumIn.txt @@ -15,7 +15,6 @@ JetFile: EnumIn.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('`in`') + PsiElement(IDENTIFIER)('`in`') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumInline.txt b/compiler/testData/psi/EnumInline.txt index b4662bbbb8f..574b6e2af53 100644 --- a/compiler/testData/psi/EnumInline.txt +++ b/compiler/testData/psi/EnumInline.txt @@ -15,7 +15,6 @@ JetFile: EnumInline.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('inline') + PsiElement(IDENTIFIER)('inline') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumInlinePublic.txt b/compiler/testData/psi/EnumInlinePublic.txt index 1fe482a0475..e3268a0b2a3 100644 --- a/compiler/testData/psi/EnumInlinePublic.txt +++ b/compiler/testData/psi/EnumInlinePublic.txt @@ -18,16 +18,14 @@ JetFile: EnumInlinePublic.kt MODIFIER_LIST PsiElement(inline)('inline') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('public') + PsiElement(IDENTIFIER)('public') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY MODIFIER_LIST PsiElement(inner)('inner') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('private') + PsiElement(IDENTIFIER)('private') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') OBJECT_DECLARATION diff --git a/compiler/testData/psi/EnumMissingName.txt b/compiler/testData/psi/EnumMissingName.txt index 1f86dee5abe..e822f91743c 100644 --- a/compiler/testData/psi/EnumMissingName.txt +++ b/compiler/testData/psi/EnumMissingName.txt @@ -32,8 +32,7 @@ JetFile: EnumMissingName.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('RED') + PsiElement(IDENTIFIER)('RED') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -50,8 +49,7 @@ JetFile: EnumMissingName.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('GREEN') + PsiElement(IDENTIFIER)('GREEN') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -68,8 +66,7 @@ JetFile: EnumMissingName.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('BLUE') + PsiElement(IDENTIFIER)('BLUE') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -84,4 +81,4 @@ JetFile: EnumMissingName.kt PsiElement(INTEGER_LITERAL)('0x0000FF') PsiElement(RPAR)(')') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumOldConstructorSyntax.txt b/compiler/testData/psi/EnumOldConstructorSyntax.txt index 9dedd8c7209..06863e8549d 100644 --- a/compiler/testData/psi/EnumOldConstructorSyntax.txt +++ b/compiler/testData/psi/EnumOldConstructorSyntax.txt @@ -27,8 +27,7 @@ JetFile: EnumOldConstructorSyntax.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') + PsiElement(IDENTIFIER)('FIRST') PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body PsiErrorElement:Expecting member declaration diff --git a/compiler/testData/psi/EnumShortCommas.txt b/compiler/testData/psi/EnumShortCommas.txt index 12e96835f97..f122fdda890 100644 --- a/compiler/testData/psi/EnumShortCommas.txt +++ b/compiler/testData/psi/EnumShortCommas.txt @@ -30,8 +30,7 @@ JetFile: EnumShortCommas.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('RED') + PsiElement(IDENTIFIER)('RED') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -48,8 +47,7 @@ JetFile: EnumShortCommas.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('GREEN') + PsiElement(IDENTIFIER)('GREEN') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -66,8 +64,7 @@ JetFile: EnumShortCommas.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('BLUE') + PsiElement(IDENTIFIER)('BLUE') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -85,4 +82,4 @@ JetFile: EnumShortCommas.kt PsiWhiteSpace('\n ') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumShortWithOverload.txt b/compiler/testData/psi/EnumShortWithOverload.txt index 40a4ee8b285..e2f59a863cd 100644 --- a/compiler/testData/psi/EnumShortWithOverload.txt +++ b/compiler/testData/psi/EnumShortWithOverload.txt @@ -30,8 +30,7 @@ JetFile: EnumShortWithOverload.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('RED') + PsiElement(IDENTIFIER)('RED') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -81,8 +80,7 @@ JetFile: EnumShortWithOverload.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('GREEN') + PsiElement(IDENTIFIER)('GREEN') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -132,8 +130,7 @@ JetFile: EnumShortWithOverload.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('BLUE') + PsiElement(IDENTIFIER)('BLUE') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -199,4 +196,4 @@ JetFile: EnumShortWithOverload.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Int') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumWithAnnotationKeyword.txt b/compiler/testData/psi/EnumWithAnnotationKeyword.txt index a8f72363cfa..9a62bcddae4 100644 --- a/compiler/testData/psi/EnumWithAnnotationKeyword.txt +++ b/compiler/testData/psi/EnumWithAnnotationKeyword.txt @@ -19,8 +19,7 @@ JetFile: EnumWithAnnotationKeyword.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('D') + PsiElement(IDENTIFIER)('D') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n') diff --git a/compiler/testData/psi/Enums.txt b/compiler/testData/psi/Enums.txt index eef959a71aa..4251b46fce4 100644 --- a/compiler/testData/psi/Enums.txt +++ b/compiler/testData/psi/Enums.txt @@ -30,8 +30,7 @@ JetFile: Enums.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('RED') + PsiElement(IDENTIFIER)('RED') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -48,8 +47,7 @@ JetFile: Enums.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('GREEN') + PsiElement(IDENTIFIER)('GREEN') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -66,8 +64,7 @@ JetFile: Enums.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('BLUE') + PsiElement(IDENTIFIER)('BLUE') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/InterfaceWithEnumKeyword.txt b/compiler/testData/psi/InterfaceWithEnumKeyword.txt index aed6fe37c58..0044e879e17 100644 --- a/compiler/testData/psi/InterfaceWithEnumKeyword.txt +++ b/compiler/testData/psi/InterfaceWithEnumKeyword.txt @@ -54,7 +54,6 @@ JetFile: InterfaceWithEnumKeyword.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('D') + PsiElement(IDENTIFIER)('D') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/NamedClassObject.txt b/compiler/testData/psi/NamedClassObject.txt index f59cbf3b72a..a6c0af4731c 100644 --- a/compiler/testData/psi/NamedClassObject.txt +++ b/compiler/testData/psi/NamedClassObject.txt @@ -17,8 +17,7 @@ JetFile: NamedClassObject.kt PsiWhiteSpace(' ') PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Companion') + PsiElement(IDENTIFIER)('Companion') PsiWhiteSpace('\n\n ') OBJECT_DECLARATION MODIFIER_LIST @@ -26,8 +25,7 @@ JetFile: NamedClassObject.kt PsiWhiteSpace(' ') PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('B') + PsiElement(IDENTIFIER)('B') PsiWhiteSpace('\n\n ') OBJECT_DECLARATION MODIFIER_LIST @@ -35,8 +33,7 @@ JetFile: NamedClassObject.kt PsiWhiteSpace(' ') PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('C') + PsiElement(IDENTIFIER)('C') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -51,7 +48,6 @@ JetFile: NamedClassObject.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('C') + PsiElement(IDENTIFIER)('C') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/SimpleClassMembers.txt b/compiler/testData/psi/SimpleClassMembers.txt index cc0389820e5..6564e65be28 100644 --- a/compiler/testData/psi/SimpleClassMembers.txt +++ b/compiler/testData/psi/SimpleClassMembers.txt @@ -22,8 +22,7 @@ JetFile: SimpleClassMembers.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('foo') + PsiElement(IDENTIFIER)('foo') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -82,8 +81,7 @@ JetFile: SimpleClassMembers.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('foo') + PsiElement(IDENTIFIER)('foo') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -401,4 +399,4 @@ JetFile: SimpleClassMembers.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace('\n\n\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/annotation/ShortAnnotations.txt b/compiler/testData/psi/annotation/ShortAnnotations.txt index e4ab36f3484..581ed451c85 100644 --- a/compiler/testData/psi/annotation/ShortAnnotations.txt +++ b/compiler/testData/psi/annotation/ShortAnnotations.txt @@ -107,8 +107,7 @@ JetFile: ShortAnnotations.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('B') + PsiElement(IDENTIFIER)('B') PsiWhiteSpace('\n') PsiErrorElement:Expecting a top level declaration PsiElement(IDENTIFIER)('foo') @@ -404,8 +403,7 @@ JetFile: ShortAnnotations.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('B') + PsiElement(IDENTIFIER)('B') PsiWhiteSpace('\n ') PsiErrorElement:Expecting member declaration PsiElement(IDENTIFIER)('foo') @@ -780,4 +778,4 @@ JetFile: ShortAnnotations.kt PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/annotation/at/enumEntries.txt b/compiler/testData/psi/annotation/at/enumEntries.txt index 7a8fe367523..cc919bd2aa0 100644 --- a/compiler/testData/psi/annotation/at/enumEntries.txt +++ b/compiler/testData/psi/annotation/at/enumEntries.txt @@ -41,8 +41,7 @@ JetFile: enumEntries.kt PsiElement(INTEGER_LITERAL)('1') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('X') + PsiElement(IDENTIFIER)('X') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -65,8 +64,7 @@ JetFile: enumEntries.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Ann') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Y') + PsiElement(IDENTIFIER)('Y') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -98,8 +96,7 @@ JetFile: enumEntries.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Z') + PsiElement(IDENTIFIER)('Z') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -130,8 +127,7 @@ JetFile: enumEntries.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('private') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Q') + PsiElement(IDENTIFIER)('Q') PsiElement(COMMA)(',') PsiWhiteSpace('\n\n ') ENUM_ENTRY @@ -149,8 +145,7 @@ JetFile: enumEntries.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('W') + PsiElement(IDENTIFIER)('W') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') FUN @@ -174,4 +169,4 @@ JetFile: enumEntries.kt PsiElement(LBRACE)('{') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/annotation/at/validDeclarations.txt b/compiler/testData/psi/annotation/at/validDeclarations.txt index 37b7607334d..4a59784dbae 100644 --- a/compiler/testData/psi/annotation/at/validDeclarations.txt +++ b/compiler/testData/psi/annotation/at/validDeclarations.txt @@ -471,9 +471,8 @@ JetFile: validDeclarations.kt PsiWhiteSpace(' ') PsiElement(object)('object') PsiWhiteSpace('\n\n ') - OBJECT_DECLARATION_NAME - PsiErrorElement:Name expected - PsiElement(AT)('@') + PsiErrorElement:Name expected + PsiElement(AT)('@') OBJECT_DECLARATION MODIFIER_LIST PsiElement(companion)('companion') @@ -488,8 +487,7 @@ JetFile: validDeclarations.kt PsiWhiteSpace(' ') PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('B') + PsiElement(IDENTIFIER)('B') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') SECONDARY_CONSTRUCTOR @@ -661,4 +659,4 @@ JetFile: validDeclarations.kt PsiElement(LBRACE)('{') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/examples/AnonymousObjects.txt b/compiler/testData/psi/examples/AnonymousObjects.txt index 100b8c39967..c86781f801c 100644 --- a/compiler/testData/psi/examples/AnonymousObjects.txt +++ b/compiler/testData/psi/examples/AnonymousObjects.txt @@ -137,13 +137,11 @@ JetFile: AnonymousObjects.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('TOO_MANY_CLICKS') + PsiElement(IDENTIFIER)('TOO_MANY_CLICKS') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('ONE_MORE_MESSAGE') + PsiElement(IDENTIFIER)('ONE_MORE_MESSAGE') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n') @@ -202,4 +200,4 @@ JetFile: AnonymousObjects.kt PsiElement(RBRACE)('}') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/examples/Color.txt b/compiler/testData/psi/examples/Color.txt index 606c94897e5..2f6b1ab6b3b 100644 --- a/compiler/testData/psi/examples/Color.txt +++ b/compiler/testData/psi/examples/Color.txt @@ -56,8 +56,7 @@ JetFile: Color.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('RED') + PsiElement(IDENTIFIER)('RED') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -84,8 +83,7 @@ JetFile: Color.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('GREEN') + PsiElement(IDENTIFIER)('GREEN') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -112,8 +110,7 @@ JetFile: Color.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('BLUE') + PsiElement(IDENTIFIER)('BLUE') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -138,4 +135,4 @@ JetFile: Color.kt PsiElement(INTEGER_LITERAL)('255') PsiElement(RPAR)(')') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/examples/util/Comparison.txt b/compiler/testData/psi/examples/util/Comparison.txt index 36f67392a75..a1e830e8e36 100644 --- a/compiler/testData/psi/examples/util/Comparison.txt +++ b/compiler/testData/psi/examples/util/Comparison.txt @@ -217,18 +217,15 @@ JetFile: Comparison.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('LS') + PsiElement(IDENTIFIER)('LS') PsiElement(COMMA)(',') PsiWhiteSpace(' ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('EQ') + PsiElement(IDENTIFIER)('EQ') PsiElement(COMMA)(',') PsiWhiteSpace(' ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('GR') + PsiElement(IDENTIFIER)('GR') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') @@ -420,4 +417,4 @@ JetFile: Comparison.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('GR') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/namelessObjectAsEnumMember.txt b/compiler/testData/psi/namelessObjectAsEnumMember.txt index eeb7dfed716..ec353686d82 100644 --- a/compiler/testData/psi/namelessObjectAsEnumMember.txt +++ b/compiler/testData/psi/namelessObjectAsEnumMember.txt @@ -19,13 +19,11 @@ JetFile: namelessObjectAsEnumMember.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('A') + PsiElement(IDENTIFIER)('A') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('B') + PsiElement(IDENTIFIER)('B') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') OBJECT_DECLARATION @@ -33,8 +31,7 @@ JetFile: namelessObjectAsEnumMember.kt PsiElement(inner)('inner') PsiWhiteSpace(' ') PsiElement(object)('object') - PsiWhiteSpace('\n') - OBJECT_DECLARATION_NAME - PsiErrorElement:Name expected - - PsiElement(RBRACE)('}') + PsiErrorElement:Name expected + + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/primaryConstructor/nestedClassAmbiguity.txt b/compiler/testData/psi/primaryConstructor/nestedClassAmbiguity.txt index d9d26f2ef0e..469dbcce0a2 100644 --- a/compiler/testData/psi/primaryConstructor/nestedClassAmbiguity.txt +++ b/compiler/testData/psi/primaryConstructor/nestedClassAmbiguity.txt @@ -130,8 +130,7 @@ JetFile: nestedClassAmbiguity.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Nested4') + PsiElement(IDENTIFIER)('Nested4') PsiWhiteSpace('\n ') PRIMARY_CONSTRUCTOR PsiElement(constructor)('constructor') @@ -146,8 +145,7 @@ JetFile: nestedClassAmbiguity.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Nested5') + PsiElement(IDENTIFIER)('Nested5') PsiWhiteSpace(' ') PRIMARY_CONSTRUCTOR MODIFIER_LIST @@ -179,8 +177,7 @@ JetFile: nestedClassAmbiguity.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('TopLevel') + PsiElement(IDENTIFIER)('TopLevel') PsiWhiteSpace(' ') PRIMARY_CONSTRUCTOR PsiElement(constructor)('constructor') @@ -213,4 +210,4 @@ JetFile: nestedClassAmbiguity.kt PsiElement(LBRACE)('{') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/recovery/ImportRecovery.txt b/compiler/testData/psi/recovery/ImportRecovery.txt index 33d68ffa6ee..da62f9ef9d0 100644 --- a/compiler/testData/psi/recovery/ImportRecovery.txt +++ b/compiler/testData/psi/recovery/ImportRecovery.txt @@ -22,8 +22,7 @@ JetFile: ImportRecovery.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('StyleSheetOrigin') + PsiElement(IDENTIFIER)('StyleSheetOrigin') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt b/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt index 6b8500aa694..4d78788b60d 100644 --- a/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt +++ b/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt @@ -6,8 +6,7 @@ JetFile: ConstructorModifiers.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace(' ') PRIMARY_CONSTRUCTOR MODIFIER_LIST @@ -20,8 +19,7 @@ JetFile: ConstructorModifiers.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace(' ') PRIMARY_CONSTRUCTOR MODIFIER_LIST @@ -38,8 +36,7 @@ JetFile: ConstructorModifiers.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace(' ') PRIMARY_CONSTRUCTOR MODIFIER_LIST @@ -66,8 +63,7 @@ JetFile: ConstructorModifiers.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace(' ') PRIMARY_CONSTRUCTOR MODIFIER_LIST @@ -100,4 +96,4 @@ JetFile: ConstructorModifiers.kt PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/declarations/EmptyParentheses.txt b/compiler/testData/psi/recovery/objects/declarations/EmptyParentheses.txt index faeb4ea5ab1..f724cace0f6 100644 --- a/compiler/testData/psi/recovery/objects/declarations/EmptyParentheses.txt +++ b/compiler/testData/psi/recovery/objects/declarations/EmptyParentheses.txt @@ -6,8 +6,7 @@ JetFile: EmptyParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PRIMARY_CONSTRUCTOR VALUE_PARAMETER_LIST PsiElement(LPAR)('(') @@ -16,8 +15,7 @@ JetFile: EmptyParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PRIMARY_CONSTRUCTOR VALUE_PARAMETER_LIST PsiElement(LPAR)('(') @@ -30,8 +28,7 @@ JetFile: EmptyParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PRIMARY_CONSTRUCTOR VALUE_PARAMETER_LIST PsiElement(LPAR)('(') @@ -49,4 +46,4 @@ JetFile: EmptyParentheses.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/declarations/Everything.txt b/compiler/testData/psi/recovery/objects/declarations/Everything.txt index dc92e4452ad..fb04ad89c41 100644 --- a/compiler/testData/psi/recovery/objects/declarations/Everything.txt +++ b/compiler/testData/psi/recovery/objects/declarations/Everything.txt @@ -6,8 +6,7 @@ JetFile: Everything.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Type parameters are not allowed for objects TYPE_PARAMETER_LIST PsiElement(LT)('<') @@ -76,4 +75,4 @@ JetFile: Everything.kt PsiElement(LBRACE)('{') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/declarations/FollowedByModifiers.txt b/compiler/testData/psi/recovery/objects/declarations/FollowedByModifiers.txt index d53dbcaec1a..4ba12df0cde 100644 --- a/compiler/testData/psi/recovery/objects/declarations/FollowedByModifiers.txt +++ b/compiler/testData/psi/recovery/objects/declarations/FollowedByModifiers.txt @@ -6,8 +6,7 @@ JetFile: FollowedByModifiers.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace('\n\n') CLASS MODIFIER_LIST @@ -20,8 +19,7 @@ JetFile: FollowedByModifiers.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace('\n\n') CLASS MODIFIER_LIST @@ -38,4 +36,4 @@ JetFile: FollowedByModifiers.kt PsiWhiteSpace(' ') PsiElement(class)('class') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('Bar') + PsiElement(IDENTIFIER)('Bar') \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/declarations/ParametersInParentheses.txt b/compiler/testData/psi/recovery/objects/declarations/ParametersInParentheses.txt index 907a29c257c..c9d44799d81 100644 --- a/compiler/testData/psi/recovery/objects/declarations/ParametersInParentheses.txt +++ b/compiler/testData/psi/recovery/objects/declarations/ParametersInParentheses.txt @@ -6,8 +6,7 @@ JetFile: ParametersInParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PRIMARY_CONSTRUCTOR VALUE_PARAMETER_LIST PsiElement(LPAR)('(') @@ -34,8 +33,7 @@ JetFile: ParametersInParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PRIMARY_CONSTRUCTOR VALUE_PARAMETER_LIST PsiElement(LPAR)('(') @@ -66,8 +64,7 @@ JetFile: ParametersInParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PRIMARY_CONSTRUCTOR VALUE_PARAMETER_LIST PsiElement(LPAR)('(') @@ -103,4 +100,4 @@ JetFile: ParametersInParentheses.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/declarations/TypeParametersAndParentheses.txt b/compiler/testData/psi/recovery/objects/declarations/TypeParametersAndParentheses.txt index a0a5b3f4d1d..3919fc38291 100644 --- a/compiler/testData/psi/recovery/objects/declarations/TypeParametersAndParentheses.txt +++ b/compiler/testData/psi/recovery/objects/declarations/TypeParametersAndParentheses.txt @@ -6,8 +6,7 @@ JetFile: TypeParametersAndParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Type parameters are not allowed for objects TYPE_PARAMETER_LIST PsiElement(LT)('<') @@ -26,8 +25,7 @@ JetFile: TypeParametersAndParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Type parameters are not allowed for objects TYPE_PARAMETER_LIST PsiElement(LT)('<') @@ -58,8 +56,7 @@ JetFile: TypeParametersAndParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Type parameters are not allowed for objects TYPE_PARAMETER_LIST PsiElement(LT)('<') @@ -87,4 +84,4 @@ JetFile: TypeParametersAndParentheses.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/declarations/TypeParameterss.txt b/compiler/testData/psi/recovery/objects/declarations/TypeParameterss.txt index 3cd0f3dfc11..35adffa8b04 100644 --- a/compiler/testData/psi/recovery/objects/declarations/TypeParameterss.txt +++ b/compiler/testData/psi/recovery/objects/declarations/TypeParameterss.txt @@ -6,8 +6,7 @@ JetFile: TypeParameterss.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Type parameters are not allowed for objects TYPE_PARAMETER_LIST PsiElement(LT)('<') @@ -22,8 +21,7 @@ JetFile: TypeParameterss.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Type parameters are not allowed for objects TYPE_PARAMETER_LIST PsiElement(LT)('<') @@ -42,8 +40,7 @@ JetFile: TypeParameterss.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Type parameters are not allowed for objects TYPE_PARAMETER_LIST PsiElement(LT)('<') @@ -67,4 +64,4 @@ JetFile: TypeParameterss.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/declarations/Where.txt b/compiler/testData/psi/recovery/objects/declarations/Where.txt index 56f3e48ad59..ac9f13f6752 100644 --- a/compiler/testData/psi/recovery/objects/declarations/Where.txt +++ b/compiler/testData/psi/recovery/objects/declarations/Where.txt @@ -6,8 +6,7 @@ JetFile: Where.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace(' ') PsiErrorElement:Where clause is not allowed for objects PsiErrorElement:Type constraints are not allowed when no type parameters declared @@ -28,8 +27,7 @@ JetFile: Where.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -59,8 +57,7 @@ JetFile: Where.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PRIMARY_CONSTRUCTOR VALUE_PARAMETER_LIST PsiElement(LPAR)('(') @@ -85,8 +82,7 @@ JetFile: Where.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PRIMARY_CONSTRUCTOR VALUE_PARAMETER_LIST PsiElement(LPAR)('(') @@ -120,8 +116,7 @@ JetFile: Where.kt OBJECT_DECLARATION PsiElement(object)('object') PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Foo') + PsiElement(IDENTIFIER)('Foo') PRIMARY_CONSTRUCTOR VALUE_PARAMETER_LIST PsiElement(LPAR)('(') @@ -154,4 +149,4 @@ JetFile: Where.kt PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/secondaryConstructors/enumParsing.txt b/compiler/testData/psi/secondaryConstructors/enumParsing.txt index 13ea8226414..d6c38872d0f 100644 --- a/compiler/testData/psi/secondaryConstructors/enumParsing.txt +++ b/compiler/testData/psi/secondaryConstructors/enumParsing.txt @@ -15,8 +15,7 @@ JetFile: enumParsing.kt PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('abc1') + PsiElement(IDENTIFIER)('abc1') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -41,8 +40,7 @@ JetFile: enumParsing.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('abc2') + PsiElement(IDENTIFIER)('abc2') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE @@ -71,8 +69,7 @@ JetFile: enumParsing.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('abc3') + PsiElement(IDENTIFIER)('abc3') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') SECONDARY_CONSTRUCTOR @@ -137,4 +134,4 @@ JetFile: enumParsing.kt PsiWhiteSpace('\n\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/idea/idea-completion/testData/basic/common/TopLevelClassName6.kt b/idea/idea-completion/testData/basic/common/TopLevelClassName6.kt new file mode 100644 index 00000000000..ae1aff7741d --- /dev/null +++ b/idea/idea-completion/testData/basic/common/TopLevelClassName6.kt @@ -0,0 +1,3 @@ +object + +// EXIST: { lookupString: "TopLevelClassName6", itemText: "TopLevelClassName6" } \ No newline at end of file diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JSBasicCompletionTestGenerated.java b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JSBasicCompletionTestGenerated.java index f8f0e8ba938..6d3d71bbda2 100644 --- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JSBasicCompletionTestGenerated.java +++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JSBasicCompletionTestGenerated.java @@ -745,6 +745,12 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes doTest(fileName); } + @TestMetadata("TopLevelClassName6.kt") + public void testTopLevelClassName6() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/TopLevelClassName6.kt"); + doTest(fileName); + } + @TestMetadata("TopLevelClassName-3.kt") public void testTopLevelClassName_3() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/TopLevelClassName-3.kt"); diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JvmBasicCompletionTestGenerated.java b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JvmBasicCompletionTestGenerated.java index 41856e8f58e..f8365b1e159 100644 --- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JvmBasicCompletionTestGenerated.java +++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JvmBasicCompletionTestGenerated.java @@ -745,6 +745,12 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT doTest(fileName); } + @TestMetadata("TopLevelClassName6.kt") + public void testTopLevelClassName6() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/TopLevelClassName6.kt"); + doTest(fileName); + } + @TestMetadata("TopLevelClassName-3.kt") public void testTopLevelClassName_3() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/TopLevelClassName-3.kt"); diff --git a/idea/src/org/jetbrains/kotlin/idea/formatter/kotlinSpacingRules.kt b/idea/src/org/jetbrains/kotlin/idea/formatter/kotlinSpacingRules.kt index 4b0194050cb..f1a0bd315ba 100644 --- a/idea/src/org/jetbrains/kotlin/idea/formatter/kotlinSpacingRules.kt +++ b/idea/src/org/jetbrains/kotlin/idea/formatter/kotlinSpacingRules.kt @@ -135,7 +135,7 @@ fun createSpacingBuilder(settings: CodeStyleSettings): KotlinSpacingBuilder { after(MODIFIER_LIST).spaces(1) beforeInside(IDENTIFIER, CLASS).spaces(1) - beforeInside(OBJECT_DECLARATION_NAME, OBJECT_DECLARATION).spaces(1) + beforeInside(IDENTIFIER, OBJECT_DECLARATION).spaces(1) betweenInside(VAL_KEYWORD, IDENTIFIER, PROPERTY).spaces(1) betweenInside(VAR_KEYWORD, IDENTIFIER, PROPERTY).spaces(1) diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/JetEnumEntryWithoutSuperCallUsage.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/JetEnumEntryWithoutSuperCallUsage.kt index 8df10704084..6c2135e1cba 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/JetEnumEntryWithoutSuperCallUsage.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/JetEnumEntryWithoutSuperCallUsage.kt @@ -18,7 +18,10 @@ package org.jetbrains.kotlin.idea.refactoring.changeSignature.usages import com.intellij.usageView.UsageInfo import org.jetbrains.kotlin.idea.refactoring.changeSignature.JetChangeInfo -import org.jetbrains.kotlin.psi.* +import org.jetbrains.kotlin.psi.KtDelegatorToSuperCall +import org.jetbrains.kotlin.psi.KtEnumEntry +import org.jetbrains.kotlin.psi.KtInitializerList +import org.jetbrains.kotlin.psi.KtPsiFactory public class JetEnumEntryWithoutSuperCallUsage(enumEntry: KtEnumEntry) : JetUsageInfo(enumEntry) { override fun processUsage(changeInfo: JetChangeInfo, element: KtEnumEntry, allUsages: Array): Boolean { @@ -27,7 +30,7 @@ public class JetEnumEntryWithoutSuperCallUsage(enumEntry: KtEnumEntry) : JetUsag val delegatorToSuperCall = (element.addAfter( psiFactory.createEnumEntryInitializerList(), - element.getNameAsDeclaration() + element.nameIdentifier ) as KtInitializerList).initializers[0] as KtDelegatorToSuperCall return JetFunctionCallUsage(delegatorToSuperCall, changeInfo.methodDescriptor.originalPrimaryCallable) diff --git a/idea/testData/checker/recovery/namelessToplevelDeclarations.kt b/idea/testData/checker/recovery/namelessToplevelDeclarations.kt index 3bbd0384b9e..b521fc256ac 100644 --- a/idea/testData/checker/recovery/namelessToplevelDeclarations.kt +++ b/idea/testData/checker/recovery/namelessToplevelDeclarations.kt @@ -15,7 +15,7 @@ interface { } -object { +object { }