autofix now handles comments in the event of a newline w/ comments (#1236)

* autofix now handles comments in the event of a newline w/ comments

* oob check

* continue statements so we don't waste time checking things we know

* added a skip for if the characters are a comment

* convert to switch for readability
This commit is contained in:
Joe Williams
2023-06-15 15:53:33 -04:00
committed by GitHub
parent c28a59ccf3
commit 83c9a7b493
2 changed files with 36 additions and 3 deletions

View File

@@ -81,6 +81,25 @@ test "code actions - discard captures" {
);
}
test "code actions - discard capture with comment" {
try testAutofix(
\\test {
\\ if (1 == 1) |a|
\\ //a
\\ {}
\\}
,
\\test {
\\ if (1 == 1) |a|
\\ //a
\\ {
\\ _ = a;
\\ }
\\}
\\
);
}
test "code actions - remove pointless discard" {
try testAutofix(
\\fn foo(a: u32) u32 {