File tree 1 file changed +4
-1
lines changed
crates/rust-analyzer/src/diagnostics
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(
191
191
192
192
let mut edit_map: HashMap < lsp_types:: Url , Vec < lsp_types:: TextEdit > > = HashMap :: new ( ) ;
193
193
let mut suggested_replacements = Vec :: new ( ) ;
194
+ let mut is_preferred = true ;
194
195
for & span in & spans {
195
196
if let Some ( suggested_replacement) = & span. suggested_replacement {
196
197
if !suggested_replacement. is_empty ( ) {
@@ -209,6 +210,8 @@ fn map_rust_child_diagnostic(
209
210
) {
210
211
edit_map. entry ( location. uri ) . or_default ( ) . push ( edit) ;
211
212
}
213
+ is_preferred &=
214
+ matches ! ( span. suggestion_applicability, Some ( Applicability :: MachineApplicable ) ) ;
212
215
}
213
216
}
214
217
@@ -251,7 +254,7 @@ fn map_rust_child_diagnostic(
251
254
document_changes : None ,
252
255
change_annotations : None ,
253
256
} ) ,
254
- is_preferred : Some ( true ) ,
257
+ is_preferred : Some ( is_preferred ) ,
255
258
data : None ,
256
259
command : None ,
257
260
} ,
You can’t perform that action at this time.
0 commit comments