aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-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
3 files changed, 8 insertions, 7 deletions
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 {