mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 19:30:02 -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
|
|
@ -263,18 +263,16 @@
|
|||
function: (identifier) @function.call)
|
||||
|
||||
(call_expression
|
||||
function:
|
||||
(field_expression
|
||||
field: (field_identifier) @function.call))
|
||||
function: (field_expression
|
||||
field: (field_identifier) @function.call))
|
||||
|
||||
(function_declarator
|
||||
declarator: (identifier) @function)
|
||||
|
||||
(function_declarator
|
||||
declarator:
|
||||
(parenthesized_declarator
|
||||
(pointer_declarator
|
||||
declarator: (field_identifier) @function)))
|
||||
declarator: (parenthesized_declarator
|
||||
(pointer_declarator
|
||||
declarator: (field_identifier) @function)))
|
||||
|
||||
(preproc_function_def
|
||||
name: (identifier) @function.macro)
|
||||
|
|
|
|||
|
|
@ -43,19 +43,17 @@
|
|||
|
||||
; Supports if without braces (but not both if-else without braces)
|
||||
(if_statement
|
||||
consequence:
|
||||
(_
|
||||
";" @indent.end) @_consequence
|
||||
consequence: (_
|
||||
";" @indent.end) @_consequence
|
||||
(#not-has-type? @_consequence compound_statement)
|
||||
alternative:
|
||||
(else_clause
|
||||
"else" @indent.branch
|
||||
[
|
||||
(if_statement
|
||||
(compound_statement) @indent.dedent)? @indent.dedent
|
||||
(compound_statement)? @indent.dedent
|
||||
(_)? @indent.dedent
|
||||
])?) @indent.begin
|
||||
alternative: (else_clause
|
||||
"else" @indent.branch
|
||||
[
|
||||
(if_statement
|
||||
(compound_statement) @indent.dedent)? @indent.dedent
|
||||
(compound_statement)? @indent.dedent
|
||||
(_)? @indent.dedent
|
||||
])?) @indent.begin
|
||||
|
||||
(else_clause
|
||||
(_
|
||||
|
|
|
|||
|
|
@ -14,11 +14,10 @@
|
|||
|
||||
((call_expression
|
||||
function: (identifier) @_function
|
||||
arguments:
|
||||
(argument_list
|
||||
.
|
||||
(string_literal
|
||||
(string_content) @injection.content)))
|
||||
arguments: (argument_list
|
||||
.
|
||||
(string_literal
|
||||
(string_content) @injection.content)))
|
||||
; format-ignore
|
||||
(#any-of? @_function
|
||||
"printf" "printf_s"
|
||||
|
|
@ -36,12 +35,11 @@
|
|||
|
||||
((call_expression
|
||||
function: (identifier) @_function
|
||||
arguments:
|
||||
(argument_list
|
||||
(_)
|
||||
.
|
||||
(string_literal
|
||||
(string_content) @injection.content)))
|
||||
arguments: (argument_list
|
||||
(_)
|
||||
.
|
||||
(string_literal
|
||||
(string_content) @injection.content)))
|
||||
; format-ignore
|
||||
(#any-of? @_function
|
||||
"fprintf" "fprintf_s"
|
||||
|
|
@ -68,14 +66,13 @@
|
|||
|
||||
((call_expression
|
||||
function: (identifier) @_function
|
||||
arguments:
|
||||
(argument_list
|
||||
(_)
|
||||
.
|
||||
(_)
|
||||
.
|
||||
(string_literal
|
||||
(string_content) @injection.content)))
|
||||
arguments: (argument_list
|
||||
(_)
|
||||
.
|
||||
(_)
|
||||
.
|
||||
(string_literal
|
||||
(string_content) @injection.content)))
|
||||
; format-ignore
|
||||
(#any-of? @_function
|
||||
"sprintf_s"
|
||||
|
|
@ -92,16 +89,15 @@
|
|||
|
||||
((call_expression
|
||||
function: (identifier) @_function
|
||||
arguments:
|
||||
(argument_list
|
||||
(_)
|
||||
.
|
||||
(_)
|
||||
.
|
||||
(_)
|
||||
.
|
||||
(string_literal
|
||||
(string_content) @injection.content)))
|
||||
arguments: (argument_list
|
||||
(_)
|
||||
.
|
||||
(_)
|
||||
.
|
||||
(_)
|
||||
.
|
||||
(string_literal
|
||||
(string_content) @injection.content)))
|
||||
(#any-of? @_function "mvwprintw" "mvwscanw")
|
||||
(#set! injection.language "printf"))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue