Add getFqName() to JetNamedDeclaration interface
Use stubs to get fq name in stubbed implementations
This commit is contained in:
@@ -20,6 +20,7 @@ import com.intellij.lang.ASTNode;
|
|||||||
import com.intellij.psi.PsiElement;
|
import com.intellij.psi.PsiElement;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
import org.jetbrains.jet.lexer.JetTokens;
|
import org.jetbrains.jet.lexer.JetTokens;
|
||||||
|
|
||||||
public class JetFunctionLiteral extends JetFunctionNotStubbed {
|
public class JetFunctionLiteral extends JetFunctionNotStubbed {
|
||||||
@@ -66,4 +67,10 @@ public class JetFunctionLiteral extends JetFunctionNotStubbed {
|
|||||||
public ASTNode getArrowNode() {
|
public ASTNode getArrowNode() {
|
||||||
return getNode().findChildByType(JetTokens.ARROW);
|
return getNode().findChildByType(JetTokens.ARROW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public FqName getFqName() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.intellij.psi.tree.TokenSet;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.JetNodeTypes;
|
import org.jetbrains.jet.JetNodeTypes;
|
||||||
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
import org.jetbrains.jet.lexer.JetTokens;
|
import org.jetbrains.jet.lexer.JetTokens;
|
||||||
|
|
||||||
import static org.jetbrains.jet.lexer.JetTokens.VAL_KEYWORD;
|
import static org.jetbrains.jet.lexer.JetTokens.VAL_KEYWORD;
|
||||||
@@ -63,4 +64,10 @@ public class JetMultiDeclarationEntry extends JetNamedDeclarationNotStubbed impl
|
|||||||
public ASTNode getValOrVarNode() {
|
public ASTNode getValOrVarNode() {
|
||||||
return getParentNode().findChildByType(TokenSet.create(VAL_KEYWORD, VAR_KEYWORD));
|
return getParentNode().findChildByType(TokenSet.create(VAL_KEYWORD, VAR_KEYWORD));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public FqName getFqName() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,9 +19,12 @@ package org.jetbrains.jet.lang.psi;
|
|||||||
import com.intellij.psi.PsiNameIdentifierOwner;
|
import com.intellij.psi.PsiNameIdentifierOwner;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||||
|
|
||||||
public interface JetNamedDeclaration extends JetDeclaration, PsiNameIdentifierOwner, JetStatementExpression, JetNamed {
|
public interface JetNamedDeclaration extends JetDeclaration, PsiNameIdentifierOwner, JetStatementExpression, JetNamed {
|
||||||
@NotNull
|
@NotNull
|
||||||
Name getNameAsSafeName();
|
Name getNameAsSafeName();
|
||||||
|
@Nullable
|
||||||
|
FqName getFqName();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,14 +21,16 @@ import com.intellij.psi.PsiElement;
|
|||||||
import com.intellij.psi.search.LocalSearchScope;
|
import com.intellij.psi.search.LocalSearchScope;
|
||||||
import com.intellij.psi.search.SearchScope;
|
import com.intellij.psi.search.SearchScope;
|
||||||
import com.intellij.psi.stubs.IStubElementType;
|
import com.intellij.psi.stubs.IStubElementType;
|
||||||
import com.intellij.psi.stubs.NamedStub;
|
|
||||||
import com.intellij.util.IncorrectOperationException;
|
import com.intellij.util.IncorrectOperationException;
|
||||||
import org.jetbrains.annotations.NonNls;
|
import org.jetbrains.annotations.NonNls;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import org.jetbrains.jet.lang.psi.stubs.PsiJetStubWithFqName;
|
||||||
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||||
import org.jetbrains.jet.lexer.JetTokens;
|
import org.jetbrains.jet.lexer.JetTokens;
|
||||||
|
|
||||||
abstract class JetNamedDeclarationStub<T extends NamedStub> extends JetDeclarationStub<T> implements JetNamedDeclaration {
|
abstract class JetNamedDeclarationStub<T extends PsiJetStubWithFqName> extends JetDeclarationStub<T> implements JetNamedDeclaration {
|
||||||
public JetNamedDeclarationStub(@NotNull T stub, @NotNull IStubElementType nodeType) {
|
public JetNamedDeclarationStub(@NotNull T stub, @NotNull IStubElementType nodeType) {
|
||||||
super(stub, nodeType);
|
super(stub, nodeType);
|
||||||
}
|
}
|
||||||
@@ -92,4 +94,14 @@ abstract class JetNamedDeclarationStub<T extends NamedStub> extends JetDeclarati
|
|||||||
|
|
||||||
return super.getUseScope();
|
return super.getUseScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public FqName getFqName() {
|
||||||
|
T stub = getStub();
|
||||||
|
if (stub != null) {
|
||||||
|
return stub.getFqName();
|
||||||
|
}
|
||||||
|
return JetPsiUtil.getFQName(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import org.jetbrains.jet.JetNodeTypes;
|
import org.jetbrains.jet.JetNodeTypes;
|
||||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetFunctionStub;
|
import org.jetbrains.jet.lang.psi.stubs.PsiJetFunctionStub;
|
||||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
|
||||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
|
||||||
import org.jetbrains.jet.lexer.JetTokens;
|
import org.jetbrains.jet.lexer.JetTokens;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -76,35 +74,6 @@ public class JetNamedFunction extends JetTypeParameterListOwnerStub<PsiJetFuncti
|
|||||||
return PsiTreeUtil.getNextSiblingOfType(getEqualsToken(), JetExpression.class);
|
return PsiTreeUtil.getNextSiblingOfType(getEqualsToken(), JetExpression.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns full qualified name for function "package_fqn.function_name"
|
|
||||||
* Not null for top level functions unless syntax errors are present.
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Nullable
|
|
||||||
public FqName getFqName() {
|
|
||||||
PsiJetFunctionStub stub = getStub();
|
|
||||||
if (stub != null) {
|
|
||||||
return stub.getTopFQName();
|
|
||||||
}
|
|
||||||
|
|
||||||
PsiElement parent = getParent();
|
|
||||||
if (parent instanceof JetFile) {
|
|
||||||
// fqname is different in scripts
|
|
||||||
if (((JetFile) parent).getPackageDirective() == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
JetFile jetFile = (JetFile) parent;
|
|
||||||
FqName fileFQN = JetPsiUtil.getFQName(jetFile);
|
|
||||||
Name nameAsName = getNameAsName();
|
|
||||||
if (nameAsName != null) {
|
|
||||||
return fileFQN.child(nameAsName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemPresentation getPresentation() {
|
public ItemPresentation getPresentation() {
|
||||||
return ItemPresentationProviders.getItemPresentation(this);
|
return ItemPresentationProviders.getItemPresentation(this);
|
||||||
|
|||||||
@@ -54,19 +54,6 @@ public class JetObjectDeclaration extends JetNamedDeclarationStub<PsiJetObjectSt
|
|||||||
return nameAsDeclaration == null ? null : nameAsDeclaration.getName();
|
return nameAsDeclaration == null ? null : nameAsDeclaration.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Could be null for anonymous objects and object declared inside functions
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public FqName getFqName() {
|
|
||||||
PsiJetObjectStub stub = getStub();
|
|
||||||
if (stub != null) {
|
|
||||||
return stub.getFqName();
|
|
||||||
}
|
|
||||||
|
|
||||||
return JetPsiUtil.getFQName(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isTopLevel() {
|
public boolean isTopLevel() {
|
||||||
PsiJetObjectStub stub = getStub();
|
PsiJetObjectStub stub = getStub();
|
||||||
if (stub != null) {
|
if (stub != null) {
|
||||||
|
|||||||
@@ -18,15 +18,15 @@ package org.jetbrains.jet.lang.psi;
|
|||||||
|
|
||||||
import com.intellij.lang.ASTNode;
|
import com.intellij.lang.ASTNode;
|
||||||
import com.intellij.psi.stubs.IStubElementType;
|
import com.intellij.psi.stubs.IStubElementType;
|
||||||
import com.intellij.psi.stubs.NamedStub;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.JetNodeTypes;
|
import org.jetbrains.jet.JetNodeTypes;
|
||||||
|
import org.jetbrains.jet.lang.psi.stubs.PsiJetStubWithFqName;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
abstract class JetTypeParameterListOwnerStub<T extends NamedStub> extends JetNamedDeclarationStub<T> implements JetTypeParameterListOwner {
|
abstract class JetTypeParameterListOwnerStub<T extends PsiJetStubWithFqName> extends JetNamedDeclarationStub<T> implements JetTypeParameterListOwner {
|
||||||
public JetTypeParameterListOwnerStub(@NotNull T stub, @NotNull IStubElementType nodeType) {
|
public JetTypeParameterListOwnerStub(@NotNull T stub, @NotNull IStubElementType nodeType) {
|
||||||
super(stub, nodeType);
|
super(stub, nodeType);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.intellij.lang.ASTNode;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.JetNodeTypes;
|
import org.jetbrains.jet.JetNodeTypes;
|
||||||
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
|
|
||||||
public class JetTypedef extends JetTypeParameterListOwnerNotStubbed {
|
public class JetTypedef extends JetTypeParameterListOwnerNotStubbed {
|
||||||
public JetTypedef(@NotNull ASTNode node) {
|
public JetTypedef(@NotNull ASTNode node) {
|
||||||
@@ -35,4 +36,11 @@ public class JetTypedef extends JetTypeParameterListOwnerNotStubbed {
|
|||||||
public JetTypeReference getTypeReference() {
|
public JetTypeReference getTypeReference() {
|
||||||
return (JetTypeReference) findChildByType(JetNodeTypes.TYPE_REFERENCE);
|
return (JetTypeReference) findChildByType(JetNodeTypes.TYPE_REFERENCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public FqName getFqName() {
|
||||||
|
//TODO: typedefs are unsupported
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,16 +16,10 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.lang.psi.stubs;
|
package org.jetbrains.jet.lang.psi.stubs;
|
||||||
|
|
||||||
import com.intellij.psi.stubs.NamedStub;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetNamedFunction;
|
import org.jetbrains.jet.lang.psi.JetNamedFunction;
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
|
||||||
|
|
||||||
public interface PsiJetFunctionStub extends NamedStub<JetNamedFunction> {
|
|
||||||
@Nullable
|
|
||||||
FqName getTopFQName();
|
|
||||||
|
|
||||||
|
public interface PsiJetFunctionStub extends PsiJetStubWithFqName<JetNamedFunction> {
|
||||||
/**
|
/**
|
||||||
* Is function defined in directly in package.
|
* Is function defined in directly in package.
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -16,17 +16,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.lang.psi.stubs;
|
package org.jetbrains.jet.lang.psi.stubs;
|
||||||
|
|
||||||
import com.intellij.psi.stubs.NamedStub;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.lang.psi.JetParameter;
|
import org.jetbrains.jet.lang.psi.JetParameter;
|
||||||
|
|
||||||
public interface PsiJetParameterStub extends NamedStub<JetParameter> {
|
public interface PsiJetParameterStub extends PsiJetStubWithFqName<JetParameter> {
|
||||||
boolean isMutable();
|
boolean isMutable();
|
||||||
boolean isVarArg();
|
boolean isVarArg();
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
String getTypeText();
|
String getTypeText();
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
String getDefaultValueText();
|
String getDefaultValueText();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,19 +16,11 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.lang.psi.stubs;
|
package org.jetbrains.jet.lang.psi.stubs;
|
||||||
|
|
||||||
import com.intellij.psi.stubs.NamedStub;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetProperty;
|
import org.jetbrains.jet.lang.psi.JetProperty;
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
|
||||||
|
|
||||||
public interface PsiJetPropertyStub extends NamedStub<JetProperty> {
|
public interface PsiJetPropertyStub extends PsiJetStubWithFqName<JetProperty> {
|
||||||
boolean isVar();
|
boolean isVar();
|
||||||
|
|
||||||
boolean isTopLevel();
|
boolean isTopLevel();
|
||||||
|
|
||||||
@Nullable
|
|
||||||
FqName getTopFQName();
|
|
||||||
|
|
||||||
String getTypeText();
|
String getTypeText();
|
||||||
String getInferenceBodyText();
|
String getInferenceBodyText();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,10 +16,9 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.lang.psi.stubs;
|
package org.jetbrains.jet.lang.psi.stubs;
|
||||||
|
|
||||||
import com.intellij.psi.stubs.NamedStub;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetTypeParameter;
|
import org.jetbrains.jet.lang.psi.JetTypeParameter;
|
||||||
|
|
||||||
public interface PsiJetTypeParameterStub extends NamedStub<JetTypeParameter> {
|
public interface PsiJetTypeParameterStub extends PsiJetStubWithFqName<JetTypeParameter> {
|
||||||
String getExtendBoundTypeText();
|
String getExtendBoundTypeText();
|
||||||
boolean isInVariance();
|
boolean isInVariance();
|
||||||
boolean isOutVariance();
|
boolean isOutVariance();
|
||||||
|
|||||||
+1
-1
@@ -57,7 +57,7 @@ public class JetClassElementType extends JetStubElementType<PsiJetClassStub, Jet
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PsiJetClassStub createStub(@NotNull JetClass psi, StubElement parentStub) {
|
public PsiJetClassStub createStub(@NotNull JetClass psi, StubElement parentStub) {
|
||||||
FqName fqName = JetPsiUtil.getFQName(psi);
|
FqName fqName = psi.getFqName();
|
||||||
boolean isEnumEntry = psi instanceof JetEnumEntry;
|
boolean isEnumEntry = psi instanceof JetEnumEntry;
|
||||||
List<String> superNames = PsiUtilPackage.getSuperNames(psi);
|
List<String> superNames = PsiUtilPackage.getSuperNames(psi);
|
||||||
return new PsiJetClassStubImpl(
|
return new PsiJetClassStubImpl(
|
||||||
|
|||||||
+4
-4
@@ -77,8 +77,8 @@ public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStu
|
|||||||
dataStream.writeName(stub.getName());
|
dataStream.writeName(stub.getName());
|
||||||
dataStream.writeBoolean(stub.isTopLevel());
|
dataStream.writeBoolean(stub.isTopLevel());
|
||||||
|
|
||||||
FqName topFQName = stub.getTopFQName();
|
FqName fqName = stub.getFqName();
|
||||||
dataStream.writeName(topFQName != null ? topFQName.toString() : null);
|
dataStream.writeName(fqName != null ? fqName.asString() : null);
|
||||||
|
|
||||||
dataStream.writeBoolean(stub.isExtension());
|
dataStream.writeBoolean(stub.isExtension());
|
||||||
}
|
}
|
||||||
@@ -89,8 +89,8 @@ public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStu
|
|||||||
StringRef name = dataStream.readName();
|
StringRef name = dataStream.readName();
|
||||||
boolean isTopLevel = dataStream.readBoolean();
|
boolean isTopLevel = dataStream.readBoolean();
|
||||||
|
|
||||||
StringRef topFQNameStr = dataStream.readName();
|
StringRef fqNameAsString = dataStream.readName();
|
||||||
FqName fqName = topFQNameStr != null ? new FqName(topFQNameStr.toString()) : null;
|
FqName fqName = fqNameAsString != null ? new FqName(fqNameAsString.toString()) : null;
|
||||||
|
|
||||||
boolean isExtension = dataStream.readBoolean();
|
boolean isExtension = dataStream.readBoolean();
|
||||||
|
|
||||||
|
|||||||
+7
-2
@@ -30,6 +30,7 @@ import org.jetbrains.jet.lang.psi.JetParameter;
|
|||||||
import org.jetbrains.jet.lang.psi.JetTypeReference;
|
import org.jetbrains.jet.lang.psi.JetTypeReference;
|
||||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetParameterStub;
|
import org.jetbrains.jet.lang.psi.stubs.PsiJetParameterStub;
|
||||||
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetParameterStubImpl;
|
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetParameterStubImpl;
|
||||||
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ public class JetParameterElementType extends JetStubElementType<PsiJetParameterS
|
|||||||
JetTypeReference typeReference = psi.getTypeReference();
|
JetTypeReference typeReference = psi.getTypeReference();
|
||||||
JetExpression defaultValue = psi.getDefaultValue();
|
JetExpression defaultValue = psi.getDefaultValue();
|
||||||
|
|
||||||
return new PsiJetParameterStubImpl(JetStubElementTypes.VALUE_PARAMETER, parentStub,
|
return new PsiJetParameterStubImpl(JetStubElementTypes.VALUE_PARAMETER, parentStub, psi.getFqName(),
|
||||||
psi.getName(), psi.isMutable(), psi.isVarArg(),
|
psi.getName(), psi.isMutable(), psi.isVarArg(),
|
||||||
typeReference != null ? typeReference.getText() : null,
|
typeReference != null ? typeReference.getText() : null,
|
||||||
defaultValue != null ? defaultValue.getText() : null);
|
defaultValue != null ? defaultValue.getText() : null);
|
||||||
@@ -75,6 +76,8 @@ public class JetParameterElementType extends JetStubElementType<PsiJetParameterS
|
|||||||
dataStream.writeBoolean(stub.isVarArg());
|
dataStream.writeBoolean(stub.isVarArg());
|
||||||
dataStream.writeName(stub.getTypeText());
|
dataStream.writeName(stub.getTypeText());
|
||||||
dataStream.writeName(stub.getDefaultValueText());
|
dataStream.writeName(stub.getDefaultValueText());
|
||||||
|
FqName name = stub.getFqName();
|
||||||
|
dataStream.writeName(name != null ? name.asString() : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -85,8 +88,10 @@ public class JetParameterElementType extends JetStubElementType<PsiJetParameterS
|
|||||||
boolean isVarArg = dataStream.readBoolean();
|
boolean isVarArg = dataStream.readBoolean();
|
||||||
StringRef typeText = dataStream.readName();
|
StringRef typeText = dataStream.readName();
|
||||||
StringRef defaultValueText = dataStream.readName();
|
StringRef defaultValueText = dataStream.readName();
|
||||||
|
StringRef fqNameAsString = dataStream.readName();
|
||||||
|
FqName fqName = fqNameAsString != null ? new FqName(fqNameAsString.toString()) : null;
|
||||||
|
|
||||||
return new PsiJetParameterStubImpl(JetStubElementTypes.VALUE_PARAMETER, parentStub, name, isMutable, isVarArg,
|
return new PsiJetParameterStubImpl(JetStubElementTypes.VALUE_PARAMETER, parentStub, fqName, name, isMutable, isVarArg,
|
||||||
typeText, defaultValueText);
|
typeText, defaultValueText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-6
@@ -27,7 +27,6 @@ import org.jetbrains.annotations.NonNls;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.lang.psi.JetExpression;
|
import org.jetbrains.jet.lang.psi.JetExpression;
|
||||||
import org.jetbrains.jet.lang.psi.JetProperty;
|
import org.jetbrains.jet.lang.psi.JetProperty;
|
||||||
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetTypeReference;
|
import org.jetbrains.jet.lang.psi.JetTypeReference;
|
||||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetPropertyStub;
|
import org.jetbrains.jet.lang.psi.stubs.PsiJetPropertyStub;
|
||||||
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetPropertyStubImpl;
|
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetPropertyStubImpl;
|
||||||
@@ -73,7 +72,7 @@ public class JetPropertyElementType extends JetStubElementType<PsiJetPropertyStu
|
|||||||
psi.getText(), psi.getParent() != null ? psi.getParent().getText() : "<no parent>");
|
psi.getText(), psi.getParent() != null ? psi.getParent().getText() : "<no parent>");
|
||||||
|
|
||||||
return new PsiJetPropertyStubImpl(JetStubElementTypes.PROPERTY, parentStub,
|
return new PsiJetPropertyStubImpl(JetStubElementTypes.PROPERTY, parentStub,
|
||||||
psi.getName(), psi.isVar(), psi.isTopLevel(), JetPsiUtil.getFQName(psi),
|
psi.getName(), psi.isVar(), psi.isTopLevel(), psi.getFqName(),
|
||||||
typeRef != null ? typeRef.getText() : null,
|
typeRef != null ? typeRef.getText() : null,
|
||||||
expression != null ? expression.getText() : null);
|
expression != null ? expression.getText() : null);
|
||||||
}
|
}
|
||||||
@@ -84,8 +83,8 @@ public class JetPropertyElementType extends JetStubElementType<PsiJetPropertyStu
|
|||||||
dataStream.writeBoolean(stub.isVar());
|
dataStream.writeBoolean(stub.isVar());
|
||||||
dataStream.writeBoolean(stub.isTopLevel());
|
dataStream.writeBoolean(stub.isTopLevel());
|
||||||
|
|
||||||
FqName topFQName = stub.getTopFQName();
|
FqName fqName = stub.getFqName();
|
||||||
dataStream.writeName(topFQName != null ? topFQName.toString() : null);
|
dataStream.writeName(fqName != null ? fqName.asString() : null);
|
||||||
|
|
||||||
dataStream.writeName(stub.getTypeText());
|
dataStream.writeName(stub.getTypeText());
|
||||||
dataStream.writeName(stub.getInferenceBodyText());
|
dataStream.writeName(stub.getInferenceBodyText());
|
||||||
@@ -98,8 +97,8 @@ public class JetPropertyElementType extends JetStubElementType<PsiJetPropertyStu
|
|||||||
boolean isVar = dataStream.readBoolean();
|
boolean isVar = dataStream.readBoolean();
|
||||||
boolean isTopLevel = dataStream.readBoolean();
|
boolean isTopLevel = dataStream.readBoolean();
|
||||||
|
|
||||||
StringRef topFQNameStr = dataStream.readName();
|
StringRef fqNameAsString = dataStream.readName();
|
||||||
FqName fqName = topFQNameStr != null ? new FqName(topFQNameStr.toString()) : null;
|
FqName fqName = fqNameAsString != null ? new FqName(fqNameAsString.toString()) : null;
|
||||||
|
|
||||||
StringRef typeText = dataStream.readName();
|
StringRef typeText = dataStream.readName();
|
||||||
StringRef inferenceBodyText = dataStream.readName();
|
StringRef inferenceBodyText = dataStream.readName();
|
||||||
|
|||||||
+15
-15
@@ -32,16 +32,16 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
|
|||||||
private final StringRef nameRef;
|
private final StringRef nameRef;
|
||||||
private final boolean isTopLevel;
|
private final boolean isTopLevel;
|
||||||
private final boolean isExtension;
|
private final boolean isExtension;
|
||||||
private final FqName topFQName;
|
private final FqName fqName;
|
||||||
|
|
||||||
public PsiJetFunctionStubImpl(
|
public PsiJetFunctionStubImpl(
|
||||||
@NotNull IStubElementType elementType,
|
@NotNull IStubElementType elementType,
|
||||||
@NotNull StubElement parent,
|
@NotNull StubElement parent,
|
||||||
@Nullable String name,
|
@Nullable String name,
|
||||||
boolean isTopLevel,
|
boolean isTopLevel,
|
||||||
@Nullable FqName topFQName,
|
@Nullable FqName fqName,
|
||||||
boolean isExtension) {
|
boolean isExtension) {
|
||||||
this(elementType, parent, StringRef.fromString(name), isTopLevel, topFQName, isExtension);
|
this(elementType, parent, StringRef.fromString(name), isTopLevel, fqName, isExtension);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PsiJetFunctionStubImpl(
|
public PsiJetFunctionStubImpl(
|
||||||
@@ -49,16 +49,16 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
|
|||||||
@NotNull StubElement parent,
|
@NotNull StubElement parent,
|
||||||
@Nullable StringRef nameRef,
|
@Nullable StringRef nameRef,
|
||||||
boolean isTopLevel,
|
boolean isTopLevel,
|
||||||
@Nullable FqName topFQName,
|
@Nullable FqName fqName,
|
||||||
boolean isExtension) {
|
boolean isExtension) {
|
||||||
super(parent, elementType);
|
super(parent, elementType);
|
||||||
|
|
||||||
if (isTopLevel && topFQName == null) {
|
if (isTopLevel && fqName == null) {
|
||||||
throw new IllegalArgumentException("topFQName shouldn't be null for top level functions");
|
throw new IllegalArgumentException("fqName shouldn't be null for top level functions");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.nameRef = nameRef;
|
this.nameRef = nameRef;
|
||||||
this.topFQName = topFQName;
|
this.fqName = fqName;
|
||||||
this.isTopLevel = isTopLevel;
|
this.isTopLevel = isTopLevel;
|
||||||
this.isExtension = isExtension;
|
this.isExtension = isExtension;
|
||||||
}
|
}
|
||||||
@@ -68,12 +68,6 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
|
|||||||
return StringRef.toString(nameRef);
|
return StringRef.toString(nameRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public FqName getTopFQName() {
|
|
||||||
return topFQName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isTopLevel() {
|
public boolean isTopLevel() {
|
||||||
return isTopLevel;
|
return isTopLevel;
|
||||||
@@ -97,8 +91,8 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
|
|||||||
builder.append("PsiJetFunctionStubImpl[");
|
builder.append("PsiJetFunctionStubImpl[");
|
||||||
|
|
||||||
if (isTopLevel()) {
|
if (isTopLevel()) {
|
||||||
assert topFQName != null;
|
assert fqName != null;
|
||||||
builder.append("top ").append("topFQName=").append(topFQName.toString()).append(" ");
|
builder.append("top ").append("fqName=").append(fqName.toString()).append(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isExtension()) {
|
if (isExtension()) {
|
||||||
@@ -111,4 +105,10 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
|
|||||||
|
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public FqName getFqName() {
|
||||||
|
return fqName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-7
@@ -23,6 +23,7 @@ import com.intellij.util.io.StringRef;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.lang.psi.JetParameter;
|
import org.jetbrains.jet.lang.psi.JetParameter;
|
||||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetParameterStub;
|
import org.jetbrains.jet.lang.psi.stubs.PsiJetParameterStub;
|
||||||
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
|
|
||||||
public class PsiJetParameterStubImpl extends StubBase<JetParameter> implements PsiJetParameterStub {
|
public class PsiJetParameterStubImpl extends StubBase<JetParameter> implements PsiJetParameterStub {
|
||||||
private final StringRef name;
|
private final StringRef name;
|
||||||
@@ -30,26 +31,33 @@ public class PsiJetParameterStubImpl extends StubBase<JetParameter> implements P
|
|||||||
private final boolean isVarArg;
|
private final boolean isVarArg;
|
||||||
private final StringRef typeText;
|
private final StringRef typeText;
|
||||||
private final StringRef defaultValueText;
|
private final StringRef defaultValueText;
|
||||||
|
private final FqName fqName;
|
||||||
|
|
||||||
public PsiJetParameterStubImpl(IStubElementType elementType, StubElement parent,
|
public PsiJetParameterStubImpl(
|
||||||
StringRef name,
|
IStubElementType elementType, StubElement parent,
|
||||||
|
FqName fqName, StringRef name,
|
||||||
boolean isMutable,
|
boolean isMutable,
|
||||||
boolean isVarArg,
|
boolean isVarArg,
|
||||||
StringRef typeText, StringRef defaultValueText) {
|
StringRef typeText, StringRef defaultValueText
|
||||||
|
) {
|
||||||
super(parent, elementType);
|
super(parent, elementType);
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.isMutable = isMutable;
|
this.isMutable = isMutable;
|
||||||
this.isVarArg = isVarArg;
|
this.isVarArg = isVarArg;
|
||||||
this.typeText = typeText;
|
this.typeText = typeText;
|
||||||
this.defaultValueText = defaultValueText;
|
this.defaultValueText = defaultValueText;
|
||||||
|
this.fqName = fqName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PsiJetParameterStubImpl(IStubElementType elementType, StubElement parent,
|
public PsiJetParameterStubImpl(
|
||||||
String name,
|
IStubElementType elementType, StubElement parent,
|
||||||
|
FqName fqName, String name,
|
||||||
boolean isMutable,
|
boolean isMutable,
|
||||||
boolean isVarArg,
|
boolean isVarArg,
|
||||||
String typeText, String defaultValueText) {
|
String typeText,
|
||||||
this(elementType, parent, StringRef.fromString(name), isMutable, isVarArg,
|
String defaultValueText
|
||||||
|
) {
|
||||||
|
this(elementType, parent, fqName, StringRef.fromString(name), isMutable, isVarArg,
|
||||||
StringRef.fromString(typeText), StringRef.fromString(defaultValueText));
|
StringRef.fromString(typeText), StringRef.fromString(defaultValueText));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,6 +99,9 @@ public class PsiJetParameterStubImpl extends StubBase<JetParameter> implements P
|
|||||||
}
|
}
|
||||||
|
|
||||||
builder.append("name=").append(getName());
|
builder.append("name=").append(getName());
|
||||||
|
if (fqName != null) {
|
||||||
|
builder.append(" fqName=").append(fqName.toString()).append(" ");
|
||||||
|
}
|
||||||
builder.append(" typeText=").append(getTypeText());
|
builder.append(" typeText=").append(getTypeText());
|
||||||
builder.append(" defaultValue=").append(getDefaultValueText());
|
builder.append(" defaultValue=").append(getDefaultValueText());
|
||||||
|
|
||||||
@@ -98,4 +109,10 @@ public class PsiJetParameterStubImpl extends StubBase<JetParameter> implements P
|
|||||||
|
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public FqName getFqName() {
|
||||||
|
return fqName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-9
@@ -29,22 +29,22 @@ public class PsiJetPropertyStubImpl extends StubBase<JetProperty> implements Psi
|
|||||||
private final StringRef name;
|
private final StringRef name;
|
||||||
private final boolean isVar;
|
private final boolean isVar;
|
||||||
private final boolean isTopLevel;
|
private final boolean isTopLevel;
|
||||||
private final FqName topFQName;
|
private final FqName fqName;
|
||||||
private final StringRef typeText;
|
private final StringRef typeText;
|
||||||
private final StringRef inferenceBodyText;
|
private final StringRef inferenceBodyText;
|
||||||
|
|
||||||
public PsiJetPropertyStubImpl(IStubElementType elementType, StubElement parent, StringRef name,
|
public PsiJetPropertyStubImpl(IStubElementType elementType, StubElement parent, StringRef name,
|
||||||
boolean isVar, boolean isTopLevel, @Nullable FqName topFQName, StringRef typeText, StringRef inferenceBodyText) {
|
boolean isVar, boolean isTopLevel, @Nullable FqName fqName, StringRef typeText, StringRef inferenceBodyText) {
|
||||||
super(parent, elementType);
|
super(parent, elementType);
|
||||||
|
|
||||||
if (isTopLevel && topFQName == null) {
|
if (isTopLevel && fqName == null) {
|
||||||
throw new IllegalArgumentException("topFQName shouldn't be null for top level properties");
|
throw new IllegalArgumentException("fqName shouldn't be null for top level properties");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.isVar = isVar;
|
this.isVar = isVar;
|
||||||
this.isTopLevel = isTopLevel;
|
this.isTopLevel = isTopLevel;
|
||||||
this.topFQName = topFQName;
|
this.fqName = fqName;
|
||||||
this.typeText = typeText;
|
this.typeText = typeText;
|
||||||
this.inferenceBodyText = inferenceBodyText;
|
this.inferenceBodyText = inferenceBodyText;
|
||||||
}
|
}
|
||||||
@@ -69,8 +69,8 @@ public class PsiJetPropertyStubImpl extends StubBase<JetProperty> implements Psi
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public FqName getTopFQName() {
|
public FqName getFqName() {
|
||||||
return topFQName;
|
return fqName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -97,8 +97,8 @@ public class PsiJetPropertyStubImpl extends StubBase<JetProperty> implements Psi
|
|||||||
builder.append(isVar() ? "var " : "val ");
|
builder.append(isVar() ? "var " : "val ");
|
||||||
|
|
||||||
if (isTopLevel()) {
|
if (isTopLevel()) {
|
||||||
assert topFQName != null;
|
assert fqName != null;
|
||||||
builder.append("top ").append("topFQName=").append(topFQName.toString()).append(" ");
|
builder.append("top ").append("fqName=").append(fqName.toString()).append(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.append("name=").append(getName());
|
builder.append("name=").append(getName());
|
||||||
|
|||||||
+9
@@ -19,9 +19,11 @@ package org.jetbrains.jet.lang.psi.stubs.impl;
|
|||||||
import com.intellij.psi.stubs.StubBase;
|
import com.intellij.psi.stubs.StubBase;
|
||||||
import com.intellij.psi.stubs.StubElement;
|
import com.intellij.psi.stubs.StubElement;
|
||||||
import com.intellij.util.io.StringRef;
|
import com.intellij.util.io.StringRef;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.lang.psi.JetTypeParameter;
|
import org.jetbrains.jet.lang.psi.JetTypeParameter;
|
||||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeParameterStub;
|
import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeParameterStub;
|
||||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetTypeParameterElementType;
|
import org.jetbrains.jet.lang.psi.stubs.elements.JetTypeParameterElementType;
|
||||||
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
|
|
||||||
public class PsiJetTypeParameterStubImpl extends StubBase<JetTypeParameter> implements PsiJetTypeParameterStub {
|
public class PsiJetTypeParameterStubImpl extends StubBase<JetTypeParameter> implements PsiJetTypeParameterStub {
|
||||||
private final StringRef name;
|
private final StringRef name;
|
||||||
@@ -84,4 +86,11 @@ public class PsiJetTypeParameterStubImpl extends StubBase<JetTypeParameter> impl
|
|||||||
|
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public FqName getFqName() {
|
||||||
|
// type parameters doesn't have FqNames
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ public class StubIndexServiceImpl implements StubIndexService {
|
|||||||
sink.occurrence(JetTopLevelExtensionFunctionShortNameIndex.getInstance().getKey(), name);
|
sink.occurrence(JetTopLevelExtensionFunctionShortNameIndex.getInstance().getKey(), name);
|
||||||
}
|
}
|
||||||
|
|
||||||
FqName topFQName = stub.getTopFQName();
|
FqName topFQName = stub.getFqName();
|
||||||
if (topFQName != null) {
|
if (topFQName != null) {
|
||||||
sink.occurrence(JetTopLevelFunctionsFqnNameIndex.getInstance().getKey(), topFQName.asString());
|
sink.occurrence(JetTopLevelFunctionsFqnNameIndex.getInstance().getKey(), topFQName.asString());
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,7 @@ public class StubIndexServiceImpl implements StubIndexService {
|
|||||||
String propertyName = stub.getName();
|
String propertyName = stub.getName();
|
||||||
if (propertyName != null) {
|
if (propertyName != null) {
|
||||||
if (stub.isTopLevel()) {
|
if (stub.isTopLevel()) {
|
||||||
FqName topFQName = stub.getTopFQName();
|
FqName topFQName = stub.getFqName();
|
||||||
if (topFQName != null) {
|
if (topFQName != null) {
|
||||||
sink.occurrence(JetTopLevelPropertiesFqnNameIndex.getInstance().getKey(), topFQName.asString());
|
sink.occurrence(JetTopLevelPropertiesFqnNameIndex.getInstance().getKey(), topFQName.asString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase {
|
|||||||
public void testFunctionParameters() {
|
public void testFunctionParameters() {
|
||||||
doBuildTest("fun some(t: Int, other: String = \"hello\") { }",
|
doBuildTest("fun some(t: Int, other: String = \"hello\") { }",
|
||||||
"PsiJetFileStubImpl[package=]\n" +
|
"PsiJetFileStubImpl[package=]\n" +
|
||||||
" FUN:PsiJetFunctionStubImpl[top topFQName=some name=some]\n" +
|
" FUN:PsiJetFunctionStubImpl[top fqName=some name=some]\n" +
|
||||||
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n" +
|
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n" +
|
||||||
" VALUE_PARAMETER:PsiJetParameterStubImpl[val name=t typeText=Int defaultValue=null]\n" +
|
" VALUE_PARAMETER:PsiJetParameterStubImpl[val name=t typeText=Int defaultValue=null]\n" +
|
||||||
" VALUE_PARAMETER:PsiJetParameterStubImpl[val name=other typeText=String defaultValue=\"hello\"]\n");
|
" VALUE_PARAMETER:PsiJetParameterStubImpl[val name=other typeText=String defaultValue=\"hello\"]\n");
|
||||||
@@ -102,7 +102,7 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase {
|
|||||||
doBuildTest("package test.testing\n" +
|
doBuildTest("package test.testing\n" +
|
||||||
"val some = 12",
|
"val some = 12",
|
||||||
"PsiJetFileStubImpl[package=test.testing]\n" +
|
"PsiJetFileStubImpl[package=test.testing]\n" +
|
||||||
" PROPERTY:PsiJetPropertyStubImpl[val top topFQName=test.testing.some name=some typeText=null bodyText=12]\n");
|
" PROPERTY:PsiJetPropertyStubImpl[val top fqName=test.testing.some name=some typeText=null bodyText=12]\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testClassProperty() {
|
public void testClassProperty() {
|
||||||
@@ -117,14 +117,14 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase {
|
|||||||
public void testNotStorePropertyFromInitializer() {
|
public void testNotStorePropertyFromInitializer() {
|
||||||
doBuildTest("fun DoubleArray.some() = for (element in this) println(element)",
|
doBuildTest("fun DoubleArray.some() = for (element in this) println(element)",
|
||||||
"PsiJetFileStubImpl[package=]\n" +
|
"PsiJetFileStubImpl[package=]\n" +
|
||||||
" FUN:PsiJetFunctionStubImpl[top topFQName=some ext name=some]\n" +
|
" FUN:PsiJetFunctionStubImpl[top fqName=some ext name=some]\n" +
|
||||||
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n");
|
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNotStorePropertyFromDelegate() {
|
public void testNotStorePropertyFromDelegate() {
|
||||||
doBuildTest("val a by kotlin.\n val b = 1",
|
doBuildTest("val a by kotlin.\n val b = 1",
|
||||||
"PsiJetFileStubImpl[package=]\n" +
|
"PsiJetFileStubImpl[package=]\n" +
|
||||||
" PROPERTY:PsiJetPropertyStubImpl[val top topFQName=a name=a typeText=null bodyText=null]\n");
|
" PROPERTY:PsiJetPropertyStubImpl[val top fqName=a name=a typeText=null bodyText=null]\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNotStorePropertiesFrom() {
|
public void testNotStorePropertiesFrom() {
|
||||||
@@ -172,7 +172,7 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase {
|
|||||||
"PsiJetFileStubImpl[package=]\n" +
|
"PsiJetFileStubImpl[package=]\n" +
|
||||||
" CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]]\n" +
|
" CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]]\n" +
|
||||||
" CLASS:PsiJetClassStubImpl[trait name=T fqn=T superNames=[]]\n" +
|
" CLASS:PsiJetClassStubImpl[trait name=T fqn=T superNames=[]]\n" +
|
||||||
" FUN:PsiJetFunctionStubImpl[top topFQName=foo name=foo]\n" +
|
" FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo]\n" +
|
||||||
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n" +
|
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n" +
|
||||||
" CLASS:PsiJetClassStubImpl[local name=Test fqn=null superNames=[AT]]\n");
|
" CLASS:PsiJetClassStubImpl[local name=Test fqn=null superNames=[AT]]\n");
|
||||||
}
|
}
|
||||||
@@ -182,7 +182,7 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase {
|
|||||||
"PsiJetFileStubImpl[package=]\n" +
|
"PsiJetFileStubImpl[package=]\n" +
|
||||||
" CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]]\n" +
|
" CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]]\n" +
|
||||||
" CLASS:PsiJetClassStubImpl[trait name=T fqn=T superNames=[]]\n" +
|
" CLASS:PsiJetClassStubImpl[trait name=T fqn=T superNames=[]]\n" +
|
||||||
" FUN:PsiJetFunctionStubImpl[top topFQName=foo name=foo]\n" +
|
" FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo]\n" +
|
||||||
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n" +
|
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n" +
|
||||||
" CLASS:PsiJetClassStubImpl[local name=Test fqn=null superNames=[AT]]\n");
|
" CLASS:PsiJetClassStubImpl[local name=Test fqn=null superNames=[AT]]\n");
|
||||||
}
|
}
|
||||||
@@ -200,7 +200,7 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase {
|
|||||||
"PsiJetFileStubImpl[package=]\n" +
|
"PsiJetFileStubImpl[package=]\n" +
|
||||||
" CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]]\n" +
|
" CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]]\n" +
|
||||||
" CLASS:PsiJetClassStubImpl[trait name=T fqn=T superNames=[]]\n" +
|
" CLASS:PsiJetClassStubImpl[trait name=T fqn=T superNames=[]]\n" +
|
||||||
" FUN:PsiJetFunctionStubImpl[top topFQName=foo name=foo]\n" +
|
" FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo]\n" +
|
||||||
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n" +
|
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n" +
|
||||||
" OBJECT_DECLARATION:PsiJetObjectStubImpl[local name=O fqName=null superNames=[AT]]\n");
|
" OBJECT_DECLARATION:PsiJetObjectStubImpl[local name=O fqName=null superNames=[AT]]\n");
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase {
|
|||||||
"PsiJetFileStubImpl[package=]\n" +
|
"PsiJetFileStubImpl[package=]\n" +
|
||||||
" CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]]\n" +
|
" CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]]\n" +
|
||||||
" CLASS:PsiJetClassStubImpl[trait name=T fqn=T superNames=[]]\n" +
|
" CLASS:PsiJetClassStubImpl[trait name=T fqn=T superNames=[]]\n" +
|
||||||
" PROPERTY:PsiJetPropertyStubImpl[val top topFQName=obj name=obj typeText=null bodyText=object : A(), T]\n" +
|
" PROPERTY:PsiJetPropertyStubImpl[val top fqName=obj name=obj typeText=null bodyText=object : A(), T]\n" +
|
||||||
" OBJECT_DECLARATION:PsiJetObjectStubImpl[local name=null fqName=null superNames=[AT]]\n");
|
" OBJECT_DECLARATION:PsiJetObjectStubImpl[local name=null fqName=null superNames=[AT]]\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase {
|
|||||||
public void testAnnotationOnFunction() {
|
public void testAnnotationOnFunction() {
|
||||||
doBuildTest("Deprecated fun foo() {}",
|
doBuildTest("Deprecated fun foo() {}",
|
||||||
"PsiJetFileStubImpl[package=]\n" +
|
"PsiJetFileStubImpl[package=]\n" +
|
||||||
" FUN:PsiJetFunctionStubImpl[top topFQName=foo name=foo]\n" +
|
" FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo]\n" +
|
||||||
" ANNOTATION_ENTRY:PsiJetAnnotationStubImpl[shortName=Deprecated]\n" +
|
" ANNOTATION_ENTRY:PsiJetAnnotationStubImpl[shortName=Deprecated]\n" +
|
||||||
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n");
|
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n");
|
||||||
}
|
}
|
||||||
@@ -232,7 +232,7 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase {
|
|||||||
public void testQualifiedAnnotationOnFunction() {
|
public void testQualifiedAnnotationOnFunction() {
|
||||||
doBuildTest("java.lang.Deprecated fun foo() {}",
|
doBuildTest("java.lang.Deprecated fun foo() {}",
|
||||||
"PsiJetFileStubImpl[package=]\n" +
|
"PsiJetFileStubImpl[package=]\n" +
|
||||||
" FUN:PsiJetFunctionStubImpl[top topFQName=foo name=foo]\n" +
|
" FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo]\n" +
|
||||||
" ANNOTATION_ENTRY:PsiJetAnnotationStubImpl[shortName=Deprecated]\n" +
|
" ANNOTATION_ENTRY:PsiJetAnnotationStubImpl[shortName=Deprecated]\n" +
|
||||||
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n");
|
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n");
|
||||||
}
|
}
|
||||||
@@ -240,7 +240,7 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase {
|
|||||||
public void testManyAnnotationsOnFunction() {
|
public void testManyAnnotationsOnFunction() {
|
||||||
doBuildTest("[Deprecated Override] fun foo() {}",
|
doBuildTest("[Deprecated Override] fun foo() {}",
|
||||||
"PsiJetFileStubImpl[package=]\n" +
|
"PsiJetFileStubImpl[package=]\n" +
|
||||||
" FUN:PsiJetFunctionStubImpl[top topFQName=foo name=foo]\n" +
|
" FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo]\n" +
|
||||||
" ANNOTATION_ENTRY:PsiJetAnnotationStubImpl[shortName=Deprecated]\n" +
|
" ANNOTATION_ENTRY:PsiJetAnnotationStubImpl[shortName=Deprecated]\n" +
|
||||||
" ANNOTATION_ENTRY:PsiJetAnnotationStubImpl[shortName=Override]\n" +
|
" ANNOTATION_ENTRY:PsiJetAnnotationStubImpl[shortName=Override]\n" +
|
||||||
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n");
|
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n");
|
||||||
@@ -249,7 +249,7 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase {
|
|||||||
public void testAnnotationOnLocalFunction() {
|
public void testAnnotationOnLocalFunction() {
|
||||||
doBuildTest("fun foo() { [Deprecated] fun innerFoo() {} }",
|
doBuildTest("fun foo() { [Deprecated] fun innerFoo() {} }",
|
||||||
"PsiJetFileStubImpl[package=]\n" +
|
"PsiJetFileStubImpl[package=]\n" +
|
||||||
" FUN:PsiJetFunctionStubImpl[top topFQName=foo name=foo]\n" +
|
" FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo]\n" +
|
||||||
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n");
|
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user