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

Formatting the code removes all comments #3

Open
pbsladek opened this issue Aug 29, 2017 · 2 comments
Open

Formatting the code removes all comments #3

pbsladek opened this issue Aug 29, 2017 · 2 comments

Comments

@pbsladek
Copy link

#Some comment
database:
  mysql:
    #another comment
    core: null

All comments gets removed. Possible to not remove them?

@adamvoss
Copy link
Owner

The underlying library that provides formatting does not (and will not) support comments. If another workable library can be found that preserves comments, I would be happy to switch.

If no existing library can be found and someone wants to take this on, my recommended starting point would be to see if the parser that powers this extension would be willing to accept a PR to add a node type for comment nodes. If comments appear in the tree, then it would just be a matter of writing a function that produces formatted output given the tree.

A related issue tracking the same [lack of] functionality is adamvoss/vscode-yaml#9.

@erguotou520
Copy link

This is an useful recommendation. Inline comment should be returned also.

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