Update generated neovim config
This commit is contained in:
@ -0,0 +1,39 @@
|
||||
[
|
||||
(use_statement)
|
||||
(actor_definition)
|
||||
(class_definition)
|
||||
(primitive_definition)
|
||||
(interface_definition)
|
||||
(trait_definition)
|
||||
(struct_definition)
|
||||
|
||||
(constructor)
|
||||
(method)
|
||||
(behavior)
|
||||
|
||||
(parameters)
|
||||
|
||||
(type)
|
||||
|
||||
(if_statement)
|
||||
(iftype_statement)
|
||||
(elseif_block)
|
||||
(elseiftype_block)
|
||||
(else_block)
|
||||
(for_statement)
|
||||
(while_statement)
|
||||
(try_statement)
|
||||
(with_statement)
|
||||
(repeat_statement)
|
||||
(recover_statement)
|
||||
(match_statement)
|
||||
(case_statement)
|
||||
(parenthesized_expression)
|
||||
(tuple_expression)
|
||||
|
||||
(array_literal)
|
||||
(object_literal)
|
||||
(string)
|
||||
|
||||
(block_comment)
|
||||
] @fold
|
||||
@ -0,0 +1,290 @@
|
||||
; Includes
|
||||
|
||||
[
|
||||
"use"
|
||||
] @include
|
||||
|
||||
; Keywords
|
||||
|
||||
[
|
||||
"type"
|
||||
"actor"
|
||||
"class"
|
||||
"primitive"
|
||||
"interface"
|
||||
"trait"
|
||||
"struct"
|
||||
"embed"
|
||||
"let"
|
||||
"var"
|
||||
(compile_intrinsic)
|
||||
"as"
|
||||
"consume"
|
||||
"recover"
|
||||
"object"
|
||||
"where"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"fun"
|
||||
"be"
|
||||
] @keyword.function
|
||||
|
||||
[
|
||||
"in"
|
||||
"is"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
"return"
|
||||
] @keyword.return
|
||||
|
||||
; Qualifiers
|
||||
|
||||
[
|
||||
"iso"
|
||||
"trn"
|
||||
"ref"
|
||||
"val"
|
||||
"box"
|
||||
"tag"
|
||||
"#read"
|
||||
"#send"
|
||||
"#share"
|
||||
"#alias"
|
||||
"#any"
|
||||
] @type.qualifier
|
||||
|
||||
; Conditionals
|
||||
|
||||
[
|
||||
"if"
|
||||
"ifdef"
|
||||
"iftype"
|
||||
"then"
|
||||
"else"
|
||||
"elseif"
|
||||
"until"
|
||||
"match"
|
||||
] @conditional
|
||||
|
||||
(if_statement "end" @conditional)
|
||||
|
||||
(iftype_statement "end" @conditional)
|
||||
|
||||
(match_statement "end" @conditional)
|
||||
|
||||
; Repeats
|
||||
|
||||
[
|
||||
"repeat"
|
||||
"while"
|
||||
"for"
|
||||
"continue"
|
||||
"do"
|
||||
"break"
|
||||
] @repeat
|
||||
|
||||
(do_block "end" @repeat)
|
||||
|
||||
(repeat_statement "end" @repeat)
|
||||
|
||||
; Exceptions
|
||||
|
||||
[
|
||||
"try"
|
||||
(error)
|
||||
"compile_error"
|
||||
] @exception
|
||||
|
||||
(try_statement "end" @exception)
|
||||
|
||||
(recover_statement "end" @exception)
|
||||
|
||||
; Attributes
|
||||
|
||||
(annotation) @attribute
|
||||
|
||||
; Variables
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
(this) @variable.builtin
|
||||
(location) @preproc
|
||||
|
||||
; Fields
|
||||
|
||||
(field name: (identifier) @field)
|
||||
|
||||
(member_expression "." (identifier) @field)
|
||||
|
||||
; Constructors
|
||||
|
||||
(constructor "new" @constructor (identifier) @constructor)
|
||||
|
||||
; Methods
|
||||
|
||||
(method (identifier) @method)
|
||||
|
||||
(behavior (identifier) @method)
|
||||
|
||||
(ffi_method (identifier) @method)
|
||||
|
||||
((ffi_method (string) @string.special)
|
||||
(#set! "priority" 105))
|
||||
|
||||
(call_expression
|
||||
callee:
|
||||
[
|
||||
(identifier) @method.call
|
||||
(ffi_identifier (identifier) @method.call)
|
||||
(member_expression "." (identifier) @method.call)
|
||||
])
|
||||
|
||||
; Parameters
|
||||
|
||||
(parameter name: (identifier) @parameter)
|
||||
(lambda_parameter name: (identifier) @parameter)
|
||||
|
||||
; Types
|
||||
|
||||
(type_alias (identifier) @type.definition)
|
||||
|
||||
(base_type name: (identifier) @type)
|
||||
|
||||
(generic_parameter (identifier) @type)
|
||||
|
||||
(lambda_type (identifier)? @method)
|
||||
|
||||
((identifier) @type
|
||||
(#lua-match? @type "^_*[A-Z][a-zA-Z0-9_]*$"))
|
||||
|
||||
; Operators
|
||||
|
||||
(unary_expression
|
||||
operator: ["not" "addressof" "digestof"] @keyword.operator)
|
||||
|
||||
(binary_expression
|
||||
operator: ["and" "or" "xor" "is" "isnt"] @keyword.operator)
|
||||
|
||||
[
|
||||
"="
|
||||
"?"
|
||||
"|"
|
||||
"&"
|
||||
"-~"
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"/"
|
||||
"%"
|
||||
"%%"
|
||||
"<<"
|
||||
">>"
|
||||
"=="
|
||||
"!="
|
||||
">"
|
||||
">="
|
||||
"<="
|
||||
"<"
|
||||
"+~"
|
||||
"-~"
|
||||
"*~"
|
||||
"/~"
|
||||
"%~"
|
||||
"%%~"
|
||||
"<<~"
|
||||
">>~"
|
||||
"==~"
|
||||
"!=~"
|
||||
">~"
|
||||
">=~"
|
||||
"<=~"
|
||||
"<~"
|
||||
"+?"
|
||||
"-?"
|
||||
"*?"
|
||||
"/?"
|
||||
"%?"
|
||||
"%%?"
|
||||
"<:"
|
||||
] @operator
|
||||
|
||||
; Literals
|
||||
|
||||
(string) @string
|
||||
|
||||
(source_file (string) @string.documentation)
|
||||
(actor_definition (string) @string.documentation)
|
||||
(class_definition (string) @string.documentation)
|
||||
(primitive_definition (string) @string.documentation)
|
||||
(interface_definition (string) @string.documentation)
|
||||
(trait_definition (string) @string.documentation)
|
||||
(struct_definition (string) @string.documentation)
|
||||
(type_alias (string) @string.documentation)
|
||||
(field (string) @string.documentation)
|
||||
|
||||
(constructor
|
||||
[
|
||||
(string) @string.documentation
|
||||
(block . (string) @string.documentation)
|
||||
])
|
||||
|
||||
(method
|
||||
[
|
||||
(string) @string.documentation
|
||||
(block . (string) @string.documentation)
|
||||
])
|
||||
|
||||
(behavior
|
||||
[
|
||||
(string) @string.documentation
|
||||
(block . (string) @string.documentation)
|
||||
])
|
||||
|
||||
(character) @character
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
(number) @number
|
||||
|
||||
(float) @float
|
||||
|
||||
(boolean) @boolean
|
||||
|
||||
; Punctuation
|
||||
|
||||
[ "{" "}" ] @punctuation.bracket
|
||||
|
||||
[ "[" "]" ] @punctuation.bracket
|
||||
|
||||
[ "(" ")" ] @punctuation.bracket
|
||||
|
||||
[
|
||||
"."
|
||||
","
|
||||
";"
|
||||
":"
|
||||
"~"
|
||||
".>"
|
||||
"->"
|
||||
"=>"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"@"
|
||||
"!"
|
||||
"^"
|
||||
"..."
|
||||
] @punctuation.special
|
||||
|
||||
; Comments
|
||||
|
||||
[
|
||||
(line_comment)
|
||||
(block_comment)
|
||||
] @comment @spell
|
||||
|
||||
; Errors
|
||||
|
||||
(ERROR) @error
|
||||
@ -0,0 +1,60 @@
|
||||
[
|
||||
(use_statement)
|
||||
(actor_definition)
|
||||
(class_definition)
|
||||
(primitive_definition)
|
||||
(interface_definition)
|
||||
(trait_definition)
|
||||
(struct_definition)
|
||||
|
||||
(constructor)
|
||||
(method)
|
||||
(behavior)
|
||||
|
||||
(parameters)
|
||||
|
||||
(if_block)
|
||||
(then_block)
|
||||
(elseif_block)
|
||||
(else_block)
|
||||
(iftype_statement)
|
||||
(elseiftype_block)
|
||||
(do_block)
|
||||
(match_statement)
|
||||
(parenthesized_expression)
|
||||
(tuple_expression)
|
||||
|
||||
(array_literal)
|
||||
(object_literal)
|
||||
] @indent
|
||||
|
||||
(try_statement (block) @indent)
|
||||
|
||||
(repeat_statement (block) @indent)
|
||||
|
||||
(recover_statement (block) @indent)
|
||||
|
||||
(return_statement (block) @indent)
|
||||
|
||||
(continue_statement (block) @indent)
|
||||
|
||||
(break_statement (block) @indent)
|
||||
|
||||
[
|
||||
"}"
|
||||
"]"
|
||||
")"
|
||||
] @indent_end
|
||||
|
||||
[ "{" "}" ] @branch
|
||||
|
||||
[ "[" "]" ] @branch
|
||||
|
||||
[ "(" ")" ] @branch
|
||||
|
||||
[
|
||||
(ERROR)
|
||||
(string)
|
||||
(line_comment)
|
||||
(block_comment)
|
||||
] @auto
|
||||
@ -0,0 +1,4 @@
|
||||
[
|
||||
(line_comment)
|
||||
(block_comment)
|
||||
] @comment
|
||||
@ -0,0 +1,79 @@
|
||||
; Scopes
|
||||
|
||||
[
|
||||
(use_statement)
|
||||
(actor_definition)
|
||||
(class_definition)
|
||||
(primitive_definition)
|
||||
(interface_definition)
|
||||
(trait_definition)
|
||||
(struct_definition)
|
||||
|
||||
(constructor)
|
||||
(method)
|
||||
(behavior)
|
||||
|
||||
(if_statement)
|
||||
(iftype_statement)
|
||||
(elseif_block)
|
||||
(elseiftype_block)
|
||||
(else_block)
|
||||
(for_statement)
|
||||
(while_statement)
|
||||
(try_statement)
|
||||
(with_statement)
|
||||
(repeat_statement)
|
||||
(recover_statement)
|
||||
(match_statement)
|
||||
(case_statement)
|
||||
(parenthesized_expression)
|
||||
(tuple_expression)
|
||||
|
||||
(array_literal)
|
||||
(object_literal)
|
||||
] @scope
|
||||
|
||||
; References
|
||||
|
||||
(identifier) @reference
|
||||
|
||||
; Definitions
|
||||
|
||||
(field
|
||||
name: (identifier) @definition.field)
|
||||
|
||||
(use_statement
|
||||
(identifier) @definition.import)
|
||||
|
||||
(constructor
|
||||
(identifier) @definition.method)
|
||||
|
||||
(method
|
||||
(identifier) @definition.method)
|
||||
|
||||
(behavior
|
||||
(identifier) @definition.method)
|
||||
|
||||
(actor_definition
|
||||
(identifier) @definition.type)
|
||||
|
||||
(type_alias
|
||||
(identifier) @definition.type)
|
||||
|
||||
(class_definition
|
||||
(identifier) @definition.type)
|
||||
|
||||
(primitive_definition
|
||||
(identifier) @definition.type)
|
||||
|
||||
(interface_definition
|
||||
(identifier) @definition.type)
|
||||
|
||||
(trait_definition
|
||||
(identifier) @definition.type)
|
||||
|
||||
(struct_definition
|
||||
(identifier) @definition.type)
|
||||
|
||||
(parameter
|
||||
name: (identifier) @definition.parameter)
|
||||
39
config/neovim/store/treesitter-parsers/queries/pony/tags.scm
Normal file
39
config/neovim/store/treesitter-parsers/queries/pony/tags.scm
Normal file
@ -0,0 +1,39 @@
|
||||
;Class definitions @definition.class
|
||||
;Function definitions @definition.function
|
||||
;Interface definitions @definition.interface
|
||||
;Method definitions @definition.method
|
||||
;Module definitions @definition.module
|
||||
;Function/method calls @reference.call
|
||||
;Class reference @reference.class
|
||||
;Interface implementation @reference.implementation
|
||||
(
|
||||
(identifier) @reference.class
|
||||
(#match? @reference.class "^_*[A-Z][a-zA-Z0-9_]*$")
|
||||
)
|
||||
|
||||
(class_definition (identifier) @name) @definition.class
|
||||
(actor_definition (identifier) @name) @definition.class
|
||||
(primitive_definition (identifier) @name) @definition.class
|
||||
(struct_definition (identifier) @name) @definition.class
|
||||
(type_alias (identifier) @name) @definition.class
|
||||
|
||||
(trait_definition (identifier) @name) @definition.interface
|
||||
(interface_definition (identifier) @name) @definition.interface
|
||||
|
||||
(constructor (identifier) @name) @definition.method
|
||||
(method (identifier) @name) @definition.method
|
||||
(behavior (identifier) @name) @definition.method
|
||||
|
||||
(class_definition (type) @name) @reference.implementation
|
||||
(actor_definition (type) @name) @reference.implementation
|
||||
(primitive_definition (type) @name) @reference.implementation
|
||||
(struct_definition (type) @name) @reference.implementation
|
||||
(type_alias (type) @name) @reference.implementation
|
||||
|
||||
; calls - not catching all possible call cases of callees for capturing the method name
|
||||
(call_expression callee: [(identifier) (ffi_identifier)] @name) @reference.call
|
||||
(call_expression callee: (generic_expression [(identifier) (ffi_identifier)] @name)) @reference.call
|
||||
(call_expression callee: (member_expression (identifier) @name .)) @reference.call
|
||||
(call_expression callee: (member_expression (generic_expression [(identifier) (ffi_identifier)] @name) .)) @reference.call
|
||||
; TODO: add more possible callee expressions
|
||||
(call_expression) @reference.call
|
||||
Reference in New Issue
Block a user