mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
HasSource::source -> HasSource::source_old
To start migrating HasSource::source to return an Option.
This commit is contained in:
parent
aa3ce16f26
commit
27cadcd531
15 changed files with 55 additions and 55 deletions
|
@ -206,7 +206,7 @@ fn runnable_action(
|
|||
_ => None,
|
||||
},
|
||||
ModuleDef::Function(it) => {
|
||||
let src = it.source(sema.db);
|
||||
let src = it.source_old(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,11 +332,11 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> {
|
|||
if it.is_proc_macro() {
|
||||
return None;
|
||||
}
|
||||
let label = macro_label(&it.source(db).value);
|
||||
let label = macro_label(&it.source_old(db).value);
|
||||
from_def_source_labeled(db, it, Some(label), mod_path)
|
||||
}
|
||||
Definition::Field(def) => {
|
||||
let src = def.source(db).value;
|
||||
let src = def.source_old(db).value;
|
||||
if let FieldSource::Named(it) = src {
|
||||
from_def_source_labeled(db, def, it.short_label(), mod_path)
|
||||
} else {
|
||||
|
@ -385,7 +385,7 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> {
|
|||
D: HasSource<Ast = A> + HasAttrs + Copy,
|
||||
A: ShortLabel,
|
||||
{
|
||||
let short_label = def.source(db).value.short_label();
|
||||
let short_label = def.source_old(db).value.short_label();
|
||||
from_def_source_labeled(db, def, short_label, mod_path)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue