Skip to content

Commit c6a6e43

Browse files
bors[bot]kjeremy
andcommitted
Merge #1484
1484: Update to lsp-types 0.58.0 r=matklad a=kjeremy Fixes CodeActionResponse Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2 parents cf8e59d + a394c04 commit c6a6e43

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

Cargo.lock

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

crates/gen_lsp_server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
88
description = "Generic LSP server scaffold."
99

1010
[dependencies]
11-
lsp-types = "0.57.0"
11+
lsp-types = "0.58.0"
1212
log = "0.4.3"
1313
serde_json = "1.0.34"
1414
serde = { version = "1.0.83", features = ["derive"] }

crates/ra_lsp_server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ crossbeam-channel = "0.3.5"
1313
flexi_logger = "0.13.0"
1414
log = "0.4.3"
1515
url_serde = "0.2.0"
16-
lsp-types = { version = "0.57.1", features = ["proposed"] }
16+
lsp-types = { version = "0.58.0", features = ["proposed"] }
1717
rustc-hash = "1.0"
1818
parking_lot = "0.8.0"
1919

crates/ra_lsp_server/src/main_loop/handlers.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ use std::{fmt::Write as _, io::Write as _};
22

33
use gen_lsp_server::ErrorCode;
44
use lsp_types::{
5-
CodeAction, CodeActionResponse, CodeLens, Command, Diagnostic, DiagnosticSeverity,
6-
DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeKind,
7-
FoldingRangeParams, Hover, HoverContents, Location, MarkupContent, MarkupKind, Position,
8-
PrepareRenameResponse, Range, RenameParams, SymbolInformation, TextDocumentIdentifier,
9-
TextEdit, WorkspaceEdit,
5+
CodeAction, CodeActionOrCommand, CodeActionResponse, CodeLens, Command, Diagnostic,
6+
DiagnosticSeverity, DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange,
7+
FoldingRangeKind, FoldingRangeParams, Hover, HoverContents, Location, MarkupContent,
8+
MarkupKind, Position, PrepareRenameResponse, Range, RenameParams, SymbolInformation,
9+
TextDocumentIdentifier, TextEdit, WorkspaceEdit,
1010
};
1111
use ra_ide_api::{
1212
AssistId, Cancelable, FileId, FilePosition, FileRange, FoldKind, Query, RangeInfo,
@@ -665,7 +665,7 @@ pub fn handle_code_action(
665665

666666
let assists = world.analysis().assists(FileRange { file_id, range })?.into_iter();
667667
let diagnostics = world.analysis().diagnostics(file_id)?;
668-
let mut res: Vec<CodeAction> = Vec::new();
668+
let mut res = CodeActionResponse::default();
669669

670670
let fixes_from_diagnostics = diagnostics
671671
.into_iter()
@@ -689,7 +689,7 @@ pub fn handle_code_action(
689689
edit: None,
690690
command: Some(command),
691691
};
692-
res.push(action);
692+
res.push(CodeActionOrCommand::CodeAction(action));
693693
}
694694

695695
for assist in assists {
@@ -711,10 +711,10 @@ pub fn handle_code_action(
711711
edit: None,
712712
command: Some(command),
713713
};
714-
res.push(action);
714+
res.push(CodeActionOrCommand::CodeAction(action));
715715
}
716716

717-
Ok(Some(CodeActionResponse::Actions(res)))
717+
Ok(Some(res))
718718
}
719719

720720
pub fn handle_code_lens(

0 commit comments

Comments
 (0)