Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/purescript/highlights.scm')
-rw-r--r--runtime/queries/purescript/highlights.scm68
1 files changed, 36 insertions, 32 deletions
diff --git a/runtime/queries/purescript/highlights.scm b/runtime/queries/purescript/highlights.scm
index cdb6baab..b7868e6e 100644
--- a/runtime/queries/purescript/highlights.scm
+++ b/runtime/queries/purescript/highlights.scm
@@ -1,11 +1,26 @@
; ----------------------------------------------------------------------------
+; 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
(integer) @constant.numeric.integer
(exp_negation) @constant.numeric.integer
(exp_literal (number)) @constant.numeric.float
(char) @constant.character
-
[
(string)
(triple_quote_string)
@@ -13,6 +28,7 @@
(comment) @comment
+
; ----------------------------------------------------------------------------
; Punctuation
@@ -25,19 +41,18 @@
"]"
] @punctuation.bracket
- (comma) @punctuation.delimiter
-
-; ----------------------------------------------------------------------------
-; Types
-
- (type) @type
+ [
+ (comma)
+ ";"
+ ] @punctuation.delimiter
- (constructor) @constructor
; ----------------------------------------------------------------------------
; Keywords, operators, includes
- (module) @namespace
+ ; This needs to come before the other "else" in
+ ; order to be highlighted correctly
+ (class_instance "else" @keyword)
[
"if"
@@ -54,6 +69,7 @@
[
(operator)
+ (constructor_operator)
(type_operator)
(qualified_module) ; grabs the `.` (dot), ex: import System.IO
(all_names)
@@ -79,6 +95,7 @@
] @operator
(qualified_module (module) @constructor)
+ (module) @namespace
(qualified_type (module) @namespace)
(qualified_variable (module) @namespace)
(import (module) @namespace)
@@ -105,11 +122,6 @@
"infixr"
] @keyword
- ; NOTE
- ; Needs to come after the other `else` in
- ; order to be highlighted correctly
- (class_instance "else" @keyword)
-
(type_role_declaration
"role" @keyword
role: (type_role) @keyword)
@@ -119,27 +131,10 @@
; ----------------------------------------------------------------------------
; Functions and variables
- (variable) @variable
-
(row_field (field_name) @variable.other.member)
(record_field (field_name) @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)
(function name: (variable) @function)
(class_instance (instance_name) @function)
@@ -156,5 +151,14 @@
(exp_ticked (exp_name (variable) @operator))
(exp_ticked (exp_name (qualified_variable (variable) @operator)))
- (patterns (pat_as "@" @namespace))
+ (variable) @variable
+
+ ("@" @namespace) ; "as" pattern operator, e.g. x@Constructor
+
+; ----------------------------------------------------------------------------
+; Types
+
+ (type) @type
+
+ (constructor) @constructor