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

Commit b06cbba

Browse files
committed
Auto merge of #1545 - mati865:update-deps, r=Xanewok
Update dependencies
2 parents 8851e1a + ef71516 commit b06cbba

File tree

7 files changed

+743
-668
lines changed

7 files changed

+743
-668
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ cargo_metadata = "0.8"
3333
clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "72da1015d6d918fe1b29170acbf486d30e0c2695", optional = true }
3434
env_logger = "0.6"
3535
failure = "0.1.1"
36-
home = "0.3"
36+
home = "0.5"
3737
itertools = "0.8"
3838
jsonrpc-core = "12"
39-
lsp-types = { version = "=0.57.2", features = ["proposed"] }
39+
lsp-types = { version = "0.60", features = ["proposed"] }
4040
lazy_static = "1"
4141
log = "0.4"
4242
num_cpus = "1"
@@ -49,8 +49,8 @@ rustc-serialize = "0.3"
4949
serde = "1.0"
5050
serde_json = "1.0"
5151
serde_derive = "1.0"
52-
serde_ignored = "0.0"
53-
url = "1"
52+
serde_ignored = "0.1"
53+
url = "2"
5454
walkdir = "2"
5555
regex = "1"
5656
ordslice = "0.3"

rls/src/actions/requests.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,9 @@ impl RequestAction for References {
223223
ctx: InitActionContext,
224224
params: Self::Params,
225225
) -> Result<Self::Response, ResponseError> {
226-
let file_path = parse_file_path!(&params.text_document.uri, "find_all_refs")?;
227-
let span = ctx.convert_pos_to_span(file_path, params.position);
226+
let file_path =
227+
parse_file_path!(&params.text_document_position.text_document.uri, "find_all_refs")?;
228+
let span = ctx.convert_pos_to_span(file_path, params.text_document_position.position);
228229

229230
let result =
230231
match ctx.analysis.find_all_refs(&span, params.context.include_declaration, false) {
@@ -251,12 +252,13 @@ impl RequestAction for Completion {
251252
return Self::fallback_response();
252253
}
253254

254-
let file_path = parse_file_path!(&params.text_document.uri, "complete")?;
255+
let file_path =
256+
parse_file_path!(&params.text_document_position.text_document.uri, "complete")?;
255257

256258
let cache = ctx.racer_cache();
257259
let session = ctx.racer_session(&cache);
258260

259-
let location = pos_to_racer_location(params.position);
261+
let location = pos_to_racer_location(params.text_document_position.position);
260262
let results = racer::complete_from_file(&file_path, location, &session);
261263
let is_use_stmt = racer::is_use_stmt(&file_path, location, &session);
262264

@@ -329,8 +331,9 @@ impl RequestAction for Rename {
329331
// data is ready.
330332
ctx.block_on_build();
331333

332-
let file_path = parse_file_path!(&params.text_document.uri, "rename")?;
333-
let span = ctx.convert_pos_to_span(file_path, params.position);
334+
let file_path =
335+
parse_file_path!(&params.text_document_position.text_document.uri, "rename")?;
336+
let span = ctx.convert_pos_to_span(file_path, params.text_document_position.position);
334337

335338
let analysis = ctx.analysis;
336339

rls/src/build/cargo_plan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ impl CargoPlan {
329329
) {
330330
if !visited.contains(unit) {
331331
visited.insert(unit.clone());
332-
for neighbour in graph.get(unit).into_iter().flat_map(|nodes| nodes) {
332+
for neighbour in graph.get(unit).into_iter().flatten() {
333333
dfs(neighbour, graph, visited, output);
334334
}
335335
output.push(unit.clone());

rls/src/cmd.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,13 @@ fn def(file_name: &str, row: &str, col: &str) -> Request<requests::Definition> {
185185

186186
fn rename(file_name: &str, row: &str, col: &str, new_name: &str) -> Request<requests::Rename> {
187187
let params = RenameParams {
188-
text_document: TextDocumentIdentifier::new(url(file_name)),
189-
position: Position::new(
190-
u64::from_str(row).expect("Bad line number"),
191-
u64::from_str(col).expect("Bad column number"),
192-
),
188+
text_document_position: TextDocumentPositionParams {
189+
text_document: TextDocumentIdentifier::new(url(file_name)),
190+
position: Position::new(
191+
u64::from_str(row).expect("Bad line number"),
192+
u64::from_str(col).expect("Bad column number"),
193+
),
194+
},
193195
new_name: new_name.to_owned(),
194196
};
195197
Request { id: next_id(), params, received: Instant::now(), _action: PhantomData }

tests/client.rs

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,11 @@ fn client_test_complete_self_crate_name() {
439439
trigger_character: Some(":".to_string()),
440440
trigger_kind: CompletionTriggerKind::TriggerCharacter,
441441
}),
442-
position: Position::new(2, 32),
443-
text_document: TextDocumentIdentifier {
444-
uri: Url::from_file_path(p.root().join("library/tests/test.rs")).unwrap(),
442+
text_document_position: TextDocumentPositionParams {
443+
position: Position::new(2, 32),
444+
text_document: TextDocumentIdentifier {
445+
uri: Url::from_file_path(p.root().join("library/tests/test.rs")).unwrap(),
446+
},
445447
},
446448
},
447449
);
@@ -537,9 +539,11 @@ fn client_completion_suggests_arguments_in_statements() {
537539
trigger_character: Some("f".to_string()),
538540
trigger_kind: CompletionTriggerKind::TriggerCharacter,
539541
}),
540-
position: Position::new(3, 41),
541-
text_document: TextDocumentIdentifier {
542-
uri: Url::from_file_path(p.root().join("library/tests/test.rs")).unwrap(),
542+
text_document_position: TextDocumentPositionParams {
543+
position: Position::new(3, 41),
544+
text_document: TextDocumentIdentifier {
545+
uri: Url::from_file_path(p.root().join("library/tests/test.rs")).unwrap(),
546+
},
543547
},
544548
},
545549
);
@@ -603,9 +607,11 @@ fn client_use_statement_completion_doesnt_suggest_arguments() {
603607
trigger_character: Some(":".to_string()),
604608
trigger_kind: CompletionTriggerKind::TriggerCharacter,
605609
}),
606-
position: Position::new(2, 32),
607-
text_document: TextDocumentIdentifier {
608-
uri: Url::from_file_path(p.root().join("library/tests/test.rs")).unwrap(),
610+
text_document_position: TextDocumentPositionParams {
611+
position: Position::new(2, 32),
612+
text_document: TextDocumentIdentifier {
613+
uri: Url::from_file_path(p.root().join("library/tests/test.rs")).unwrap(),
614+
},
609615
},
610616
},
611617
);
@@ -1153,13 +1159,10 @@ fn client_deglob() {
11531159
// Right now we only support deglobbing via commands. Please update this
11541160
// test if we move to making text edits via CodeAction (which we should for
11551161
// deglobbing);
1156-
let Command { title, command, arguments, .. } = match commands {
1157-
CodeActionResponse::Commands(commands) => commands,
1158-
CodeActionResponse::Actions(_) => unimplemented!(),
1159-
}
1160-
.into_iter()
1161-
.nth(0)
1162-
.unwrap();
1162+
let Command { title, command, arguments, .. } = match commands.into_iter().nth(0).unwrap() {
1163+
CodeActionOrCommand::Command(commands) => commands,
1164+
CodeActionOrCommand::CodeAction(_) => unimplemented!(),
1165+
};
11631166

11641167
let arguments = arguments.expect("Missing command arguments");
11651168

@@ -1214,13 +1217,10 @@ fn client_deglob() {
12141217
// Right now we only support deglobbing via commands. Please update this
12151218
// test if we move to making text edits via CodeAction (which we should for
12161219
// deglobbing);
1217-
let Command { title, command, arguments, .. } = match commands {
1218-
CodeActionResponse::Commands(commands) => commands,
1219-
CodeActionResponse::Actions(_) => unimplemented!(),
1220-
}
1221-
.into_iter()
1222-
.nth(0)
1223-
.unwrap();
1220+
let Command { title, command, arguments, .. } = match commands.into_iter().nth(0).unwrap() {
1221+
CodeActionOrCommand::Command(commands) => commands,
1222+
CodeActionOrCommand::CodeAction(_) => unimplemented!(),
1223+
};
12241224

12251225
let arguments = arguments.expect("Missing command arguments");
12261226

@@ -1605,10 +1605,12 @@ fn client_find_all_refs_test() {
16051605
.request::<References>(
16061606
42,
16071607
ReferenceParams {
1608-
text_document: TextDocumentIdentifier {
1609-
uri: Url::from_file_path(p.root().join("src/main.rs")).unwrap(),
1608+
text_document_position: TextDocumentPositionParams {
1609+
text_document: TextDocumentIdentifier {
1610+
uri: Url::from_file_path(p.root().join("src/main.rs")).unwrap(),
1611+
},
1612+
position: Position { line: 0, character: 7 },
16101613
},
1611-
position: Position { line: 0, character: 7 },
16121614
context: ReferenceContext { include_declaration: true },
16131615
},
16141616
)
@@ -1643,10 +1645,12 @@ fn client_find_all_refs_no_cfg_test() {
16431645
.request::<References>(
16441646
42,
16451647
ReferenceParams {
1646-
text_document: TextDocumentIdentifier {
1647-
uri: Url::from_file_path(p.root().join("src/main.rs")).unwrap(),
1648+
text_document_position: TextDocumentPositionParams {
1649+
text_document: TextDocumentIdentifier {
1650+
uri: Url::from_file_path(p.root().join("src/main.rs")).unwrap(),
1651+
},
1652+
position: Position { line: 0, character: 7 },
16481653
},
1649-
position: Position { line: 0, character: 7 },
16501654
context: ReferenceContext { include_declaration: true },
16511655
},
16521656
)
@@ -1730,9 +1734,11 @@ fn client_rename() {
17301734
.request::<Rename>(
17311735
42,
17321736
RenameParams {
1733-
position: Position { line: 12, character: 27 },
1734-
text_document: TextDocumentIdentifier {
1735-
uri: Url::from_file_path(p.root().join("src/main.rs")).unwrap(),
1737+
text_document_position: TextDocumentPositionParams {
1738+
position: Position { line: 12, character: 27 },
1739+
text_document: TextDocumentIdentifier {
1740+
uri: Url::from_file_path(p.root().join("src/main.rs")).unwrap(),
1741+
},
17361742
},
17371743
new_name: "foo".to_owned(),
17381744
},
@@ -1895,8 +1901,10 @@ fn client_completion() {
18951901
let result = rls.request::<Completion>(
18961902
11,
18971903
CompletionParams {
1898-
text_document: text_document.clone(),
1899-
position: Position { line: 12, character: 30 },
1904+
text_document_position: TextDocumentPositionParams {
1905+
text_document: text_document.clone(),
1906+
position: Position { line: 12, character: 30 },
1907+
},
19001908
context: None,
19011909
},
19021910
);
@@ -1905,8 +1913,10 @@ fn client_completion() {
19051913
let result = rls.request::<Completion>(
19061914
11,
19071915
CompletionParams {
1908-
text_document: text_document.clone(),
1909-
position: Position { line: 15, character: 30 },
1916+
text_document_position: TextDocumentPositionParams {
1917+
text_document: text_document.clone(),
1918+
position: Position { line: 15, character: 30 },
1919+
},
19101920
context: None,
19111921
},
19121922
);

tests/support/paths.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::path::{Path, PathBuf};
99
use std::sync::atomic::{AtomicUsize, Ordering};
1010
use std::sync::Once;
1111

12-
static RLS_INTEGRATION_TEST_DIR: &'static str = "rlsit";
12+
static RLS_INTEGRATION_TEST_DIR: &str = "rlsit";
1313
static NEXT_ID: AtomicUsize = AtomicUsize::new(0);
1414

1515
thread_local!(static TASK_ID: usize = NEXT_ID.fetch_add(1, Ordering::SeqCst));

0 commit comments

Comments
 (0)