From b437dca4bd100c0a7a498d5960d566a0ccd92432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Rouill=C3=A9?= Date: Wed, 4 Dec 2019 23:05:01 +0100 Subject: Run rustfmt with respect to Cargo.toml edition --- crates/ra_lsp_server/tests/heavy_tests/main.rs | 58 ++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'crates/ra_lsp_server/tests/heavy_tests/main.rs') 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() {} fn test_format_document() { let server = project( r#" +//- Cargo.toml [package] name = "foo" version = "0.0.0" @@ -219,6 +220,63 @@ pub use std::collections::HashMap; ); } +#[test] +fn test_format_document_2018() { + let server = project( + r#" +//- Cargo.toml +[package] +name = "foo" +version = "0.0.0" +edition = "2018" + +//- src/lib.rs +mod bar; + +async fn test() { +} + +fn main() { +} + +pub use std::collections::HashMap; +"#, + ); + server.wait_until_workspace_is_loaded(); + + server.request::( + DocumentFormattingParams { + text_document: server.doc_id("src/lib.rs"), + options: FormattingOptions { + tab_size: 4, + insert_spaces: false, + properties: HashMap::new(), + }, + }, + json!([ + { + "newText": r#"mod bar; + +async fn test() {} + +fn main() {} + +pub use std::collections::HashMap; +"#, + "range": { + "end": { + "character": 0, + "line": 10 + }, + "start": { + "character": 0, + "line": 0 + } + } + } + ]), + ); +} #[test] fn test_missing_module_code_action() { let server = project( -- cgit v1.2.3