NPE in GlobalURIEditorOpener [message #1385898] |
Thu, 12 June 2014 07:56 |
|
The Geppetto IDE for the puppet language performs cross referencing to artifacts found in ruby files. We have a headless runtime module for ruby that registers the language and the 'rb' extension but it does not register an editor. Instead we would like to use the default. I've had some problems getting this working.
The first problem is that in the GlobalURIEditorOpener, it's assumed that a IResourceServiceUIProvider will return an IURIEditorOpener. If it doesn't, the code will NPE in both open() methods. The LanguageSpecificURIEditorOpener declares it's injected IURIEditorOpener as optional so this seems to be a bug.
The second problem is that if I bind a LanguageSpecificURIEditorOpener then it assumes that the editorID to use is equal to the language. We don't register any editor for the ruby language.
My current workaround is to bind a subclass of the GlobalURIEditorOpener as the IURIEditorOpener for ruby. In this subclass I override both open() methods to simply dispatch to openDefaultEditor(). This works but would not be needed if the original methods checked for null return on the IResourceUIServiceProvider.getURIEditorOpener() method and used the default when that happened.
Since I'm fairly new to xtext I wonder if I'm doing something wrong here or if I should report a bug.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05156 seconds