You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This feature is mostly complete but tests fail under certain conditions when saving preceeding comments for structural variables (tables and arrays).
Variable is not ordering is not guaranteed. This is due to the TOML spec requiring that structural variables appear at the end of a document to resolve ambiguities in the variable heirarchy.
Since ordering is not guaranteed, and tomlkit does not explicitly know that preceeding comments are associated with variables, structural variables can be moved around during document rendering, with their preceeding comments left behind in undesirable locations in the document.
An unideal solution to this problem could make use of reflection, in a sense. A tomlkit document maintains two private fields:
_body: A list of (key (name), value) tuples
_map: A dictionary mapping a key (name) to the index of the key in _body.
It may be possible to manipulate the rendering order of the document by manually moving the index of preceeding comments to just before the new table location. Depending on when reordering takes place, this may or may not be feasible.
there may be other easier solutions, or if all else fails, we can just manipulate the rendered string.
The text was updated successfully, but these errors were encountered:
This feature is mostly complete but tests fail under certain conditions when saving preceeding comments for structural variables (tables and arrays).
Variable is not ordering is not guaranteed. This is due to the TOML spec requiring that structural variables appear at the end of a document to resolve ambiguities in the variable heirarchy.
Since ordering is not guaranteed, and tomlkit does not explicitly know that preceeding comments are associated with variables, structural variables can be moved around during document rendering, with their preceeding comments left behind in undesirable locations in the document.
An unideal solution to this problem could make use of reflection, in a sense. A tomlkit document maintains two private fields:
_body
: A list of (key (name), value) tuples_map
: A dictionary mapping a key (name) to the index of the key in_body
.It may be possible to manipulate the rendering order of the document by manually moving the index of preceeding comments to just before the new table location. Depending on when reordering takes place, this may or may not be feasible.
there may be other easier solutions, or if all else fails, we can just manipulate the rendered string.
The text was updated successfully, but these errors were encountered: