File tree 3 files changed +16
-3
lines changed 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ impl LsifManager<'_> {
136
136
result : lsp_types:: Hover {
137
137
contents : lsp_types:: HoverContents :: Markup ( to_proto:: markup_content (
138
138
hover. markup ,
139
+ ide:: HoverDocFormat :: Markdown ,
139
140
) ) ,
140
141
range : None ,
141
142
} ,
Original file line number Diff line number Diff line change @@ -920,9 +920,14 @@ pub(crate) fn handle_hover(
920
920
921
921
let line_index = snap. file_line_index ( file_range. file_id ) ?;
922
922
let range = to_proto:: range ( & line_index, info. range ) ;
923
+ let markup_kind =
924
+ snap. config . hover ( ) . documentation . map_or ( ide:: HoverDocFormat :: Markdown , |kind| kind) ;
923
925
let hover = lsp_ext:: Hover {
924
926
hover : lsp_types:: Hover {
925
- contents : HoverContents :: Markup ( to_proto:: markup_content ( info. info . markup ) ) ,
927
+ contents : HoverContents :: Markup ( to_proto:: markup_content (
928
+ info. info . markup ,
929
+ markup_kind,
930
+ ) ) ,
926
931
range : Some ( range) ,
927
932
} ,
928
933
actions : if snap. config . hover_actions ( ) . none ( ) {
Original file line number Diff line number Diff line change @@ -1202,9 +1202,16 @@ pub(crate) fn reference_title(count: usize) -> String {
1202
1202
}
1203
1203
}
1204
1204
1205
- pub ( crate ) fn markup_content ( markup : Markup ) -> lsp_types:: MarkupContent {
1205
+ pub ( crate ) fn markup_content (
1206
+ markup : Markup ,
1207
+ kind : ide:: HoverDocFormat ,
1208
+ ) -> lsp_types:: MarkupContent {
1209
+ let kind = match kind {
1210
+ ide:: HoverDocFormat :: Markdown => lsp_types:: MarkupKind :: Markdown ,
1211
+ ide:: HoverDocFormat :: PlainText => lsp_types:: MarkupKind :: PlainText ,
1212
+ } ;
1206
1213
let value = crate :: markdown:: format_docs ( markup. as_str ( ) ) ;
1207
- lsp_types:: MarkupContent { kind : lsp_types :: MarkupKind :: Markdown , value }
1214
+ lsp_types:: MarkupContent { kind, value }
1208
1215
}
1209
1216
1210
1217
pub ( crate ) fn rename_error ( err : RenameError ) -> crate :: LspError {
You can’t perform that action at this time.
0 commit comments