From 17870a3e2c39770a99f9ab5ce090abbe1dc334d2 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 3 Sep 2020 23:18:23 +0300 Subject: Better API --- crates/ide/src/completion/completion_context.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'crates/ide/src/completion') diff --git a/crates/ide/src/completion/completion_context.rs b/crates/ide/src/completion/completion_context.rs index 4d8b3670b..cbfc77a46 100644 --- a/crates/ide/src/completion/completion_context.rs +++ b/crates/ide/src/completion/completion_context.rs @@ -120,11 +120,10 @@ impl<'a> CompletionContext<'a> { if !matches!(definition_source.value, ModuleSource::SourceFile(_)) { return None; } - let definition_source_file = definition_source.file_id.original_file(db); - - // TODO kb for all possible candidates - let zz = db.list_some_random_files_todo(definition_source_file); - dbg!(zz); + let module_definition_source_file = definition_source.file_id.original_file(db); + let mod_declaration_candidates = + db.possible_sudmobules(module_definition_source_file); + dbg!(mod_declaration_candidates); // TODO kb exlude existing children from the candidates let existing_children = current_module.children(db).collect::>(); dbg!(existing_children); -- cgit v1.2.3