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

Commit 965cd33

Browse files
committed
Fix: avoid checking inside of closure
1 parent d69566e commit 965cd33

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/test/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ fn test_reformat_with_range() {
309309
ServerMessage::request(42, Method::RangeFormatting(DocumentRangeFormattingParams {
310310
text_document: text_doc,
311311
range: Range {
312-
start: Position { line: 11, character: 0 },
313-
end: Position { line: 12, character: 0 },
312+
start: Position { line: 12, character: 0 },
313+
end: Position { line: 13, character: 0 },
314314
},
315315
options: FormattingOptions {
316316
tab_size: 4,
@@ -331,8 +331,8 @@ fn test_reformat_with_range() {
331331

332332
assert_eq!(ls_server::LsService::handle_message(server.clone()),
333333
ls_server::ServerStateChange::Continue);
334-
expect_messages(results.clone(), &[ExpectedMessage::new(Some(42)).expect_contains(r#"{"start":{"line":0,"character":0},"end":{"line":14,"character":5}}"#)
335-
.expect_contains(r#"newText":"// Copyright 2017 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http://rust-lang.org/COPYRIGHT.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license\n// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your\n// option. This file may not be copied, modified, or distributed\n// except according to those terms.\n\npub fn main() {\n let world1 = \"world\";\n println!(\"Hello, {}!\", world1);\nlet world2 = \"world\"; println!(\"Hello, {}!\", world2);\n}"#)]);
334+
expect_messages(results.clone(), &[ExpectedMessage::new(Some(42)).expect_contains(r#"{"start":{"line":0,"character":0},"end":{"line":15,"character":5}}"#)
335+
.expect_contains(r#"newText":"// Copyright 2017 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http://rust-lang.org/COPYRIGHT.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license\n// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your\n// option. This file may not be copied, modified, or distributed\n// except according to those terms.\n\npub fn main() {\n let world1 = \"world\";\n println!(\"Hello, {}!\", world1);\n let world2 = \"world\";\n println!(\"Hello, {}!\", world2);\nlet world3 = \"world\"; println!(\"Hello, {}!\", world3);\n}\n"#)]);
336336
}
337337

338338
#[test]

test_data/reformat_with_range/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ pub fn main()
1212
{
1313
let world1 = "world"; println!("Hello, {}!", world1);
1414
let world2 = "world"; println!("Hello, {}!", world2);
15+
let world3 = "world"; println!("Hello, {}!", world3);
1516
}

0 commit comments

Comments
 (0)