aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock8
-rw-r--r--crates/ra_analysis/Cargo.toml3
-rw-r--r--crates/ra_analysis/src/db/mod.rs4
-rw-r--r--crates/ra_analysis/src/roots.rs8
4 files changed, 13 insertions, 10 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 98f06f53a..c18ee2f44 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -619,7 +619,8 @@ dependencies = [
619 "ra_syntax 0.1.0", 619 "ra_syntax 0.1.0",
620 "rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 620 "rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
621 "relative-path 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", 621 "relative-path 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
622 "salsa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 622 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
623 "salsa 0.4.1 (git+https://github.com/salsa-rs/salsa?rev=20c9fbf)",
623 "test_utils 0.1.0", 624 "test_utils 0.1.0",
624] 625]
625 626
@@ -845,13 +846,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
845[[package]] 846[[package]]
846name = "salsa" 847name = "salsa"
847version = "0.4.1" 848version = "0.4.1"
848source = "registry+https://github.com/rust-lang/crates.io-index" 849source = "git+https://github.com/salsa-rs/salsa?rev=20c9fbf#20c9fbf45c0201e39cfeda4c939160ad1c35132c"
849dependencies = [ 850dependencies = [
850 "derive-new 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", 851 "derive-new 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
851 "indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 852 "indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
852 "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", 853 "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
853 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", 854 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
854 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 855 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
856 "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
855] 857]
856 858
857[[package]] 859[[package]]
@@ -1350,7 +1352,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1350"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 1352"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
1351"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" 1353"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7"
1352"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" 1354"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9"
1353"checksum salsa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b7a4bcb8e4e81d092709a98130025666d255c8821970dcb9347d05f928e3d505" 1355"checksum salsa 0.4.1 (git+https://github.com/salsa-rs/salsa?rev=20c9fbf)" = "<none>"
1354"checksum same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f7794e2fda7f594866840e95f5c5962e886e228e68b6505885811a94dd728c" 1356"checksum same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f7794e2fda7f594866840e95f5c5962e886e228e68b6505885811a94dd728c"
1355"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" 1357"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
1356"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 1358"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
diff --git a/crates/ra_analysis/Cargo.toml b/crates/ra_analysis/Cargo.toml
index 4481e98d6..233f34e34 100644
--- a/crates/ra_analysis/Cargo.toml
+++ b/crates/ra_analysis/Cargo.toml
@@ -15,7 +15,8 @@ fst = "0.3.1"
15im = "12.0.0" 15im = "12.0.0"
16ra_syntax = { path = "../ra_syntax" } 16ra_syntax = { path = "../ra_syntax" }
17ra_editor = { path = "../ra_editor" } 17ra_editor = { path = "../ra_editor" }
18salsa = "0.4.1" 18salsa = { git = "https://github.com/salsa-rs/salsa", rev = "20c9fbf" }
19rustc-hash = "1.0"
19 20
20[dev-dependencies] 21[dev-dependencies]
21test_utils = { path = "../test_utils" } 22test_utils = { path = "../test_utils" }
diff --git a/crates/ra_analysis/src/db/mod.rs b/crates/ra_analysis/src/db/mod.rs
index c54d50252..c84bfa7a8 100644
--- a/crates/ra_analysis/src/db/mod.rs
+++ b/crates/ra_analysis/src/db/mod.rs
@@ -2,9 +2,9 @@ use std::{
2 fmt, 2 fmt,
3 sync::Arc, 3 sync::Arc,
4 hash::{Hash, Hasher}, 4 hash::{Hash, Hasher},
5 collections::HashSet,
6}; 5};
7use salsa; 6use salsa;
7use rustc_hash::FxHashSet;
8use ra_syntax::File; 8use ra_syntax::File;
9use ra_editor::{LineIndex}; 9use ra_editor::{LineIndex};
10use crate::{ 10use crate::{
@@ -63,7 +63,7 @@ salsa::query_group! {
63 63
64#[derive(Default, Debug)] 64#[derive(Default, Debug)]
65pub(crate) struct FileSet { 65pub(crate) struct FileSet {
66 pub(crate) files: HashSet<FileId>, 66 pub(crate) files: FxHashSet<FileId>,
67 pub(crate) resolver: FileResolverImp, 67 pub(crate) resolver: FileResolverImp,
68} 68}
69 69
diff --git a/crates/ra_analysis/src/roots.rs b/crates/ra_analysis/src/roots.rs
index 908f49b0a..692a07ccd 100644
--- a/crates/ra_analysis/src/roots.rs
+++ b/crates/ra_analysis/src/roots.rs
@@ -1,5 +1,4 @@
1use std::{ 1use std::{
2 collections::{HashMap, HashSet},
3 sync::Arc, 2 sync::Arc,
4 panic, 3 panic,
5}; 4};
@@ -8,6 +7,7 @@ use parking_lot::RwLock;
8use once_cell::sync::OnceCell; 7use once_cell::sync::OnceCell;
9use rayon::prelude::*; 8use rayon::prelude::*;
10use salsa::Database; 9use salsa::Database;
10use rustc_hash::{FxHashMap, FxHashSet};
11use ra_editor::LineIndex; 11use ra_editor::LineIndex;
12use ra_syntax::File; 12use ra_syntax::File;
13 13
@@ -40,8 +40,8 @@ impl WritableSourceRoot {
40 file_resolver: Option<FileResolverImp>, 40 file_resolver: Option<FileResolverImp>,
41 ) -> WritableSourceRoot { 41 ) -> WritableSourceRoot {
42 let db = self.db.write(); 42 let db = self.db.write();
43 let mut changed = HashSet::new(); 43 let mut changed = FxHashSet::default();
44 let mut removed = HashSet::new(); 44 let mut removed = FxHashSet::default();
45 for (file_id, text) in changes { 45 for (file_id, text) in changes {
46 match text { 46 match text {
47 None => { 47 None => {
@@ -55,7 +55,7 @@ impl WritableSourceRoot {
55 } 55 }
56 } 56 }
57 let file_set = db.file_set(()); 57 let file_set = db.file_set(());
58 let mut files: HashSet<FileId> = file_set 58 let mut files: FxHashSet<FileId> = file_set
59 .files 59 .files
60 .clone(); 60 .clone();
61 for file_id in removed { 61 for file_id in removed {