From b850b812de0a1f2cfdd8a132ad1f069a1da7ce87 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Fri, 16 Aug 2024 19:50:12 +0530 Subject: [PATCH] Use cell source code instead of the concatenated one (#12929) ## Summary fixes: #12880 ## Test Plan Test against the notebook provided in the issue. --- crates/ruff_server/src/fix.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/ruff_server/src/fix.rs b/crates/ruff_server/src/fix.rs index 163d097c4e6b0..06e10198783ba 100644 --- a/crates/ruff_server/src/fix.rs +++ b/crates/ruff_server/src/fix.rs @@ -123,11 +123,7 @@ pub(crate) fn fix_all( fixes.insert( url.clone(), vec![lsp_types::TextEdit { - range: source_range.to_range( - source_kind.source_code(), - &source_index, - encoding, - ), + range: source_range.to_range(&source, &source_index, encoding), new_text: modified[modified_range].to_owned(), }], );