From 2619950b3b405324ab1c1745876165c834b3b4b9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 13 Dec 2019 12:12:36 +0100 Subject: Use different types for path with and without generics --- crates/ra_ide/src/completion/completion_context.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide/src/completion') diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index ca0a483d4..981da2b79 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs @@ -188,10 +188,9 @@ impl<'a> CompletionContext<'a> { self.is_path_type = path.syntax().parent().and_then(ast::PathType::cast).is_some(); self.has_type_args = segment.type_arg_list().is_some(); - if let Some(mut path) = hir::Path::from_ast(path.clone()) { - if !path.is_ident() { - path.segments.pop().unwrap(); - self.path_prefix = Some(path); + if let Some(path) = hir::Path::from_ast(path.clone()) { + if let Some(path_prefix) = path.qualifier() { + self.path_prefix = Some(path_prefix); return; } } -- cgit v1.2.3