diff options
author | Aleksey Kladov <[email protected]> | 2019-06-11 15:25:55 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-06-11 16:28:51 +0100 |
commit | f2ccc54468348af96d6167da5971749ef0f4ab5e (patch) | |
tree | 87de4b002bcdca775ff339b81236dea1eb4ed8c9 /crates/ra_ide_api/src/completion | |
parent | 647c8f3df8e5f798f940ce0b93e5e0ccd59b0e7f (diff) |
use Source for TypeAlias
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r-- | crates/ra_ide_api/src/completion/presentation.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs index 8c4d7127b..495899262 100644 --- a/crates/ra_ide_api/src/completion/presentation.rs +++ b/crates/ra_ide_api/src/completion/presentation.rs | |||
@@ -141,13 +141,12 @@ impl Completions { | |||
141 | } | 141 | } |
142 | 142 | ||
143 | pub(crate) fn add_type_alias(&mut self, ctx: &CompletionContext, type_alias: hir::TypeAlias) { | 143 | pub(crate) fn add_type_alias(&mut self, ctx: &CompletionContext, type_alias: hir::TypeAlias) { |
144 | let (_file_id, type_def) = type_alias.source(ctx.db); | 144 | let type_def = type_alias.source(ctx.db).ast; |
145 | let name = match type_def.name() { | 145 | let name = match type_def.name() { |
146 | Some(name) => name, | 146 | Some(name) => name, |
147 | _ => return, | 147 | _ => return, |
148 | }; | 148 | }; |
149 | let (_, ast_node) = type_alias.source(ctx.db); | 149 | let detail = type_label(&type_def); |
150 | let detail = type_label(&ast_node); | ||
151 | 150 | ||
152 | CompletionItem::new(CompletionKind::Reference, ctx.source_range(), name.text().to_string()) | 151 | CompletionItem::new(CompletionKind::Reference, ctx.source_range(), name.text().to_string()) |
153 | .kind(CompletionItemKind::TypeAlias) | 152 | .kind(CompletionItemKind::TypeAlias) |