diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-12 08:41:16 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-12 08:41:16 +0000 |
commit | c01ef6eabab1fa70d3fdfed9c565fadec9f0a5ed (patch) | |
tree | 37160de8384855fd5fadce3ca4a3de4dacdf98b8 /crates/ide_completion/src/render/type_alias.rs | |
parent | db6364fecc2b0e9a95d9aaece820a86265b4cb4f (diff) | |
parent | 99c4a41cd1a9f9ef0ee4f067f0069a23123b949a (diff) |
Merge #7974
7974: use references in CompletionItem's builder r=matklad a=yonip23
@matklad
This is a follow up to [this pr](https://github.com/rust-analyzer/rust-analyzer/pull/7973)
Co-authored-by: yonip23 <[email protected]>
Diffstat (limited to 'crates/ide_completion/src/render/type_alias.rs')
-rw-r--r-- | crates/ide_completion/src/render/type_alias.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ide_completion/src/render/type_alias.rs b/crates/ide_completion/src/render/type_alias.rs index bd97c3692..e47b4c745 100644 --- a/crates/ide_completion/src/render/type_alias.rs +++ b/crates/ide_completion/src/render/type_alias.rs | |||
@@ -36,17 +36,17 @@ impl<'a> TypeAliasRender<'a> { | |||
36 | let name = self.name()?; | 36 | let name = self.name()?; |
37 | let detail = self.detail(); | 37 | let detail = self.detail(); |
38 | 38 | ||
39 | let item = CompletionItem::new(CompletionKind::Reference, self.ctx.source_range(), name) | 39 | let mut item = |
40 | .kind(SymbolKind::TypeAlias) | 40 | CompletionItem::new(CompletionKind::Reference, self.ctx.source_range(), name); |
41 | item.kind(SymbolKind::TypeAlias) | ||
41 | .set_documentation(self.ctx.docs(self.type_alias)) | 42 | .set_documentation(self.ctx.docs(self.type_alias)) |
42 | .set_deprecated( | 43 | .set_deprecated( |
43 | self.ctx.is_deprecated(self.type_alias) | 44 | self.ctx.is_deprecated(self.type_alias) |
44 | || self.ctx.is_deprecated_assoc_item(self.type_alias), | 45 | || self.ctx.is_deprecated_assoc_item(self.type_alias), |
45 | ) | 46 | ) |
46 | .detail(detail) | 47 | .detail(detail); |
47 | .build(); | ||
48 | 48 | ||
49 | Some(item) | 49 | Some(item.build()) |
50 | } | 50 | } |
51 | 51 | ||
52 | fn name(&self) -> Option<String> { | 52 | fn name(&self) -> Option<String> { |