-
Notifications
You must be signed in to change notification settings - Fork 123
TOML: Trailing Comments in Arrays #3297
Comments
Thank you for asking the question. In general I am already impressed how far you already went in preserving the file structure. I do not think we need to go further. At least not at the moment. Now is time to get your plugin to be ready as default storage plugin. But if you need a decision for the implementation...
Yes, I like this solution. We only need to document this. (Ideally with a whole file where you see where all comments go to.)
This is a very tricky question but a bit abusing of the possibility that you can add comments everywhere, e.g.:
or even:
I think in such situations, like with whitespaces, we do not need to 100% preserve the initial file. So it is okay if your example gets reordered to:
I am looking forward to a big example file where one sees where everything gets assigned to (full meta key name like |
Thanks for the solution! |
I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue. |
I closed this issue now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. |
Currently we lose the comment of the example above: # Comment assigned to array
array = [ # Comment assigned to element 0
- 0, # Inline comment assigned to element 0
+0, # Inline comment assigned to element 0
# Comment assigned to element 1
- 1 # Inline comment assigned to element 1
- # Comment we can't store yet, where/how should we do it?
+1 # Inline comment assigned to element 1
] # Inline comment assigned to array |
I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue. |
I closed this issue now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. |
I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue. |
I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. |
In TOML it is possible to have any amount of comments between the last array element and the closing brackets.
Given the TOML array:
How should we store the non-inline comment after value 1, but before the closing brackets?
It is neither before any element that has a key, nor is it an inline comment for any key.
This is the same issue as with comments at the end of a file, which is currently solved by assigning this comments to the file-root key (where comment metakeys have the special meaning of being "at the end of the file"). The same solution is not possible in this case, since any comment metakey with index > 0 assigned to a non-root key is interpreted as "comment before the key".
The text was updated successfully, but these errors were encountered: