Add presentation renderer for field declared in constructor
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
package org.jetbrains.jet.lang.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.navigation.ItemPresentationProviders;
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.util.ArrayFactory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -107,5 +109,8 @@ public class JetParameter extends JetNamedDeclarationStub<PsiJetParameterStub> {
|
||||
return getNode().findChildByType(JetTokens.VAR_KEYWORD);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemPresentation getPresentation() {
|
||||
return ItemPresentationProviders.getItemPresentation(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,11 +196,16 @@ public class JetPsiUtil {
|
||||
else if (parent instanceof JetNamedFunction || parent instanceof JetClass) {
|
||||
firstPart = getFQName((JetNamedDeclaration) parent);
|
||||
}
|
||||
else if (namedDeclaration instanceof JetParameter) {
|
||||
if (((JetParameter) namedDeclaration).getValOrVarNode() != null && parent != null && parent.getParent() instanceof JetClassOrObject) {
|
||||
firstPart = getFQName((JetClassOrObject) parent.getParent());
|
||||
}
|
||||
}
|
||||
else if (parent instanceof JetObjectDeclaration) {
|
||||
if (parent.getParent() instanceof JetClassObject) {
|
||||
JetClassOrObject classOrObject = PsiTreeUtil.getParentOfType(parent, JetClassOrObject.class);
|
||||
if (classOrObject != null) {
|
||||
firstPart = getFQName((JetNamedDeclaration) classOrObject);
|
||||
firstPart = getFQName(classOrObject);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user