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

jsonc formatter adds trailing commas and triggers warnings #21303

Closed
1 task done
matthewmueller opened this issue Nov 28, 2024 · 1 comment
Closed
1 task done

jsonc formatter adds trailing commas and triggers warnings #21303

matthewmueller opened this issue Nov 28, 2024 · 1 comment
Labels
duplicate Additional reports of an existing issue

Comments

@matthewmueller
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Create a jsonc file like, e.g. config.jsonc

// This is a dot schema file. It defines the server configuration for your project.
// For more information, visit https://dot.io/docs/schema
{
  // Application name
  "name": "", // e.g., "my-app"
  // Domains for the app (leave empty for local development)
  // Example: ["example.com", "api.example.com"]
  "domains": [],
  // Host servers to deploy to
  "hosts": {
    "main": {
      "host": "localhost:2222",
      "admin": "ubuntu",
      "user": "dot"
    }
  },
}

Then hit save, the formatter will append trailing commas, leading to warnings.

Environment

Zed: v0.162.5 (Zed)
OS: macOS 14.6.1
Memory: 64 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Quick video:

CleanShot.2024-11-28.at.14.56.37.mp4

I'd expect the formatter to not generate trailing commas. This also matches what VSCode does.

If applicable, attach your Zed.log file to this issue.

Zed.log

@notpeter notpeter added duplicate Additional reports of an existing issue and removed bug [core label] triage labels Dec 3, 2024
@notpeter
Copy link
Member

notpeter commented Dec 3, 2024

This is an upstream prettier issue:

Duplicate of:

Explicitly called out in the Zed JSON Language Docs.

@notpeter notpeter closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Additional reports of an existing issue
Projects
None yet
Development

No branches or pull requests

2 participants