Skip to content

Commit 30361b9

Browse files
committed
fix: anchor shortvar rule to function declaration rule to prevent other edits
1 parent 3414447 commit 30361b9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lua/auto-fix-return/lib.lua

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@ M.wrap_golang_return = function()
4242
result: (_) @result
4343
(ERROR)? @error_end
4444
)
45-
(short_var_declaration
46-
left: (expression_list
47-
(identifier) @named_result
48-
(ERROR (identifier) @error_end)?
49-
)
45+
(
46+
(function_declaration)
47+
(short_var_declaration
48+
left: (expression_list
49+
(identifier) @named_result
50+
(ERROR (identifier) @error_end)?
51+
)
52+
)
5053
)
5154
]
5255
]]

0 commit comments

Comments
 (0)