Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/completions.rs')
-rw-r--r--crates/ide-completion/src/completions.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ide-completion/src/completions.rs b/crates/ide-completion/src/completions.rs
index ba3c0cf3fd..920db07e06 100644
--- a/crates/ide-completion/src/completions.rs
+++ b/crates/ide-completion/src/completions.rs
@@ -41,6 +41,7 @@ use crate::{
macro_::render_macro,
pattern::{render_struct_pat, render_variant_pat},
render_field, render_path_resolution, render_pattern_resolution, render_tuple_field,
+ render_type_tree,
type_alias::{render_type_alias, render_type_alias_with_eq},
union_literal::render_union_literal,
RenderContext,
@@ -157,6 +158,16 @@ impl Completions {
item.add_to(self, ctx.db);
}
+ pub(crate) fn add_expr(
+ &mut self,
+ ctx: &CompletionContext<'_>,
+ expr: &hir::term_search::TypeTree,
+ path_ctx: &PathCompletionCtx,
+ ) {
+ let item = render_type_tree(ctx, expr, path_ctx);
+ item.add_to(self, ctx.db);
+ }
+
pub(crate) fn add_crate_roots(
&mut self,
ctx: &CompletionContext<'_>,
@@ -690,6 +701,7 @@ pub(super) fn complete_name_ref(
match kind {
NameRefKind::Path(path_ctx) => {
flyimport::import_on_the_fly_path(acc, ctx, path_ctx);
+ expr::complete_expr(acc, ctx, path_ctx);
match &path_ctx.kind {
PathKind::Expr { expr_ctx } => {