Changed parsing of object and enum entries to drop "KtObjectDeclarationName"
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -63,9 +63,6 @@ abstract public class KtClassOrObject :
|
||||
|
||||
public fun getAnonymousInitializers(): List<KtClassInitializer> = getBody()?.anonymousInitializers.orEmpty()
|
||||
|
||||
public fun getNameAsDeclaration(): KtObjectDeclarationName? =
|
||||
findChildByType<PsiElement>(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
|
||||
|
||||
@@ -40,29 +40,6 @@ public class KtEnumEntry extends KtClass {
|
||||
super(stub);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
KotlinClassOrObjectStub<? extends KtClassOrObject> classStub = getStub();
|
||||
if (classStub != null) {
|
||||
return classStub.getName();
|
||||
}
|
||||
|
||||
KtObjectDeclarationName nameAsDeclaration = getNameAsDeclaration();
|
||||
return nameAsDeclaration == null ? "<Anonymous>" : 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<KtDelegationSpecifier> getDelegationSpecifiers() {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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, D> R accept(@NotNull KtVisitor<R, D> 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();
|
||||
}
|
||||
}
|
||||
@@ -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<KtObjectDeclaration>("object $name").getNameAsDeclaration()!!
|
||||
}
|
||||
|
||||
public fun createIdentifier(name: String): PsiElement {
|
||||
return createSimpleName(name).getIdentifier()!!
|
||||
}
|
||||
|
||||
@@ -414,10 +414,6 @@ public class KtVisitor<R, D> 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);
|
||||
}
|
||||
|
||||
@@ -401,10 +401,6 @@ public class KtVisitorVoid extends KtVisitor<Void, Void> {
|
||||
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<Void, Void> {
|
||||
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);
|
||||
|
||||
@@ -398,10 +398,6 @@ public class KtVisitorVoidWithParameter<P> extends KtVisitor<Void, P> {
|
||||
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<P> extends KtVisitor<Void, P> {
|
||||
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);
|
||||
|
||||
@@ -13,7 +13,7 @@ class<!SYNTAX!><!> {
|
||||
|
||||
}
|
||||
|
||||
object <!SYNTAX!><!>{
|
||||
object<!SYNTAX!><!> {
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class Outer {
|
||||
|
||||
}<!>
|
||||
|
||||
<!REDECLARATION!>object<!> <!SYNTAX!><!>{
|
||||
<!REDECLARATION!>object<!><!SYNTAX!><!> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ interface<!SYNTAX!><!> {
|
||||
|
||||
}
|
||||
|
||||
object <!SYNTAX!><!>{
|
||||
object<!SYNTAX!><!> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
+4
-8
@@ -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)('{')
|
||||
|
||||
+17
-30
@@ -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
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
OBJECT_DECLARATION_NAME
|
||||
PsiErrorElement:Name expected
|
||||
<empty list>
|
||||
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
|
||||
<empty list>
|
||||
PsiErrorElement:Name expected
|
||||
<empty list>
|
||||
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)('}')
|
||||
Vendored
+5
-9
@@ -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)('}')
|
||||
+1
-2
@@ -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
|
||||
<empty list>
|
||||
|
||||
+1
-2
@@ -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
|
||||
<empty list>
|
||||
|
||||
+1
-2
@@ -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
|
||||
<empty list>
|
||||
|
||||
+1
-2
@@ -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
|
||||
<empty list>
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
+1
-2
@@ -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
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n\n ')
|
||||
|
||||
+1
-2
@@ -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
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n\n ')
|
||||
|
||||
+1
-2
@@ -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
|
||||
<empty list>
|
||||
|
||||
Vendored
+1
-2
@@ -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)('}')
|
||||
Vendored
+1
-2
@@ -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)('}')
|
||||
+2
-4
@@ -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
|
||||
|
||||
+4
-7
@@ -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)('}')
|
||||
+1
-2
@@ -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
|
||||
<empty list>
|
||||
PsiErrorElement:Expecting member declaration
|
||||
|
||||
+4
-7
@@ -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)('}')
|
||||
+4
-7
@@ -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)('}')
|
||||
+1
-2
@@ -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')
|
||||
|
||||
Vendored
+3
-6
@@ -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
|
||||
|
||||
+1
-2
@@ -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)('}')
|
||||
+5
-9
@@ -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)('}')
|
||||
+3
-5
@@ -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)('}')
|
||||
+3
-5
@@ -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)('}')
|
||||
+6
-11
@@ -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)('}')
|
||||
@@ -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)('}')
|
||||
+3
-5
@@ -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)('}')
|
||||
+4
-7
@@ -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)('}')
|
||||
+4
-7
@@ -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)('}')
|
||||
+6
-9
@@ -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
|
||||
<empty list>
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiErrorElement:Name expected
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -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)('}')
|
||||
+1
-2
@@ -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)('{')
|
||||
|
||||
+5
-9
@@ -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)(')')
|
||||
@@ -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)('}')
|
||||
@@ -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)('}')
|
||||
+3
-5
@@ -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')
|
||||
+4
-7
@@ -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)('}')
|
||||
+4
-7
@@ -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)('}')
|
||||
@@ -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)('}')
|
||||
@@ -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)('}')
|
||||
@@ -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)('}')
|
||||
@@ -0,0 +1,3 @@
|
||||
object <caret>
|
||||
|
||||
// EXIST: { lookupString: "TopLevelClassName6", itemText: "TopLevelClassName6" }
|
||||
+6
@@ -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");
|
||||
|
||||
+6
@@ -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");
|
||||
|
||||
@@ -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)
|
||||
|
||||
+5
-2
@@ -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<KtEnumEntry>(enumEntry) {
|
||||
override fun processUsage(changeInfo: JetChangeInfo, element: KtEnumEntry, allUsages: Array<out UsageInfo>): 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)
|
||||
|
||||
@@ -15,7 +15,7 @@ interface<error> </error>{
|
||||
|
||||
}
|
||||
|
||||
object <error>{</error>
|
||||
object<error> </error>{
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user