Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 7b50f09

Browse files
authored
Merge pull request #1704 from calebcartwright/bump-racer-rustfmt
Bump racer and rustfmt to fix broken toolstates
2 parents cd957a8 + d9d1536 commit 7b50f09

File tree

7 files changed

+81
-80
lines changed

7 files changed

+81
-80
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ lsp-types = { version = "0.60", features = ["proposed"] }
4242
lazy_static = "1"
4343
log = "0.4"
4444
num_cpus = "1"
45-
racer = { version = "2.1.39", default-features = false }
45+
racer = { version = "2.1.40", default-features = false }
4646
rand = "0.7"
4747
rayon = "1"
4848
rustc_tools_util = "0.2"
49-
rustfmt-nightly = { version = "1.4.22", git = "https://github.com/rust-lang/rustfmt", branch = "rustfmt-1.4.22" }
49+
rustfmt-nightly = { version = "1.4.23", git = "https://github.com/rust-lang/rustfmt", branch = "rustfmt-1.4.23" }
5050
serde = "1.0"
5151
serde_json = "1.0"
5252
serde_derive = "1.0"

rls-rustc/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extern crate rustc_span;
99

1010
#[cfg(feature = "ipc")]
1111
use rustc_driver::Compilation;
12-
use rustc_driver::{run_compiler, Callbacks};
12+
use rustc_driver::{Callbacks, RunCompiler};
1313
use rustc_interface::interface;
1414
#[cfg(feature = "ipc")]
1515
use rustc_interface::Queries;
@@ -75,8 +75,10 @@ pub fn run() -> Result<(), ()> {
7575
};
7676

7777
rustc_driver::install_ice_hook();
78-
rustc_driver::catch_fatal_errors(|| {
79-
run_compiler(&args, &mut shim_calls, file_loader, None, None)
78+
rustc_driver::catch_fatal_errors(move || {
79+
let mut compiler = RunCompiler::new(&args, &mut shim_calls);
80+
compiler.set_file_loader(file_loader);
81+
compiler.run()
8082
})
8183
.map(|_| ())
8284
.map_err(|_| ())

rls/src/build/rustc.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use log::trace;
1919
use rls_data::Analysis;
2020
use rls_vfs::Vfs;
2121

22-
use self::rustc_driver::{run_compiler, Compilation};
22+
use self::rustc_driver::{Compilation, RunCompiler};
2323
use self::rustc_interface::interface;
2424
use self::rustc_interface::Queries;
2525
use self::rustc_save_analysis as save;
@@ -185,14 +185,12 @@ fn run_in_process(
185185
let stderr = Arc::clone(&stderr);
186186
|| {
187187
rustc_driver::catch_fatal_errors(move || {
188-
// Replace stderr so we catch most errors.
189-
run_compiler(
190-
&args,
191-
&mut callbacks,
192-
Some(Box::new(ReplacedFileLoader::new(changed))),
193-
Some(Box::new(BufWriter(stderr))),
194-
None,
195-
)
188+
let mut compiler = RunCompiler::new(&args, &mut callbacks);
189+
compiler
190+
.set_file_loader(Some(Box::new(ReplacedFileLoader::new(changed))))
191+
// Replace stderr so we catch most errors.
192+
.set_emitter(Some(Box::new(BufWriter(stderr))));
193+
compiler.run()
196194
})
197195
}
198196
})

tests/fixtures/hover/save_data/test_tooltip_mod_use_external.rs.0004_012.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
"col": 12
66
},
77
"data": {
8-
"Ok": []
8+
"Ok": [
9+
{
10+
"language": "rust",
11+
"value": "std/src/sync/mod.rs"
12+
},
13+
"Useful synchronization primitives.\n\n## The need for synchronization\n\nConceptually, a Rust program is a series of operations which will\nbe executed on a computer. The timeline of events happening in the\nprogram is consistent with the order of the operations in the code.\n\nConsider the following code, operating on some global static variables:\n\n```rust\nstatic mut A: u32 = 0;"
14+
]
915
}
1016
}

0 commit comments

Comments
 (0)