This commit is contained in:
Florian Diebold 2019-01-27 17:23:49 +01:00
parent afce8e4426
commit d3df80dfe4
7 changed files with 17 additions and 27 deletions

View file

@ -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() {

View file

@ -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<hir::Module>,
pub(super) function: Option<hir::Function>,
pub(super) function_syntax: Option<&'a ast::FnDef>,

View file

@ -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};