helix/runtime/queries/cue/highlights.scm

156 lines
1.8 KiB
Scheme
Raw Normal View History

; Includes
[
"package"
"import"
] @keyword.control.import
2022-07-31 20:04:57 +08:00
; Namespaces
(package_identifier) @namespace
2022-07-31 20:04:57 +08:00
(import_spec
[
"."
"_"
] @punctuation.special)
2022-07-31 20:04:57 +08:00
[
(attr_path)
(package_path)
] @string.special.url ; In attributes
; Attributes
(attribute) @attribute
; Conditionals
"if" @keyword.control.conditional
; Repeats
"for" @keyword.control.repeat
(for_clause
"_" @punctuation.special)
; Keywords
"let" @keyword
"in" @keyword.operator
; Operators
[
"+"
"-"
2022-07-31 20:04:57 +08:00
"*"
"/"
2022-07-31 20:04:57 +08:00
"|"
"&"
"||"
"&&"
"=="
"!="
"<"
"<="
">"
">="
"=~"
"!~"
"!"
"="
2022-07-31 20:04:57 +08:00
] @operator
; Fields & Properties
(field
(label
(identifier) @variable.other.member))
2022-07-31 20:04:57 +08:00
(selector_expression
(_)
(identifier) @variable.other.member)
2022-07-31 20:04:57 +08:00
; Functions
(call_expression
function: (identifier) @function)
2022-07-31 20:04:57 +08:00
(call_expression
function: (selector_expression
(_)
(identifier) @function))
2022-07-31 20:04:57 +08:00
(call_expression
function: (builtin_function) @function)
2022-07-31 20:04:57 +08:00
(builtin_function) @function.builtin
2022-07-31 20:04:57 +08:00
; Variables
(identifier) @variable
2022-07-31 20:04:57 +08:00
; Types
(primitive_type) @type.builtin
2022-07-31 20:04:57 +08:00
((identifier) @type
(#match? @type "^_?#"))
2022-07-31 20:04:57 +08:00
[
(slice_type)
(pointer_type)
] @type ; In attributes
2022-07-31 20:04:57 +08:00
; Punctuation
2022-07-31 20:04:57 +08:00
[
","
":"
] @punctuation.delimiter
[
"{"
"}"
"["
"]"
"("
")"
"<"
">"
2022-07-31 20:04:57 +08:00
] @punctuation.bracket
[
(ellipsis)
"?"
] @punctuation.special
; Literals
(string) @string
2022-07-31 20:04:57 +08:00
[
(escape_char)
(escape_unicode)
] @constant.character.escape
2022-07-31 20:04:57 +08:00
(number) @constant.numeric
2022-07-31 20:04:57 +08:00
(float) @constant.numeric.float
2022-07-31 20:04:57 +08:00
(si_unit
(float)
(_) @string.special.symbol)
2022-07-31 20:04:57 +08:00
(boolean) @constant.builtin.boolean
2022-07-31 20:04:57 +08:00
[
(null)
(top)
(bottom)
] @constant.builtin
; Interpolations
(interpolation
"\\(" @punctuation.special
(_)
")" @punctuation.special)
(interpolation
"\\("
(identifier) @variable
")")
; Comments
(comment) @comment