Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/unison/highlights.scm')
| -rw-r--r-- | runtime/queries/unison/highlights.scm | 79 |
1 files changed, 24 insertions, 55 deletions
diff --git a/runtime/queries/unison/highlights.scm b/runtime/queries/unison/highlights.scm index eaf4c6bf..956dc582 100644 --- a/runtime/queries/unison/highlights.scm +++ b/runtime/queries/unison/highlights.scm @@ -9,25 +9,34 @@ ;; Keywords [ (kw_forall) + (unique_kw) + (structural_kw) + (type_kw) (kw_equals) (do) - (kw_let) (ability) (where) ] @keyword (kw_let) @keyword.function -(type_kw) @keyword.storage.modifier +(type_kw) @keyword.storage.type +(unique) @keyword.storage.modifier (structural) @keyword.storage.modifier ("use") @keyword.control.import -(unique) @keyword.storage.modifier + + +[ + (type_constructor) +] @constructor [ (operator) (pipe) (arrow_symbol) + (">") (or) (and) + (bang) ] @operator [ @@ -41,62 +50,24 @@ (blank_pattern) @variable.builtin -(pattern) @variable - -(use_clause) @keyword.import - ;; 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) +(record_field name: (wordy_id) @variable.other.member type: (wordy_id) @type) +(type_constructor (type_name (wordy_id) @constructor)) +(ability_declaration type_name: (wordy_id) @type type_arg: (wordy_id) @variable.parameter) +(effect (wordy_id) @special) ;; NOTE: an effect is just like a type, but in signature we special case it -(ability_declaration - (ability_name) @type - (type_argument) @variable.parameter) - -(type_constructor) @constructor - -(constructor - (constructor_name) @constructor) - -(constructor - type: (regular_identifier) @type) - -(effect - (regular_identifier) @special) ; NOTE: an effect is a special type - -; Namespaces +;; Namespaces (path) @namespace - (namespace) @namespace -; Terms -(type_signature - term_name: (path) @namespace - term_name: (regular_identifier) @variable) - -(type_signature - term_name: (regular_identifier) @variable) - -(term_type) @type +;; Terms +(type_signature term_name: (path)? @variable term_name: (wordy_id) @variable) +(type_signature (wordy_id) @type) +(type_signature (delayed (wordy_id)) @type) -(term_definition - name: (path) @namespace) +(term_definition param: (wordy_id) @variable.parameter) -(term_definition - name: (regular_identifier) @variable) - -(term_definition - param: (regular_identifier) @variable.parameter) +(function_application function_name: (path)? function_name: (wordy_id) @function) ;; Punctuation [ @@ -113,6 +84,4 @@ "]" ] @punctuation.bracket -(watch_expression) @keyword.directive - -(test_watch_expression) @keyword.directive +(test_watch_expression (wordy_id) @keyword.directive) |