Replies: 1 comment 3 replies
-
Hey @goto40, given that Langium only formats the document content between two tokens (never within a token as that changes its semantic value), you will need to write the formatting code for that yourself. The main idea would be as follows:
Note that I'm a bit concerned about the formatting behavior you're proposing. In most language, multi line strings aren't formatted in any way, because doing so will change the semantic content (i.e. the amount of whitespace within). Is that not of concern for your language? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have multiline strings in our model, like
terminal STRING: /"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/;
(still in Langium 2.x).We would like to have a formatter to take care of these multiline strings (e.g. removing any indentation):
Is this somehow possible? What is the strategy, if so?
Beta Was this translation helpful? Give feedback.
All reactions