Add hasTypeParameterListBeforeFunctionName() to PsiJetFunctionStub

This commit is contained in:
Pavel V. Talanov
2014-03-31 14:09:17 +04:00
parent 0418085bc9
commit 1d112c3358
3 changed files with 16 additions and 3 deletions
@@ -28,6 +28,8 @@ public interface PsiJetFunctionStub extends PsiJetStubWithFqName<JetNamedFunctio
boolean hasBody();
boolean hasTypeParameterListBeforeFunctionName();
@NotNull
String[] getAnnotations();
}
@@ -58,7 +58,7 @@ public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStu
boolean hasBlockBody = psi.hasBlockBody();
boolean hasBody = psi.hasBody();
return new PsiJetFunctionStubImpl(parentStub, StringRef.fromString(psi.getName()), isTopLevel, fqName,
isExtension, hasBlockBody, hasBody);
isExtension, hasBlockBody, hasBody, psi.hasTypeParameterListBeforeFunctionName());
}
@Override
@@ -72,6 +72,7 @@ public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStu
dataStream.writeBoolean(stub.isExtension());
dataStream.writeBoolean(stub.hasBlockBody());
dataStream.writeBoolean(stub.hasBody());
dataStream.writeBoolean(stub.hasTypeParameterListBeforeFunctionName());
}
@NotNull
@@ -86,8 +87,10 @@ public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStu
boolean isExtension = dataStream.readBoolean();
boolean hasBlockBody = dataStream.readBoolean();
boolean hasBody = dataStream.readBoolean();
boolean hasTypeParameterListBeforeFunctionName = dataStream.readBoolean();
return new PsiJetFunctionStubImpl(parentStub, name, isTopLevel, fqName, isExtension, hasBlockBody, hasBody);
return new PsiJetFunctionStubImpl(parentStub, name, isTopLevel, fqName, isExtension, hasBlockBody, hasBody,
hasTypeParameterListBeforeFunctionName);
}
@Override
@@ -35,6 +35,7 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
private final FqName fqName;
private final boolean hasBlockBody;
private final boolean hasBody;
private final boolean hasTypeParameterListBeforeFunctionName;
public PsiJetFunctionStubImpl(
@NotNull StubElement parent,
@@ -43,7 +44,8 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
@Nullable FqName fqName,
boolean isExtension,
boolean hasBlockBody,
boolean hasBody
boolean hasBody,
boolean hasTypeParameterListBeforeFunctionName
) {
super(parent, JetStubElementTypes.FUNCTION);
@@ -57,6 +59,7 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
this.isExtension = isExtension;
this.hasBlockBody = hasBlockBody;
this.hasBody = hasBody;
this.hasTypeParameterListBeforeFunctionName = hasTypeParameterListBeforeFunctionName;
}
@Override
@@ -84,6 +87,11 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
return hasBody;
}
@Override
public boolean hasTypeParameterListBeforeFunctionName() {
return hasTypeParameterListBeforeFunctionName;
}
@NotNull
@Override
public String[] getAnnotations() {