mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
⬆️ salsa
This commit is contained in:
parent
d10214581e
commit
23cad90fe9
4 changed files with 40 additions and 35 deletions
|
@ -11,7 +11,7 @@ rayon = "1.0.2"
|
|||
fst = "0.3.1"
|
||||
ra_syntax = { path = "../ra_syntax" }
|
||||
ra_editor = { path = "../ra_editor" }
|
||||
salsa = "0.6.2"
|
||||
salsa = "0.7.0"
|
||||
rustc-hash = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -84,7 +84,7 @@ impl Default for FileResolverImp {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct AnalysisHostImpl {
|
||||
db: db::RootDatabase,
|
||||
}
|
||||
|
@ -92,7 +92,12 @@ pub(crate) struct AnalysisHostImpl {
|
|||
|
||||
impl AnalysisHostImpl {
|
||||
pub fn new() -> AnalysisHostImpl {
|
||||
AnalysisHostImpl::default()
|
||||
let db = db::RootDatabase::default();
|
||||
db.query(crate::input::SourceRootQuery)
|
||||
.set(WORKSPACE, Default::default());
|
||||
db.query(crate::input::CrateGraphQuery)
|
||||
.set((), Default::default());
|
||||
AnalysisHostImpl { db }
|
||||
}
|
||||
pub fn analysis(&self) -> AnalysisImpl {
|
||||
AnalysisImpl {
|
||||
|
|
|
@ -67,10 +67,10 @@ salsa::query_group! {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
pub(crate) struct SourceRootId(pub(crate) u32);
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Eq)]
|
||||
#[derive(Default, Clone, Debug, PartialEq, Eq)]
|
||||
pub(crate) struct SourceRoot {
|
||||
pub(crate) file_resolver: FileResolverImp,
|
||||
pub(crate) files: FxHashSet<FileId>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue