mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
make analysis sync
This commit is contained in:
parent
76c51fae77
commit
bbcd998433
4 changed files with 37 additions and 19 deletions
|
@ -78,13 +78,13 @@ impl Default for FileResolverImp {
|
|||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct AnalysisHostImpl {
|
||||
data: Arc<WorldData>
|
||||
data: WorldData
|
||||
}
|
||||
|
||||
impl AnalysisHostImpl {
|
||||
pub fn new() -> AnalysisHostImpl {
|
||||
AnalysisHostImpl {
|
||||
data: Arc::new(WorldData::default()),
|
||||
data: WorldData::default(),
|
||||
}
|
||||
}
|
||||
pub fn analysis(&self) -> AnalysisImpl {
|
||||
|
@ -114,18 +114,18 @@ impl AnalysisHostImpl {
|
|||
self.data_mut().libs.push(Arc::new(root));
|
||||
}
|
||||
fn data_mut(&mut self) -> &mut WorldData {
|
||||
Arc::make_mut(&mut self.data)
|
||||
&mut self.data
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) struct AnalysisImpl {
|
||||
needs_reindex: AtomicBool,
|
||||
data: Arc<WorldData>,
|
||||
data: WorldData,
|
||||
}
|
||||
|
||||
impl fmt::Debug for AnalysisImpl {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
(&*self.data).fmt(f)
|
||||
self.data.fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ impl Clone for AnalysisImpl {
|
|||
fn clone(&self) -> AnalysisImpl {
|
||||
AnalysisImpl {
|
||||
needs_reindex: AtomicBool::new(self.needs_reindex.load(SeqCst)),
|
||||
data: Arc::clone(&self.data),
|
||||
data: self.data.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue