helix-mirror/runtime/queries/unison/highlights.scm

119 lines
1.8 KiB
Scheme
Raw Normal View History

2023-08-08 22:50:49 +04:00
;; Primitives
(comment) @comment
(nat) @constant.numeric
(unit) @constant.builtin
(literal_char) @constant.character
(literal_text) @string
(literal_boolean) @constant.builtin.boolean
;; Keywords
[
(kw_forall)
(kw_equals)
(do)
(kw_let)
2023-09-17 22:23:19 +04:00
(ability)
(where)
2023-08-08 22:50:49 +04:00
] @keyword
(kw_let) @keyword.function
(type_kw) @keyword.storage.modifier
2023-09-17 22:23:19 +04:00
(structural) @keyword.storage.modifier
2023-08-08 22:50:49 +04:00
("use") @keyword.control.import
(unique) @keyword.storage.modifier
2023-08-08 22:50:49 +04:00
[
(operator)
(pipe)
(arrow_symbol)
(or)
2023-09-17 22:23:19 +04:00
(and)
2023-08-08 22:50:49 +04:00
] @operator
[
"if"
"else"
"then"
(match)
(with)
(cases)
] @keyword.control.conditional
(blank_pattern) @variable.builtin
(pattern) @variable
(use_clause) @keyword.import
2023-08-08 22:50:49 +04:00
;; Types
(record_field
(field_name) @variable.other.member
type: (regular_identifier) @type)
(type_name) @type
(type_declaration
(regular_identifier) @type.enum.variant)
(ability_name
(path)? @namespace
(regular_identifier) @type)
2023-09-17 22:23:19 +04:00
(ability_declaration
(ability_name) @type
(type_argument) @variable.parameter)
2023-09-17 22:23:19 +04:00
(type_constructor) @constructor
2023-09-17 22:23:19 +04:00
(constructor
(constructor_name) @constructor)
2023-08-08 22:50:49 +04:00
(constructor
type: (regular_identifier) @type)
(effect
(regular_identifier) @special) ; NOTE: an effect is a special type
; Namespaces
(path) @module
(namespace) @module
; Terms
(type_signature
term_name: (path) @module
term_name: (regular_identifier) @variable)
(type_signature
term_name: (regular_identifier) @variable)
(term_type) @type
(term_definition
name: (path) @namespace)
(term_definition
name: (regular_identifier) @variable)
(term_definition
param: (regular_identifier) @variable.parameter)
2023-08-08 22:50:49 +04:00
;; Punctuation
[
(type_signature_colon)
":"
] @punctuation.delimiter
[
"("
")"
"{"
"}"
"["
"]"
] @punctuation.bracket
(watch_expression) @keyword.directive
(test_watch_expression) @keyword.directive