@@ -28,7 +28,7 @@ use ide_db::{
2828 EditionedFileId , LineIndexDatabase , SnippetCap ,
2929 base_db:: {
3030 SourceDatabase ,
31- salsa:: { self , Database } ,
31+ salsa:: { self , Cancelled , Database } ,
3232 } ,
3333} ;
3434use itertools:: Itertools ;
@@ -1128,36 +1128,44 @@ impl flags::AnalysisStats {
11281128 file_ids. dedup ( ) ;
11291129 let mut sw = self . stop_watch ( ) ;
11301130
1131+ HirDatabase :: zalsa_register_downcaster ( db) ;
1132+
11311133 let mut bar = create_bar ( ) ;
11321134 for & file_id in & file_ids {
11331135 let msg = format ! ( "diagnostics: {}" , vfs. file_path( file_id. file_id( db) ) ) ;
11341136 bar. set_message ( move || msg. clone ( ) ) ;
1135- _ = analysis. full_diagnostics (
1136- & DiagnosticsConfig {
1137- enabled : true ,
1138- proc_macros_enabled : true ,
1139- proc_attr_macros_enabled : true ,
1140- disable_experimental : false ,
1141- disabled : Default :: default ( ) ,
1142- expr_fill_default : Default :: default ( ) ,
1143- snippet_cap : SnippetCap :: new ( true ) ,
1144- insert_use : ide_db:: imports:: insert_use:: InsertUseConfig {
1145- granularity : ide_db:: imports:: insert_use:: ImportGranularity :: Crate ,
1146- enforce_granularity : true ,
1147- prefix_kind : hir:: PrefixKind :: ByCrate ,
1148- group : true ,
1149- skip_glob_imports : true ,
1150- } ,
1151- prefer_no_std : false ,
1152- prefer_prelude : true ,
1153- prefer_absolute : false ,
1154- style_lints : false ,
1155- term_search_fuel : 400 ,
1156- term_search_borrowck : true ,
1137+
1138+ let config = DiagnosticsConfig {
1139+ enabled : true ,
1140+ proc_macros_enabled : true ,
1141+ proc_attr_macros_enabled : true ,
1142+ disable_experimental : false ,
1143+ disabled : Default :: default ( ) ,
1144+ expr_fill_default : Default :: default ( ) ,
1145+ snippet_cap : SnippetCap :: new ( true ) ,
1146+ insert_use : ide_db:: imports:: insert_use:: InsertUseConfig {
1147+ granularity : ide_db:: imports:: insert_use:: ImportGranularity :: Crate ,
1148+ enforce_granularity : true ,
1149+ prefix_kind : hir:: PrefixKind :: ByCrate ,
1150+ group : true ,
1151+ skip_glob_imports : true ,
11571152 } ,
1158- ide:: AssistResolveStrategy :: All ,
1159- analysis. editioned_file_id_to_vfs ( file_id) ,
1160- ) ;
1153+ prefer_no_std : false ,
1154+ prefer_prelude : true ,
1155+ prefer_absolute : false ,
1156+ style_lints : false ,
1157+ term_search_fuel : 400 ,
1158+ term_search_borrowck : true ,
1159+ } ;
1160+ let id_vfs = analysis. editioned_file_id_to_vfs ( file_id) ;
1161+ _ = Cancelled :: catch ( || {
1162+ ide_diagnostics:: full_diagnostics (
1163+ db,
1164+ & config,
1165+ & ide:: AssistResolveStrategy :: All ,
1166+ id_vfs,
1167+ )
1168+ } ) ;
11611169 bar. inc ( 1 ) ;
11621170 }
11631171 bar. finish_and_clear ( ) ;
@@ -1166,41 +1174,40 @@ impl flags::AnalysisStats {
11661174 for & file_id in & file_ids {
11671175 let msg = format ! ( "inlay hints: {}" , vfs. file_path( file_id. file_id( db) ) ) ;
11681176 bar. set_message ( move || msg. clone ( ) ) ;
1169- _ = analysis. inlay_hints (
1170- & InlayHintsConfig {
1171- render_colons : false ,
1177+ let config = InlayHintsConfig {
1178+ render_colons : false ,
1179+ type_hints : true ,
1180+ sized_bound : false ,
1181+ discriminant_hints : ide:: DiscriminantHints :: Always ,
1182+ parameter_hints : true ,
1183+ generic_parameter_hints : ide:: GenericParameterHints {
11721184 type_hints : true ,
1173- sized_bound : false ,
1174- discriminant_hints : ide:: DiscriminantHints :: Always ,
1175- parameter_hints : true ,
1176- generic_parameter_hints : ide:: GenericParameterHints {
1177- type_hints : true ,
1178- lifetime_hints : true ,
1179- const_hints : true ,
1180- } ,
1181- chaining_hints : true ,
1182- adjustment_hints : ide:: AdjustmentHints :: Always ,
1183- adjustment_hints_disable_reborrows : true ,
1184- adjustment_hints_mode : ide:: AdjustmentHintsMode :: Postfix ,
1185- adjustment_hints_hide_outside_unsafe : false ,
1186- closure_return_type_hints : ide:: ClosureReturnTypeHints :: Always ,
1187- closure_capture_hints : true ,
1188- binding_mode_hints : true ,
1189- implicit_drop_hints : true ,
1190- lifetime_elision_hints : ide:: LifetimeElisionHints :: Always ,
1191- param_names_for_lifetime_elision_hints : true ,
1192- hide_named_constructor_hints : false ,
1193- hide_closure_initialization_hints : false ,
1194- hide_closure_parameter_hints : false ,
1195- closure_style : hir:: ClosureStyle :: ImplFn ,
1196- max_length : Some ( 25 ) ,
1197- closing_brace_hints_min_lines : Some ( 20 ) ,
1198- fields_to_resolve : InlayFieldsToResolve :: empty ( ) ,
1199- range_exclusive_hints : true ,
1185+ lifetime_hints : true ,
1186+ const_hints : true ,
12001187 } ,
1201- analysis. editioned_file_id_to_vfs ( file_id) ,
1202- None ,
1203- ) ;
1188+ chaining_hints : true ,
1189+ adjustment_hints : ide:: AdjustmentHints :: Always ,
1190+ adjustment_hints_disable_reborrows : true ,
1191+ adjustment_hints_mode : ide:: AdjustmentHintsMode :: Postfix ,
1192+ adjustment_hints_hide_outside_unsafe : false ,
1193+ closure_return_type_hints : ide:: ClosureReturnTypeHints :: Always ,
1194+ closure_capture_hints : true ,
1195+ binding_mode_hints : true ,
1196+ implicit_drop_hints : true ,
1197+ lifetime_elision_hints : ide:: LifetimeElisionHints :: Always ,
1198+ param_names_for_lifetime_elision_hints : true ,
1199+ hide_named_constructor_hints : false ,
1200+ hide_closure_initialization_hints : false ,
1201+ hide_closure_parameter_hints : false ,
1202+ closure_style : hir:: ClosureStyle :: ImplFn ,
1203+ max_length : Some ( 25 ) ,
1204+ closing_brace_hints_min_lines : Some ( 20 ) ,
1205+ fields_to_resolve : InlayFieldsToResolve :: empty ( ) ,
1206+ range_exclusive_hints : true ,
1207+ } ;
1208+ let file_id = analysis. editioned_file_id_to_vfs ( file_id) ;
1209+
1210+ _ = Cancelled :: catch ( || Analysis :: inlay_hints_preattached ( db, file_id, None , & config) ) ;
12041211 bar. inc ( 1 ) ;
12051212 }
12061213 bar. finish_and_clear ( ) ;
@@ -1209,24 +1216,25 @@ impl flags::AnalysisStats {
12091216 for & file_id in & file_ids {
12101217 let msg = format ! ( "annotations: {}" , vfs. file_path( file_id. file_id( db) ) ) ;
12111218 bar. set_message ( move || msg. clone ( ) ) ;
1212- analysis
1213- . annotations (
1214- & AnnotationConfig {
1215- binary_target : true ,
1216- annotate_runnables : true ,
1217- annotate_impls : true ,
1218- annotate_references : false ,
1219- annotate_method_references : false ,
1220- annotate_enum_variant_references : false ,
1221- location : ide:: AnnotationLocation :: AboveName ,
1222- } ,
1223- analysis. editioned_file_id_to_vfs ( file_id) ,
1224- )
1225- . unwrap ( )
1226- . into_iter ( )
1227- . for_each ( |annotation| {
1228- _ = analysis. resolve_annotation ( annotation) ;
1229- } ) ;
1219+ let config = AnnotationConfig {
1220+ binary_target : true ,
1221+ annotate_runnables : true ,
1222+ annotate_impls : true ,
1223+ annotate_references : false ,
1224+ annotate_method_references : false ,
1225+ annotate_enum_variant_references : false ,
1226+ location : ide:: AnnotationLocation :: AboveName ,
1227+ } ;
1228+
1229+ Analysis :: annotations_preattached (
1230+ db,
1231+ & config,
1232+ analysis. editioned_file_id_to_vfs ( file_id) ,
1233+ )
1234+ . into_iter ( )
1235+ . for_each ( |annotation| {
1236+ _ = Analysis :: resolve_annotation_preattached ( db, annotation) ;
1237+ } ) ;
12301238 bar. inc ( 1 ) ;
12311239 }
12321240 bar. finish_and_clear ( ) ;
0 commit comments