Stubs for dot qualified expression built inside package directive
This commit is contained in:
@@ -73,8 +73,8 @@ public class JetDotQualifiedExpression extends JetExpressionImplStub<PsiJetPlace
|
||||
|
||||
@Nullable
|
||||
private JetExpression[] getChildExpressionsByStub(@NotNull PsiJetPlaceHolderStub<JetDotQualifiedExpression> stub) {
|
||||
if (stub.getParentStubOfType(JetImportDirective.class) == null) {
|
||||
LOG.error("JetDotQualifiedExpression should only have stubs inside import directives.\n " +
|
||||
if (stub.getParentStubOfType(JetImportDirective.class) == null && stub.getParentStubOfType(JetPackageDirective.class) == null) {
|
||||
LOG.error("JetDotQualifiedExpression should only have stubs inside import or package directives.\n " +
|
||||
"Stubs were created for:\n " + getText() +
|
||||
"\nFile text:\n" + getContainingFile().getText());
|
||||
return null;
|
||||
|
||||
+2
-1
@@ -22,6 +22,7 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.psi.JetDotQualifiedExpression;
|
||||
import org.jetbrains.jet.lang.psi.JetImportDirective;
|
||||
import org.jetbrains.jet.lang.psi.JetPackageDirective;
|
||||
|
||||
public class JetDotQualifiedExpressionElementType extends JetPlaceHolderStubElementType<JetDotQualifiedExpression> {
|
||||
public JetDotQualifiedExpressionElementType(@NotNull @NonNls String debugName) {
|
||||
@@ -30,6 +31,6 @@ public class JetDotQualifiedExpressionElementType extends JetPlaceHolderStubElem
|
||||
|
||||
@Override
|
||||
public boolean shouldCreateStub(ASTNode node) {
|
||||
return PsiTreeUtil.getParentOfType(node.getPsi(), JetImportDirective.class) != null;
|
||||
return PsiTreeUtil.getParentOfType(node.getPsi(), JetImportDirective.class, JetPackageDirective.class) != null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user