aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/tests/heavy_tests
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-02-08 11:49:43 +0000
committerAleksey Kladov <[email protected]>2019-02-08 11:49:43 +0000
commit12e3b4c70b5ef23b2fdfc197296d483680e125f9 (patch)
tree71baa0e0a62f9f6b61450501c5f821f67badf9e4 /crates/ra_lsp_server/tests/heavy_tests
parent5cb1d41a30d25cbe136402644bf5434dd667f1e5 (diff)
reformat the world
Diffstat (limited to 'crates/ra_lsp_server/tests/heavy_tests')
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/main.rs10
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/support.rs16
2 files changed, 5 insertions, 21 deletions
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs
index bfb0645a8..e49c87169 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/main.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs
@@ -55,10 +55,7 @@ fn foo() {
55 ); 55 );
56 server.wait_for_feedback("workspace loaded"); 56 server.wait_for_feedback("workspace loaded");
57 server.request::<Runnables>( 57 server.request::<Runnables>(
58 RunnablesParams { 58 RunnablesParams { text_document: server.doc_id("lib.rs"), position: None },
59 text_document: server.doc_id("lib.rs"),
60 position: None,
61 },
62 json!([ 59 json!([
63 { 60 {
64 "args": [ "test", "--", "foo", "--nocapture" ], 61 "args": [ "test", "--", "foo", "--nocapture" ],
@@ -220,10 +217,7 @@ fn main() {}
220"#, 217"#,
221 ); 218 );
222 server.wait_for_feedback("workspace loaded"); 219 server.wait_for_feedback("workspace loaded");
223 let empty_context = || CodeActionContext { 220 let empty_context = || CodeActionContext { diagnostics: Vec::new(), only: None };
224 diagnostics: Vec::new(),
225 only: None,
226 };
227 server.request::<CodeActionRequest>( 221 server.request::<CodeActionRequest>(
228 CodeActionParams { 222 CodeActionParams {
229 text_document: server.doc_id("src/lib.rs"), 223 text_document: server.doc_id("src/lib.rs"),
diff --git a/crates/ra_lsp_server/tests/heavy_tests/support.rs b/crates/ra_lsp_server/tests/heavy_tests/support.rs
index 57a8b4f4d..eee85f8c8 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/support.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/support.rs
@@ -83,9 +83,7 @@ impl Server {
83 83
84 pub fn doc_id(&self, rel_path: &str) -> TextDocumentIdentifier { 84 pub fn doc_id(&self, rel_path: &str) -> TextDocumentIdentifier {
85 let path = self.dir.path().join(rel_path); 85 let path = self.dir.path().join(rel_path);
86 TextDocumentIdentifier { 86 TextDocumentIdentifier { uri: Url::from_file_path(path).unwrap() }
87 uri: Url::from_file_path(path).unwrap(),
88 }
89 } 87 }
90 88
91 pub fn request<R>(&self, params: R::Params, expected_resp: Value) 89 pub fn request<R>(&self, params: R::Params, expected_resp: Value)
@@ -119,11 +117,7 @@ impl Server {
119 } 117 }
120 fn send_request_(&self, r: RawRequest) -> Value { 118 fn send_request_(&self, r: RawRequest) -> Value {
121 let id = r.id; 119 let id = r.id;
122 self.worker 120 self.worker.as_ref().unwrap().send(RawMessage::Request(r)).unwrap();
123 .as_ref()
124 .unwrap()
125 .send(RawMessage::Request(r))
126 .unwrap();
127 while let Some(msg) = self.recv() { 121 while let Some(msg) = self.recv() {
128 match msg { 122 match msg {
129 RawMessage::Request(req) => panic!("unexpected request: {:?}", req), 123 RawMessage::Request(req) => panic!("unexpected request: {:?}", req),
@@ -169,11 +163,7 @@ impl Server {
169 }) 163 })
170 } 164 }
171 fn send_notification(&self, not: RawNotification) { 165 fn send_notification(&self, not: RawNotification) {
172 self.worker 166 self.worker.as_ref().unwrap().send(RawMessage::Notification(not)).unwrap();
173 .as_ref()
174 .unwrap()
175 .send(RawMessage::Notification(not))
176 .unwrap();
177 } 167 }
178} 168}
179 169