Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 370626

Summary: [xtend] Completion on TypeName can cause ValueConverterException
Product: [Modeling] TMF Reporter: Marcel Bruch <marcel.bruch>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: jan, sebastian.zarnekow
Version: 2.3.0Flags: sebastian.zarnekow: juno+
Target Milestone: M6   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Example none

Description Marcel Bruch CLA 2012-02-04 04:23:23 EST
I'm triggering code completion in 

def exercise(CharSequence code, List<String> expected){
[...]
sut.sessionStarted

Stopw$ <-- <^Space> triggered at $, $ is cursor position (not part of the editor content)

[...]

causes the following exception when applying one of the proposals. Completion just does nothing but error log shows the exception.


org.eclipse.xtext.conversion.ValueConverterException: ID may not be empty.
	at org.eclipse.xtext.conversion.impl.AbstractIDValueConverter.assertValidValue(AbstractIDValueConverter.java:68)
	at org.eclipse.xtext.conversion.impl.AbstractIDValueConverter.assertValidValue(AbstractIDValueConverter.java:1)
	at org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter.toString(AbstractLexerBasedConverter.java:41)
	at org.eclipse.xtext.conversion.impl.AbstractDeclarativeValueConverterService.toString(AbstractDeclarativeValueConverterService.java:58)
	at org.eclipse.xtext.conversion.impl.KeywordAlternativeConverter.toString(KeywordAlternativeConverter.java:48)
	at org.eclipse.xtext.conversion.impl.KeywordAlternativeConverter.toString(KeywordAlternativeConverter.java:1)
	at org.eclipse.xtext.conversion.impl.AbstractDeclarativeValueConverterService.toString(AbstractDeclarativeValueConverterService.java:58)
	at org.eclipse.xtext.conversion.impl.QualifiedNameValueConverter.delegateToString(QualifiedNameValueConverter.java:135)
	at org.eclipse.xtext.conversion.impl.QualifiedNameValueConverter.toString(QualifiedNameValueConverter.java:74)
	at org.eclipse.xtext.xbase.conversion.StaticQualifierValueConverter.toString(StaticQualifierValueConverter.java:34)
	at org.eclipse.xtext.conversion.impl.QualifiedNameValueConverter.toString(QualifiedNameValueConverter.java:1)
	at org.eclipse.xtext.xtend2.ui.contentassist.ImportingTypesProposalProvider$FQNImporter.apply(ImportingTypesProposalProvider.java:145)
	at org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal.apply(ConfigurableCompletionProposal.java:139)
	at org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal.apply(ConfigurableCompletionProposal.java:323)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:930)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:881)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$27(CompletionProposalPopup.java:877)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$5.widgetDefaultSelected(CompletionProposalPopup.java:657)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:119)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4135)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3981)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3620)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:999)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:893)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:85)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:579)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:534)
	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:352)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:624)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1433)
Comment 1 Marcel Bruch CLA 2012-02-04 04:27:24 EST
yes, syntax is wrong... :)
Comment 2 Sebastian Zarnekow CLA 2012-02-04 04:44:37 EST
Marcel, could you please provide the a complete file as a repro? Which proposal did you select?
Comment 3 Marcel Bruch CLA 2012-02-04 04:54:47 EST
Created attachment 210537 [details]
Example

Attached simple test scenario that causes the exception in my setup.

Trigger position is $.

Selected:
java.lang.String

Installed version:
Xtend2 SDK 2.3.0.v201201310353
Comment 4 Jan Koehnlein CLA 2012-02-09 06:52:55 EST
I could not reproduce this on the current HEAD. I suppose the fix came with cb811286a096cea2ade126172fffc33bee0248e6.
Comment 5 Sebastian Zarnekow CLA 2012-02-17 09:14:01 EST
Just stumbled accross this one
Comment 6 Sebastian Zarnekow CLA 2012-02-17 09:58:22 EST
Turned out that the problem was caused by a recent refactoring. 

see bug 369411
Comment 7 Karsten Thoms CLA 2017-09-19 16:59:07 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 8 Karsten Thoms CLA 2017-09-19 17:10:36 EDT
Closing all bugs that were set to RESOLVED before Neon.0