fix(gleam): update highlights from upstream

This commit is contained in:
Amaan Qureshi 2023-03-08 16:38:18 -05:00
parent faa4caa661
commit c8c083e8ce
3 changed files with 41 additions and 44 deletions

View file

@ -3,9 +3,6 @@
(case) (case)
(expression_group) (expression_group)
(function) (function)
(public_function)
(anonymous_function) (anonymous_function)
(type_definition) (type_definition)
(public_type_definition)
(public_opaque_type_definition)
] @fold ] @fold

View file

@ -2,14 +2,15 @@
[ [
"as" "as"
"let" "let"
"panic"
"todo" "todo"
"try" "type"
"use"
] @keyword ] @keyword
; Function Keywords ; Function Keywords
[ [
"fn" "fn"
"type"
] @keyword.function ] @keyword.function
; Imports ; Imports
@ -26,6 +27,7 @@
; Exceptions ; Exceptions
[ [
"assert" "assert"
"try"
] @exception ] @exception
; Punctuation ; Punctuation
@ -43,6 +45,8 @@
[ [
"," ","
"." "."
":"
"->"
] @punctuation.delimiter ] @punctuation.delimiter
[ [
@ -59,11 +63,9 @@
"+." "+."
"-" "-"
"-." "-."
"->"
".." ".."
"/" "/"
"/." "/."
":"
"<" "<"
"<." "<."
"<=" "<="
@ -98,7 +100,7 @@
] @comment ] @comment
; Modules & Imports ; Modules & Imports
(module ("/" @namespace)?) @namespace (module) @namespace
(import alias: ((identifier) @namespace)?) (import alias: ((identifier) @namespace)?)
(remote_type_identifier module: (identifier) @namespace) (remote_type_identifier module: (identifier) @namespace)
(unqualified_import name: (identifier) @function) (unqualified_import name: (identifier) @function)
@ -110,43 +112,37 @@
(bit_string_segment) @string.special (bit_string_segment) @string.special
; Numbers ; Numbers
[ (integer) @number
(integer)
(float) (float) @float
(bit_string_segment_option_unit)
] @number
; Function Parameter Labels ; Function Parameter Labels
(function_call arguments: (arguments (argument label: (label) @symbol ":" @symbol))) (function_call arguments: (arguments (argument label: (label) @label)))
(function_parameter label: (label)? @symbol name: (identifier) @parameter (":" @parameter)?) (function_parameter label: (label)? @label name: (identifier) @parameter)
; Records ; Records
(record arguments: (arguments (argument label: (label) @property ":" @property)?)) (record arguments: (arguments (argument label: (label) @property)?))
(record_pattern_argument label: (label) @property ":" @property) (record_pattern_argument label: (label) @property)
(record_update_argument label: (label) @property ":" @property) (record_update_argument label: (label) @property)
(field_access record: (identifier) @variable field: (label) @property) (field_access record: (identifier) @variable field: (label) @property)
(data_constructor_argument (label) @property)
; Type Constructors
(data_constructor_argument label: (label) @property ":" @property)
; Type Parameters
(type_parameter) @parameter
; Types ; Types
((type_identifier) @type (#not-any-of? @type "True" "False")) [
(type_identifier)
(type_parameter)
(type_var)
] @type
; Booleans ((type_identifier) @type.builtin
((type_identifier) @boolean (#any-of? @boolean "True" "False")) (#any-of? @type.builtin "Int" "Float" "String" "List"))
; Type Variables
(type_var) @type
; Type Qualifiers ; Type Qualifiers
[ [
"const" "const"
"external" "external"
"opaque" (opacity_modifier)
"pub" (visibility_modifier)
] @type.qualifier ] @type.qualifier
; Tuples ; Tuples
@ -154,15 +150,22 @@
; Functions ; Functions
(function name: (identifier) @function) (function name: (identifier) @function)
(public_function name: (identifier) @function) (function_call function: (identifier) @function.call)
(function_call function: (identifier) @function) (function_call function: (field_access field: (label) @function.call))
(function_call function: (field_access field: (label) @function))
; External Functions ; External Functions
(public_external_function name: (identifier) @function)
(external_function name: (identifier) @function) (external_function name: (identifier) @function)
(external_function_body (string) @namespace . (string) @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 ; Pipe Operator
(binary_expression operator: "|>" right: (identifier) @function) (binary_expression operator: "|>" right: (identifier) @function)

View file

@ -10,17 +10,14 @@
(import) (import)
(let) (let)
(list) (list)
(public_constant) (constant)
(public_external_function) (external_function)
(public_function) (function)
(public_opaque_type_definition) (type_definition)
(public_type_alias) (type_alias)
(public_type_definition)
(todo) (todo)
(try) (try)
(tuple) (tuple)
(type_alias)
(type_definition)
] @indent ] @indent
[ [