mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Return more data about located imports
This commit is contained in:
parent
309421c117
commit
582cee2cdf
9 changed files with 172 additions and 125 deletions
|
@ -56,7 +56,7 @@ pub(crate) fn render_resolution_with_import<'a>(
|
|||
ScopeDef::ModuleDef(ModuleDef::Function(f)) => f.name(ctx.completion.db).to_string(),
|
||||
ScopeDef::ModuleDef(ModuleDef::Const(c)) => c.name(ctx.completion.db)?.to_string(),
|
||||
ScopeDef::ModuleDef(ModuleDef::TypeAlias(t)) => t.name(ctx.completion.db).to_string(),
|
||||
_ => import_edit.import_path.segments().last()?.to_string(),
|
||||
_ => import_edit.import.display_path().segments().last()?.to_string(),
|
||||
};
|
||||
Render::new(ctx).render_resolution(local_name, Some(import_edit), resolution).map(|mut item| {
|
||||
item.completion_kind = CompletionKind::Magic;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue