Did you guys want to format languages.toml? #15869
Replies: 2 comments
|
YES! It has been bugging me for a very long time, but I just assumed that the PR would not be accepted. Maybe now before the big new release is a great time to do it :) Regardless of the specific formatting choice, the project should use a mainstream, supported formatting tool to ensure long-term maintainability. Unfortunately the 2 main obvious choices have problems, https://github.com/tamasfe/taplo is as good as dead, and https://github.com/tombi-toml/tombi seems very sloppy and vibe coded with a new release every 5 minutes. Maybe https://www.npmjs.com/package/prettier-plugin-toml is the way to go. I don't really care too much about the spaces around [[language]]
name = "rust"
scope = "source.rust"
injection-regex = "rs|rust"To the example you call normal with the excessive spacing added. It goes deeper than just the formatting:
[language-server.ansible-language-server]
command = "ansible-language-server"
args = ["--stdio"]Which should have been added at the top under ansible-language-server = { command = "ansible-language-server", args = ["--stdio"] }These cases need correcting to standardise the style and make it easy to read. |
|
I wouldn't really care for a formatting change to languages.toml. I think that the benefits of formatting are questionable for such a straightforward nearly-text document. Enforcing formatting adds a hurdle to the contribution path - you need to ensure your change satisfies the formatter - and I don't see much concrete upshot like I do for Rust formatting (i.e. that you never need to argue about how the code should be laid out). languages.toml changes are fairly often very minor drive-by like changes, and you don't need much project context to make the change. I think that formatting would punish those kinds of changes. Separately I really disagree that using spaces to align items on either side of equals signs is a good idea, like you suggest with rust vs. circom in the original post. Adding a new key then might mean reformatting the entire block, making a noisy diff. I don't see it as a good tradeoff since the upshot seems to be purely cosmetic and the downside is noisy churn. All language formatters that I am aware of avoid this trap. And overall I see us deleting this file as we work towards coalescing config.toml and languages.toml options and moving them into scheme. Requiring the scheme to be formatted seems alright to me, but I'm not so convinced about formatting for TOML. |
Uh oh!
There was an error while loading. Please reload this page.
I want to contribute something (like using deno lsp for js and ts, supporting liquid), but I found there is not a unique style in languages.toml.
I think it is bad to have multiple styles in one file.
whitespace between
argsand=strange:
helix/languages.toml
Line 67 in 1cbad94
normal:
helix/languages.toml
Line 76 in 1cbad94
whitespace between
=and "strange:
helix/languages.toml
Line 5463 in 1cbad94
helix/languages.toml
Line 3086 in 1cbad94
normal:
helix/languages.toml
Line 5482 in 1cbad94
helix/languages.toml
Line 326 in 1cbad94
format or not?
strange:
helix/languages.toml
Lines 325 to 341 in 1cbad94
normal:
helix/languages.toml
Lines 4622 to 4631 in 1cbad94
But, formatting such a large file (~5511 lines) will result in lots of changes. It may be a bad idea to shadow others' edits.
I try to format, then I get
715 insertions(+), 359 deletions(-).So, what should we do?
All reactions