Add PsiJetFunctionStub#hasBody()

This commit is contained in:
Pavel V. Talanov
2014-03-26 16:35:25 +04:00
parent 737177a56e
commit e7fd8c4118
3 changed files with 19 additions and 5 deletions
@@ -26,6 +26,8 @@ public interface PsiJetFunctionStub extends PsiJetStubWithFqName<JetNamedFunctio
boolean hasBlockBody();
boolean hasBody();
@NotNull
String[] getAnnotations();
}
@@ -56,7 +56,8 @@ public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStu
boolean isExtension = psi.getReceiverTypeRef() != null;
FqName fqName = ResolveSessionUtils.safeFqNameForLazyResolve(psi);
boolean hasBlockBody = psi.hasBlockBody();
return new PsiJetFunctionStubImpl(parentStub, psi.getName(), isTopLevel, fqName, isExtension, hasBlockBody);
boolean hasBody = psi.hasBody();
return new PsiJetFunctionStubImpl(parentStub, psi.getName(), isTopLevel, fqName, isExtension, hasBlockBody, hasBody);
}
@Override
@@ -69,6 +70,7 @@ public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStu
dataStream.writeBoolean(stub.isExtension());
dataStream.writeBoolean(stub.hasBlockBody());
dataStream.writeBoolean(stub.hasBody());
}
@NotNull
@@ -82,8 +84,9 @@ public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStu
boolean isExtension = dataStream.readBoolean();
boolean hasBlockBody = dataStream.readBoolean();
boolean hasBody = dataStream.readBoolean();
return new PsiJetFunctionStubImpl(parentStub, name, isTopLevel, fqName, isExtension, hasBlockBody);
return new PsiJetFunctionStubImpl(parentStub, name, isTopLevel, fqName, isExtension, hasBlockBody, hasBody);
}
@Override
@@ -34,6 +34,7 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
private final boolean isExtension;
private final FqName fqName;
private final boolean hasBlockBody;
private final boolean hasBody;
public PsiJetFunctionStubImpl(
@NotNull StubElement parent,
@@ -41,9 +42,10 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
boolean isTopLevel,
@Nullable FqName fqName,
boolean isExtension,
boolean hasBlockBody
boolean hasBlockBody,
boolean hasBody
) {
this(parent, StringRef.fromString(name), isTopLevel, fqName, isExtension, hasBlockBody);
this(parent, StringRef.fromString(name), isTopLevel, fqName, isExtension, hasBlockBody, hasBody);
}
public PsiJetFunctionStubImpl(
@@ -52,7 +54,8 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
boolean isTopLevel,
@Nullable FqName fqName,
boolean isExtension,
boolean hasBlockBody
boolean hasBlockBody,
boolean hasBody
) {
super(parent, JetStubElementTypes.FUNCTION);
@@ -65,6 +68,7 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
this.isTopLevel = isTopLevel;
this.isExtension = isExtension;
this.hasBlockBody = hasBlockBody;
this.hasBody = hasBody;
}
@Override
@@ -87,6 +91,11 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
return hasBlockBody;
}
@Override
public boolean hasBody() {
return hasBody;
}
@NotNull
@Override
public String[] getAnnotations() {