aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/hover.rs
diff options
context:
space:
mode:
authorNick Spain <[email protected]>2021-01-01 02:05:28 +0000
committerNick Spain <[email protected]>2021-01-02 10:53:51 +0000
commit27cadcd531c017aa7c78c6f7a36f2b7f2ce8a196 (patch)
tree24f43261eeafffc8b98be361c9c2841c2e4861f0 /crates/ide/src/hover.rs
parentaa3ce16f2641b7eb562a8eae67738b0ff0c0b7b0 (diff)
HasSource::source -> HasSource::source_old
To start migrating HasSource::source to return an Option.
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r--crates/ide/src/hover.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index 98c7bfbe5..90781ea34 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -206,7 +206,7 @@ fn runnable_action(
206 _ => None, 206 _ => None,
207 }, 207 },
208 ModuleDef::Function(it) => { 208 ModuleDef::Function(it) => {
209 let src = it.source(sema.db); 209 let src = it.source_old(sema.db);
210 if src.file_id != file_id.into() { 210 if src.file_id != file_id.into() {
211 mark::hit!(hover_macro_generated_struct_fn_doc_comment); 211 mark::hit!(hover_macro_generated_struct_fn_doc_comment);
212 mark::hit!(hover_macro_generated_struct_fn_doc_attr); 212 mark::hit!(hover_macro_generated_struct_fn_doc_attr);
@@ -332,11 +332,11 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> {
332 if it.is_proc_macro() { 332 if it.is_proc_macro() {
333 return None; 333 return None;
334 } 334 }
335 let label = macro_label(&it.source(db).value); 335 let label = macro_label(&it.source_old(db).value);
336 from_def_source_labeled(db, it, Some(label), mod_path) 336 from_def_source_labeled(db, it, Some(label), mod_path)
337 } 337 }
338 Definition::Field(def) => { 338 Definition::Field(def) => {
339 let src = def.source(db).value; 339 let src = def.source_old(db).value;
340 if let FieldSource::Named(it) = src { 340 if let FieldSource::Named(it) = src {
341 from_def_source_labeled(db, def, it.short_label(), mod_path) 341 from_def_source_labeled(db, def, it.short_label(), mod_path)
342 } else { 342 } else {
@@ -385,7 +385,7 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> {
385 D: HasSource<Ast = A> + HasAttrs + Copy, 385 D: HasSource<Ast = A> + HasAttrs + Copy,
386 A: ShortLabel, 386 A: ShortLabel,
387 { 387 {
388 let short_label = def.source(db).value.short_label(); 388 let short_label = def.source_old(db).value.short_label();
389 from_def_source_labeled(db, def, short_label, mod_path) 389 from_def_source_labeled(db, def, short_label, mod_path)
390 } 390 }
391 391