aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock20
-rw-r--r--crates/ra_db/Cargo.toml2
-rw-r--r--crates/ra_hir/src/db.rs9
-rw-r--r--crates/ra_ide_db/src/change.rs24
4 files changed, 35 insertions, 20 deletions
diff --git a/Cargo.lock b/Cargo.lock
index de361cc23..451928c27 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -318,9 +318,9 @@ dependencies = [
318 318
319[[package]] 319[[package]]
320name = "filetime" 320name = "filetime"
321version = "0.2.11" 321version = "0.2.12"
322source = "registry+https://github.com/rust-lang/crates.io-index" 322source = "registry+https://github.com/rust-lang/crates.io-index"
323checksum = "e500da2fab70bdc43f8f0e0b350a227f31c72311c56aba48f01d5cd62bb0345b" 323checksum = "3ed85775dcc68644b5c950ac06a2b23768d3bc9390464151aaf27136998dcf9e"
324dependencies = [ 324dependencies = [
325 "cfg-if", 325 "cfg-if",
326 "libc", 326 "libc",
@@ -1371,9 +1371,9 @@ checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
1371 1371
1372[[package]] 1372[[package]]
1373name = "salsa" 1373name = "salsa"
1374version = "0.15.1" 1374version = "0.15.2"
1375source = "registry+https://github.com/rust-lang/crates.io-index" 1375source = "registry+https://github.com/rust-lang/crates.io-index"
1376checksum = "d4cdc109fcc9e9450c7ef47fb7474e99bffd51799da03ed0a6c7f0e2cb3848a6" 1376checksum = "9ab29056d4fb4048a5f0d169c9b6e5526160c9ec37aded5a6879c2c9c445a8e4"
1377dependencies = [ 1377dependencies = [
1378 "crossbeam-utils", 1378 "crossbeam-utils",
1379 "indexmap", 1379 "indexmap",
@@ -1388,9 +1388,9 @@ dependencies = [
1388 1388
1389[[package]] 1389[[package]]
1390name = "salsa-macros" 1390name = "salsa-macros"
1391version = "0.15.0" 1391version = "0.15.2"
1392source = "registry+https://github.com/rust-lang/crates.io-index" 1392source = "registry+https://github.com/rust-lang/crates.io-index"
1393checksum = "2c280ac85b15ac214b86ac4b407626a48e6a1c4f90769a582fec74aa57942b9f" 1393checksum = "a1c3aec007c63c4ed4cd7a018529fb0b5575c4562575fc6a40d6cd2ae0b792ef"
1394dependencies = [ 1394dependencies = [
1395 "heck", 1395 "heck",
1396 "proc-macro2", 1396 "proc-macro2",
@@ -1533,9 +1533,9 @@ version = "0.1.0"
1533 1533
1534[[package]] 1534[[package]]
1535name = "syn" 1535name = "syn"
1536version = "1.0.36" 1536version = "1.0.38"
1537source = "registry+https://github.com/rust-lang/crates.io-index" 1537source = "registry+https://github.com/rust-lang/crates.io-index"
1538checksum = "4cdb98bcb1f9d81d07b536179c269ea15999b5d14ea958196413869445bb5250" 1538checksum = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4"
1539dependencies = [ 1539dependencies = [
1540 "proc-macro2", 1540 "proc-macro2",
1541 "quote", 1541 "quote",
@@ -1644,9 +1644,9 @@ dependencies = [
1644 1644
1645[[package]] 1645[[package]]
1646name = "tracing-core" 1646name = "tracing-core"
1647version = "0.1.12" 1647version = "0.1.13"
1648source = "registry+https://github.com/rust-lang/crates.io-index" 1648source = "registry+https://github.com/rust-lang/crates.io-index"
1649checksum = "b2734b5a028fa697686f16c6d18c2c6a3c7e41513f9a213abb6754c4acb3c8d7" 1649checksum = "d593f98af59ebc017c0648f0117525db358745a8894a8d684e185ba3f45954f9"
1650dependencies = [ 1650dependencies = [
1651 "lazy_static", 1651 "lazy_static",
1652] 1652]
diff --git a/crates/ra_db/Cargo.toml b/crates/ra_db/Cargo.toml
index 5f334d04f..fe73dc015 100644
--- a/crates/ra_db/Cargo.toml
+++ b/crates/ra_db/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
9doctest = false 9doctest = false
10 10
11[dependencies] 11[dependencies]
12salsa = "0.15.0" 12salsa = "0.15.2"
13rustc-hash = "1.1.0" 13rustc-hash = "1.1.0"
14 14
15ra_syntax = { path = "../ra_syntax" } 15ra_syntax = { path = "../ra_syntax" }
diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs
index a2b9f3e35..07333c453 100644
--- a/crates/ra_hir/src/db.rs
+++ b/crates/ra_hir/src/db.rs
@@ -13,14 +13,7 @@ pub use hir_expand::db::{
13 AstDatabase, AstDatabaseStorage, AstIdMapQuery, InternEagerExpansionQuery, InternMacroQuery, 13 AstDatabase, AstDatabaseStorage, AstIdMapQuery, InternEagerExpansionQuery, InternMacroQuery,
14 MacroArgTextQuery, MacroDefQuery, MacroExpandQuery, ParseMacroQuery, 14 MacroArgTextQuery, MacroDefQuery, MacroExpandQuery, ParseMacroQuery,
15}; 15};
16pub use hir_ty::db::{ 16pub use hir_ty::db::*;
17 AssociatedTyDataQuery, AssociatedTyValueQuery, CallableItemSignatureQuery, FieldTypesQuery,
18 GenericDefaultsQuery, GenericPredicatesForParamQuery, GenericPredicatesQuery, HirDatabase,
19 HirDatabaseStorage, ImplDatumQuery, ImplSelfTyQuery, ImplTraitQuery, InferQueryQuery,
20 InherentImplsInCrateQuery, InternTypeParamIdQuery, ReturnTypeImplTraitsQuery, StructDatumQuery,
21 TraitDatumQuery, TraitImplsInCrateQuery, TraitImplsInDepsQuery, TraitSolveQuery, TyQuery,
22 ValueTyQuery,
23};
24 17
25#[test] 18#[test]
26fn hir_database_is_object_safe() { 19fn hir_database_is_object_safe() {
diff --git a/crates/ra_ide_db/src/change.rs b/crates/ra_ide_db/src/change.rs
index 32d9a8d1f..b13df8b85 100644
--- a/crates/ra_ide_db/src/change.rs
+++ b/crates/ra_ide_db/src/change.rs
@@ -190,11 +190,24 @@ impl RootDatabase {
190 let q: $q = Default::default(); 190 let q: $q = Default::default();
191 let name = format!("{:?} (deps)", q); 191 let name = format!("{:?} (deps)", q);
192 acc.push((name, before - after)); 192 acc.push((name, before - after));
193
194 let before = memory_usage().allocated;
195 $q.in_db(self).purge();
196 let after = memory_usage().allocated;
197 let q: $q = Default::default();
198 let name = format!("{:?} (purge)", q);
199 acc.push((name, before - after));
193 )*} 200 )*}
194 } 201 }
195 sweep_each_query![ 202 sweep_each_query![
196 // SourceDatabase 203 // SourceDatabase
197 ra_db::ParseQuery 204 ra_db::ParseQuery
205 ra_db::CrateGraphQuery
206
207 // SourceDatabaseExt
208 ra_db::FileTextQuery
209 ra_db::FileSourceRootQuery
210 ra_db::SourceRootQuery
198 ra_db::SourceRootCratesQuery 211 ra_db::SourceRootCratesQuery
199 212
200 // AstDatabase 213 // AstDatabase
@@ -242,15 +255,24 @@ impl RootDatabase {
242 hir::db::TraitImplsInCrateQuery 255 hir::db::TraitImplsInCrateQuery
243 hir::db::TraitImplsInDepsQuery 256 hir::db::TraitImplsInDepsQuery
244 hir::db::AssociatedTyDataQuery 257 hir::db::AssociatedTyDataQuery
258 hir::db::AssociatedTyDataQuery
245 hir::db::TraitDatumQuery 259 hir::db::TraitDatumQuery
246 hir::db::StructDatumQuery 260 hir::db::StructDatumQuery
247 hir::db::ImplDatumQuery 261 hir::db::ImplDatumQuery
262 hir::db::FnDefDatumQuery
263 hir::db::ReturnTypeImplTraitsQuery
264 hir::db::InternCallableDefQuery
265 hir::db::InternTypeParamIdQuery
266 hir::db::InternImplTraitIdQuery
267 hir::db::InternClosureQuery
248 hir::db::AssociatedTyValueQuery 268 hir::db::AssociatedTyValueQuery
249 hir::db::TraitSolveQuery 269 hir::db::TraitSolveQuery
250 hir::db::ReturnTypeImplTraitsQuery
251 270
252 // SymbolsDatabase 271 // SymbolsDatabase
253 crate::symbol_index::FileSymbolsQuery 272 crate::symbol_index::FileSymbolsQuery
273 crate::symbol_index::LibrarySymbolsQuery
274 crate::symbol_index::LocalRootsQuery
275 crate::symbol_index::LibraryRootsQuery
254 276
255 // LineIndexDatabase 277 // LineIndexDatabase
256 crate::LineIndexQuery 278 crate::LineIndexQuery