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

Commit

Permalink
Fix definitions test
Browse files Browse the repository at this point in the history
Pulls lsp-codec 0.1.1 due to message send buffer reservation fix.
  • Loading branch information
Xanewok committed Jan 22, 2019
1 parent c1d705d commit 663e437
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ rustc-workspace-hack = "1.0.0"
[dev-dependencies]
difference = "2"
tempfile = "3"
lsp-codec = "0.1"
lsp-codec = "0.1.1"
tokio = "0.1"
futures = "0.1"
tokio-process = "0.2"
Expand Down
12 changes: 9 additions & 3 deletions tests/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,13 @@ fn client_find_definitions() {
process_id: None,
root_uri: None,
root_path: Some(root_path.display().to_string()),
initialization_options: Some(json!({"settings.rust.racer_completion": false})),
initialization_options: Some(json!({
"settings": {
"rust": {
"racer_completion": false
}
}
})),
capabilities: Default::default(),
trace: None,
workspace_folders: None,
Expand All @@ -1071,13 +1077,13 @@ fn client_find_definitions() {
}
});

let ranges = result.into_iter().flat_map(|x| match x {
let ranges: Vec<_> = result.into_iter().flat_map(|x| match x {
GotoDefinitionResponse::Scalar(loc) => vec![loc].into_iter(),
GotoDefinitionResponse::Array(locs) => locs.into_iter(),
_ => unreachable!(),
}).map(|x| x.range).collect();

if !results.is_empty() {
if !ranges.is_empty() {
results.push((line_index, i, ranges));
}
}
Expand Down

0 comments on commit 663e437

Please sign in to comment.