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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user