Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to add formatter based on the new formatting API to the project
How to add formatter based on the new formatting API to the project [message #1720341] Sun, 17 January 2016 22:01 Go to next message
kozhaev Vladimir is currently offline kozhaev VladimirFriend
Messages: 108
Registered: July 2009
Senior Member
Hi, all
I have read this nice slideshare and domainmodel example provided with API, but can't understand how to add new formatter class to the eclipse infrastructure.

May somebody provide me step-by-step instruction or tutorial?

Regards,
Vladimir
Re: How to add formatter based on the new formatting API to the project [message #1720345 is a reply to message #1720341] Mon, 18 January 2016 02:35 Go to previous message
Weihua Fan is currently offline Weihua FanFriend
Messages: 18
Registered: December 2015
Junior Member
Actually formatter2 support is enabled by default.
If you're using xtext 2.9.0 or 2.9.1 to generate the project, you can see the mwe2 file like this:
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 = "UTF-8"
				fileHeader = "/*\n * generated by Xtext \${version}\n */"
			}
		}
		language = StandardLanguage {
			name = "org.xtext.example.mydsl.MyDsl"
			fileExtensions = "mydsl"

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


you can generate stub codes by adding the following lines under validator:
formatter = {
	generateStub = true
}
Previous Topic:Cross reference issue while using EmbeddedEditor
Next Topic:File Extension problems
Goto Forum:
  


Current Time: Fri Apr 19 14:10:27 GMT 2024

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

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

Back to the top