strange behavior of XImportSection [message #1053342] |
Sat, 04 May 2013 06:55 |
|
Hi
I'm using the new XImportSection in my DSL like this
TJProgram:
('package' name=QualifiedName ';')?
importSection=XImportSection?
elements+=TJDeclaration*
;
now when using content assist for completing Java type references, this
works most of the time (and the import statement is automatically added).
However, especially when there is currently no import in the program,
the completion does not work and I see this exception
org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal
- Error applying completion proposal
java.lang.ClassCastException:
org.eclipse.xtext.nodemodel.impl.HiddenLeafNode cannot be cast to
org.eclipse.xtext.nodemodel.ICompositeNode
at
org.eclipse.xtext.xbase.imports.DefaultImportsConfiguration.findPreviousNode(DefaultImportsConfiguration.java:151)
at
org.eclipse.xtext.xbase.imports.DefaultImportsConfiguration.getImportSectionOffset(DefaultImportsConfiguration.java:127)
at
org.eclipse.xtext.xbase.imports.ImportSectionRegionUtil.computeRegion(ImportSectionRegionUtil.java:41)
at
org.eclipse.xtext.xbase.imports.RewritableImportSection.addSectionToAppend(RewritableImportSection.java:284)
at
org.eclipse.xtext.xbase.imports.RewritableImportSection.rewrite(RewritableImportSection.java:264)
at
org.eclipse.xtext.xbase.ui.contentassist.ImportingTypesProposalProvider$FQNImporter.apply(ImportingTypesProposalProvider.java:167)
at
org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal.apply(ConfigurableCompletionProposal.java:143)
at
org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal.apply(ConfigurableCompletionProposal.java:335)
at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:940)
at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:891)
at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:1323)
at
org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:808)
at
org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:491)
at
org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:65)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1416)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1401)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187)
at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5940)
at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5636)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1416)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1401)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1428)
at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:829)
at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:3186)
at
org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:758)
at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2092)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:5344)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4544)
at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8654)
at org.eclipse.swt.widgets.Display.eventProc(Display.java:1243)
at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2283)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3336)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1108)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:992)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:137)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:600)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:555)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03490 seconds