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

Bug 373873

Summary: Compile error in generated ProposalProvider for languages extending Xtend
Product: [Modeling] TMF Reporter: Sebastian Benz <sebastian.benz>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: christian.dietrich.opensource, karsten.thoms
Version: 2.3.0Keywords: triaged
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Sample Project none

Description Sebastian Benz CLA 2012-03-10 12:31:16 EST
Generating the source code for a language that extends Xtend will result in a compile error in the generated AbstractProposalProvider, as it uses the wrong package name for the XtendProposalProvider:

org.eclipse.xtend.ui.XtendProposalProvider 

instead of 

org.eclipse.xtend.ide.XtendProposalProvider 

A possible fix would be adding a check for xtend in Naming.java:

	public String basePackageUi(Grammar g) {
		// for backward compatibility reasons, the uiBasePackage is only used, if also the grammarId has been explicitly set.
		if (!Strings.isEmpty(uiBasePackage) && (grammarId!=null && grammarId.equals(g.getName())))
			return this.uiBasePackage;
		if(g.getName().equals("org.eclipse.xtend.core.Xtend")){
			return "org.eclipse.xtend.ide";
		}
		return getNamespace(g) + ".ui";
	}
Comment 1 Karsten Thoms CLA 2017-08-29 04:31:06 EDT
Created attachment 270006 [details]
Sample Project
Comment 2 Christian Dietrich CLA 2017-08-31 05:22:33 EDT
i am not sure if this is a "user error"
and the user should modify the workflow to

Workflow {
	
	component = XtextGenerator {
		configuration = org.eclipse.xtend.core.parser.XtendGeneratorModule {
Comment 3 Christian Dietrich CLA 2017-08-31 05:42:44 EDT
(or maybe a subclass of that module to fix the avtivator name again