From c936e4b86fd5de8e9709cd01547a69054cdec91b Mon Sep 17 00:00:00 2001 From: Nick Spain Date: Fri, 1 Jan 2021 15:02:39 +1100 Subject: source_old -> source for cases that can be handled by simple bubbling --- crates/ide/src/diagnostics/fixes.rs | 6 +++--- crates/ide/src/hover.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ide') diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs index 0b5e0a4c1..ec0f840e9 100644 --- a/crates/ide/src/diagnostics/fixes.rs +++ b/crates/ide/src/diagnostics/fixes.rs @@ -157,7 +157,7 @@ fn missing_record_expr_field_fix( VariantDef::Struct(s) => { module = s.module(sema.db); #[allow(deprecated)] - let source = s.source_old(sema.db); + let source = s.source(sema.db)?; def_file_id = source.file_id; let fields = source.value.field_list()?; record_field_list(fields)? @@ -165,14 +165,14 @@ fn missing_record_expr_field_fix( VariantDef::Union(u) => { module = u.module(sema.db); #[allow(deprecated)] - let source = u.source_old(sema.db); + let source = u.source(sema.db)?; def_file_id = source.file_id; source.value.record_field_list()? } VariantDef::Variant(e) => { module = e.module(sema.db); #[allow(deprecated)] - let source = e.source_old(sema.db); + let source = e.source(sema.db)?; def_file_id = source.file_id; let fields = source.value.field_list()?; record_field_list(fields)? diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index a18dcdd8e..d2a0cfcd4 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -207,7 +207,7 @@ fn runnable_action( }, ModuleDef::Function(it) => { #[allow(deprecated)] - let src = it.source_old(sema.db); + let src = it.source(sema.db)?; if src.file_id != file_id.into() { mark::hit!(hover_macro_generated_struct_fn_doc_comment); mark::hit!(hover_macro_generated_struct_fn_doc_attr); @@ -332,7 +332,7 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option { } Definition::Field(def) => { #[allow(deprecated)] - let src = def.source_old(db).value; + let src = def.source(db)?.value; if let FieldSource::Named(it) = src { from_def_source_labeled(db, def, it.short_label(), mod_path) } else { @@ -382,7 +382,7 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option { A: ShortLabel, { #[allow(deprecated)] - let short_label = def.source_old(db).value.short_label(); + let short_label = def.source(db)?.value.short_label(); from_def_source_labeled(db, def, short_label, mod_path) } -- cgit v1.2.3