refactor(format): drop extra indentation for field

This commit is contained in:
Phạm Huy Hoàng 2024-03-21 20:44:35 +09:00 committed by Christian Clason
parent c28396de30
commit 722617e672
140 changed files with 2146 additions and 2766 deletions

View file

@ -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)

View file

@ -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
(_

View file

@ -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"))