aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python/highlights.scm
diff options
context:
space:
mode:
authorPhạm Huy Hoàng <hoangtun0810@gmail.com>2024-03-21 20:44:35 +0900
committerChristian Clason <c.clason@uni-graz.at>2024-03-21 15:51:26 +0100
commit722617e6726c1508adadf83d531f54987c703be0 (patch)
tree951cdcf1cd2571647a3e5afdc11d6fae5e88b630 /queries/python/highlights.scm
parentfeat(rust): improve indents (diff)
downloadnvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar
nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.gz
nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.bz2
nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.lz
nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.xz
nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.zst
nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.zip
refactor(format): drop extra indentation for field
Diffstat (limited to 'queries/python/highlights.scm')
-rw-r--r--queries/python/highlights.scm87
1 files changed, 37 insertions, 50 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index fea97bed3..d35f7307c 100644
--- a/queries/python/highlights.scm
+++ b/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
@@ -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"))