diff options
author | Christian Clason <c.clason@uni-graz.at> | 2024-04-05 18:06:24 +0200 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2024-04-05 18:36:17 +0200 |
commit | 39a0e6bf3c04f26cc2a43993fd63d94039b7262d (patch) | |
tree | 8f5585ef75963002572363f354d4c3768cc82072 /runtime/queries/python | |
parent | 73de98256cf3932dca156fbfd0c82c1cc10d487e (diff) | |
download | rneovim-39a0e6bf3c04f26cc2a43993fd63d94039b7262d.tar.gz rneovim-39a0e6bf3c04f26cc2a43993fd63d94039b7262d.tar.bz2 rneovim-39a0e6bf3c04f26cc2a43993fd63d94039b7262d.zip |
fix(treesitter): update parsers and queries
Diffstat (limited to 'runtime/queries/python')
-rw-r--r-- | runtime/queries/python/highlights.scm | 89 |
1 files changed, 38 insertions, 51 deletions
diff --git a/runtime/queries/python/highlights.scm b/runtime/queries/python/highlights.scm index fea97bed32..4d62aeff06 100644 --- a/runtime/queries/python/highlights.scm +++ b/runtime/queries/python/highlights.scm @@ -35,9 +35,8 @@ ((assignment left: (identifier) @type.definition - right: - (call - function: (identifier) @_func)) + right: (call + function: (identifier) @_func)) (#any-of? @_func "TypeVar" "NewType")) ; Function calls @@ -45,18 +44,16 @@ function: (identifier) @function.call) (call - function: - (attribute - attribute: (identifier) @function.method.call)) + function: (attribute + attribute: (identifier) @function.method.call)) ((call function: (identifier) @constructor) (#lua-match? @constructor "^%u")) ((call - function: - (attribute - attribute: (identifier) @constructor)) + function: (attribute + attribute: (identifier) @constructor)) (#lua-match? @constructor "^%u")) ; Decorators @@ -82,7 +79,7 @@ ((decorator (identifier) @attribute.builtin) - (#any-of? @attribute.builtin "classmethod" "property")) + (#any-of? @attribute.builtin "classmethod" "property" "staticmethod")) ; Builtin functions ((call @@ -109,10 +106,9 @@ ((call function: (identifier) @_isinstance - arguments: - (argument_list - (_) - (identifier) @type)) + arguments: (argument_list + (_) + (identifier) @type)) (#eq? @_isinstance "isinstance")) ; Normal parameters @@ -211,18 +207,16 @@ (string) @string.documentation @spell)) (class_definition - body: - (block - . - (expression_statement - (string) @string.documentation @spell))) + body: (block + . + (expression_statement + (string) @string.documentation @spell))) (function_definition - body: - (block - . - (expression_statement - (string) @string.documentation @spell))) + body: (block + . + (expression_statement + (string) @string.documentation @spell))) ; Tokens [ @@ -378,32 +372,27 @@ name: (identifier) @type) (class_definition - body: - (block - (function_definition - name: (identifier) @function.method))) + body: (block + (function_definition + name: (identifier) @function.method))) (class_definition - superclasses: - (argument_list - (identifier) @type)) + superclasses: (argument_list + (identifier) @type)) ((class_definition - body: - (block - (expression_statement - (assignment - left: (identifier) @variable.member)))) + body: (block + (expression_statement + (assignment + left: (identifier) @variable.member)))) (#lua-match? @variable.member "^[%l_].*$")) ((class_definition - body: - (block - (expression_statement - (assignment - left: - (_ - (identifier) @variable.member))))) + body: (block + (expression_statement + (assignment + left: (_ + (identifier) @variable.member))))) (#lua-match? @variable.member "^[%l_].*$")) ((class_definition @@ -434,12 +423,10 @@ ; Regex from the `re` module (call - function: - (attribute - object: (identifier) @_re) - arguments: - (argument_list - . - (string - (string_content) @string.regexp)) + function: (attribute + object: (identifier) @_re) + arguments: (argument_list + . + (string + (string_content) @string.regexp)) (#eq? @_re "re")) |