Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Remove unused import warning
Remove unused import warning [message #1753255] Fri, 03 February 2017 06:21 Go to next message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
Hi,

I just updated my workflow to 2.9, and I keep getting this warning from the src-gen\org.services\MyDslGrammarAccess.java.
The import org.eclipse.xtext.service.AbstractElementFinder.AbstractEnumRuleElementFinder is never used.


How can I get rid of this warning? Xtext should not generate this import if it is not used.
Re: Remove unused import warning [message #1753258 is a reply to message #1753255] Fri, 03 February 2017 06:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10431
Registered: July 2009
Senior Member
can you share a minimal reproducing grammar?

how did you do the workflow update? how does the new one look like?
Re: Remove unused import warning [message #1753259 is a reply to message #1753258] Fri, 03 February 2017 06:48 Go to previous messageGo to next message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
MyDsl.xtext
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals

generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"

Model:
	greetings+=(Greeting| Test)*;
	
Greeting:
	'Hello' sample=[Test] 'age' age=INT '!';
Test:
	'Bye' sName=ID '!' 'see' 'you' date=ID letter=WarnTest';'
;

enum WarnTest:
	A = 'a' |
	B = 'b'
;


My workflow is:
module org.xtext.example.mydsl.GenerateMyDsl

import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*

var rootPath = ".."

Workflow {
	
	component = XtextGenerator {
		configuration = {
			project = StandardProjectConfig {
				baseName = "org.xtext.example.mydsl"
				rootPath = rootPath
				runtimeTest = {
					enabled = true
				}
				eclipsePlugin = {
					enabled = true
				}
				eclipsePluginTest = {
					enabled = true
				}
				createEclipseMetaData = true
			}
			code = {
				encoding = "windows-1252"
				fileHeader = "/*\n * generated by Xtext \${version}\n */"
			}
		}
		language = StandardLanguage {
			name = "org.xtext.example.mydsl.MyDsl"
			fileExtensions = "mydsl"

			generator = {
				generateJavaMain = true
			}
			serializer = {
				generateStub = false
			}
			validator = {
				// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
			}
		}
	}
}



I am using Java 1.7 to build the project.
Re: Remove unused import warning [message #1753261 is a reply to message #1753259] Fri, 03 February 2017 07:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10431
Registered: July 2009
Senior Member
Hi,

i have created https://github.com/eclipse/xtext-core/issues/269

the only thing you can to is to suppress warnings in the generated code generally

but that currently buggy as well https://github.com/eclipse/xtext-core/issues/270
Re: Remove unused import warning [message #1753262 is a reply to message #1753261] Fri, 03 February 2017 07:48 Go to previous message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
Thanks, I will just wait for an update on when this can be fixed.
Previous Topic:Troubles With Parsing Numbers
Next Topic:How can i scope Strings or IDs?
Goto Forum:
  


Current Time: Thu Apr 27 13:45:48 GMT 2017

Powered by FUDForum. Page generated in 0.03902 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software