-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add custom Jayvee formatter #562
Conversation
Co-authored-by: joluj <jablonski@group.riehle.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cars.jv
uses tabs,gtfs-rt.jv
uses spaces. I'd unify this.- Personally, I'm team 2 spaces but I don't really mind.
- Every file should end with exactly one empty line https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline
- Some formatting errors (see comments in files)
These points can be tackled in other PRs though. But we should open issues at least.
Thx, good catches! I noticed in the meanwhile that Langium itself does AST-node-specific formatting. Probably sth we should consider as well (e.g., for the colons). |
I've tried that when I've created the initial POC. For the colons end brackets, I decided against it. With it, we need to explicitly provide every relevant AST element, which seemed laborious for a POC. However, since it goes to production now, we should reevaluate. |
Fixed the issues and converted all examples to use 2 spaces.
That should be tackled in a separate issue (#567). In general, I'm not too happy with the implementation. At some points two formatting are valid that the formatting function switches between when applied. But I'll leave that to future PRs, together with the refactoring to apply formatting not globally but AST node specifically. |
Adds a custom formatter to via the language server protocol.
Future updates might enable using the formatted from CLI.
Works around an issue with comments not being correctly formatted: eclipse-langium/langium#1351