Skip to content

Langium Formatting and Print Width #1646

Answered by msujew
brsanthu asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @brsanthu,

print width style formatting would require a second pass through the document after applying the first formatting (even if only in memory) to figure out where the tokens exceed the print width to correctly calculate further edits. I'm not sure how well this fits into the existing API. In theory you could extend the AbstractFormatter to do exactly that after the "normal" formatting operation.

If it doesn't support that now, are there any plans to add such capability in the future?

Nobody brought this topic up until now, so it wasn't even on our minds :) No plans to add it yet. I plan to refactor the formatter due to various issues that are inherent to the current feature a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by brsanthu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants