diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2023-03-08 16:38:18 -0500 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-03-10 02:41:45 -0500 |
| commit | c8c083e8ce9449876bac00ef91d47e38b1f39a43 (patch) | |
| tree | 157b71475c1cd0adfd2a1998cc6d76b22488a390 | |
| parent | chore(gleam): update parser info (diff) | |
| download | nvim-treesitter-c8c083e8ce9449876bac00ef91d47e38b1f39a43.tar nvim-treesitter-c8c083e8ce9449876bac00ef91d47e38b1f39a43.tar.gz nvim-treesitter-c8c083e8ce9449876bac00ef91d47e38b1f39a43.tar.bz2 nvim-treesitter-c8c083e8ce9449876bac00ef91d47e38b1f39a43.tar.lz nvim-treesitter-c8c083e8ce9449876bac00ef91d47e38b1f39a43.tar.xz nvim-treesitter-c8c083e8ce9449876bac00ef91d47e38b1f39a43.tar.zst nvim-treesitter-c8c083e8ce9449876bac00ef91d47e38b1f39a43.zip | |
fix(gleam): update highlights from upstream
| -rw-r--r-- | queries/gleam/folds.scm | 3 | ||||
| -rw-r--r-- | queries/gleam/highlights.scm | 69 | ||||
| -rw-r--r-- | queries/gleam/indents.scm | 13 |
3 files changed, 41 insertions, 44 deletions
diff --git a/queries/gleam/folds.scm b/queries/gleam/folds.scm index ff05eeb05..fbcec0ef1 100644 --- a/queries/gleam/folds.scm +++ b/queries/gleam/folds.scm @@ -3,9 +3,6 @@ (case) (expression_group) (function) - (public_function) (anonymous_function) (type_definition) - (public_type_definition) - (public_opaque_type_definition) ] @fold diff --git a/queries/gleam/highlights.scm b/queries/gleam/highlights.scm index 00cabd171..f7eb1c5e7 100644 --- a/queries/gleam/highlights.scm +++ b/queries/gleam/highlights.scm @@ -2,14 +2,15 @@ [ "as" "let" + "panic" "todo" - "try" + "type" + "use" ] @keyword ; Function Keywords [ "fn" - "type" ] @keyword.function ; Imports @@ -26,6 +27,7 @@ ; Exceptions [ "assert" + "try" ] @exception ; Punctuation @@ -43,6 +45,8 @@ [ "," "." + ":" + "->" ] @punctuation.delimiter [ @@ -59,11 +63,9 @@ "+." "-" "-." - "->" ".." "/" "/." - ":" "<" "<." "<=" @@ -98,7 +100,7 @@ ] @comment ; Modules & Imports -(module ("/" @namespace)?) @namespace +(module) @namespace (import alias: ((identifier) @namespace)?) (remote_type_identifier module: (identifier) @namespace) (unqualified_import name: (identifier) @function) @@ -110,43 +112,37 @@ (bit_string_segment) @string.special ; Numbers -[ - (integer) - (float) - (bit_string_segment_option_unit) -] @number +(integer) @number + +(float) @float ; Function Parameter Labels -(function_call arguments: (arguments (argument label: (label) @symbol ":" @symbol))) -(function_parameter label: (label)? @symbol name: (identifier) @parameter (":" @parameter)?) +(function_call arguments: (arguments (argument label: (label) @label))) +(function_parameter label: (label)? @label name: (identifier) @parameter) ; Records -(record arguments: (arguments (argument label: (label) @property ":" @property)?)) -(record_pattern_argument label: (label) @property ":" @property) -(record_update_argument label: (label) @property ":" @property) +(record arguments: (arguments (argument label: (label) @property)?)) +(record_pattern_argument label: (label) @property) +(record_update_argument label: (label) @property) (field_access record: (identifier) @variable field: (label) @property) - -; Type Constructors -(data_constructor_argument label: (label) @property ":" @property) - -; Type Parameters -(type_parameter) @parameter +(data_constructor_argument (label) @property) ; Types -((type_identifier) @type (#not-any-of? @type "True" "False")) - -; Booleans -((type_identifier) @boolean (#any-of? @boolean "True" "False")) +[ + (type_identifier) + (type_parameter) + (type_var) +] @type -; Type Variables -(type_var) @type +((type_identifier) @type.builtin + (#any-of? @type.builtin "Int" "Float" "String" "List")) ; Type Qualifiers [ "const" "external" - "opaque" - "pub" + (opacity_modifier) + (visibility_modifier) ] @type.qualifier ; Tuples @@ -154,15 +150,22 @@ ; Functions (function name: (identifier) @function) -(public_function name: (identifier) @function) -(function_call function: (identifier) @function) -(function_call function: (field_access field: (label) @function)) +(function_call function: (identifier) @function.call) +(function_call function: (field_access field: (label) @function.call)) ; External Functions -(public_external_function name: (identifier) @function) (external_function name: (identifier) @function) (external_function_body (string) @namespace . (string) @function) +; Constructors +(constructor_name) @type @constructor + +([(type_identifier) (constructor_name)] @constant.builtin + (#any-of? @constant.builtin "Ok" "Error")) + +; Booleans +((constructor_name) @boolean (#any-of? @boolean "True" "False")) + ; Pipe Operator (binary_expression operator: "|>" right: (identifier) @function) diff --git a/queries/gleam/indents.scm b/queries/gleam/indents.scm index e2259b688..61986b26f 100644 --- a/queries/gleam/indents.scm +++ b/queries/gleam/indents.scm @@ -10,17 +10,14 @@ (import) (let) (list) - (public_constant) - (public_external_function) - (public_function) - (public_opaque_type_definition) - (public_type_alias) - (public_type_definition) + (constant) + (external_function) + (function) + (type_definition) + (type_alias) (todo) (try) (tuple) - (type_alias) - (type_definition) ] @indent [ |
