mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
index libraies off the main thread
This commit is contained in:
parent
47cbaeba6f
commit
5ba645c009
5 changed files with 39 additions and 13 deletions
|
@ -68,8 +68,8 @@ impl AnalysisHost {
|
|||
pub fn set_crate_graph(&mut self, graph: CrateGraph) {
|
||||
self.imp.set_crate_graph(graph)
|
||||
}
|
||||
pub fn add_library(&mut self, files: impl Iterator<Item=(FileId, String)>) {
|
||||
self.imp.add_library(files)
|
||||
pub fn add_library(&mut self, data: LibraryData) {
|
||||
self.imp.add_library(data.root)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -216,3 +216,15 @@ impl Analysis {
|
|||
self.imp.diagnostics(file_id)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct LibraryData {
|
||||
root: roots::ReadonlySourceRoot
|
||||
}
|
||||
|
||||
impl LibraryData {
|
||||
pub fn prepare(files: Vec<(FileId, String)>) -> LibraryData {
|
||||
let root = roots::ReadonlySourceRoot::new(files);
|
||||
LibraryData { root }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue