Regenerate nvim config
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
; Folds
|
||||
[
|
||||
(case)
|
||||
(function)
|
||||
(anonymous_function)
|
||||
(type_definition)
|
||||
] @fold
|
||||
201
config/neovim/store/nvim-treesitter/queries/gleam/highlights.scm
Normal file
201
config/neovim/store/nvim-treesitter/queries/gleam/highlights.scm
Normal file
@ -0,0 +1,201 @@
|
||||
; Keywords
|
||||
[
|
||||
"as"
|
||||
"let"
|
||||
"panic"
|
||||
"todo"
|
||||
"type"
|
||||
"use"
|
||||
] @keyword
|
||||
|
||||
; Function Keywords
|
||||
"fn" @keyword.function
|
||||
|
||||
; Imports
|
||||
"import" @keyword.import
|
||||
|
||||
; Conditionals
|
||||
[
|
||||
"case"
|
||||
"if"
|
||||
] @keyword.conditional
|
||||
|
||||
; Exceptions
|
||||
"assert" @keyword.exception
|
||||
|
||||
; Punctuation
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"<<"
|
||||
">>"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
","
|
||||
"."
|
||||
":"
|
||||
"->"
|
||||
] @punctuation.delimiter
|
||||
|
||||
"#" @punctuation.special
|
||||
|
||||
; Operators
|
||||
[
|
||||
"%"
|
||||
"&&"
|
||||
"*"
|
||||
"*."
|
||||
"+"
|
||||
"+."
|
||||
"-"
|
||||
"-."
|
||||
".."
|
||||
"/"
|
||||
"/."
|
||||
"<"
|
||||
"<."
|
||||
"<="
|
||||
"<=."
|
||||
"="
|
||||
"=="
|
||||
">"
|
||||
">."
|
||||
">="
|
||||
">=."
|
||||
"|>"
|
||||
"||"
|
||||
] @operator
|
||||
|
||||
; Identifiers
|
||||
(identifier) @variable
|
||||
|
||||
; Comments
|
||||
(comment) @comment @spell
|
||||
|
||||
[
|
||||
(module_comment)
|
||||
(statement_comment)
|
||||
] @comment.documentation @spell
|
||||
|
||||
; Unused Identifiers
|
||||
[
|
||||
(discard)
|
||||
(hole)
|
||||
] @comment
|
||||
|
||||
; Modules & Imports
|
||||
(module) @module
|
||||
|
||||
(import
|
||||
alias: ((identifier) @module)?)
|
||||
|
||||
(remote_type_identifier
|
||||
module: (identifier) @module)
|
||||
|
||||
(unqualified_import
|
||||
name: (identifier) @function)
|
||||
|
||||
; Strings
|
||||
(string) @string
|
||||
|
||||
; Bit Strings
|
||||
(bit_string_segment) @string.special
|
||||
|
||||
; Numbers
|
||||
(integer) @number
|
||||
|
||||
(float) @number.float
|
||||
|
||||
; Function Parameter Labels
|
||||
(function_call
|
||||
arguments: (arguments
|
||||
(argument
|
||||
label: (label) @label)))
|
||||
|
||||
(function_parameter
|
||||
label: (label)? @label
|
||||
name: (identifier) @variable.parameter)
|
||||
|
||||
; Records
|
||||
(record
|
||||
arguments: (arguments
|
||||
(argument
|
||||
label: (label) @variable.member)?))
|
||||
|
||||
(record_pattern_argument
|
||||
label: (label) @variable.member)
|
||||
|
||||
(record_update_argument
|
||||
label: (label) @variable.member)
|
||||
|
||||
(field_access
|
||||
record: (identifier) @variable
|
||||
field: (label) @variable.member)
|
||||
|
||||
(data_constructor_argument
|
||||
(label) @variable.member)
|
||||
|
||||
; Types
|
||||
[
|
||||
(type_identifier)
|
||||
(type_parameter)
|
||||
(type_var)
|
||||
] @type
|
||||
|
||||
((type_identifier) @type.builtin
|
||||
(#any-of? @type.builtin "Int" "Float" "String" "List"))
|
||||
|
||||
; Type Qualifiers
|
||||
[
|
||||
"const"
|
||||
"external"
|
||||
(opacity_modifier)
|
||||
(visibility_modifier)
|
||||
] @keyword.modifier
|
||||
|
||||
; Tuples
|
||||
(tuple_access
|
||||
index: (integer) @operator)
|
||||
|
||||
; Functions
|
||||
(function
|
||||
name: (identifier) @function)
|
||||
|
||||
(function_call
|
||||
function: (identifier) @function.call)
|
||||
|
||||
(function_call
|
||||
function: (field_access
|
||||
field: (label) @function.call))
|
||||
|
||||
; External Functions
|
||||
(external_function
|
||||
name: (identifier) @function)
|
||||
|
||||
(external_function_body
|
||||
(string) @module
|
||||
.
|
||||
(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)
|
||||
@ -0,0 +1,30 @@
|
||||
; Gleam indents similar to Rust and JavaScript
|
||||
[
|
||||
(anonymous_function)
|
||||
(assert)
|
||||
(case)
|
||||
(case_clause)
|
||||
(constant)
|
||||
(external_function)
|
||||
(function)
|
||||
(import)
|
||||
(let)
|
||||
(list)
|
||||
(constant)
|
||||
(function)
|
||||
(type_definition)
|
||||
(type_alias)
|
||||
(todo)
|
||||
(tuple)
|
||||
] @indent.begin
|
||||
|
||||
[
|
||||
")"
|
||||
"]"
|
||||
"}"
|
||||
] @indent.end @indent.branch
|
||||
|
||||
; Gleam pipelines are not indented, but other binary expression chains are
|
||||
((binary_expression
|
||||
operator: _ @_operator) @indent.begin
|
||||
(#not-eq? @_operator "|>"))
|
||||
@ -0,0 +1,7 @@
|
||||
; Comments
|
||||
([
|
||||
(module_comment)
|
||||
(statement_comment)
|
||||
(comment)
|
||||
] @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
31
config/neovim/store/nvim-treesitter/queries/gleam/locals.scm
Normal file
31
config/neovim/store/nvim-treesitter/queries/gleam/locals.scm
Normal file
@ -0,0 +1,31 @@
|
||||
; Let Binding Definition
|
||||
(let
|
||||
pattern: (identifier) @local.definition)
|
||||
|
||||
; List Pattern Definitions
|
||||
(list_pattern
|
||||
(identifier) @local.definition)
|
||||
|
||||
(list_pattern
|
||||
assign: (identifier) @local.definition)
|
||||
|
||||
; Tuple Pattern Definition
|
||||
(tuple_pattern
|
||||
(identifier) @local.definition)
|
||||
|
||||
; Record Pattern Definition
|
||||
(record_pattern_argument
|
||||
pattern: (identifier) @local.definition)
|
||||
|
||||
; Function Parameter Definition
|
||||
(function_parameter
|
||||
name: (identifier) @local.definition)
|
||||
|
||||
; References
|
||||
(identifier) @local.reference
|
||||
|
||||
; Function Body Scope
|
||||
(function_body) @local.scope
|
||||
|
||||
; Case Scope
|
||||
(case_clause) @local.scope
|
||||
Reference in New Issue
Block a user