diff options
Diffstat (limited to 'crates/ra_lsp_server/tests')
-rw-r--r-- | crates/ra_lsp_server/tests/heavy_tests/main.rs | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs index 29224cbe8..fec50bd25 100644 --- a/crates/ra_lsp_server/tests/heavy_tests/main.rs +++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs | |||
@@ -172,6 +172,7 @@ fn main() {} | |||
172 | fn test_format_document() { | 172 | fn test_format_document() { |
173 | let server = project( | 173 | let server = project( |
174 | r#" | 174 | r#" |
175 | //- Cargo.toml | ||
175 | [package] | 176 | [package] |
176 | name = "foo" | 177 | name = "foo" |
177 | version = "0.0.0" | 178 | version = "0.0.0" |
@@ -220,6 +221,63 @@ pub use std::collections::HashMap; | |||
220 | } | 221 | } |
221 | 222 | ||
222 | #[test] | 223 | #[test] |
224 | fn test_format_document_2018() { | ||
225 | let server = project( | ||
226 | r#" | ||
227 | //- Cargo.toml | ||
228 | [package] | ||
229 | name = "foo" | ||
230 | version = "0.0.0" | ||
231 | edition = "2018" | ||
232 | |||
233 | //- src/lib.rs | ||
234 | mod bar; | ||
235 | |||
236 | async fn test() { | ||
237 | } | ||
238 | |||
239 | fn main() { | ||
240 | } | ||
241 | |||
242 | pub use std::collections::HashMap; | ||
243 | "#, | ||
244 | ); | ||
245 | server.wait_until_workspace_is_loaded(); | ||
246 | |||
247 | server.request::<Formatting>( | ||
248 | DocumentFormattingParams { | ||
249 | text_document: server.doc_id("src/lib.rs"), | ||
250 | options: FormattingOptions { | ||
251 | tab_size: 4, | ||
252 | insert_spaces: false, | ||
253 | properties: HashMap::new(), | ||
254 | }, | ||
255 | }, | ||
256 | json!([ | ||
257 | { | ||
258 | "newText": r#"mod bar; | ||
259 | |||
260 | async fn test() {} | ||
261 | |||
262 | fn main() {} | ||
263 | |||
264 | pub use std::collections::HashMap; | ||
265 | "#, | ||
266 | "range": { | ||
267 | "end": { | ||
268 | "character": 0, | ||
269 | "line": 10 | ||
270 | }, | ||
271 | "start": { | ||
272 | "character": 0, | ||
273 | "line": 0 | ||
274 | } | ||
275 | } | ||
276 | } | ||
277 | ]), | ||
278 | ); | ||
279 | } | ||
280 | #[test] | ||
223 | fn test_missing_module_code_action() { | 281 | fn test_missing_module_code_action() { |
224 | let server = project( | 282 | let server = project( |
225 | r#" | 283 | r#" |