Update PureScript highlight queries in light of reversing queries precedence order

This commit adapts PureScript highlight queries to match upcoming changes in Helix which will make queries matching order go from more to general to more specific, the opposite of previous order.
pull/10793/head
postsolar 10 months ago committed by Blaž Hrastnik
parent c75179d921
commit 96688a5915

@ -1,19 +1,3 @@
; ----------------------------------------------------------------------------
; Record fields would need to come before literal strings in order to be captured correctly
(record_accessor
field: [ (variable)
(string)
(triple_quote_string)
] @variable.other.member)
(exp_record_access
field: [ (variable)
(string)
(triple_quote_string)
] @variable.other.member)
; ---------------------------------------------------------------------------- ; ----------------------------------------------------------------------------
; Literals and comments ; Literals and comments
@ -21,6 +5,7 @@
(exp_negation) @constant.numeric.integer (exp_negation) @constant.numeric.integer
(exp_literal (number)) @constant.numeric.float (exp_literal (number)) @constant.numeric.float
(char) @constant.character (char) @constant.character
[ [
(string) (string)
(triple_quote_string) (triple_quote_string)
@ -28,7 +13,6 @@
(comment) @comment (comment) @comment
; ---------------------------------------------------------------------------- ; ----------------------------------------------------------------------------
; Punctuation ; Punctuation
@ -41,18 +25,19 @@
"]" "]"
] @punctuation.bracket ] @punctuation.bracket
[ (comma) @punctuation.delimiter
(comma)
";"
] @punctuation.delimiter
; ----------------------------------------------------------------------------
; Types
(type) @type
(constructor) @constructor
; ---------------------------------------------------------------------------- ; ----------------------------------------------------------------------------
; Keywords, operators, includes ; Keywords, operators, includes
; This needs to come before the other "else" in (module) @namespace
; order to be highlighted correctly
(class_instance "else" @keyword)
[ [
"if" "if"
@ -95,7 +80,6 @@
] @operator ] @operator
(qualified_module (module) @constructor) (qualified_module (module) @constructor)
(module) @namespace
(qualified_type (module) @namespace) (qualified_type (module) @namespace)
(qualified_variable (module) @namespace) (qualified_variable (module) @namespace)
(import (module) @namespace) (import (module) @namespace)
@ -122,6 +106,11 @@
"infixr" "infixr"
] @keyword ] @keyword
; NOTE
; Needs to come after the other `else` in
; order to be highlighted correctly
(class_instance "else" @keyword)
(type_role_declaration (type_role_declaration
"role" @keyword "role" @keyword
role: (type_role) @keyword) role: (type_role) @keyword)
@ -131,10 +120,27 @@
; ---------------------------------------------------------------------------- ; ----------------------------------------------------------------------------
; Functions and variables ; Functions and variables
(variable) @variable
(row_field (field_name) @variable.other.member) (row_field (field_name) @variable.other.member)
(record_field (field_name) @variable.other.member) (record_field (field_name) @variable.other.member)
(record_field (field_pun) @variable.other.member) (record_field (field_pun) @variable.other.member)
; NOTE
; Record fields must come after literal strings and
; plain variables in order to be highlighted correctly
(record_accessor
field: [ (variable)
(string)
(triple_quote_string)
] @variable.other.member)
(exp_record_access
field: [ (variable)
(string)
(triple_quote_string)
] @variable.other.member)
(signature name: (variable) @type) (signature name: (variable) @type)
(function name: (variable) @function) (function name: (variable) @function)
(class_instance (instance_name) @function) (class_instance (instance_name) @function)
@ -151,14 +157,5 @@
(exp_ticked (exp_name (variable) @operator)) (exp_ticked (exp_name (variable) @operator))
(exp_ticked (exp_name (qualified_variable (variable) @operator))) (exp_ticked (exp_name (qualified_variable (variable) @operator)))
(variable) @variable (patterns (pat_as "@" @namespace))
("@" @namespace) ; "as" pattern operator, e.g. x@Constructor
; ----------------------------------------------------------------------------
; Types
(type) @type
(constructor) @constructor

Loading…
Cancel
Save