From 663ce0e99d8aa11707dd2ca22956552859b6ea12 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 11 Jun 2020 13:26:48 +0200 Subject: Remove dead code --- crates/ra_ide_db/src/change.rs | 9 +-------- crates/ra_ide_db/src/lib.rs | 18 ++---------------- crates/rust-analyzer/src/cli/load_cargo.rs | 4 ---- crates/rust-analyzer/src/global_state.rs | 1 - 4 files changed, 3 insertions(+), 29 deletions(-) diff --git a/crates/ra_ide_db/src/change.rs b/crates/ra_ide_db/src/change.rs index 5dbe1c1b7..2fc796a85 100644 --- a/crates/ra_ide_db/src/change.rs +++ b/crates/ra_ide_db/src/change.rs @@ -16,7 +16,7 @@ use rustc_hash::FxHashMap; use crate::{ symbol_index::{SymbolIndex, SymbolsDatabase}, - DebugData, RootDatabase, + RootDatabase, }; #[derive(Default)] @@ -26,7 +26,6 @@ pub struct AnalysisChange { files_changed: Vec<(FileId, Arc)>, libraries_added: Vec, crate_graph: Option, - debug_data: DebugData, } impl fmt::Debug for AnalysisChange { @@ -87,10 +86,6 @@ impl AnalysisChange { pub fn set_crate_graph(&mut self, graph: CrateGraph) { self.crate_graph = Some(graph); } - - pub fn set_debug_root_path(&mut self, source_root_id: SourceRootId, path: String) { - self.debug_data.root_paths.insert(source_root_id, path); - } } #[derive(Debug)] @@ -218,8 +213,6 @@ impl RootDatabase { if let Some(crate_graph) = change.crate_graph { self.set_crate_graph_with_durability(Arc::new(crate_graph), Durability::HIGH) } - - Arc::make_mut(&mut self.debug_data).merge(change.debug_data) } fn apply_root_change(&mut self, root_id: SourceRootId, root_change: RootChange) { diff --git a/crates/ra_ide_db/src/lib.rs b/crates/ra_ide_db/src/lib.rs index 480fd4576..a808de4f1 100644 --- a/crates/ra_ide_db/src/lib.rs +++ b/crates/ra_ide_db/src/lib.rs @@ -17,9 +17,9 @@ use hir::db::{AstDatabase, DefDatabase}; use ra_db::{ salsa::{self, Database, Durability}, Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, - SourceRootId, Upcast, + Upcast, }; -use rustc_hash::{FxHashMap, FxHashSet}; +use rustc_hash::FxHashSet; use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase}; @@ -36,7 +36,6 @@ use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase}; #[derive(Debug)] pub struct RootDatabase { runtime: salsa::Runtime, - pub(crate) debug_data: Arc, pub last_gc: crate::wasm_shims::Instant, pub last_gc_check: crate::wasm_shims::Instant, } @@ -98,7 +97,6 @@ impl RootDatabase { runtime: salsa::Runtime::default(), last_gc: crate::wasm_shims::Instant::now(), last_gc_check: crate::wasm_shims::Instant::now(), - debug_data: Default::default(), }; db.set_crate_graph_with_durability(Default::default(), Durability::HIGH); db.set_local_roots_with_durability(Default::default(), Durability::HIGH); @@ -121,7 +119,6 @@ impl salsa::ParallelDatabase for RootDatabase { runtime: self.runtime.snapshot(self), last_gc: self.last_gc, last_gc_check: self.last_gc_check, - debug_data: Arc::clone(&self.debug_data), }) } } @@ -135,14 +132,3 @@ fn line_index(db: &impl LineIndexDatabase, file_id: FileId) -> Arc { let text = db.file_text(file_id); Arc::new(LineIndex::new(&*text)) } - -#[derive(Debug, Default, Clone)] -pub(crate) struct DebugData { - pub(crate) root_paths: FxHashMap, -} - -impl DebugData { - pub(crate) fn merge(&mut self, other: DebugData) { - self.root_paths.extend(other.root_paths.into_iter()); - } -} diff --git a/crates/rust-analyzer/src/cli/load_cargo.rs b/crates/rust-analyzer/src/cli/load_cargo.rs index 45af96317..97367d7c6 100644 --- a/crates/rust-analyzer/src/cli/load_cargo.rs +++ b/crates/rust-analyzer/src/cli/load_cargo.rs @@ -111,10 +111,6 @@ pub(crate) fn load( vfs.root2path(root) ); analysis_change.add_root(source_root_id, is_local); - analysis_change.set_debug_root_path( - source_root_id, - source_roots[&source_root_id].path().display().to_string(), - ); let vfs_root_path = vfs.root2path(root); if extern_dirs.contains(&vfs_root_path) { diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index 96d91b12d..21116e165 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs @@ -126,7 +126,6 @@ impl GlobalState { let vfs_root_path = vfs.root2path(r); let is_local = local_roots.iter().any(|it| vfs_root_path.starts_with(it)); change.add_root(SourceRootId(r.0), is_local); - change.set_debug_root_path(SourceRootId(r.0), vfs_root_path.display().to_string()); // FIXME: add path2root in vfs to simpily this logic if extern_dirs.contains(&vfs_root_path) { -- cgit v1.2.3