diff --git a/apps/oxlint/src/lsp/server_linter.rs b/apps/oxlint/src/lsp/server_linter.rs index 8a7da546d7aa1..57ba1f5ebea5e 100644 --- a/apps/oxlint/src/lsp/server_linter.rs +++ b/apps/oxlint/src/lsp/server_linter.rs @@ -180,6 +180,9 @@ impl ToolBuilder for ServerLinterBuilder { if !code_action_kinds.contains(&CODE_ACTION_KIND_SOURCE_FIX_ALL_OXC) { code_action_kinds.push(CODE_ACTION_KIND_SOURCE_FIX_ALL_OXC); } + if !code_action_kinds.contains(&CodeActionKind::SOURCE_FIX_ALL) { + code_action_kinds.push(CodeActionKind::SOURCE_FIX_ALL); + } // override code action kinds if the code action provider is already set capabilities.code_action_provider = @@ -517,10 +520,13 @@ impl Tool for ServerLinter { let actions = actions.into_iter().filter(|r| r.range == *range || range_overlaps(*range, r.range)); - let is_source_fix_all_oxc = only_code_action_kinds - .is_some_and(|only| only.contains(&CODE_ACTION_KIND_SOURCE_FIX_ALL_OXC)); + // if `source.fixAll.oxc` or `source.fixAll` is requested, return a single code action that applies all fixes + let is_source_fix_all = only_code_action_kinds.is_some_and(|only| { + only.contains(&CODE_ACTION_KIND_SOURCE_FIX_ALL_OXC) + || only.contains(&CodeActionKind::SOURCE_FIX_ALL) + }); - if is_source_fix_all_oxc { + if is_source_fix_all { return apply_all_fix_code_action(actions, uri.clone()) .map_or(vec![], |code_actions| { vec![CodeActionOrCommand::CodeAction(code_actions)] @@ -697,7 +703,8 @@ mod tests_builder { let code_action_kinds = options.code_action_kinds.as_ref().unwrap(); assert!(code_action_kinds.contains(&CodeActionKind::QUICKFIX)); assert!(code_action_kinds.contains(&CODE_ACTION_KIND_SOURCE_FIX_ALL_OXC)); - assert_eq!(code_action_kinds.len(), 2); + assert!(code_action_kinds.contains(&CodeActionKind::SOURCE_FIX_ALL)); + assert_eq!(code_action_kinds.len(), 3); } _ => panic!("Expected code action provider options"), } @@ -728,7 +735,8 @@ mod tests_builder { assert!(code_action_kinds.contains(&CodeActionKind::REFACTOR)); assert!(code_action_kinds.contains(&CodeActionKind::QUICKFIX)); assert!(code_action_kinds.contains(&CODE_ACTION_KIND_SOURCE_FIX_ALL_OXC)); - assert_eq!(code_action_kinds.len(), 3); + assert!(code_action_kinds.contains(&CodeActionKind::SOURCE_FIX_ALL)); + assert_eq!(code_action_kinds.len(), 4); assert_eq!(options.resolve_provider, Some(true)); } _ => panic!("Expected code action provider options"), @@ -754,7 +762,8 @@ mod tests_builder { let code_action_kinds = options.code_action_kinds.as_ref().unwrap(); assert!(code_action_kinds.contains(&CodeActionKind::QUICKFIX)); assert!(code_action_kinds.contains(&CODE_ACTION_KIND_SOURCE_FIX_ALL_OXC)); - assert_eq!(code_action_kinds.len(), 2); + assert!(code_action_kinds.contains(&CodeActionKind::SOURCE_FIX_ALL)); + assert_eq!(code_action_kinds.len(), 3); } _ => panic!("Expected code action provider options"), } @@ -776,7 +785,8 @@ mod tests_builder { let code_action_kinds = options.code_action_kinds.as_ref().unwrap(); assert!(code_action_kinds.contains(&CodeActionKind::QUICKFIX)); assert!(code_action_kinds.contains(&CODE_ACTION_KIND_SOURCE_FIX_ALL_OXC)); - assert_eq!(code_action_kinds.len(), 2); + assert!(code_action_kinds.contains(&CodeActionKind::SOURCE_FIX_ALL)); + assert_eq!(code_action_kinds.len(), 3); } _ => panic!("Expected code action provider options"), } diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module@debugger.ts.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module@debugger.ts.snap index a5bc5c93e4f10..01d92900d2e2e 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module@debugger.ts.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module@debugger.ts.snap @@ -71,3 +71,22 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable no-debugger\n", } + + +########### Fix All Action +CodeAction: +Title: quick fix +Is Preferred: Some(true) +TextEdit: TextEdit { + range: Range { + start: Position { + line: 1, + character: 0, + }, + end: Position { + line: 1, + character: 9, + }, + }, + new_text: "", +} diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module@dep-a.ts.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module@dep-a.ts.snap index 831cf9b30dd22..ed8ad74d1f06c 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module@dep-a.ts.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module@dep-a.ts.snap @@ -53,3 +53,7 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable import/no-cycle\n", } + + +########### Fix All Action +None diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module_extended_config@dep-a.ts.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module_extended_config@dep-a.ts.snap index fb0aef6842e45..aa33feb8a7e79 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module_extended_config@dep-a.ts.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module_extended_config@dep-a.ts.snap @@ -53,3 +53,7 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable import/no-cycle\n", } + + +########### Fix All Action +None diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module_nested_config@dep-a.ts_folder__folder-dep-a.ts.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module_nested_config@dep-a.ts_folder__folder-dep-a.ts.snap index b38e830af3646..6e8f98be1a0a6 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module_nested_config@dep-a.ts_folder__folder-dep-a.ts.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_cross_module_nested_config@dep-a.ts_folder__folder-dep-a.ts.snap @@ -9,6 +9,8 @@ File URI: file:///fixtures/lsp/cross_module_nested_config/dep-a.ts ########### Code Actions/Commands +########### Fix All Action +None ########## Linted file: fixtures/lsp/cross_module_nested_config/folder/folder-dep-a.ts ---------- @@ -61,3 +63,7 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable import/no-cycle\n", } + + +########### Fix All Action +None diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_deny_no_console@hello_world.js.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_deny_no_console@hello_world.js.snap index df80a33914982..7870fc0e95a91 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_deny_no_console@hello_world.js.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_deny_no_console@hello_world.js.snap @@ -53,3 +53,7 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable no-console\n", } + + +########### Fix All Action +None diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_frameworks@astro__debugger.astro_vue__debugger.vue_svelte__debugger.svelte_nextjs__[[..rest]]__debugger.ts.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_frameworks@astro__debugger.astro_vue__debugger.vue_svelte__debugger.svelte_nextjs__[[..rest]]__debugger.ts.snap index d8ba1258c7378..d7d6d12a9314a 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_frameworks@astro__debugger.astro_vue__debugger.vue_svelte__debugger.svelte_nextjs__[[..rest]]__debugger.ts.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_frameworks@astro__debugger.astro_vue__debugger.vue_svelte__debugger.svelte_nextjs__[[..rest]]__debugger.ts.snap @@ -268,6 +268,64 @@ TextEdit: TextEdit { } +########### Fix All Action +CodeAction: +Title: quick fix +Is Preferred: Some(true) +TextEdit: TextEdit { + range: Range { + start: Position { + line: 1, + character: 0, + }, + end: Position { + line: 1, + character: 8, + }, + }, + new_text: "", +} +TextEdit: TextEdit { + range: Range { + start: Position { + line: 10, + character: 2, + }, + end: Position { + line: 10, + character: 10, + }, + }, + new_text: "", +} +TextEdit: TextEdit { + range: Range { + start: Position { + line: 14, + character: 2, + }, + end: Position { + line: 14, + character: 10, + }, + }, + new_text: "", +} +TextEdit: TextEdit { + range: Range { + start: Position { + line: 18, + character: 2, + }, + end: Position { + line: 18, + character: 10, + }, + }, + new_text: "", +} + + ########## Linted file: fixtures/lsp/frameworks/vue/debugger.vue ---------- @@ -405,6 +463,38 @@ TextEdit: TextEdit { } +########### Fix All Action +CodeAction: +Title: quick fix +Is Preferred: Some(true) +TextEdit: TextEdit { + range: Range { + start: Position { + line: 4, + character: 8, + }, + end: Position { + line: 4, + character: 17, + }, + }, + new_text: "", +} +TextEdit: TextEdit { + range: Range { + start: Position { + line: 8, + character: 4, + }, + end: Position { + line: 8, + character: 13, + }, + }, + new_text: "", +} + + ########## Linted file: fixtures/lsp/frameworks/svelte/debugger.svelte ---------- @@ -571,6 +661,25 @@ TextEdit: TextEdit { } +########### Fix All Action +CodeAction: +Title: quick fix +Is Preferred: Some(true) +TextEdit: TextEdit { + range: Range { + start: Position { + line: 1, + character: 1, + }, + end: Position { + line: 1, + character: 10, + }, + }, + new_text: "", +} + + ########## Linted file: fixtures/lsp/frameworks/nextjs/[[..rest]]/debugger.ts ---------- @@ -641,3 +750,22 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable no-debugger\n", } + + +########### Fix All Action +CodeAction: +Title: quick fix +Is Preferred: Some(true) +TextEdit: TextEdit { + range: Range { + start: Position { + line: 0, + character: 0, + }, + end: Position { + line: 0, + character: 9, + }, + }, + new_text: "", +} diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_ignore_patterns@ignored-file.ts_another_config__not-ignored-file.ts.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_ignore_patterns@ignored-file.ts_another_config__not-ignored-file.ts.snap index a7af4760ab8d7..c61b6ce20b14c 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_ignore_patterns@ignored-file.ts_another_config__not-ignored-file.ts.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_ignore_patterns@ignored-file.ts_another_config__not-ignored-file.ts.snap @@ -9,6 +9,8 @@ File URI: file:///fixtures/lsp/ignore_patterns/ignored-file.ts ########### Code Actions/Commands +########### Fix All Action +None ########## Linted file: fixtures/lsp/ignore_patterns/another_config/not-ignored-file.ts ---------- @@ -79,3 +81,22 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable no-debugger\n", } + + +########### Fix All Action +CodeAction: +Title: quick fix +Is Preferred: Some(true) +TextEdit: TextEdit { + range: Range { + start: Position { + line: 0, + character: 0, + }, + end: Position { + line: 0, + character: 9, + }, + }, + new_text: "", +} diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_invalid_syntax@debugger.ts_invalid.vue.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_invalid_syntax@debugger.ts_invalid.vue.snap index 8423b2445c0c5..3e9aafd63180e 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_invalid_syntax@debugger.ts_invalid.vue.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_invalid_syntax@debugger.ts_invalid.vue.snap @@ -20,6 +20,8 @@ tags: None ########### Code Actions/Commands +########### Fix All Action +None ########## Linted file: fixtures/lsp/invalid_syntax/invalid.vue ---------- @@ -38,3 +40,6 @@ source: Some("oxc") tags: None ########### Code Actions/Commands + +########### Fix All Action +None diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_issue_14565@foo-bar.astro.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_issue_14565@foo-bar.astro.snap index 8a97939acdb49..cd108e809e00d 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_issue_14565@foo-bar.astro.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_issue_14565@foo-bar.astro.snap @@ -19,3 +19,6 @@ source: Some("oxc") tags: None ########### Code Actions/Commands + +########### Fix All Action +None diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_issue_9958@issue.ts.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_issue_9958@issue.ts.snap index 2e3269148405b..53da5767ab9b1 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_issue_9958@issue.ts.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_issue_9958@issue.ts.snap @@ -114,3 +114,7 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable typescript/no-non-null-asserted-optional-chain\n", } + + +########### Fix All Action +None diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_js_plugins@index.js.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_js_plugins@index.js.snap index da1ee773f3c9e..c63192b1a417d 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_js_plugins@index.js.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_js_plugins@index.js.snap @@ -71,3 +71,22 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable no-debugger\n", } + + +########### Fix All Action +CodeAction: +Title: quick fix +Is Preferred: Some(true) +TextEdit: TextEdit { + range: Range { + start: Position { + line: 0, + character: 0, + }, + end: Position { + line: 0, + character: 9, + }, + }, + new_text: "", +} diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_multiple_suggestions@forward_ref.ts.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_multiple_suggestions@forward_ref.ts.snap index 6175bfe15f623..05ec39ba49a7d 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_multiple_suggestions@forward_ref.ts.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_multiple_suggestions@forward_ref.ts.snap @@ -89,3 +89,22 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable react/forward-ref-uses-ref\n", } + + +########### Fix All Action +CodeAction: +Title: quick fix +Is Preferred: Some(true) +TextEdit: TextEdit { + range: Range { + start: Position { + line: 0, + character: 0, + }, + end: Position { + line: 0, + character: 25, + }, + }, + new_text: "(props) => {}", +} diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_no_errors@hello_world.js.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_no_errors@hello_world.js.snap index ce6db82a59efd..e297cf423090d 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_no_errors@hello_world.js.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_no_errors@hello_world.js.snap @@ -8,3 +8,6 @@ Linted file: fixtures/lsp/no_errors/hello_world.js File URI: file:///fixtures/lsp/no_errors/hello_world.js ########### Code Actions/Commands + +########### Fix All Action +None diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_regexp_feature@index.ts.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_regexp_feature@index.ts.snap index b620df259e867..e407aac48e3a0 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_regexp_feature@index.ts.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_regexp_feature@index.ts.snap @@ -118,3 +118,22 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable no-useless-escape\n", } + + +########### Fix All Action +CodeAction: +Title: quick fix +Is Preferred: Some(true) +TextEdit: TextEdit { + range: Range { + start: Position { + line: 0, + character: 16, + }, + end: Position { + line: 0, + character: 18, + }, + }, + new_text: "/", +} diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_ts_path_alias@deep__src__dep-a.ts.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_ts_path_alias@deep__src__dep-a.ts.snap index 72c512055c581..d7850537d02fc 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_ts_path_alias@deep__src__dep-a.ts.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_ts_path_alias@deep__src__dep-a.ts.snap @@ -53,3 +53,7 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable import/no-cycle\n", } + + +########### Fix All Action +None diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_tsgolint@no-floating-promises__index.ts.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_tsgolint@no-floating-promises__index.ts.snap index 4073b059eedd5..326bd81647b37 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_tsgolint@no-floating-promises__index.ts.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_tsgolint@no-floating-promises__index.ts.snap @@ -432,3 +432,61 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable typescript/no-floating-promises\n", } + + +########### Fix All Action +CodeAction: +Title: quick fix +Is Preferred: Some(true) +TextEdit: TextEdit { + range: Range { + start: Position { + line: 1, + character: 0, + }, + end: Position { + line: 1, + character: 0, + }, + }, + new_text: "void ", +} +TextEdit: TextEdit { + range: Range { + start: Position { + line: 7, + character: 0, + }, + end: Position { + line: 7, + character: 0, + }, + }, + new_text: "void ", +} +TextEdit: TextEdit { + range: Range { + start: Position { + line: 9, + character: 0, + }, + end: Position { + line: 9, + character: 0, + }, + }, + new_text: "void ", +} +TextEdit: TextEdit { + range: Range { + start: Position { + line: 11, + character: 0, + }, + end: Position { + line: 11, + character: 0, + }, + }, + new_text: "void ", +} diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_tsgolint_unused_disabled_directives@test.ts.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_tsgolint_unused_disabled_directives@test.ts.snap index 1ea09094acc66..4b6d0a9d8336b 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_tsgolint_unused_disabled_directives@test.ts.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_tsgolint_unused_disabled_directives@test.ts.snap @@ -100,3 +100,7 @@ TextEdit: TextEdit { }, new_text: "// oxlint-disable typescript/no-floating-promises\n", } + + +########### Fix All Action +None diff --git a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_unused_disabled_directives@test.js.snap b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_unused_disabled_directives@test.js.snap index 02adf3c67b4e6..524e353369e4f 100644 --- a/apps/oxlint/src/lsp/snapshots/fixtures_lsp_unused_disabled_directives@test.js.snap +++ b/apps/oxlint/src/lsp/snapshots/fixtures_lsp_unused_disabled_directives@test.js.snap @@ -205,3 +205,61 @@ TextEdit: TextEdit { }, new_text: "", } + + +########### Fix All Action +CodeAction: +Title: quick fix +Is Preferred: Some(true) +TextEdit: TextEdit { + range: Range { + start: Position { + line: 2, + character: 2, + }, + end: Position { + line: 2, + character: 11, + }, + }, + new_text: "", +} +TextEdit: TextEdit { + range: Range { + start: Position { + line: 0, + character: 2, + }, + end: Position { + line: 0, + character: 56, + }, + }, + new_text: "", +} +TextEdit: TextEdit { + range: Range { + start: Position { + line: 5, + character: 39, + }, + end: Position { + line: 5, + character: 52, + }, + }, + new_text: "", +} +TextEdit: TextEdit { + range: Range { + start: Position { + line: 8, + character: 2, + }, + end: Position { + line: 8, + character: 52, + }, + }, + new_text: "", +} diff --git a/apps/oxlint/src/lsp/tester.rs b/apps/oxlint/src/lsp/tester.rs index 78520eaa49da6..e20c79420cab7 100644 --- a/apps/oxlint/src/lsp/tester.rs +++ b/apps/oxlint/src/lsp/tester.rs @@ -2,8 +2,8 @@ use std::{fmt::Write, path::PathBuf}; use oxc_language_server::{DiagnosticResult, Tool, ToolRestartChanges}; use tower_lsp_server::ls_types::{ - CodeAction, CodeActionOrCommand, CodeDescription, Diagnostic, NumberOrString, Position, Range, - Uri, + CodeAction, CodeActionKind, CodeActionOrCommand, CodeDescription, Diagnostic, NumberOrString, + Position, Range, Uri, }; use crate::lsp::server_linter::{ServerLinter, ServerLinterBuilder}; @@ -157,6 +157,8 @@ fn get_snapshot_from_report(report: &FileResult) -> String { "########## Diagnostic Reports {} ########### Code Actions/Commands +{} +########### Fix All Action {}", get_snapshot_from_diagnostic_result(diagnostics), report @@ -165,6 +167,10 @@ fn get_snapshot_from_report(report: &FileResult) -> String { .map(get_snapshot_from_code_action_or_command) .collect::>() .join("\n"), + report + .fix_all_action + .as_ref() + .map_or_else(|| "None".to_string(), get_snapshot_from_code_action_or_command) ) } @@ -177,6 +183,7 @@ pub struct Tester<'t> { struct FileResult { diagnostic: DiagnosticResult, actions: Vec, + fix_all_action: Option, } impl Tester<'_> { @@ -214,6 +221,14 @@ impl Tester<'_> { &Range::new(Position::new(0, 0), Position::new(u32::MAX, u32::MAX)), None, ), + fix_all_action: linter + .get_code_actions_or_commands( + &uri, + &Range::new(Position::new(0, 0), Position::new(u32::MAX, u32::MAX)), + Some(&vec![CodeActionKind::SOURCE_FIX_ALL]), + ) + .into_iter() + .next(), }; let _ = write!(