Formatter in whitespace aware language [message #1829050] |
Wed, 24 June 2020 10:45 |
Robert Walter 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?
|
|
|
Powered by
FUDForum. Page generated in 5.04007 seconds