I've noticed that spaces preceding commas in inline tables seem to create problems for the formatter. Notably, that everything starting with the comma until the next table item is formatted as plain-text (unformatted).
name = { first = "Tom", last = "Preston-Werner" }
# This works fine.
point = { x = 1, y = 2 }
animal = { name = "pug" }
But if I put a space between the value "Tom" and the comma, it breaks. Everything is unformatted up to the table item point
name = { first = "Tom" , last = "Preston-Werner" }
# ^ space here makes everything following formatted as plain text
# This comment and above are formatted as plain text
# Item after this line returns to correct highlighting
point = { x = 1, y = 2 }
animal = { name = "pug" }
This seems to be independent of the value type. It also breaks for integer values.
name = { first = "Tom" , last = "Preston-Werner" }
point = { x = 1 , y = 2 }
# ^ space here also also breaks the formatter
# This comment and above are formatted as plain text
animal = { name = "pug" }
This bug seems to only apply inside inline tables, and not between them. For example, if i turn point into an array of inline tables, the comma spacing doesn't seem to be affected.
name = { first = "Tom", last = "Preston-Werner" }
# Objects in arrays seem to be fine
point = [ {x = 1} , {y = 2} ]
# ^ This space does not cause a problem
animal = { name = "pug" }
Better TOML: v0.3.2
VS Code: v1.30.2
OSX: v10.14.2
I've noticed that spaces preceding commas in inline tables seem to create problems for the formatter. Notably, that everything starting with the comma until the next table item is formatted as plain-text (unformatted).
Take this example from from the spec.
But if I put a space between the value
"Tom"
and the comma, it breaks. Everything is unformatted up to the table itempoint
This seems to be independent of the value type. It also breaks for integer values.
This bug seems to only apply inside inline tables, and not between them. For example, if i turn
point
into an array of inline tables, the comma spacing doesn't seem to be affected.Better TOML: v0.3.2 VS Code: v1.30.2 OSX: v10.14.2