mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
refactor(format): drop extra indentation for field
This commit is contained in:
parent
c28396de30
commit
722617e672
140 changed files with 2146 additions and 2766 deletions
|
|
@ -137,9 +137,8 @@
|
|||
|
||||
((assignment
|
||||
left: (python_identifier) @type.definition
|
||||
right:
|
||||
(call
|
||||
function: (python_identifier) @_func))
|
||||
right: (call
|
||||
function: (python_identifier) @_func))
|
||||
(#any-of? @_func "TypeVar" "NewType"))
|
||||
|
||||
; Fields
|
||||
|
|
@ -154,18 +153,16 @@
|
|||
function: (python_identifier) @function.call)
|
||||
|
||||
(call
|
||||
function:
|
||||
(attribute
|
||||
attribute: (python_identifier) @function.method.call))
|
||||
function: (attribute
|
||||
attribute: (python_identifier) @function.method.call))
|
||||
|
||||
((call
|
||||
function: (python_identifier) @constructor)
|
||||
(#lua-match? @constructor "^%u"))
|
||||
|
||||
((call
|
||||
function:
|
||||
(attribute
|
||||
attribute: (python_identifier) @constructor))
|
||||
function: (attribute
|
||||
attribute: (python_identifier) @constructor))
|
||||
(#lua-match? @constructor "^%u"))
|
||||
|
||||
((call
|
||||
|
|
@ -191,10 +188,9 @@
|
|||
|
||||
((call
|
||||
function: (python_identifier) @_isinstance
|
||||
arguments:
|
||||
(argument_list
|
||||
(_)
|
||||
(python_identifier) @type))
|
||||
arguments: (argument_list
|
||||
(_)
|
||||
(python_identifier) @type))
|
||||
(#eq? @_isinstance "isinstance"))
|
||||
|
||||
(anonymous_python_function
|
||||
|
|
@ -216,11 +212,10 @@
|
|||
(identifier) @function)
|
||||
|
||||
(python_function_definition
|
||||
body:
|
||||
(block
|
||||
.
|
||||
(expression_statement
|
||||
(python_string) @string.documentation @spell)))
|
||||
body: (block
|
||||
.
|
||||
(expression_statement
|
||||
(python_string) @string.documentation @spell)))
|
||||
|
||||
; Namespace
|
||||
(inherit_path) @module
|
||||
|
|
|
|||
|
|
@ -154,9 +154,8 @@
|
|||
(attribute
|
||||
attribute: (_) @indent.end)
|
||||
(call
|
||||
arguments:
|
||||
(_
|
||||
")" @indent.end))
|
||||
arguments: (_
|
||||
")" @indent.end))
|
||||
"return" @indent.end
|
||||
] .)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
(call
|
||||
function:
|
||||
(attribute
|
||||
object: (python_identifier) @_re)
|
||||
arguments:
|
||||
(argument_list
|
||||
(python_string
|
||||
(string_content) @injection.content) @_string)
|
||||
function: (attribute
|
||||
object: (python_identifier) @_re)
|
||||
arguments: (argument_list
|
||||
(python_string
|
||||
(string_content) @injection.content) @_string)
|
||||
(#eq? @_re "re")
|
||||
(#lua-match? @_string "^r.*")
|
||||
(#set! injection.language "regex"))
|
||||
|
|
|
|||
|
|
@ -9,14 +9,12 @@
|
|||
alias: (python_identifier) @local.definition.import)
|
||||
|
||||
(import_statement
|
||||
name:
|
||||
(dotted_name
|
||||
(python_identifier) @local.definition.import))
|
||||
name: (dotted_name
|
||||
(python_identifier) @local.definition.import))
|
||||
|
||||
(import_from_statement
|
||||
name:
|
||||
(dotted_name
|
||||
(python_identifier) @local.definition.import))
|
||||
name: (dotted_name
|
||||
(python_identifier) @local.definition.import))
|
||||
|
||||
; Function with parameters, defines parameters
|
||||
(parameters
|
||||
|
|
@ -55,14 +53,12 @@
|
|||
; Loops
|
||||
; not a scope!
|
||||
(for_statement
|
||||
left:
|
||||
(pattern_list
|
||||
(python_identifier) @local.definition.var))
|
||||
left: (pattern_list
|
||||
(python_identifier) @local.definition.var))
|
||||
|
||||
(for_statement
|
||||
left:
|
||||
(tuple_pattern
|
||||
(python_identifier) @local.definition.var))
|
||||
left: (tuple_pattern
|
||||
(python_identifier) @local.definition.var))
|
||||
|
||||
(for_statement
|
||||
left: (python_identifier) @local.definition.var)
|
||||
|
|
@ -74,14 +70,12 @@
|
|||
left: (python_identifier) @local.definition.var)
|
||||
|
||||
(for_in_clause
|
||||
left:
|
||||
(tuple_pattern
|
||||
(python_identifier) @local.definition.var))
|
||||
left: (tuple_pattern
|
||||
(python_identifier) @local.definition.var))
|
||||
|
||||
(for_in_clause
|
||||
left:
|
||||
(pattern_list
|
||||
(python_identifier) @local.definition.var))
|
||||
left: (pattern_list
|
||||
(python_identifier) @local.definition.var))
|
||||
|
||||
(dictionary_comprehension) @local.scope
|
||||
|
||||
|
|
@ -94,30 +88,26 @@
|
|||
left: (python_identifier) @local.definition.var)
|
||||
|
||||
(assignment
|
||||
left:
|
||||
(pattern_list
|
||||
(python_identifier) @local.definition.var))
|
||||
left: (pattern_list
|
||||
(python_identifier) @local.definition.var))
|
||||
|
||||
(assignment
|
||||
left:
|
||||
(tuple_pattern
|
||||
(python_identifier) @local.definition.var))
|
||||
left: (tuple_pattern
|
||||
(python_identifier) @local.definition.var))
|
||||
|
||||
(assignment
|
||||
left:
|
||||
(attribute
|
||||
(python_identifier)
|
||||
(python_identifier) @local.definition.field))
|
||||
left: (attribute
|
||||
(python_identifier)
|
||||
(python_identifier) @local.definition.field))
|
||||
|
||||
(variable_assignment
|
||||
(identifier)
|
||||
operator:
|
||||
[
|
||||
"="
|
||||
"?="
|
||||
"??="
|
||||
":="
|
||||
] @local.definition.var)
|
||||
operator: [
|
||||
"="
|
||||
"?="
|
||||
"??="
|
||||
":="
|
||||
] @local.definition.var)
|
||||
|
||||
; Walrus operator x := 1
|
||||
(named_expression
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue