File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
crates/rust-analyzer/src/diagnostics Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,7 @@ fn map_rust_child_diagnostic(
191191
192192 let mut edit_map: HashMap < lsp_types:: Url , Vec < lsp_types:: TextEdit > > = HashMap :: new ( ) ;
193193 let mut suggested_replacements = Vec :: new ( ) ;
194+ let mut is_preferred = true ;
194195 for & span in & spans {
195196 if let Some ( suggested_replacement) = & span. suggested_replacement {
196197 if !suggested_replacement. is_empty ( ) {
@@ -209,6 +210,8 @@ fn map_rust_child_diagnostic(
209210 ) {
210211 edit_map. entry ( location. uri ) . or_default ( ) . push ( edit) ;
211212 }
213+ is_preferred &=
214+ matches ! ( span. suggestion_applicability, Some ( Applicability :: MachineApplicable ) ) ;
212215 }
213216 }
214217
@@ -251,7 +254,7 @@ fn map_rust_child_diagnostic(
251254 document_changes : None ,
252255 change_annotations : None ,
253256 } ) ,
254- is_preferred : Some ( true ) ,
257+ is_preferred : Some ( is_preferred ) ,
255258 data : None ,
256259 command : None ,
257260 } ,
You can’t perform that action at this time.
0 commit comments