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

Saving stripes out yaml comments. #81

Open
uxder opened this issue Jun 11, 2020 · 2 comments
Open

Saving stripes out yaml comments. #81

uxder opened this issue Jun 11, 2020 · 2 comments

Comments

@uxder
Copy link
Member

uxder commented Jun 11, 2020

I think saving is stripping out comments.

For example:

$title: Hello
# Some comment
debug: true
# show_grid: true
partials:

turns into:

$title: Hello
debug: true
partials:

Ideally, the editor would retain these comments as they are useful for developer comments.

@Zoramite
Copy link
Member

Right now we don't have the ability to do that since the yaml parser (pyyaml) completely destroys the comments, we don't even have a way to find out what they were.

I did find out that there is one yaml parser that does preserve the comments (https://pypi.org/project/ruamel.yaml/) So we might look at it to see if it would be a valid replacement, at least for changing the yaml files. But we would also need to some crazy trickery to make sure that the comments stay with the correct data.

@jeremydw
Copy link
Member

jeremydw commented Jun 11, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants