mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix(gleam): update highlights from upstream
This commit is contained in:
parent
faa4caa661
commit
c8c083e8ce
3 changed files with 41 additions and 44 deletions
|
|
@ -3,9 +3,6 @@
|
|||
(case)
|
||||
(expression_group)
|
||||
(function)
|
||||
(public_function)
|
||||
(anonymous_function)
|
||||
(type_definition)
|
||||
(public_type_definition)
|
||||
(public_opaque_type_definition)
|
||||
] @fold
|
||||
|
|
|
|||
|
|
@ -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"))
|
||||
[
|
||||
(type_identifier)
|
||||
(type_parameter)
|
||||
(type_var)
|
||||
] @type
|
||||
|
||||
; Booleans
|
||||
((type_identifier) @boolean (#any-of? @boolean "True" "False"))
|
||||
|
||||
; 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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue