Files
oak-gpui/crates/languages/src/c/highlights.scm
T
Hayashi Mikihiro 9a72453a2b Highlight control flow in Rust/C/C++ (#39683)
part of https://github.com/zed-industries/zed/issues/9461


Release Notes:
- Added the ability to seperately highlight control flow keywords for
Rust, C and C++ for users and theme authors via the `keyword.control`
syntax property
<img width="805" height="475" alt="スクリーンショット 2025-10-07 22 21 59"
src="https://github.com/user-attachments/assets/40ed03ea-a129-44ce-b6d8-284656b9f3ba"
/>
2025-10-20 13:28:54 +02:00

135 lines
1.4 KiB
Scheme

[
"const"
"enum"
"extern"
"inline"
"sizeof"
"static"
"struct"
"typedef"
"union"
"volatile"
] @keyword
[
"break"
"case"
"continue"
"default"
"do"
"else"
"for"
"goto"
"if"
"return"
"switch"
"while"
] @keyword.control
[
"#define"
"#elif"
"#else"
"#endif"
"#if"
"#ifdef"
"#ifndef"
"#include"
(preproc_directive)
] @keyword
[
"="
"+="
"-="
"*="
"/="
"%="
"&="
"|="
"^="
"<<="
">>="
"++"
"--"
"+"
"-"
"*"
"/"
"%"
"~"
"&"
"|"
"^"
"<<"
">>"
"!"
"&&"
"||"
"=="
"!="
"<"
">"
"<="
">="
"->"
"?"
":"
] @operator
[
"."
";"
","
] @punctuation.delimiter
[
"{"
"}"
"("
")"
"["
"]"
] @punctuation.bracket
[
(string_literal)
(system_lib_string)
(char_literal)
] @string
(comment) @comment
(number_literal) @number
[
(true)
(false)
] @boolean
(null) @constant.builtin
(identifier) @variable
((identifier) @constant
(#match? @constant "^_*[A-Z][A-Z\\d_]*$"))
(call_expression
function: (identifier) @function)
(call_expression
function: (field_expression
field: (field_identifier) @function))
(function_declarator
declarator: (identifier) @function)
(preproc_function_def
name: (identifier) @function.special)
(field_identifier) @property
(statement_identifier) @label
[
(type_identifier)
(primitive_type)
(sized_type_specifier)
] @type