diff --git a/crates/oxc_language_server/src/linter/isolated_lint_handler.rs b/crates/oxc_language_server/src/linter/isolated_lint_handler.rs index 0387b353d2a33..e5c5ff86706b3 100644 --- a/crates/oxc_language_server/src/linter/isolated_lint_handler.rs +++ b/crates/oxc_language_server/src/linter/isolated_lint_handler.rs @@ -111,7 +111,6 @@ impl IsolatedLintHandler { fn lint_path(&mut self, path: &Path, uri: &Uri, source_text: &str) -> Vec { debug!("lint {}", path.display()); - let mut allocator = Allocator::default(); let rope = &Rope::from_str(source_text); let mut messages: Vec = self @@ -121,7 +120,7 @@ impl IsolatedLintHandler { Arc::from(source_text), ))) .with_paths(vec![Arc::from(path.as_os_str())]) - .run_source(&mut allocator) + .run_source() .iter() .map(|message| message_to_lsp_diagnostic(message, uri, source_text, rope)) .collect(); diff --git a/crates/oxc_linter/src/service/mod.rs b/crates/oxc_linter/src/service/mod.rs index 1ace2a56f02b6..c6ab220ff75ae 100644 --- a/crates/oxc_linter/src/service/mod.rs +++ b/crates/oxc_linter/src/service/mod.rs @@ -96,18 +96,17 @@ impl LintService { } #[cfg(feature = "language_server")] - pub fn run_source(&mut self, allocator: &mut oxc_allocator::Allocator) -> Vec { - self.runtime.run_source(allocator) + pub fn run_source(&mut self) -> Vec { + self.runtime.run_source() } /// For tests #[cfg(test)] pub(crate) fn run_test_source( &mut self, - allocator: &mut oxc_allocator::Allocator, check_syntax_errors: bool, tx_error: &DiagnosticSender, ) -> Vec { - self.runtime.run_test_source(allocator, check_syntax_errors, tx_error) + self.runtime.run_test_source(check_syntax_errors, tx_error) } } diff --git a/crates/oxc_linter/src/service/runtime.rs b/crates/oxc_linter/src/service/runtime.rs index 127c57fb4c94a..0aaa65bb97bd0 100644 --- a/crates/oxc_linter/src/service/runtime.rs +++ b/crates/oxc_linter/src/service/runtime.rs @@ -637,7 +637,7 @@ impl Runtime { // the struct not using `oxc_diagnostic::Error, because we are just collecting information // and returning it to the client to let him display it. #[cfg(feature = "language_server")] - pub(super) fn run_source(&mut self, _allocator: &mut oxc_allocator::Allocator) -> Vec { + pub(super) fn run_source(&mut self) -> Vec { use std::sync::Mutex; let messages = Mutex::new(Vec::::new()); @@ -706,7 +706,6 @@ impl Runtime { #[cfg(test)] pub(super) fn run_test_source( &mut self, - _allocator: &mut Allocator, check_syntax_errors: bool, tx_error: &DiagnosticSender, ) -> Vec { diff --git a/crates/oxc_linter/src/tester.rs b/crates/oxc_linter/src/tester.rs index a9e36b290469a..e42960cfbd013 100644 --- a/crates/oxc_linter/src/tester.rs +++ b/crates/oxc_linter/src/tester.rs @@ -501,7 +501,6 @@ impl Tester { fix_kind: ExpectFixKind, fix_index: u8, ) -> TestResult { - let mut allocator = Allocator::default(); let rule = self.find_rule().read_json(rule_config.unwrap_or_default()); let mut external_plugin_store = ExternalPluginStore::default(); let linter = Linter::new( @@ -557,7 +556,7 @@ impl Tester { .with_paths(paths); let (sender, _receiver) = mpsc::channel(); - let result = lint_service.run_test_source(&mut allocator, false, &sender); + let result = lint_service.run_test_source(false, &sender); if result.is_empty() { return TestResult::Passed;