Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/completions/mod_.rs')
| -rw-r--r-- | crates/ide-completion/src/completions/mod_.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ide-completion/src/completions/mod_.rs b/crates/ide-completion/src/completions/mod_.rs index ecf5b29e2c..c2faa2d939 100644 --- a/crates/ide-completion/src/completions/mod_.rs +++ b/crates/ide-completion/src/completions/mod_.rs @@ -2,7 +2,7 @@ use std::iter; -use hir::{HirFileIdExt, Module, ModuleSource}; +use hir::{HirFileIdExt, Module}; use ide_db::{ base_db::{SourceDatabaseExt, VfsPath}, FxHashSet, RootDatabase, SymbolKind, @@ -57,7 +57,7 @@ pub(crate) fn complete_mod( .collect::<FxHashSet<_>>(); let module_declaration_file = - current_module.declaration_source(ctx.db).map(|module_declaration_source_file| { + current_module.declaration_source_range(ctx.db).map(|module_declaration_source_file| { module_declaration_source_file.file_id.original_file(ctx.db) }); @@ -148,9 +148,7 @@ fn module_chain_to_containing_module_file( ) -> Vec<Module> { let mut path = iter::successors(Some(current_module), |current_module| current_module.parent(db)) - .take_while(|current_module| { - matches!(current_module.definition_source(db).value, ModuleSource::Module(_)) - }) + .take_while(|current_module| current_module.is_inline(db)) .collect::<Vec<_>>(); path.reverse(); path |