mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Fix some tests
This commit is contained in:
parent
582cee2cdf
commit
d386481fac
4 changed files with 143 additions and 49 deletions
|
@ -13,7 +13,10 @@ mod builder_ext;
|
|||
use hir::{
|
||||
AsAssocItem, Documentation, HasAttrs, HirDisplay, ModuleDef, Mutability, ScopeDef, Type,
|
||||
};
|
||||
use ide_db::{helpers::SnippetCap, RootDatabase, SymbolKind};
|
||||
use ide_db::{
|
||||
helpers::{item_name, SnippetCap},
|
||||
RootDatabase, SymbolKind,
|
||||
};
|
||||
use syntax::TextRange;
|
||||
|
||||
use crate::{
|
||||
|
@ -56,7 +59,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.display_path().segments().last()?.to_string(),
|
||||
_ => item_name(ctx.db(), import_edit.import.item_to_display())?.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