How to define different indentation levels in the same document with Xtext formatter
问题 Is it possible to format a document as follows, using Xtext formatting? As you can see, Test children are indented with 4 spaces while External children are indented with 2 spaces only. I am using Xtext 2.12.0. Test my_prog { Device = "my_device"; Param = 0; } External { Path = "my_path"; File = "my_file"; } 回答1: you could try to work with custom replacers, dont know if this will work with nested block though def dispatch void format(External model, extension IFormattableDocument document) {