mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2026-05-02 23:25:50 +00:00
Switch hover to use MarkupContent
MarkedString is deprecated
This commit is contained in:
@@ -4,7 +4,7 @@ use gen_lsp_server::ErrorCode;
|
|||||||
use languageserver_types::{
|
use languageserver_types::{
|
||||||
CodeActionResponse, Command, Diagnostic, DiagnosticSeverity, DocumentFormattingParams,
|
CodeActionResponse, Command, Diagnostic, DiagnosticSeverity, DocumentFormattingParams,
|
||||||
DocumentHighlight, DocumentSymbol, Documentation, FoldingRange, FoldingRangeKind,
|
DocumentHighlight, DocumentSymbol, Documentation, FoldingRange, FoldingRangeKind,
|
||||||
FoldingRangeParams, Hover, HoverContents, Location, MarkedString, MarkupContent, MarkupKind,
|
FoldingRangeParams, Hover, HoverContents, Location, MarkupContent, MarkupKind,
|
||||||
ParameterInformation, ParameterLabel, Position, PrepareRenameResponse, Range, RenameParams,
|
ParameterInformation, ParameterLabel, Position, PrepareRenameResponse, Range, RenameParams,
|
||||||
SignatureInformation, SymbolInformation, TextDocumentIdentifier, TextEdit, WorkspaceEdit,
|
SignatureInformation, SymbolInformation, TextDocumentIdentifier, TextEdit, WorkspaceEdit,
|
||||||
};
|
};
|
||||||
@@ -515,7 +515,10 @@ pub fn handle_hover(
|
|||||||
let line_index = world.analysis.file_line_index(position.file_id);
|
let line_index = world.analysis.file_line_index(position.file_id);
|
||||||
let range = info.range.conv_with(&line_index);
|
let range = info.range.conv_with(&line_index);
|
||||||
let res = Hover {
|
let res = Hover {
|
||||||
contents: HoverContents::Scalar(MarkedString::String(info.info)),
|
contents: HoverContents::Markup(MarkupContent {
|
||||||
|
kind: MarkupKind::Markdown,
|
||||||
|
value: info.info,
|
||||||
|
}),
|
||||||
range: Some(range),
|
range: Some(range),
|
||||||
};
|
};
|
||||||
Ok(Some(res))
|
Ok(Some(res))
|
||||||
|
|||||||
Reference in New Issue
Block a user