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

Update Unison highlights #8315

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions runtime/queries/unison/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@
[
(kw_forall)
(unique_kw)
(structural_kw)
(type_kw)
(kw_equals)
(do)
(ability)
(where)
] @keyword

(kw_let) @keyword.function
(type_kw) @keyword.storage.type
(unique) @keyword.storage.modifier
(structural) @keyword.storage.modifier
("use") @keyword.control.import


Expand All @@ -31,6 +35,7 @@
(arrow_symbol)
(">")
(or)
(and)
(bang)
] @operator

Expand All @@ -47,13 +52,22 @@

;; Types
(record_field name: (wordy_id) @variable.other.member type: (wordy_id) @type)
[
(type_name)
(type_signature)
(effect)
] @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

;; Namespaces
(path) @namespace
(namespace) @namespace

;; 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 param: (wordy_id) @variable.parameter)

(term_definition) @variable
(function_application function_name: (path)? function_name: (wordy_id) @function)

;; Punctuation
[
Expand All @@ -70,3 +84,4 @@
"]"
] @punctuation.bracket

(test_watch_expression (wordy_id) @keyword.directive)
Loading