aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/render.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_completion/src/render.rs')
-rw-r--r--crates/ide_completion/src/render.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/crates/ide_completion/src/render.rs b/crates/ide_completion/src/render.rs
index f24ef7e49..d3db55c35 100644
--- a/crates/ide_completion/src/render.rs
+++ b/crates/ide_completion/src/render.rs
@@ -135,16 +135,17 @@ fn render_field_(
135 ctx.source_range(), 135 ctx.source_range(),
136 receiver.map_or_else(|| name.clone(), |receiver| format!("{}.{}", receiver, name)), 136 receiver.map_or_else(|| name.clone(), |receiver| format!("{}.{}", receiver, name)),
137 ); 137 );
138 item.kind(SymbolKind::Field)
139 .detail(ty.display(ctx.db()).to_string())
140 .set_documentation(field.docs(ctx.db()))
141 .set_deprecated(is_deprecated);
142 138
143 item.set_relevance(CompletionRelevance { 139 item.set_relevance(CompletionRelevance {
144 type_match: compute_type_match(ctx.completion, ty), 140 type_match: compute_type_match(ctx.completion, ty),
145 exact_name_match: compute_exact_name_match(ctx.completion, &name), 141 exact_name_match: compute_exact_name_match(ctx.completion, &name),
146 ..CompletionRelevance::default() 142 ..CompletionRelevance::default()
147 }); 143 });
144 item.kind(SymbolKind::Field)
145 .detail(ty.display(ctx.db()).to_string())
146 .set_documentation(field.docs(ctx.db()))
147 .set_deprecated(is_deprecated)
148 .lookup_by(name);
148 149
149 if let Some(_ref_match) = compute_ref_match(ctx.completion, ty) { 150 if let Some(_ref_match) = compute_ref_match(ctx.completion, ty) {
150 // FIXME 151 // FIXME
@@ -167,7 +168,9 @@ fn render_tuple_field_(
167 receiver.map_or_else(|| field.to_string(), |receiver| format!("{}.{}", receiver, field)), 168 receiver.map_or_else(|| field.to_string(), |receiver| format!("{}.{}", receiver, field)),
168 ); 169 );
169 170
170 item.kind(SymbolKind::Field).detail(ty.display(ctx.db()).to_string()); 171 item.kind(SymbolKind::Field)
172 .detail(ty.display(ctx.db()).to_string())
173 .lookup_by(field.to_string());
171 174
172 item.build() 175 item.build()
173} 176}