Don't stub parameter if it's a loop parameter
This commit is contained in:
+5
@@ -61,6 +61,11 @@ public class JetParameterElementType extends JetStubElementType<PsiJetParameterS
|
||||
defaultValue != null ? defaultValue.getText() : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldCreateStub(ASTNode node) {
|
||||
return node.getElementType() == JetStubElementTypes.VALUE_PARAMETER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(PsiJetParameterStub stub, StubOutputStream dataStream) throws IOException {
|
||||
dataStream.writeName(stub.getName());
|
||||
|
||||
+21
@@ -75,4 +75,25 @@ public class PsiJetPropertyStubImpl extends StubBase<JetProperty> implements Psi
|
||||
public String getName() {
|
||||
return StringRef.toString(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.append("PsiJetPropertyStubImpl[");
|
||||
|
||||
builder.append(isVar() ? "var " : "val ");
|
||||
|
||||
if (isLocal()) {
|
||||
builder.append("local ");
|
||||
}
|
||||
|
||||
builder.append("name=").append(getName());
|
||||
builder.append(" typeText=").append(getTypeText());
|
||||
builder.append(" bodyText=").append(getInferenceBodyText());
|
||||
|
||||
builder.append("]");
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,6 +98,25 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase {
|
||||
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n");
|
||||
}
|
||||
|
||||
public void testNotStorePropertiesFrom() {
|
||||
doBuildTest("class Test() {\n" +
|
||||
" val test = 12;\n" +
|
||||
" {\n" +
|
||||
" for (i in 0..12) {\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
" fun more() {\n" +
|
||||
" }\n" +
|
||||
"}\n",
|
||||
"PsiJetFileStubImpl[package=]\n" +
|
||||
" CLASS:PsiJetClassStubImpl[name=Test fqn=Test superNames=[]]\n" +
|
||||
" TYPE_PARAMETER_LIST:PsiJetTypeParameterListStubImpl\n" +
|
||||
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n" +
|
||||
" PROPERTY:PsiJetPropertyStubImpl[val name=test typeText=null bodyText=12]\n" +
|
||||
" FUN:PsiJetFunctionStubImpl[name=more]\n" +
|
||||
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n");
|
||||
}
|
||||
|
||||
public void testSimpleEnumBuild() {
|
||||
doBuildTest("enum class Test { First\n Second\n }",
|
||||
"PsiJetFileStubImpl[package=]\n" +
|
||||
|
||||
Reference in New Issue
Block a user