Skip to content

Commit 869847d

Browse files
dimblebyautozimu
authored andcommitted
Update lsp_types
1 parent 8098958 commit 869847d

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
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
@@ -20,7 +20,7 @@ serde_json = "1"
2020
crossbeam-channel = "0.3"
2121

2222
jsonrpc-core = "12"
23-
lsp-types = "0.57"
23+
lsp-types = "0.58"
2424
url = "1"
2525
pathdiff = "0"
2626
diff = "0"

src/language_server_protocol.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,19 +1240,19 @@ impl LanguageClient {
12401240

12411241
// Convert any Commands into CodeActions, so that the remainder of the handling can be
12421242
// shared.
1243-
let actions = match response {
1244-
CodeActionResponse::Commands(commands) => commands
1245-
.into_iter()
1246-
.map(|command| CodeAction {
1243+
let actions: Vec<_> = response
1244+
.into_iter()
1245+
.map(|action_or_command| match action_or_command {
1246+
CodeActionOrCommand::Command(command) => CodeAction {
12471247
title: command.title.clone(),
12481248
kind: Some(command.command.clone()),
12491249
diagnostics: None,
12501250
edit: None,
12511251
command: Some(command),
1252-
})
1253-
.collect(),
1254-
CodeActionResponse::Actions(actions) => actions,
1255-
};
1252+
},
1253+
CodeActionOrCommand::CodeAction(action) => action,
1254+
})
1255+
.collect();
12561256

12571257
let source: Vec<_> = actions
12581258
.iter()

0 commit comments

Comments
 (0)