mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-20 20:30:05 -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
|
|
@ -33,9 +33,8 @@
|
|||
|
||||
((assignment
|
||||
left: (identifier) @type.definition
|
||||
right:
|
||||
(call
|
||||
function: (identifier) @_func))
|
||||
right: (call
|
||||
function: (identifier) @_func))
|
||||
(#any-of? @_func "TypeVar" "NewType"))
|
||||
|
||||
; Decorators
|
||||
|
|
@ -88,10 +87,9 @@
|
|||
|
||||
((call
|
||||
function: (identifier) @_isinstance
|
||||
arguments:
|
||||
(argument_list
|
||||
(_)
|
||||
(identifier) @type))
|
||||
arguments: (argument_list
|
||||
(_)
|
||||
(identifier) @type))
|
||||
(#eq? @_isinstance "isinstance"))
|
||||
|
||||
((identifier) @type.builtin
|
||||
|
|
@ -190,11 +188,10 @@
|
|||
(string) @string.documentation @spell))
|
||||
|
||||
(function_definition
|
||||
body:
|
||||
(block
|
||||
.
|
||||
(expression_statement
|
||||
(string) @string.documentation @spell)))
|
||||
body: (block
|
||||
.
|
||||
(expression_statement
|
||||
(string) @string.documentation @spell)))
|
||||
|
||||
; Tokens
|
||||
[
|
||||
|
|
@ -271,9 +268,8 @@
|
|||
|
||||
((call
|
||||
function: (identifier) @keyword.import
|
||||
arguments:
|
||||
(argument_list
|
||||
(string) @string))
|
||||
arguments: (argument_list
|
||||
(string) @string))
|
||||
(#eq? @keyword.import "load"))
|
||||
|
||||
[
|
||||
|
|
@ -323,10 +319,9 @@
|
|||
; Struct definitions
|
||||
((call
|
||||
function: (identifier) @_func
|
||||
arguments:
|
||||
(argument_list
|
||||
(keyword_argument
|
||||
name: (identifier) @variable.member)))
|
||||
arguments: (argument_list
|
||||
(keyword_argument
|
||||
name: (identifier) @variable.member)))
|
||||
(#eq? @_func "struct"))
|
||||
|
||||
; Function calls
|
||||
|
|
@ -334,16 +329,14 @@
|
|||
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 "^[A-Z]"))
|
||||
|
||||
((call
|
||||
function:
|
||||
(attribute
|
||||
attribute: (identifier) @constructor))
|
||||
function: (attribute
|
||||
attribute: (identifier) @constructor))
|
||||
(#lua-match? @constructor "^[A-Z]"))
|
||||
|
|
|
|||
|
|
@ -32,14 +32,12 @@
|
|||
; Loops
|
||||
; not a scope!
|
||||
(for_statement
|
||||
left:
|
||||
(pattern_list
|
||||
(identifier) @local.definition.var))
|
||||
left: (pattern_list
|
||||
(identifier) @local.definition.var))
|
||||
|
||||
(for_statement
|
||||
left:
|
||||
(tuple_pattern
|
||||
(identifier) @local.definition.var))
|
||||
left: (tuple_pattern
|
||||
(identifier) @local.definition.var))
|
||||
|
||||
(for_statement
|
||||
left: (identifier) @local.definition.var)
|
||||
|
|
@ -49,14 +47,12 @@
|
|||
left: (identifier) @local.definition.var)
|
||||
|
||||
(for_in_clause
|
||||
left:
|
||||
(tuple_pattern
|
||||
(identifier) @local.definition.var))
|
||||
left: (tuple_pattern
|
||||
(identifier) @local.definition.var))
|
||||
|
||||
(for_in_clause
|
||||
left:
|
||||
(pattern_list
|
||||
(identifier) @local.definition.var))
|
||||
left: (pattern_list
|
||||
(identifier) @local.definition.var))
|
||||
|
||||
(dictionary_comprehension) @local.scope
|
||||
|
||||
|
|
@ -69,20 +65,17 @@
|
|||
left: (identifier) @local.definition.var)
|
||||
|
||||
(assignment
|
||||
left:
|
||||
(pattern_list
|
||||
(identifier) @local.definition.var))
|
||||
left: (pattern_list
|
||||
(identifier) @local.definition.var))
|
||||
|
||||
(assignment
|
||||
left:
|
||||
(tuple_pattern
|
||||
(identifier) @local.definition.var))
|
||||
left: (tuple_pattern
|
||||
(identifier) @local.definition.var))
|
||||
|
||||
(assignment
|
||||
left:
|
||||
(attribute
|
||||
(identifier)
|
||||
(identifier) @local.definition.field))
|
||||
left: (attribute
|
||||
(identifier)
|
||||
(identifier) @local.definition.field))
|
||||
|
||||
; Walrus operator x := 1
|
||||
(named_expression
|
||||
|
|
@ -98,7 +91,6 @@
|
|||
; Loads
|
||||
((call
|
||||
function: (identifier) @_fn
|
||||
arguments:
|
||||
(argument_list
|
||||
(string) @local.definition.import))
|
||||
arguments: (argument_list
|
||||
(string) @local.definition.import))
|
||||
(#eq? @_fn "load"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue