PSI: Introduce KtImportAlias element
This commit is contained in:
@@ -55,6 +55,7 @@ public interface KtNodeTypes {
|
||||
IElementType IMPORT_LIST = KtStubElementTypes.IMPORT_LIST;
|
||||
IElementType FILE_ANNOTATION_LIST = KtStubElementTypes.FILE_ANNOTATION_LIST;
|
||||
IElementType IMPORT_DIRECTIVE = KtStubElementTypes.IMPORT_DIRECTIVE;
|
||||
IElementType IMPORT_ALIAS = KtStubElementTypes.IMPORT_ALIAS;
|
||||
IElementType MODIFIER_LIST = KtStubElementTypes.MODIFIER_LIST;
|
||||
IElementType ANNOTATION = KtStubElementTypes.ANNOTATION;
|
||||
IElementType ANNOTATION_ENTRY = KtStubElementTypes.ANNOTATION_ENTRY;
|
||||
|
||||
@@ -471,7 +471,7 @@ object PositioningStrategies {
|
||||
|
||||
@JvmField val IMPORT_ALIAS: PositioningStrategy<KtImportDirective> = object: PositioningStrategy<KtImportDirective>() {
|
||||
override fun mark(element: KtImportDirective): List<TextRange> {
|
||||
element.aliasNameNode?.let { return markNode(it) }
|
||||
element.alias?.nameIdentifier?.let { return markElement(it) }
|
||||
element.importedReference?.let {
|
||||
if (it is KtQualifiedExpression) {
|
||||
it.selectorExpression?.let { return markElement(it) }
|
||||
|
||||
@@ -292,7 +292,7 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
||||
PsiBuilder.Marker importDirective = mark();
|
||||
advance(); // IMPORT_KEYWORD
|
||||
|
||||
if (closeImportWithErrorIfNewline(importDirective, "Expecting qualified name")) {
|
||||
if (closeImportWithErrorIfNewline(importDirective, null, "Expecting qualified name")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
||||
while (at(DOT) && lookahead(1) != MUL) {
|
||||
advance(); // DOT
|
||||
|
||||
if (closeImportWithErrorIfNewline(importDirective, "Import must be placed on a single line")) {
|
||||
if (closeImportWithErrorIfNewline(importDirective, null, "Import must be placed on a single line")) {
|
||||
qualifiedName.drop();
|
||||
return;
|
||||
}
|
||||
@@ -339,28 +339,37 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
||||
if (at(AS_KEYWORD)) {
|
||||
PsiBuilder.Marker as = mark();
|
||||
advance(); // AS_KEYWORD
|
||||
if (closeImportWithErrorIfNewline(importDirective, "Expecting identifier")) {
|
||||
if (closeImportWithErrorIfNewline(importDirective, null, "Expecting identifier")) {
|
||||
as.drop();
|
||||
return;
|
||||
}
|
||||
consumeIf(IDENTIFIER);
|
||||
as.error("Cannot rename all imported items to one identifier");
|
||||
as.done(IMPORT_ALIAS);
|
||||
as.precede().error("Cannot rename all imported items to one identifier");
|
||||
}
|
||||
}
|
||||
if (at(AS_KEYWORD)) {
|
||||
PsiBuilder.Marker alias = mark();
|
||||
advance(); // AS_KEYWORD
|
||||
if (closeImportWithErrorIfNewline(importDirective, "Expecting identifier")) {
|
||||
if (closeImportWithErrorIfNewline(importDirective, alias, "Expecting identifier")) {
|
||||
return;
|
||||
}
|
||||
expect(IDENTIFIER, "Expecting identifier", TokenSet.create(SEMICOLON));
|
||||
alias.done(IMPORT_ALIAS);
|
||||
}
|
||||
consumeIf(SEMICOLON);
|
||||
importDirective.done(IMPORT_DIRECTIVE);
|
||||
importDirective.setCustomEdgeTokenBinders(null, TrailingCommentsBinder.INSTANCE);
|
||||
}
|
||||
|
||||
private boolean closeImportWithErrorIfNewline(PsiBuilder.Marker importDirective, String errorMessage) {
|
||||
private boolean closeImportWithErrorIfNewline(
|
||||
PsiBuilder.Marker importDirective,
|
||||
@Nullable PsiBuilder.Marker importAlias,
|
||||
String errorMessage) {
|
||||
if (myBuilder.newlineBeforeCurrentToken()) {
|
||||
if (importAlias != null) {
|
||||
importAlias.done(IMPORT_ALIAS);
|
||||
}
|
||||
error(errorMessage);
|
||||
importDirective.done(IMPORT_DIRECTIVE);
|
||||
return true;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2010-2017 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.PsiNameIdentifierOwner
|
||||
import org.jetbrains.kotlin.lexer.KtTokens
|
||||
import org.jetbrains.kotlin.psi.stubs.KotlinImportAliasStub
|
||||
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes
|
||||
|
||||
class KtImportAlias : KtElementImplStub<KotlinImportAliasStub>, PsiNameIdentifierOwner {
|
||||
@Suppress("unused") constructor(node: ASTNode) : super(node)
|
||||
@Suppress("unused") constructor(stub: KotlinImportAliasStub) : super(stub, KtStubElementTypes.IMPORT_ALIAS)
|
||||
|
||||
override fun <R : Any?, D : Any?> accept(visitor: KtVisitor<R, D>, data: D): R {
|
||||
return visitor.visitImportAlias(this, data)
|
||||
}
|
||||
|
||||
override fun getName() = stub?.getName() ?: nameIdentifier?.text
|
||||
|
||||
override fun setName(name: String): PsiElement {
|
||||
nameIdentifier?.replace(KtPsiFactory(this).createNameIdentifier(name))
|
||||
return this
|
||||
}
|
||||
|
||||
override fun getNameIdentifier(): PsiElement? = findChildByType(KtTokens.IDENTIFIER)
|
||||
}
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.jetbrains.kotlin.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -54,32 +53,14 @@ public class KtImportDirective extends KtElementImplStub<KotlinImportDirectiveSt
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ASTNode getAliasNameNode() {
|
||||
boolean asPassed = false;
|
||||
ASTNode childNode = getNode().getFirstChildNode();
|
||||
while (childNode != null) {
|
||||
IElementType tt = childNode.getElementType();
|
||||
if (tt == KtTokens.AS_KEYWORD) asPassed = true;
|
||||
if (asPassed && tt == KtTokens.IDENTIFIER) {
|
||||
return childNode;
|
||||
}
|
||||
|
||||
childNode = childNode.getTreeNext();
|
||||
}
|
||||
return null;
|
||||
public KtImportAlias getAlias() {
|
||||
return getStubOrPsiChild(KtStubElementTypes.IMPORT_ALIAS);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getAliasName() {
|
||||
KotlinImportDirectiveStub stub = getStub();
|
||||
if (stub != null) {
|
||||
return stub.getAliasName();
|
||||
}
|
||||
ASTNode aliasNameNode = getAliasNameNode();
|
||||
if (aliasNameNode == null) {
|
||||
return null;
|
||||
}
|
||||
return aliasNameNode.getText();
|
||||
KtImportAlias alias = getAlias();
|
||||
return alias != null ? alias.getName() : null;
|
||||
}
|
||||
|
||||
public boolean isAllUnder() {
|
||||
|
||||
@@ -78,6 +78,10 @@ public class KtVisitor<R, D> extends PsiElementVisitor {
|
||||
return visitDeclaration(script, data);
|
||||
}
|
||||
|
||||
public R visitImportAlias(@NotNull KtImportAlias importAlias, D data) {
|
||||
return visitKtElement(importAlias, data);
|
||||
}
|
||||
|
||||
public R visitImportDirective(@NotNull KtImportDirective importDirective, D data) {
|
||||
return visitKtElement(importDirective, data);
|
||||
}
|
||||
|
||||
@@ -73,6 +73,10 @@ public class KtVisitorVoid extends KtVisitor<Void, Void> {
|
||||
super.visitScript(script, null);
|
||||
}
|
||||
|
||||
public void visitImportAlias(@NotNull KtImportAlias importAlias) {
|
||||
super.visitImportAlias(importAlias, null);
|
||||
}
|
||||
|
||||
public void visitImportDirective(@NotNull KtImportDirective importDirective) {
|
||||
super.visitImportDirective(importDirective, null);
|
||||
}
|
||||
|
||||
@@ -70,6 +70,10 @@ public class KtVisitorVoidWithParameter<P> extends KtVisitor<Void, P> {
|
||||
super.visitImportDirective(importDirective, data);
|
||||
}
|
||||
|
||||
public void visitImportAliasVoid(@NotNull KtImportAlias importAlias, P data) {
|
||||
super.visitImportAlias(importAlias, data);
|
||||
}
|
||||
|
||||
public void visitImportListVoid(@NotNull KtImportList importList, P data) {
|
||||
super.visitImportList(importList, data);
|
||||
}
|
||||
|
||||
@@ -71,10 +71,13 @@ interface KotlinFunctionStub : KotlinCallableStubBase<KtNamedFunction> {
|
||||
fun hasTypeParameterListBeforeFunctionName(): Boolean
|
||||
}
|
||||
|
||||
interface KotlinImportAliasStub : StubElement<KtImportAlias> {
|
||||
fun getName(): String?
|
||||
}
|
||||
|
||||
interface KotlinImportDirectiveStub : StubElement<KtImportDirective> {
|
||||
fun isAllUnder(): Boolean
|
||||
fun getImportedFqName(): FqName?
|
||||
fun getAliasName(): String?
|
||||
fun isValid(): Boolean
|
||||
}
|
||||
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2010-2017 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.stubs.elements
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.stubs.StubElement
|
||||
import com.intellij.psi.stubs.StubInputStream
|
||||
import com.intellij.psi.stubs.StubOutputStream
|
||||
import com.intellij.util.io.StringRef
|
||||
import org.jetbrains.kotlin.psi.KtImportAlias
|
||||
import org.jetbrains.kotlin.psi.stubs.KotlinImportAliasStub
|
||||
import org.jetbrains.kotlin.psi.stubs.impl.KotlinImportAliasStubImpl
|
||||
|
||||
class KtImportAliasElementType(debugName: String) :
|
||||
KtStubElementType<KotlinImportAliasStub, KtImportAlias>(debugName, KtImportAlias::class.java, KotlinImportAliasStub::class.java) {
|
||||
override fun createStub(psi: KtImportAlias, parentStub: StubElement<PsiElement>?): KotlinImportAliasStub {
|
||||
return KotlinImportAliasStubImpl(parentStub, StringRef.fromString(psi.name))
|
||||
}
|
||||
|
||||
override fun serialize(stub: KotlinImportAliasStub, dataStream: StubOutputStream) {
|
||||
dataStream.writeName(stub.getName())
|
||||
}
|
||||
|
||||
override fun deserialize(dataStream: StubInputStream, parentStub: StubElement<PsiElement>?): KotlinImportAliasStub {
|
||||
val name = dataStream.readName()
|
||||
return KotlinImportAliasStubImpl(parentStub, name)
|
||||
}
|
||||
}
|
||||
+2
-5
@@ -38,8 +38,7 @@ public class KtImportDirectiveElementType extends KtStubElementType<KotlinImport
|
||||
public KotlinImportDirectiveStub createStub(@NotNull KtImportDirective psi, StubElement parentStub) {
|
||||
FqName importedFqName = psi.getImportedFqName();
|
||||
StringRef fqName = StringRef.fromString(importedFqName == null ? null : importedFqName.asString());
|
||||
StringRef aliasName = StringRef.fromString(psi.getAliasName());
|
||||
return new KotlinImportDirectiveStubImpl(parentStub, psi.isAllUnder(), fqName, aliasName, psi.isValidImport());
|
||||
return new KotlinImportDirectiveStubImpl(parentStub, psi.isAllUnder(), fqName, psi.isValidImport());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,7 +46,6 @@ public class KtImportDirectiveElementType extends KtStubElementType<KotlinImport
|
||||
dataStream.writeBoolean(stub.isAllUnder());
|
||||
FqName importedFqName = stub.getImportedFqName();
|
||||
dataStream.writeName(importedFqName != null ? importedFqName.asString() : null);
|
||||
dataStream.writeName(stub.getAliasName());
|
||||
dataStream.writeBoolean(stub.isValid());
|
||||
}
|
||||
|
||||
@@ -56,8 +54,7 @@ public class KtImportDirectiveElementType extends KtStubElementType<KotlinImport
|
||||
public KotlinImportDirectiveStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
|
||||
boolean isAllUnder = dataStream.readBoolean();
|
||||
StringRef importedName = dataStream.readName();
|
||||
StringRef aliasName = dataStream.readName();
|
||||
boolean isValid = dataStream.readBoolean();
|
||||
return new KotlinImportDirectiveStubImpl(parentStub, isAllUnder, importedName, aliasName, isValid);
|
||||
return new KotlinImportDirectiveStubImpl(parentStub, isAllUnder, importedName, isValid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +62,8 @@ public interface KtStubElementTypes {
|
||||
|
||||
KtImportDirectiveElementType IMPORT_DIRECTIVE = new KtImportDirectiveElementType("IMPORT_DIRECTIVE");
|
||||
|
||||
KtImportAliasElementType IMPORT_ALIAS = new KtImportAliasElementType("IMPORT_ALIAS");
|
||||
|
||||
KtPlaceHolderStubElementType<KtPackageDirective> PACKAGE_DIRECTIVE =
|
||||
new KtPlaceHolderStubElementType<>("PACKAGE_DIRECTIVE", KtPackageDirective.class);
|
||||
|
||||
|
||||
@@ -25,8 +25,11 @@ import com.intellij.util.io.StringRef
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.psi.stubs.KotlinFileStub
|
||||
import org.jetbrains.kotlin.psi.stubs.KotlinImportAliasStub
|
||||
import org.jetbrains.kotlin.psi.stubs.KotlinImportDirectiveStub
|
||||
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes
|
||||
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes.FILE
|
||||
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes.IMPORT_LIST
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
|
||||
|
||||
open class KotlinFileStubImpl(
|
||||
jetFile: KtFile?,
|
||||
@@ -39,7 +42,7 @@ open class KotlinFileStubImpl(
|
||||
|
||||
override fun getPackageFqName(): FqName = FqName(StringRef.toString(packageName)!!)
|
||||
override fun isScript(): Boolean = isScript
|
||||
override fun getType(): IStubFileElementType<KotlinFileStub> = KtStubElementTypes.FILE
|
||||
override fun getType(): IStubFileElementType<KotlinFileStub> = FILE
|
||||
|
||||
override fun toString(): String = "PsiJetFileStubImpl[" + "package=" + getPackageFqName().asString() + "]"
|
||||
|
||||
@@ -48,7 +51,9 @@ open class KotlinFileStubImpl(
|
||||
}
|
||||
|
||||
override fun findImportsByAlias(alias: String): List<KotlinImportDirectiveStub> {
|
||||
val importList = childrenStubs.firstOrNull { it.stubType == KtStubElementTypes.IMPORT_LIST } ?: return emptyList()
|
||||
return importList.childrenStubs.filterIsInstance<KotlinImportDirectiveStub>().filter { it.getAliasName() == alias }
|
||||
val importList = childrenStubs.firstOrNull { it.stubType == IMPORT_LIST } ?: return emptyList()
|
||||
return importList.childrenStubs.filterIsInstance<KotlinImportDirectiveStub>().filter {
|
||||
it.childrenStubs.firstIsInstanceOrNull<KotlinImportAliasStub>()?.getName() == alias
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2010-2017 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.stubs.impl
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.stubs.StubElement
|
||||
import com.intellij.util.io.StringRef
|
||||
import org.jetbrains.kotlin.psi.KtImportAlias
|
||||
import org.jetbrains.kotlin.psi.stubs.KotlinImportAliasStub
|
||||
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes
|
||||
|
||||
class KotlinImportAliasStubImpl(
|
||||
parent: StubElement<PsiElement>?,
|
||||
private val name: StringRef?
|
||||
) : KotlinStubBaseImpl<KtImportAlias>(parent, KtStubElementTypes.IMPORT_ALIAS), KotlinImportAliasStub {
|
||||
override fun getName(): String? = StringRef.toString(name)
|
||||
}
|
||||
-2
@@ -28,7 +28,6 @@ class KotlinImportDirectiveStubImpl(
|
||||
parent: StubElement<PsiElement>,
|
||||
private val isAllUnder: Boolean,
|
||||
private val importedFqName: StringRef?,
|
||||
private val aliasName: StringRef?,
|
||||
private val isValid: Boolean
|
||||
) : KotlinStubBaseImpl<KtImportDirective>(parent, KtStubElementTypes.IMPORT_DIRECTIVE), KotlinImportDirectiveStub {
|
||||
override fun isAllUnder(): Boolean = isAllUnder
|
||||
@@ -38,6 +37,5 @@ class KotlinImportDirectiveStubImpl(
|
||||
return if (fqNameString != null) FqName(fqNameString) else null
|
||||
}
|
||||
|
||||
override fun getAliasName(): String? = StringRef.toString(aliasName)
|
||||
override fun isValid(): Boolean = isValid
|
||||
}
|
||||
|
||||
+4
-3
@@ -20,6 +20,7 @@ JetFile: ImportSoftKW.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
Vendored
+8
-6
@@ -36,9 +36,10 @@ JetFile: Imports.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
@@ -50,9 +51,10 @@ JetFile: Imports.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
|
||||
+95
-80
@@ -62,7 +62,8 @@ JetFile: Imports_ERR.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiErrorElement:Expecting identifier
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n')
|
||||
@@ -76,7 +77,8 @@ JetFile: Imports_ERR.kt
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiErrorElement:Expecting identifier
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n')
|
||||
@@ -102,9 +104,10 @@ JetFile: Imports_ERR.kt
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiErrorElement:Expecting identifier
|
||||
<empty list>
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiErrorElement:Expecting identifier
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n')
|
||||
@@ -117,7 +120,8 @@ JetFile: Imports_ERR.kt
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename all imported items to one identifier
|
||||
PsiElement(as)('as')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n\n')
|
||||
IMPORT_DIRECTIVE
|
||||
@@ -126,69 +130,75 @@ JetFile: Imports_ERR.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Expecting identifier
|
||||
PsiElement(DOT)('.')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiErrorElement:Expecting identifier
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Expecting identifier
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('sdfsdf')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename all imported items to one identifier
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename all imported items to one identifier
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiErrorElement:Expecting identifier
|
||||
PsiElement(DOT)('.')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiErrorElement:Expecting identifier
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Expecting identifier
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('sdfsdf')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename all imported items to one identifier
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename all imported items to one identifier
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
@@ -213,9 +223,10 @@ JetFile: Imports_ERR.kt
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
@@ -227,9 +238,10 @@ JetFile: Imports_ERR.kt
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n\n')
|
||||
@@ -246,9 +258,10 @@ JetFile: Imports_ERR.kt
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename all imported items to one identifier
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
@@ -295,9 +308,10 @@ JetFile: Imports_ERR.kt
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename all imported items to one identifier
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n')
|
||||
@@ -314,7 +328,8 @@ JetFile: Imports_ERR.kt
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename all imported items to one identifier
|
||||
PsiElement(as)('as')
|
||||
IMPORT_ALIAS
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n')
|
||||
|
||||
Reference in New Issue
Block a user