-
Notifications
You must be signed in to change notification settings - Fork 595
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 TOML syntax #4167
Comments
It is also a supported Markdown frontmatter syntax, already supported by MarkdownEditing. Hugo requires it for instance. |
We are broadly in favor of adding TOML. |
With regards to https://toml.io/en/v1.0.0#array-of-tables I wonder how strictly we want to follow a "meta.mapping.key" interpretation or how it corresponds/maps to JSON. Current TOML, INI and GitConfig scope sections TOML actually calls it "table". As I guess general highlighting would probably be pretty unexpected. TOMLJSON |
|
Semantically, I think an |
Makes sense, but also renders see "Dotted keys": name = "Orange"
physical.color = "orange"
physical.shape = "round"
site."google.com" = true
1.2."foo" = "value If section headers are scoped as proposed, keys should follow such schema, too, which leads us back to Other than YAML, all keys are "strings" in JSON and TOML. |
No, I don't see how this relates to my argument. My point is that the For the dot-joined individual keys (which I didn't even know were legal until now and don't remember seeing anywhere 🙃 ), they would still be string keys of a mapping, same as JSON. The question I do not have an answer for right now is whether the full path should be scoped as I saw that you opened a PR but I'm short on time these days so I won't be looking at that in detail. I might take a look at open discussions some time during the next week, though, like this one. |
TOML is comparable to JSON and YAML, which we both already have in the default packages, and it has gained significant traction from being used for packaging metadata in both the Python and Rust ecosystems, which we also already support in the default packages. TOML is, however, also used in other fashion such as generic configuration files by individual applications and recently even started showing up inline for Rust (unstable, see also #4164) and Python ("living standard").
A package that provides TOML syntax support exists on Package Control since 2013 and has been installed a total of 76k times with around 25 installations daily. I personally have been using it for years and cannot name any shortcomings right now besides the scope naming being a bit dated compared to what we agreed upon in the recent years (using
entity.name.tag
instead ofmeta.mapping.key
), but I also have not investigated closer right now.In order to properly support inline metadata highlighting inside the Rust and Python syntaxes, TOML must also be available in the default packages because otherwise it is not guaranteed to be available and we do not want to depend on third-party package. We may also want to built it in a way that allows the Python syntax to trivially extend it to strip away the comment punctuation that is necessary inside the file to not interfere with actual source code.
According to @deathaxe, Package Control 4 handles third-party packages with the same name as a default package "gracefully", but we are also in a position to adjust the PC code to provide commands that specifically target the integration of a new default package in the future, if necessary.
The previous attempt to get it into the default packages (#453) was shot down in 2016, but I believe that the situation has changed since then.
The text was updated successfully, but these errors were encountered: