red-knot: source_text, line_index, and parsed_module queries (#11822)

This commit is contained in:
Micha Reiser 2024-06-13 08:37:02 +01:00 committed by GitHub
parent efbf7b14b5
commit d4dd96d1f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 194 additions and 16 deletions

View file

@ -4,15 +4,19 @@ use rustc_hash::FxHasher;
use salsa::DbWithJar;
use crate::file_system::{FileSystem, FileSystemPath};
use crate::parsed::parsed_module;
use crate::source::{line_index, source_text};
use crate::vfs::{VendoredPath, Vfs, VfsFile};
pub mod file_system;
pub mod parsed;
pub mod source;
pub mod vfs;
pub(crate) type FxDashMap<K, V> = dashmap::DashMap<K, V, BuildHasherDefault<FxHasher>>;
#[salsa::jar(db=Db)]
pub struct Jar(VfsFile);
pub struct Jar(VfsFile, source_text, line_index, parsed_module);
/// Database that gives access to the virtual filesystem, source code, and parsed AST.
pub trait Db: DbWithJar<Jar> {