Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » NPE in GlobalURIEditorOpener(An IResourceUIServiceProvider that lacks an IURIEditorOpener causes NPE)
NPE in GlobalURIEditorOpener [message #1385898] Thu, 12 June 2014 07:56 Go to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
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.
Re: NPE in GlobalURIEditorOpener [message #1386002 is a reply to message #1385898] Thu, 12 June 2014 20:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
yes please file a bug

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: NPE in GlobalURIEditorOpener [message #1386248 is a reply to message #1386002] Mon, 16 June 2014 06:43 Go to previous message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
I filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=437497
Previous Topic:[SOLVED] Generics in Xtext
Next Topic:[Solved] How2 access top AST from Validator,Quickfix,Proposal
Goto Forum:
  


Current Time: Thu Apr 25 12:23:54 GMT 2024

Powered by FUDForum. Page generated in 0.03018 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top