mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
subscriptions
This commit is contained in:
parent
7570d85869
commit
9fcebbc512
6 changed files with 85 additions and 61 deletions
|
@ -12,6 +12,8 @@ mod symbol_index;
|
|||
mod module_map;
|
||||
mod imp;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use relative_path::{RelativePath, RelativePathBuf};
|
||||
use libsyntax2::{File, TextRange, TextUnit, AtomEdit};
|
||||
use imp::{AnalysisImpl, AnalysisHostImpl};
|
||||
|
@ -31,7 +33,7 @@ pub trait FileResolver: Send + Sync + 'static {
|
|||
|
||||
#[derive(Debug)]
|
||||
pub struct AnalysisHost {
|
||||
pub(crate) imp: AnalysisHostImpl
|
||||
imp: AnalysisHostImpl
|
||||
}
|
||||
|
||||
impl AnalysisHost {
|
||||
|
@ -39,7 +41,7 @@ impl AnalysisHost {
|
|||
AnalysisHost { imp: AnalysisHostImpl::new() }
|
||||
}
|
||||
pub fn analysis(&self, file_resolver: impl FileResolver) -> Analysis {
|
||||
Analysis { imp: self.imp.analysis(file_resolver) }
|
||||
Analysis { imp: self.imp.analysis(Arc::new(file_resolver)) }
|
||||
}
|
||||
pub fn change_file(&mut self, file_id: FileId, text: Option<String>) {
|
||||
self.change_files(::std::iter::once((file_id, text)));
|
||||
|
@ -121,7 +123,7 @@ impl Query {
|
|||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Analysis {
|
||||
pub(crate) imp: AnalysisImpl
|
||||
imp: AnalysisImpl
|
||||
}
|
||||
|
||||
impl Analysis {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue