Skip to content

Commit f7425ab

Browse files
committed
Add comment
1 parent f5d2079 commit f7425ab

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crates/ruff_server/src/server/api/requests/code_action.rs

+8
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ impl super::BackgroundDocumentRequestHandler for CodeActions {
4949
if snapshot.client_settings().fix_all() {
5050
if supported_code_actions.contains(&SupportedCodeAction::SourceFixAll) {
5151
if snapshot.is_notebook_cell() {
52+
// This is ignore here because the client requests this code action for each
53+
// cell in parallel and the server would send a workspace edit with the same
54+
// content which would result in applying the same edit multiple times
55+
// resulting in (possibly) duplicate code.
5256
tracing::debug!("Ignoring `source.fixAll` code action for a notebook cell");
5357
} else {
5458
response.push(fix_all(&snapshot).with_failure_code(ErrorCode::InternalError)?);
@@ -62,6 +66,10 @@ impl super::BackgroundDocumentRequestHandler for CodeActions {
6266
if snapshot.client_settings().organize_imports() {
6367
if supported_code_actions.contains(&SupportedCodeAction::SourceOrganizeImports) {
6468
if snapshot.is_notebook_cell() {
69+
// This is ignore here because the client requests this code action for each
70+
// cell in parallel and the server would send a workspace edit with the same
71+
// content which would result in applying the same edit multiple times
72+
// resulting in (possibly) duplicate code.
6573
tracing::debug!(
6674
"Ignoring `source.organizeImports` code action for a notebook cell"
6775
);

0 commit comments

Comments
 (0)