aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_db
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-03-08 13:26:57 +0000
committerKirill Bulatov <[email protected]>2020-03-08 21:00:50 +0000
commit5cffef56e2c373f6d67b0f7b70d7ade995795c04 (patch)
tree4549fa9ccf4e204057d35f4bbc6c18987690f0ab /crates/ra_ide_db
parent32f5276465266522ebc01b8417feeba99bf00f6f (diff)
Consider crate declaration names
Diffstat (limited to 'crates/ra_ide_db')
-rw-r--r--crates/ra_ide_db/src/change.rs6
-rw-r--r--crates/ra_ide_db/src/lib.rs6
2 files changed, 1 insertions, 11 deletions
diff --git a/crates/ra_ide_db/src/change.rs b/crates/ra_ide_db/src/change.rs
index 8b5be9d21..628cf6416 100644
--- a/crates/ra_ide_db/src/change.rs
+++ b/crates/ra_ide_db/src/change.rs
@@ -5,7 +5,7 @@ use std::{fmt, sync::Arc, time};
5 5
6use ra_db::{ 6use ra_db::{
7 salsa::{Database, Durability, SweepStrategy}, 7 salsa::{Database, Durability, SweepStrategy},
8 CrateGraph, CrateId, FileId, RelativePathBuf, SourceDatabase, SourceDatabaseExt, SourceRoot, 8 CrateGraph, FileId, RelativePathBuf, SourceDatabase, SourceDatabaseExt, SourceRoot,
9 SourceRootId, 9 SourceRootId,
10}; 10};
11use ra_prof::{memory_usage, profile, Bytes}; 11use ra_prof::{memory_usage, profile, Bytes};
@@ -88,10 +88,6 @@ impl AnalysisChange {
88 self.crate_graph = Some(graph); 88 self.crate_graph = Some(graph);
89 } 89 }
90 90
91 pub fn set_debug_crate_name(&mut self, crate_id: CrateId, name: String) {
92 self.debug_data.crate_names.insert(crate_id, name);
93 }
94
95 pub fn set_debug_root_path(&mut self, source_root_id: SourceRootId, path: String) { 91 pub fn set_debug_root_path(&mut self, source_root_id: SourceRootId, path: String) {
96 self.debug_data.root_paths.insert(source_root_id, path); 92 self.debug_data.root_paths.insert(source_root_id, path);
97 } 93 }
diff --git a/crates/ra_ide_db/src/lib.rs b/crates/ra_ide_db/src/lib.rs
index efa472c7d..a105c7556 100644
--- a/crates/ra_ide_db/src/lib.rs
+++ b/crates/ra_ide_db/src/lib.rs
@@ -104,10 +104,6 @@ impl RootDatabase {
104 db.query_mut(hir::db::MacroExpandQuery).set_lru_capacity(lru_capacity); 104 db.query_mut(hir::db::MacroExpandQuery).set_lru_capacity(lru_capacity);
105 db 105 db
106 } 106 }
107
108 pub fn get_crate_original_name(&self, crate_id: &CrateId) -> Option<String> {
109 self.debug_data.crate_names.get(crate_id).cloned()
110 }
111} 107}
112 108
113impl salsa::ParallelDatabase for RootDatabase { 109impl salsa::ParallelDatabase for RootDatabase {
@@ -135,12 +131,10 @@ fn line_index(db: &impl LineIndexDatabase, file_id: FileId) -> Arc<LineIndex> {
135#[derive(Debug, Default, Clone)] 131#[derive(Debug, Default, Clone)]
136pub(crate) struct DebugData { 132pub(crate) struct DebugData {
137 pub(crate) root_paths: FxHashMap<SourceRootId, String>, 133 pub(crate) root_paths: FxHashMap<SourceRootId, String>,
138 pub(crate) crate_names: FxHashMap<CrateId, String>,
139} 134}
140 135
141impl DebugData { 136impl DebugData {
142 pub(crate) fn merge(&mut self, other: DebugData) { 137 pub(crate) fn merge(&mut self, other: DebugData) {
143 self.root_paths.extend(other.root_paths.into_iter()); 138 self.root_paths.extend(other.root_paths.into_iter());
144 self.crate_names.extend(other.crate_names.into_iter());
145 } 139 }
146} 140}