-
Notifications
You must be signed in to change notification settings - Fork 39
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
Failed yaml edit #1938
Closed
sigurdm opened this issue
Aug 10, 2023
· 2 comments
· Fixed by dart-archive/yaml_edit#75 or dart-archive/yaml_edit#76
Closed
Failed yaml edit #1938
sigurdm opened this issue
Aug 10, 2023
· 2 comments
· Fixed by dart-archive/yaml_edit#75 or dart-archive/yaml_edit#76
Labels
Comments
@jonasfj we should look into this. |
jonasfj
referenced
this issue
in jonasfj/yaml_edit
May 2, 2024
Fixes #55. When the value is empty the `SourceSpan` for the `YamlNode` representing the value in a map points to the colon. Example: ```yaml foo: bar: ``` The `YamlNode` for `foo.bar` has a value of `null` and starts and ends at the colon `:` following `bar`. This means that removal might leave the colon behind, which causes invalid YAML. We have the same issue when removing `foo.bar` from the following YAML document: ```yaml foo: baz: true bar: ``` However, in this case, we have a hack that ensures we always strip away the any comments that follows `bar`. We do this by deleting up-to the next newline. If we apply the same hack when removing `foo.bar` in the first example, then it works. One could argue that it works by accident, but it's kind of desired that trailing comments are removed, when the value they are trailing is removed.
jonasfj
referenced
this issue
in dart-archive/yaml_edit
May 2, 2024
Fix removal of last key from map in block-mode when value is empty. Fixes #55. When the value is empty the `SourceSpan` for the `YamlNode` representing the value in a map points to the colon. Example: ```yaml foo: bar: ``` The `YamlNode` for `foo.bar` has a value of `null` and starts and ends at the colon `:` following `bar`. This means that removal might leave the colon behind, which causes invalid YAML. We have the same issue when removing `foo.bar` from the following YAML document: ```yaml foo: baz: true bar: ``` However, in this case, we have a hack that ensures we always strip away the any comments that follows `bar`. We do this by deleting up-to the next newline. If we apply the same hack when removing `foo.bar` in the first example, then it works. One could argue that it works by accident, but it's kind of desired that trailing comments are removed, when the value they are trailing is removed.
If the file ends immediately after |
mosuem
referenced
this issue
Dec 11, 2024
Fix removal of last key from map in block-mode when value is empty. Fixes dart-lang/yaml_edit#55. When the value is empty the `SourceSpan` for the `YamlNode` representing the value in a map points to the colon. Example: ```yaml foo: bar: ``` The `YamlNode` for `foo.bar` has a value of `null` and starts and ends at the colon `:` following `bar`. This means that removal might leave the colon behind, which causes invalid YAML. We have the same issue when removing `foo.bar` from the following YAML document: ```yaml foo: baz: true bar: ``` However, in this case, we have a hack that ensures we always strip away the any comments that follows `bar`. We do this by deleting up-to the next newline. If we apply the same hack when removing `foo.bar` in the first example, then it works. One could argue that it works by accident, but it's kind of desired that trailing comments are removed, when the value they are trailing is removed.
mosuem
referenced
this issue
Dec 11, 2024
…om (dart-archive/yaml_edit#76) block map. Fixes dart-lang/yaml_edit#55.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Reproduction:
No
pubspec.lock
.The text was updated successfully, but these errors were encountered: