From d3df80dfe41e4e3ab7644ae576119a264ba0e7f1 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 27 Jan 2019 17:23:49 +0100 Subject: Cleanup --- crates/ra_ide_api/src/completion/complete_path.rs | 6 +++--- crates/ra_ide_api/src/completion/completion_context.rs | 2 +- crates/ra_ide_api/src/goto_definition.rs | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs index 9e61c0212..5b89c64ad 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs @@ -1,11 +1,11 @@ use join_to_string::join; +use hir::{Docs, Resolution}; + use crate::{ completion::{CompletionItem, CompletionItemKind, Completions, CompletionKind, CompletionContext}, }; -use hir::Docs; - pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { let path = match &ctx.path_prefix { Some(path) => path.clone(), @@ -15,7 +15,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { Some(Resolution::Def { def }) => def, _ => return, }; - match def_id { + match def { hir::ModuleDef::Module(module) => { let module_scope = module.scope(ctx.db); for (name, res) in module_scope.entries() { diff --git a/crates/ra_ide_api/src/completion/completion_context.rs b/crates/ra_ide_api/src/completion/completion_context.rs index aea32fce3..5d1851da6 100644 --- a/crates/ra_ide_api/src/completion/completion_context.rs +++ b/crates/ra_ide_api/src/completion/completion_context.rs @@ -16,7 +16,7 @@ pub(crate) struct CompletionContext<'a> { pub(super) db: &'a db::RootDatabase, pub(super) offset: TextUnit, pub(super) leaf: &'a SyntaxNode, - pub(super) resolver: Resolver<'static>, + pub(super) resolver: Resolver, pub(super) module: Option, pub(super) function: Option, pub(super) function_syntax: Option<&'a ast::FnDef>, diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs index f7dd28c7c..48080b6e1 100644 --- a/crates/ra_ide_api/src/goto_definition.rs +++ b/crates/ra_ide_api/src/goto_definition.rs @@ -4,6 +4,7 @@ use ra_syntax::{ algo::find_node_at_offset, }; use test_utils::tested_by; +use hir::Resolution; use crate::{FilePosition, NavigationTarget, db::RootDatabase, RangeInfo}; -- cgit v1.2.3