mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
swtich lsp server to vfs
This commit is contained in:
parent
6a755ed83a
commit
a5ef8ad05b
14 changed files with 235 additions and 399 deletions
|
@ -43,14 +43,17 @@ impl AnalysisHostImpl {
|
|||
pub fn apply_change(&mut self, change: AnalysisChange) {
|
||||
log::info!("apply_change {:?}", change);
|
||||
// self.gc_syntax_trees();
|
||||
for root_id in change.new_roots {
|
||||
self.db
|
||||
.query_mut(ra_db::SourceRootQuery)
|
||||
.set(root_id, Default::default());
|
||||
}
|
||||
|
||||
for (root_id, root_change) in change.roots_changed {
|
||||
self.apply_root_change(root_id, root_change);
|
||||
}
|
||||
for (file_id, text) in change.files_changed {
|
||||
self.db
|
||||
.query_mut(ra_db::FileTextQuery)
|
||||
.set(file_id, Arc::new(text))
|
||||
self.db.query_mut(ra_db::FileTextQuery).set(file_id, text)
|
||||
}
|
||||
if !change.libraries_added.is_empty() {
|
||||
let mut libraries = Vec::clone(&self.db.libraries());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue