An internal error occurred during: "Updating outline view".
During building of the Stratego editor, I got the following stracktrace about the outline:
Submitted by Gabriël Konat on 19 May 2014 at 14:59java.lang.NullPointerException at org.strategoxt.imp.runtime.services.views.outline.SpoofaxOutlinePage.getOutline(SpoofaxOutlinePage.java:285) at org.strategoxt.imp.runtime.services.views.outline.SpoofaxOutlinePage.access$1(SpoofaxOutlinePage.java:283) at org.strategoxt.imp.runtime.services.views.outline.SpoofaxOutlinePage$2.run(SpoofaxOutlinePage.java:108) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Issue Log
This would then happen every subsequent edit, and a workaround is to close and open the file again. Seems very similar to https://yellowgrass.org/issue/Spoofax/856.
I fixed it but we really need some proper Spoofax refactoring to fix it properly and avoid similar issues in the future. Every small change introduces ten new bugs.
https://github.com/metaborg/spoofax/commit/638bcfb9237ac20814f9ed1f6d1035b6fd89bc22
Can you sketch what needs to be improved in this refactoring? The code looks like null values need to be handled everywhere and are typically handled by just propagating them.
I think it requires refactoring in the way languages are loaded. Now, during rebuilding of a project, there are various intermediate stages in which only portions of the language are loaded. Instead, a language should first be loaded entirely and should then replace it’s old instance.
There are these two classes called
FileState.java
andEditorState.java
which hold adescriptor
. The descriptor holds an IMP language and other things that describe a Spoofax language, like the ESV definition. Now when a language is reloaded, file states, editor states and descriptors are often still hanging around in all kind of classes. However, they don’t provide access to the possibly updated ESV definition and such.I think once we have our own
Language.java
andLanguageRegistry.java
(not IMP’s ones), we can get rid of editor states, file states and descriptors by moving functionality over toLanguage.java
. Then we have a single point of entry.
Log in to post comments