File tree 1 file changed +8
-0
lines changed
crates/ruff_server/src/server/api/requests
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ impl super::BackgroundDocumentRequestHandler for CodeActions {
49
49
if snapshot. client_settings ( ) . fix_all ( ) {
50
50
if supported_code_actions. contains ( & SupportedCodeAction :: SourceFixAll ) {
51
51
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.
52
56
tracing:: debug!( "Ignoring `source.fixAll` code action for a notebook cell" ) ;
53
57
} else {
54
58
response. push ( fix_all ( & snapshot) . with_failure_code ( ErrorCode :: InternalError ) ?) ;
@@ -62,6 +66,10 @@ impl super::BackgroundDocumentRequestHandler for CodeActions {
62
66
if snapshot. client_settings ( ) . organize_imports ( ) {
63
67
if supported_code_actions. contains ( & SupportedCodeAction :: SourceOrganizeImports ) {
64
68
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.
65
73
tracing:: debug!(
66
74
"Ignoring `source.organizeImports` code action for a notebook cell"
67
75
) ;
You can’t perform that action at this time.
0 commit comments