diff --git a/crates/ty_ide/src/code_action.rs b/crates/ty_ide/src/code_action.rs index 2e0640d3af825..240ff68220ff1 100644 --- a/crates/ty_ide/src/code_action.rs +++ b/crates/ty_ide/src/code_action.rs @@ -128,16 +128,8 @@ mod tests { fn add_ignore_trailing_whitespace() { let test = CodeActionTest::with_source(r#"b = a / 10 "#); - assert_snapshot!(test.code_actions(&UNRESOLVED_REFERENCE), @" - info[code-action]: Ignore 'unresolved-reference' for this line - --> main.py:1:5 - | - 1 | b = a / 10 - | ^ - | - - b = a / 10 - 1 + b = a / 10 # ty:ignore[unresolved-reference] - "); + // Not an inline snapshot because of trailing whitespace. + assert_snapshot!(test.code_actions(&UNRESOLVED_REFERENCE)); } #[test] diff --git a/crates/ty_ide/src/snapshots/ty_ide__code_action__tests__add_ignore_trailing_whitespace.snap b/crates/ty_ide/src/snapshots/ty_ide__code_action__tests__add_ignore_trailing_whitespace.snap new file mode 100644 index 0000000000000..48db5f09a685c --- /dev/null +++ b/crates/ty_ide/src/snapshots/ty_ide__code_action__tests__add_ignore_trailing_whitespace.snap @@ -0,0 +1,12 @@ +--- +source: crates/ty_ide/src/code_action.rs +expression: test.code_actions(&UNRESOLVED_REFERENCE) +--- +info[code-action]: Ignore 'unresolved-reference' for this line + --> main.py:1:5 + | +1 | b = a / 10 + | ^ + | + - b = a / 10 +1 + b = a / 10 # ty:ignore[unresolved-reference]