mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Switch to the master of salsa
This commit is contained in:
parent
d783371b86
commit
062019590d
4 changed files with 13 additions and 10 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -619,7 +619,8 @@ dependencies = [
|
||||||
"ra_syntax 0.1.0",
|
"ra_syntax 0.1.0",
|
||||||
"rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"relative-path 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"relative-path 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"salsa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"salsa 0.4.1 (git+https://github.com/salsa-rs/salsa?rev=20c9fbf)",
|
||||||
"test_utils 0.1.0",
|
"test_utils 0.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -845,13 +846,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "salsa"
|
name = "salsa"
|
||||||
version = "0.4.1"
|
version = "0.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/salsa-rs/salsa?rev=20c9fbf#20c9fbf45c0201e39cfeda4c939160ad1c35132c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"derive-new 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"derive-new 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1350,7 +1352,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
||||||
"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7"
|
"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7"
|
||||||
"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9"
|
"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9"
|
||||||
"checksum salsa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b7a4bcb8e4e81d092709a98130025666d255c8821970dcb9347d05f928e3d505"
|
"checksum salsa 0.4.1 (git+https://github.com/salsa-rs/salsa?rev=20c9fbf)" = "<none>"
|
||||||
"checksum same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f7794e2fda7f594866840e95f5c5962e886e228e68b6505885811a94dd728c"
|
"checksum same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f7794e2fda7f594866840e95f5c5962e886e228e68b6505885811a94dd728c"
|
||||||
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
|
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
|
||||||
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
||||||
|
|
|
@ -15,7 +15,8 @@ fst = "0.3.1"
|
||||||
im = "12.0.0"
|
im = "12.0.0"
|
||||||
ra_syntax = { path = "../ra_syntax" }
|
ra_syntax = { path = "../ra_syntax" }
|
||||||
ra_editor = { path = "../ra_editor" }
|
ra_editor = { path = "../ra_editor" }
|
||||||
salsa = "0.4.1"
|
salsa = { git = "https://github.com/salsa-rs/salsa", rev = "20c9fbf" }
|
||||||
|
rustc-hash = "1.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
test_utils = { path = "../test_utils" }
|
test_utils = { path = "../test_utils" }
|
||||||
|
|
|
@ -2,9 +2,9 @@ use std::{
|
||||||
fmt,
|
fmt,
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
hash::{Hash, Hasher},
|
hash::{Hash, Hasher},
|
||||||
collections::HashSet,
|
|
||||||
};
|
};
|
||||||
use salsa;
|
use salsa;
|
||||||
|
use rustc_hash::FxHashSet;
|
||||||
use ra_syntax::File;
|
use ra_syntax::File;
|
||||||
use ra_editor::{LineIndex};
|
use ra_editor::{LineIndex};
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -63,7 +63,7 @@ salsa::query_group! {
|
||||||
|
|
||||||
#[derive(Default, Debug)]
|
#[derive(Default, Debug)]
|
||||||
pub(crate) struct FileSet {
|
pub(crate) struct FileSet {
|
||||||
pub(crate) files: HashSet<FileId>,
|
pub(crate) files: FxHashSet<FileId>,
|
||||||
pub(crate) resolver: FileResolverImp,
|
pub(crate) resolver: FileResolverImp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use std::{
|
use std::{
|
||||||
collections::{HashMap, HashSet},
|
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
panic,
|
panic,
|
||||||
};
|
};
|
||||||
|
@ -8,6 +7,7 @@ use parking_lot::RwLock;
|
||||||
use once_cell::sync::OnceCell;
|
use once_cell::sync::OnceCell;
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use salsa::Database;
|
use salsa::Database;
|
||||||
|
use rustc_hash::{FxHashMap, FxHashSet};
|
||||||
use ra_editor::LineIndex;
|
use ra_editor::LineIndex;
|
||||||
use ra_syntax::File;
|
use ra_syntax::File;
|
||||||
|
|
||||||
|
@ -40,8 +40,8 @@ impl WritableSourceRoot {
|
||||||
file_resolver: Option<FileResolverImp>,
|
file_resolver: Option<FileResolverImp>,
|
||||||
) -> WritableSourceRoot {
|
) -> WritableSourceRoot {
|
||||||
let db = self.db.write();
|
let db = self.db.write();
|
||||||
let mut changed = HashSet::new();
|
let mut changed = FxHashSet::default();
|
||||||
let mut removed = HashSet::new();
|
let mut removed = FxHashSet::default();
|
||||||
for (file_id, text) in changes {
|
for (file_id, text) in changes {
|
||||||
match text {
|
match text {
|
||||||
None => {
|
None => {
|
||||||
|
@ -55,7 +55,7 @@ impl WritableSourceRoot {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let file_set = db.file_set(());
|
let file_set = db.file_set(());
|
||||||
let mut files: HashSet<FileId> = file_set
|
let mut files: FxHashSet<FileId> = file_set
|
||||||
.files
|
.files
|
||||||
.clone();
|
.clone();
|
||||||
for file_id in removed {
|
for file_id in removed {
|
||||||
|
|
Loading…
Reference in a new issue