Go To Symbol Contributor crashes

Hello,


I've followed the tutorial on how to build a custom language plugin but I've got stuck on this step: http://confluence.jetbrains.com/display/IntelliJIDEA/Go+To+Symbol+Contributor

When running the plugin (with -ea switch on) I get this error:

PSI elements displayed in choose by name lists must return a non-null value from getPresentation(): element GoLangPropertyImpl(PROPERTY), class com.dlsniper.golang.psi.impl.GoLangPropertyImpl: PSI elements displayed in choose by name lists must return a non-null value from getPresentation(): element GoLangPropertyImpl(PROPERTY), class com.dlsniper.golang.psi.impl.GoLangPropertyImpl java.lang.AssertionError: PSI elements displayed in choose by name lists must return a non-null value from getPresentation(): element GoLangPropertyImpl(PROPERTY), class com.dlsniper.golang.psi.impl.GoLangPropertyImpl      at com.intellij.ide.util.NavigationItemListCellRenderer$LeftRenderer.customizeCellRenderer(NavigationItemListCellRenderer.java:148)      at com.intellij.ui.ColoredListCellRenderer.getListCellRendererComponent(ColoredListCellRenderer.java:64)      at com.intellij.ide.util.NavigationItemListCellRenderer.getListCellRendererComponent(NavigationItemListCellRenderer.java:76)      at com.intellij.ide.util.gotoByName.ContributorsBasedGotoByModel$1.getListCellRendererComponent(ContributorsBasedGotoByModel.java:76)      at com.intellij.ui.ExpandedItemListCellRendererWrapper.getListCellRendererComponent(ExpandedItemListCellRendererWrapper.java:34)      at javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1361)      at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1311)      at javax.swing.plaf.basic.BasicListUI.locationToIndex(BasicListUI.java:929)      at javax.swing.JList.locationToIndex(JList.java:1592)      at javax.swing.JList.getToolTipText(JList.java:1531)      at com.intellij.ide.IdeTooltipManager.a(IdeTooltipManager.java:176)      at com.intellij.ide.IdeTooltipManager.eventDispatched(IdeTooltipManager.java:123)      at java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2422)      at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2314)      at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2313)      at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2313)      at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2313)      at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2313)      at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2313)      at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2313)      at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2313)      at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2313)      at java.awt.Toolkit.notifyAWTEventListeners(Toolkit.java:2272)      at java.awt.Component.dispatchEventImpl(Component.java:4757)      at java.awt.Container.dispatchEventImpl(Container.java:2287)      at java.awt.Component.dispatchEvent(Component.java:4687)      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)      at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:4620)      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4474)      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)      at java.awt.Container.dispatchEventImpl(Container.java:2273)      at java.awt.Window.dispatchEventImpl(Window.java:2719)      at java.awt.Component.dispatchEvent(Component.java:4687)      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)      at java.awt.EventQueue.access$200(EventQueue.java:103)      at java.awt.EventQueue$3.run(EventQueue.java:694)      at java.awt.EventQueue$3.run(EventQueue.java:692)      at java.security.AccessController.doPrivileged(Native Method)      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)      at java.awt.EventQueue$4.run(EventQueue.java:708)      at java.awt.EventQueue$4.run(EventQueue.java:706)      at java.security.AccessController.doPrivileged(Native Method)      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)      at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)      at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:696)      at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:520)      at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)      at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)


There also seems to be an issue reported by inspections:

  Name
public method NavigationItem[] getItemsByName(String name, String pattern, Project project, boolean includeNonProjectItems)

  Location
class GoLangChooseByNameContributor (com.dlsniper.golang.editor.symbol)

  Problem synopsis
Array of type 'GoLangProperty[]' expected at line 38


I'm building the plugin using IntelliJ IDEA v13 EAP 132.637 with Java 7 as language and I guess it's pretty obvious for which language I want to end up doing it :)

The sources can be found here: https://github.com/dlsniper/golang-idea

Any help would be greatly appreciated, thank you.

2 comments

Hi Florin,

The assertion error tells you exactly what you need to do to fix it.

0

I've found the issue, I had the bracket closing earlier that it should have in the .bnf file.

Thanks.

0

Please sign in to leave a comment.