File tree 1 file changed +8
-2
lines changed
intellij-plugin/src/main/kotlin/com/apollographql/ijplugin/navigation
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import com.intellij.navigation.NavigationItem
7
7
import com.intellij.platform.backend.navigation.NavigationRequest
8
8
import com.intellij.pom.Navigatable
9
9
import com.intellij.psi.PsiElement
10
+ import javax.swing.Icon
10
11
11
12
private class LogNavigationPsiElement (
12
13
private val wrapped : PsiElement ,
@@ -24,8 +25,13 @@ private class LogNavigationPsiElement(
24
25
return (wrapped as ? NavigationItem )?.name
25
26
}
26
27
27
- override fun getPresentation (): ItemPresentation ? {
28
- return (wrapped as ? NavigationItem )?.presentation
28
+ override fun getPresentation (): ItemPresentation {
29
+ return (wrapped as ? NavigationItem )?.presentation ? : object : ItemPresentation {
30
+ // We don't want the presentation to be too wide: fallback to the first line of text, truncated to 80 characters
31
+ override fun getPresentableText (): String? = wrapped.text.split(' \n ' ).firstOrNull()?.take(80 )
32
+
33
+ override fun getIcon (unused : Boolean ): Icon ? = null
34
+ }
29
35
}
30
36
31
37
@Suppress(" UnstableApiUsage" )
You can’t perform that action at this time.
0 commit comments