Skip to content
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

wrapAsYamlNode should apply style recursively #24

Closed
dcharkes opened this issue Oct 7, 2022 · 4 comments
Closed

wrapAsYamlNode should apply style recursively #24

dcharkes opened this issue Oct 7, 2022 · 4 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@dcharkes
Copy link

dcharkes commented Oct 7, 2022

https://pub.dev/documentation/yaml_edit/latest/yaml_edit/wrapAsYamlNode.html

Should this wrap recursively?

input (lists, strings, maps):

[{name: bla, packaging: dynamic, path: {path_type: absolute, uri: path/with spaces/bla.dll}, target: windows_x64}]

output:

- name: bla
  packaging: dynamic
  path:
    path_type: absolute
    uri: path/with spaces/bla.dll
  target: windows_x64

conversion

String _toYamlString(Object yamlEncoding) => (YamlEditor('')
      ..update(
          [],
          wrapAsYamlNode(
            yamlEncoding,
            collectionStyle: CollectionStyle.BLOCK,
            scalarStyle: ScalarStyle.DOUBLE_QUOTED,
          )))
    .toString();

Asked for quotes, but didn't get any.

@devoncarew devoncarew added the type-enhancement A request for a change that isn't a bug label Nov 11, 2022
@jonasfj
Copy link
Member

jonasfj commented Dec 21, 2022

@dcharkes would #26 solve this problem better?

@dcharkes
Copy link
Author

Since wrapAsYamlNode already takes style arguments, why not add a recursive boolean or recursion depth to it instead rather than introducing a new method? It's unclear to me why wrapAsCustomStyledYamlNode should apply style why wrapAsYamlNode shouldn't.

@jonasfj
Copy link
Member

jonasfj commented Dec 21, 2022

I think wrapAsYamlNode probably could apply recursively, hmm, I guess that would solve most issues.

The wrapAsCustomStyledYamlNode is only really if you want to control styling even more.

@jonasfj
Copy link
Member

jonasfj commented Mar 2, 2023

Fixed

@jonasfj jonasfj closed this as completed Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants