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

Support formatting json with comments #840

Closed
matklad opened this issue Apr 21, 2023 · 4 comments
Closed

Support formatting json with comments #840

matklad opened this issue Apr 21, 2023 · 4 comments
Labels
wontfix This will not be worked on

Comments

@matklad
Copy link

matklad commented Apr 21, 2023

I have the following in my VsCode's settings.json (which is a "json-with-comments file despite the extension"):

    "[json]": {
        "editor.defaultFormatter": "denoland.vscode-deno"
    },
    "[jsonc]": {
        "editor.defaultFormatter": "denoland.vscode-deno"
    },

However, if I try to format it I get

image

It feels like this should just work, and perhaps there's some config somewhere missing to enable this?

@dsherret
Copy link
Member

dsherret commented Apr 24, 2023

I'm not sure what's causing that for you because when I try that it works for me :/

(I'm also not sure where this is configured)

@matklad
Copy link
Author

matklad commented Apr 24, 2023

Aha, that's very curious. When I open my settings.json as a file, formatting works. However, if I open it via Ctrl+Shift+P > Open User Settings (JSON), then I see the above dialog. So it looks like vscode bug

@bartlomieju
Copy link
Member

Hey @matklad, have you experience the same problem again? I'm not sure if we should investigate it on our side or if that's been fixed.

@bartlomieju
Copy link
Member

Please see #860 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants