internal: port rust-analyzer to new Salsa

This commit is contained in:
David Barsky 2024-11-05 12:24:41 -05:00
parent 394374e769
commit 74620e64ec
161 changed files with 3075 additions and 2331 deletions

View file

@ -1,7 +1,7 @@
//! This module is responsible for resolving paths within rules.
use hir::AsAssocItem;
use ide_db::FxHashMap;
use ide_db::{base_db::salsa::AsDynDatabase, FxHashMap};
use parsing::Placeholder;
use syntax::{
ast::{self, HasGenericArgs},
@ -198,7 +198,12 @@ impl<'db> ResolutionScope<'db> {
resolve_context: hir::FilePosition,
) -> Option<ResolutionScope<'db>> {
use syntax::ast::AstNode;
let file = sema.parse(resolve_context.file_id);
let editioned_file_id_wrapper = ide_db::base_db::EditionedFileId::new(
sema.db.as_dyn_database(),
resolve_context.file_id,
);
let file = sema.parse(editioned_file_id_wrapper);
// Find a node at the requested position, falling back to the whole file.
let node = file
.syntax()