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

Allow keyword to have different colors #22138

Open
1 task done
takkuumi opened this issue Dec 17, 2024 · 1 comment
Open
1 task done

Allow keyword to have different colors #22138

takkuumi opened this issue Dec 17, 2024 · 1 comment
Labels
enhancement [core label] language An umbrella label for all programming languages syntax behaviors rust Rust programming language support tree-sitter Syntax highlighting and tree-sitter

Comments

@takkuumi
Copy link

Check for existing issues

  • Completed

Describe the feature

VSCODE allows KEYWORD to have different colors.
image

ZED only allows KEYWORD to have one color.
image

Environment

Software:

System Software Overview:

  System Version: macOS 15.1.1 (24B91)
  Kernel Version: Darwin 24.1.0
  Boot Volume: Macintosh HD - 数据
  Boot Mode: Normal
  Computer Name: takumi’s MacBook Pro
  User Name: takumi (takumi)
  Secure Virtual Memory: Enabled
  System Integrity Protection: Enabled
  Time since boot: 9 days, 1 hour, 56 minutes

Hardware:

Hardware Overview:

  Model Name: MacBook Pro
  Model Identifier: MacBookPro16,1
  Processor Name: 8-Core Intel Core i9
  Processor Speed: 2.3 GHz
  Number of Processors: 1
  Total Number of Cores: 8
  L2 Cache (per Core): 256 KB
  L3 Cache: 16 MB
  Hyper-Threading Technology: Enabled
  Memory: 32 GB
  System Firmware Version: 2069.40.2.0.0 (iBridge: 22.16.11072.0.0,0)
  OS Loader Version: 582~2132
  Serial Number (system): C02CH7B5MD6T
  Hardware UUID: A8F6E96A-6964-57F2-ACDE-E6C43E3C665D
  Provisioning UDID: A8F6E96A-6964-57F2-ACDE-E6C43E3C665D
  Activation Lock Status: Enabled

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

No response

@takkuumi takkuumi added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Dec 17, 2024
@uncenter
Copy link
Contributor

This is a Rust-specific highlights improvement issue.
Zed's Rust queries group all keywords under @keyword:

[
"as"
"async"
"await"
"break"
"const"
"continue"
"default"
"dyn"
"else"
"enum"
"extern"
"fn"
"for"
"if"
"impl"
"in"
"let"
"loop"
"macro_rules!"
"match"
"mod"
"move"
"pub"
"ref"
"return"
"static"
"struct"
"trait"
"type"
"union"
"unsafe"
"use"
"where"
"while"
"yield"
(crate)
(mutable_specifier)
(super)
] @keyword

We should look at how nvim-treesitter does this instead, breaking up the keywords into semantic groups such as @keyword.function for the fn keyword and @keyword.conditional for match: https://github.com/nvim-treesitter/nvim-treesitter/blob/c47d8d27d047634d00a07ca80a1b694624743b38/queries/rust/highlights.scm#L239-L344

@jansol jansol added rust Rust programming language support tree-sitter Syntax highlighting and tree-sitter and removed triage Maintainer needs to classify the issue labels Dec 17, 2024
@JosephTLyons JosephTLyons added language An umbrella label for all programming languages syntax behaviors and removed admin read Pending admin review labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] language An umbrella label for all programming languages syntax behaviors rust Rust programming language support tree-sitter Syntax highlighting and tree-sitter
Projects
None yet
Development

No branches or pull requests

4 participants