Add isValid() to PsiJetImportDirectiveStub
This commit is contained in:
@@ -120,7 +120,7 @@ public class JetImportDirective extends JetElementImplStub<PsiJetImportDirective
|
||||
return new ImportPath(importFqn, isAllUnder(), alias);
|
||||
}
|
||||
|
||||
private boolean isValidImport() {
|
||||
public boolean isValidImport() {
|
||||
return !PsiTreeUtil.hasErrorElements(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,4 +26,5 @@ public interface PsiJetImportDirectiveStub extends StubElement<JetImportDirectiv
|
||||
boolean isAllUnder();
|
||||
@Nullable
|
||||
String getAliasName();
|
||||
boolean isValid();
|
||||
}
|
||||
|
||||
+5
-2
@@ -36,7 +36,8 @@ public class JetImportDirectiveElementType extends JetStubElementType<PsiJetImpo
|
||||
@Override
|
||||
public PsiJetImportDirectiveStub createStub(@NotNull JetImportDirective psi, StubElement parentStub) {
|
||||
StringRef aliasName = StringRef.fromString(psi.getAliasName());
|
||||
return new PsiJetImportDirectiveStubImpl(parentStub, psi.isAbsoluteInRootPackage(), psi.isAllUnder(), aliasName);
|
||||
return new PsiJetImportDirectiveStubImpl(parentStub, psi.isAbsoluteInRootPackage(), psi.isAllUnder(),
|
||||
aliasName, psi.isValidImport());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,6 +45,7 @@ public class JetImportDirectiveElementType extends JetStubElementType<PsiJetImpo
|
||||
dataStream.writeBoolean(stub.isAbsoluteInRootPackage());
|
||||
dataStream.writeBoolean(stub.isAllUnder());
|
||||
dataStream.writeName(stub.getAliasName());
|
||||
dataStream.writeBoolean(stub.isValid());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -52,6 +54,7 @@ public class JetImportDirectiveElementType extends JetStubElementType<PsiJetImpo
|
||||
boolean isAbsoluteInRootPackage = dataStream.readBoolean();
|
||||
boolean isAllUnder = dataStream.readBoolean();
|
||||
StringRef aliasName = dataStream.readName();
|
||||
return new PsiJetImportDirectiveStubImpl(parentStub, isAbsoluteInRootPackage, isAllUnder, aliasName);
|
||||
boolean isValid = dataStream.readBoolean();
|
||||
return new PsiJetImportDirectiveStubImpl(parentStub, isAbsoluteInRootPackage, isAllUnder, aliasName, isValid);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-1
@@ -29,17 +29,20 @@ public class PsiJetImportDirectiveStubImpl extends StubBase<JetImportDirective>
|
||||
private final boolean isAllUnder;
|
||||
@Nullable
|
||||
private final StringRef aliasName;
|
||||
private final boolean isValid;
|
||||
|
||||
public PsiJetImportDirectiveStubImpl(
|
||||
StubElement parent,
|
||||
boolean isAbsoluteInRootPackage,
|
||||
boolean isAllUnder,
|
||||
@Nullable StringRef aliasName
|
||||
@Nullable StringRef aliasName,
|
||||
boolean isValid
|
||||
) {
|
||||
super(parent, JetStubElementTypes.IMPORT_DIRECTIVE);
|
||||
this.isAbsoluteInRootPackage = isAbsoluteInRootPackage;
|
||||
this.isAllUnder = isAllUnder;
|
||||
this.aliasName = aliasName;
|
||||
this.isValid = isValid;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,4 +60,9 @@ public class PsiJetImportDirectiveStubImpl extends StubBase<JetImportDirective>
|
||||
public String getAliasName() {
|
||||
return StringRef.toString(aliasName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return isValid;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user