Skip to content

Typescript/Javascript ternary operators do not receive theme colors #41593

@alechemy

Description

@alechemy

Summary

The javascript and typescript language highlight files assign the @operator token to ? and : ternary operators, but Zed isn't applying theme colors to these operators.

Image

Description

See summary. The relevant language highlight files are here:

Steps to reproduce:

  1. In settings.json, configure a theme override for syntax.operator, e.g.:
"theme_overrides": {
    "Night Owl Dark": {
      "syntax": {
        "operator": {
          "color": "#c792ea",
          "font_style": null,
          "font_weight": null
        }
    }
}
  1. In a JS or TS file, write a ternary expression, e.g. export const foo = true ? 1 : 0;

Expected Behavior:

  1. The ? and : should receive the color specified in settings.json.

Actual Behavior:

  1. Observe that the ? and : do not receive the color specified in settings.json.

Zed Version and System Specs

Zed: v0.210.4 (Zed)
OS: macOS 15.7.2
Memory: 32 GiB
Architecture: aarch64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions