Skip to content

Commit 26d15d6

Browse files
alanzfacebook-github-bot
authored andcommitted
Bump rust-analyzer dependency to 2024-08-12
Summary: The rust-analyzer dependency is currently 2024-07-29. It turns out that a few days after that an important performance improvement landed, which does parallel loading for file in VFS. This has a significant impact on initial startup time. This diff does the bare minimum to move to the first subsequent release that had this feature, from [2024-08-12](https://github.com/rust-lang/rust-analyzer/releases/tag/2024-08-12). The key change is [this one](rust-lang/rust-analyzer#17771) "load VFS config changes in parallel." Reviewed By: jcpetruzza, michalmuskala Differential Revision: D72724277 fbshipit-source-id: eac8f371acfa548df0c51fcf2c6c49fe5417f36f
1 parent ed00b95 commit 26d15d6

File tree

5 files changed

+29
-24
lines changed

5 files changed

+29
-24
lines changed

Cargo.lock

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jemalloc-ctl = { version = "0.5.0", package = "tikv-jemalloc-ctl" }
5656
jemallocator = { version = "0.5.4", package = "tikv-jemallocator" }
5757
jod-thread = "0.1.2"
5858
krates = "0.12.6"
59-
la-arena = { git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-07-29" }
59+
la-arena = { git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-08-12" }
6060
lazy_static = "1.5.0"
6161
log = "0.4.22"
6262
lsp-server = "0.7.6"
@@ -67,11 +67,11 @@ num-derive = "0.4.2"
6767
num-traits = "0.2.19"
6868
once_cell = "1.19.0"
6969
parking_lot = "0.12.3"
70-
paths = { git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-07-29" }
70+
paths = { git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-08-12" }
7171
proc-macro2 = "1.0.86"
7272
profile = { features = [
7373
"jemalloc",
74-
], git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-07-29" }
74+
], git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-08-12" }
7575
quote = "1.0.36"
7676
range-set = "0.0.10"
7777
rayon = "1.10.0"
@@ -88,13 +88,13 @@ serde_path_to_error = "0.1.16"
8888
serde_with = "1.14.0"
8989
smallvec = { version = "1.13.2", features = ["const_new", "union", "const_generics"] }
9090
smol_str = "0.1.24"
91-
stdx = { git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-07-29" }
91+
stdx = { git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-08-12" }
9292
strsim = { version = "0.10.0" }
9393
strum = "0.25.0"
9494
strum_macros = "0.25.3"
9595
tempfile = "3.12.0"
9696
test-case = "2.2.2"
97-
text-edit = { git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-07-29" }
97+
text-edit = { git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-08-12" }
9898
text-size = "1.1.1"
9999
thiserror = "1.0"
100100
tracing = "0.1.40"
@@ -106,7 +106,7 @@ tree-sitter = "0.23.2"
106106
tree-sitter-erlang = "0.14.0" # @oss-only
107107
url = "2.5.4"
108108
ustr = { version = "1.1.0", features = ["serde"] }
109-
vfs = { git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-07-29" }
110-
vfs-notify = { git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-07-29" }
109+
vfs = { git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-08-12" }
110+
vfs-notify = { git = "https://github.com/rust-lang/rust-analyzer", rev = "2024-08-12" }
111111
walkdir = "2.5.0"
112112
xshell = "0.2.6"

crates/elp/src/build/load.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ use elp_project_model::IncludeParentDirs;
3838
use elp_project_model::Project;
3939
use elp_project_model::ProjectManifest;
4040
use fxhash::FxHashMap;
41+
use vfs::loader::LoadingProgress;
4142
use vfs::VfsPath;
4243

4344
use crate::build::types::LoadResult;
@@ -158,11 +159,14 @@ fn load_database(
158159
n_done, n_total, ..
159160
} => {
160161
pb.set_length(n_total as u64);
161-
if let Some(n_done) = n_done {
162-
pb.set_position(n_done as u64);
163-
}
164-
if n_done == Some(n_total) {
165-
break;
162+
match n_done {
163+
LoadingProgress::Started => {}
164+
LoadingProgress::Progress(n_done) => {
165+
pb.set_position(n_done as u64);
166+
}
167+
LoadingProgress::Finished => {
168+
break;
169+
}
166170
}
167171
}
168172
loader::Message::Loaded { files } | loader::Message::Changed { files } => {

crates/elp/src/server.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ use parking_lot::Mutex;
8585
use parking_lot::RwLock;
8686
use parking_lot::RwLockWriteGuard;
8787
use serde::Serialize;
88+
use vfs::loader::LoadingProgress;
8889
use vfs::Change;
8990

9091
use self::dispatch::RequestDispatcher;
@@ -885,11 +886,10 @@ impl Server {
885886
result && path_ref.is_file()
886887
}
887888

888-
fn on_loader_progress(&mut self, n_total: usize, n_done: Option<usize>, config_version: u32) {
889+
fn on_loader_progress(&mut self, n_total: usize, n_done: LoadingProgress, config_version: u32) {
889890
// report progress
890891
always!(config_version <= self.vfs_config_version);
891-
// n_done is `None` for a response to a config change
892-
if let Some(n_done) = n_done {
892+
if let LoadingProgress::Progress(n_done) = n_done {
893893
if n_done == 0 && n_total != 0 {
894894
let pb = self
895895
.progress

crates/elp/src/server/setup.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* of this source tree.
88
*/
99

10-
use std::convert::TryFrom;
1110
use std::env;
1211
use std::fs;
1312

@@ -213,7 +212,7 @@ fn root_path(params: &InitializeParams) -> Result<AbsPathBuf> {
213212
.root_uri
214213
.as_ref()
215214
.and_then(|uri| uri.to_file_path().ok())
216-
.and_then(|path| AbsPathBuf::try_from(path).ok())
215+
.map(|path| AbsPathBuf::assert_utf8(path))
217216
{
218217
Some(path) => Ok(path),
219218
None => {

0 commit comments

Comments
 (0)