[simple language] SimplePsiImplUtil: cleanup

This commit is contained in:
Yann Cébron 2020-03-06 17:18:21 +01:00
parent 67f01950d5
commit f4797cc011

View File

@ -7,7 +7,9 @@ import com.intellij.navigation.ItemPresentation;
import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile; import com.intellij.psi.PsiFile;
import org.intellij.sdk.language.SimpleIcons; import org.intellij.sdk.language.SimpleIcons;
import org.intellij.sdk.language.psi.*; import org.intellij.sdk.language.psi.SimpleElementFactory;
import org.intellij.sdk.language.psi.SimpleProperty;
import org.intellij.sdk.language.psi.SimpleTypes;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import javax.swing.*; import javax.swing.*;
@ -46,7 +48,7 @@ public class SimplePsiImplUtil {
return element; return element;
} }
public static PsiElement getNameIdentifier( SimpleProperty element) { public static PsiElement getNameIdentifier(SimpleProperty element) {
ASTNode keyNode = element.getNode().findChildByType(SimpleTypes.KEY); ASTNode keyNode = element.getNode().findChildByType(SimpleTypes.KEY);
if (keyNode != null) { if (keyNode != null) {
return keyNode.getPsi(); return keyNode.getPsi();
@ -55,7 +57,7 @@ public class SimplePsiImplUtil {
} }
} }
public static ItemPresentation getPresentation( final SimpleProperty element) { public static ItemPresentation getPresentation(final SimpleProperty element) {
return new ItemPresentation() { return new ItemPresentation() {
@Nullable @Nullable
@Override @Override
@ -70,9 +72,8 @@ public class SimplePsiImplUtil {
return containingFile == null ? null : containingFile.getName(); return containingFile == null ? null : containingFile.getName();
} }
@Nullable
@Override @Override
public Icon getIcon( boolean unused) { public Icon getIcon(boolean unused) {
return SimpleIcons.FILE; return SimpleIcons.FILE;
} }
}; };