Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/goto_definition.rs')
| -rw-r--r-- | crates/ide/src/goto_definition.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs index 60a904233a..84138986f6 100644 --- a/crates/ide/src/goto_definition.rs +++ b/crates/ide/src/goto_definition.rs @@ -10,7 +10,7 @@ use hir::{ ModuleDef, Semantics, }; use ide_db::{ - base_db::{AnchoredPath, FileLoader, SourceDatabase}, + base_db::{AnchoredPath, RootQueryDb, SourceDatabase, Upcast}, defs::{Definition, IdentClass}, famous_defs::FamousDefs, helpers::pick_best_token, @@ -216,8 +216,9 @@ fn try_lookup_include_path( } let path = token.value().ok()?; - let file_id = sema.db.resolve_path(AnchoredPath { anchor: file_id, path: &path })?; - let size = sema.db.file_text(file_id).len().try_into().ok()?; + let file_id = Upcast::<dyn RootQueryDb>::upcast(sema.db) + .resolve_path(AnchoredPath { anchor: file_id, path: &path })?; + let size = sema.db.file_text(file_id).text(sema.db).len().try_into().ok()?; Some(NavigationTarget { file_id, full_range: TextRange::new(0.into(), size), |