Disable file watching when running slow tests

This should rid us of the intermittent test failure

https://github.com/rust-analyzer/rust-analyzer/pull/5017#issuecomment-648717983
This commit is contained in:
Aleksey Kladov 2020-06-24 12:27:13 +02:00
parent c544f9a137
commit a0b76161ab

View File

@ -19,7 +19,7 @@
use ra_project_model::ProjectManifest; use ra_project_model::ProjectManifest;
use rust_analyzer::{ use rust_analyzer::{
config::{ClientCapsConfig, Config, LinkedProject}, config::{ClientCapsConfig, Config, FilesConfig, FilesWatcher, LinkedProject},
main_loop, main_loop,
}; };
@ -90,9 +90,9 @@ pub fn server(self) -> Server {
}, },
with_sysroot: self.with_sysroot, with_sysroot: self.with_sysroot,
linked_projects, linked_projects,
files: FilesConfig { watcher: FilesWatcher::Client, exclude: Vec::new() },
..Config::default() ..Config::default()
}; };
if let Some(f) = &self.config { if let Some(f) = &self.config {
f(&mut config) f(&mut config)
} }
@ -173,8 +173,14 @@ fn send_request_(&self, r: Request) -> Value {
self.client.sender.send(r.into()).unwrap(); self.client.sender.send(r.into()).unwrap();
while let Some(msg) = self.recv() { while let Some(msg) = self.recv() {
match msg { match msg {
Message::Request(req) if req.method == "window/workDoneProgress/create" => (), Message::Request(req) => {
Message::Request(req) => panic!("unexpected request: {:?}", req), if req.method != "window/workDoneProgress/create"
&& !(req.method == "client/registerCapability"
&& req.params.to_string().contains("workspace/didChangeWatchedFiles"))
{
panic!("unexpected request: {:?}", req)
}
}
Message::Notification(_) => (), Message::Notification(_) => (),
Message::Response(res) => { Message::Response(res) => {
assert_eq!(res.id, id); assert_eq!(res.id, id);