Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367397 - InvocationTargetException on Content Assist
Summary: InvocationTargetException on Content Assist
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.2.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-22 03:57 EST by Fabio Filippelli CLA
Modified: 2011-12-22 03:58 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Filippelli CLA 2011-12-22 03:57:13 EST
Build Identifier: Xtext 2.2.1 - Eclipse Indigo (20110916-0149)

We have created following Xtext grammar: 
http://teamprojekt-msi.googlecode.com/svn/trunk/spray-extensions/shapes/org.eclipselabs.spray.shapes/src/org/eclipselabs/spray/shapes/Shape.xtext. 

The code highlighting and all editor functionalities are working well in the Eclipse Application Runtime that for the DSL. 
Just the Code Completion is not working on some context. 

There we get a exception message:
!ENTRY org.eclipse.ui 4 0 2011-12-22 09:47:38.830
!MESSAGE java.lang.reflect.InvocationTargetException
!STACK 0
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at org.eclipse.xtext.ui.editor.contentassist.antlr.AbstractContentAssistParser.getFollowElements(AbstractContentAssistParser.java:237)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.AbstractContentAssistParser.getFollowElements(AbstractContentAssistParser.java:141)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory$StatefulFactory.computeFollowElements(ParserBasedContentAssistContextFactory.java:387)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory$StatefulFactory.computeFollowElements(ParserBasedContentAssistContextFactory.java:343)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory$StatefulFactory.computeFollowElements(ParserBasedContentAssistContextFactory.java:337)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory$StatefulFactory.doCreateContexts(ParserBasedContentAssistContextFactory.java:286)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory$StatefulFactory.handleLastCompleteNodeIsAtEndOfDatatypeNode(ParserBasedContentAssistContextFactory.java:212)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory$StatefulFactory.doCreateContexts(ParserBasedContentAssistContextFactory.java:161)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory$StatefulFactory.create(ParserBasedContentAssistContextFactory.java:148)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory.create(ParserBasedContentAssistContextFactory.java:549)
	at org.eclipse.xtext.ui.editor.contentassist.CompletionProposalComputer.exec(CompletionProposalComputer.java:48)
	at org.eclipse.xtext.ui.editor.contentassist.CompletionProposalComputer.exec(CompletionProposalComputer.java:1)
	at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:32)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:78)
	at org.eclipse.xtext.ui.editor.contentassist.XtextContentAssistProcessor.computeCompletionProposals(XtextContentAssistProcessor.java:69)
	at org.eclipse.xtext.ui.editor.contentassist.RepeatedContentAssistProcessor.computeCompletionProposals(RepeatedContentAssistProcessor.java:73)
	at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1830)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:556)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:553)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:488)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:482)
	at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1656)
	at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:930)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1534)
	at org.eclipse.ui.texteditor.ContentAssistAction$1.run(ContentAssistAction.java:82)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:80)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
	at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100)
	at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1509)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4640)
	at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4528)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2531)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	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:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.AbstractContentAssistParser.getFollowElements(AbstractContentAssistParser.java:210)
	... 76 more
Caused by: java.lang.IllegalStateException
	at org.eclipse.xtext.parser.antlr.UnorderedGroupHelper$State.canLeave(UnorderedGroupHelper.java:228)
	at org.eclipse.xtext.parser.antlr.UnorderedGroupHelper.canLeave(UnorderedGroupHelper.java:146)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.AbstractContentAssistParser$2.canLeave(AbstractContentAssistParser.java:132)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.AbstractContentAssistParser$3.announceEof(AbstractContentAssistParser.java:170)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.ObservableXtextTokenStream.LA(ObservableXtextTokenStream.java:48)
	at org.eclipselabs.spray.shapes.ui.contentassist.antlr.internal.InternalShapeParser.synpred184_InternalShape_fragment(InternalShapeParser.java:11335)
	at org.eclipselabs.spray.shapes.ui.contentassist.antlr.internal.InternalShapeParser.synpred184_InternalShape(InternalShapeParser.java:12880)
	at org.eclipselabs.spray.shapes.ui.contentassist.antlr.internal.InternalShapeParser$DFA134.specialStateTransition(InternalShapeParser.java:15609)
	at org.antlr.runtime.DFA.predict(DFA.java:80)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.internal.DFA.predict(DFA.java:25)
	at org.eclipselabs.spray.shapes.ui.contentassist.antlr.internal.InternalShapeParser.rule__PolyLineLayout__UnorderedGroup_1__Impl(InternalShapeParser.java:64633)
	at org.eclipselabs.spray.shapes.ui.contentassist.antlr.internal.InternalShapeParser.rule__PolyLineLayout__UnorderedGroup_1__0(InternalShapeParser.java:64851)
	at org.eclipselabs.spray.shapes.ui.contentassist.antlr.internal.InternalShapeParser.rule__PolyLineLayout__UnorderedGroup_1(InternalShapeParser.java:64593)
	... 81 more


Reproducible: Always

Steps to Reproduce:
1. Create a new Xtext project (extension shape)
2. Use the grammar (with XBase Inheritance - comment StyleLayout
3. Run the MWE2 generator
4. Run an Eclipse Application for this grammar
5. Create a new Java Project and a new file with the extension "shape"
6. Put following conten in the file:
shape BPMN_Gateway_OR {
	polygon  {
		point(x=0,y=30)
		point(x=30,y=0)
		point(x=60,y=25)
		point(x=30,y=60)		
                // TRY CONTENT ASSIST HERE
		ellipse {
			position(x=15,y=15)
			size(width=30, height=30)
		}
	}
}
7. Try the content assist on the marked position.