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

Commit 663e437

Browse files
committed
Fix definitions test
Pulls lsp-codec 0.1.1 due to message send buffer reservation fix.
1 parent c1d705d commit 663e437

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ rustc-workspace-hack = "1.0.0"
6161
[dev-dependencies]
6262
difference = "2"
6363
tempfile = "3"
64-
lsp-codec = "0.1"
64+
lsp-codec = "0.1.1"
6565
tokio = "0.1"
6666
futures = "0.1"
6767
tokio-process = "0.2"

tests/client.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,13 @@ fn client_find_definitions() {
10521052
process_id: None,
10531053
root_uri: None,
10541054
root_path: Some(root_path.display().to_string()),
1055-
initialization_options: Some(json!({"settings.rust.racer_completion": false})),
1055+
initialization_options: Some(json!({
1056+
"settings": {
1057+
"rust": {
1058+
"racer_completion": false
1059+
}
1060+
}
1061+
})),
10561062
capabilities: Default::default(),
10571063
trace: None,
10581064
workspace_folders: None,
@@ -1071,13 +1077,13 @@ fn client_find_definitions() {
10711077
}
10721078
});
10731079

1074-
let ranges = result.into_iter().flat_map(|x| match x {
1080+
let ranges: Vec<_> = result.into_iter().flat_map(|x| match x {
10751081
GotoDefinitionResponse::Scalar(loc) => vec![loc].into_iter(),
10761082
GotoDefinitionResponse::Array(locs) => locs.into_iter(),
10771083
_ => unreachable!(),
10781084
}).map(|x| x.range).collect();
10791085

1080-
if !results.is_empty() {
1086+
if !ranges.is_empty() {
10811087
results.push((line_index, i, ranges));
10821088
}
10831089
}

0 commit comments

Comments
 (0)