Skip to content

Empty string literal is not highlighted with correct colors JSON Rust #54838

@sinder38

Description

@sinder38

Reproduction steps

  1. Start Zed
  2. Open a rust file
  3. past this code:
        serde_json::json!({
            "email": "",
            "password": "password123",
            "requires2FA": false
        }),
  1. Observe the syntax highlighting for the empty string value(s)
Image
  1. Highlight color is incorrect

Current vs. Expected behavior

Current behavior: Empty string values (e.g. "") and the rest after are highlighted differently

Expected behavior: highlighted properly

Zed version and system specs

Both stable and preview tested

Zed: v0.233.8+stable (Zed)
OS: Linux Wayland endeavouros unknown
Memory: 7.4 GiB
Architecture: x86_64
GPU: Intel(R) Iris(R) Xe Graphics (TGL GT2) || Intel open-source Mesa driver || Mesa 26.0.5-arch1.1

Zed: v0.233.3+preview.233.3ae52299d4af96a6a2caf663d02516fc469a15cb (Zed Preview)
OS: Linux Wayland endeavouros unknown
Memory: 7.4 GiB
Architecture: x86_64
GPU: Intel(R) Iris(R) Xe Graphics (TGL GT2) || Intel open-source Mesa driver || Mesa 26.0.5-arch1.1

Attach Zed log file

Zed.log

Relevant Zed settings

settings.json

Relevant Keymap

keymap.json

(for AI issues) Model provider details

No response

If you are using WSL on Windows, what flavor of Linux are you using?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:languages/rustRust programming language supportarea:tree-sitterSyntax highlighting and tree-sitterfrequency:uncommonBugs that happen for a small subset of users, special configurations, rare circumstances, etcpriority:P3Papercuts, minor issues with a clear workaround, cosmetic bugsstate:reproducibleVerified steps to reproduce included and someone on the team managed to reproduce

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions