Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Formatter in whitespace aware language
Formatter in whitespace aware language [message #1829050] Wed, 24 June 2020 10:45
Robert Walter is currently offline Robert WalterFriend
Messages: 1
Registered: June 2020
Junior Member
Hello,
I created a whitespace-sensitive language following the documentation.https://www.eclipse.org/Xtext/documentation/307_special_languages.html#whitespace-aware-languages.

Now, I try to to extend the AbstractFormatter2 to make it easy for users to fix whitespace errors. My client is VS Code.

First thing I try to do is to remove all spaces before a top-level statement:
	def dispatch void format(Model model, extension IFormattableDocument document) {
		for (Statement statement: model.statements) {
			statement.prepend[noSpace]
		}
	}


However, I assume because having a whitespace there in the first place is a syntactical error, is why the formatter is not even invoked. Is there a way around this issue?
Previous Topic:Is it possible to parse a subset of the grammar
Next Topic:Getting user types ID
Goto Forum:
  


Current Time: Thu Apr 25 06:43:48 GMT 2024

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

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

Back to the top