Problem customizing the outline [message #1042013] |
Mon, 15 April 2013 22:19 |
Erick Fonseca Messages: 68 Registered: December 2011 |
Member |
|
|
So, I tried to customize the outline tree provider for my DSL. The grammar starts like this:
MyLang:
definitions += Definition+
main = Main
;
Definition:
foo='foo'
;
Main:
bar='bar'
;
And I added the following xtend class:
class MyLangOutlineTreeProvider extends org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider {
def protected void _createChildren(DocumentRootNode parentNode, MyLang lang)
{
for (Definition definition : lang.definitions)
{
createNode(parentNode, definition)
}
createNode(parentNode, lang.main)
}
}
When I run the MyLang editor, it works, but if add some garbage after or between the definitions, I get the following Eclipse error: "Error refreshing outline
java.lang.NullPointerException"
Am I doing something wrong?
[Updated on: Tue, 16 April 2013 13:37] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02487 seconds