diff options
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r-- | crates/ra_lsp_server/src/conv.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index 23b226fac..6818acaf6 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use lsp_types::{ | 1 | use lsp_types::{ |
2 | self, CreateFile, DocumentChangeOperation, DocumentChanges, Location, LocationLink, | 2 | self, CreateFile, Documentation, DocumentChangeOperation, DocumentChanges, Location, LocationLink, |
3 | Position, Range, RenameFile, ResourceOp, SymbolKind, TextDocumentEdit, TextDocumentIdentifier, | 3 | MarkupContent, MarkupKind, Position, Range, RenameFile, ResourceOp, SymbolKind, TextDocumentEdit, TextDocumentIdentifier, |
4 | TextDocumentItem, TextDocumentPositionParams, Url, VersionedTextDocumentIdentifier, | 4 | TextDocumentItem, TextDocumentPositionParams, Url, VersionedTextDocumentIdentifier, |
5 | WorkspaceEdit, | 5 | WorkspaceEdit, |
6 | }; | 6 | }; |
@@ -87,6 +87,13 @@ impl ConvWith for CompletionItem { | |||
87 | None | 87 | None |
88 | }; | 88 | }; |
89 | 89 | ||
90 | let documentation = self.documentation().map(|value| { | ||
91 | Documentation::MarkupContent(MarkupContent { | ||
92 | kind: MarkupKind::Markdown, | ||
93 | value: value.to_string(), | ||
94 | }) | ||
95 | }); | ||
96 | |||
90 | let mut res = lsp_types::CompletionItem { | 97 | let mut res = lsp_types::CompletionItem { |
91 | label: self.label().to_string(), | 98 | label: self.label().to_string(), |
92 | detail: self.detail().map(|it| it.to_string()), | 99 | detail: self.detail().map(|it| it.to_string()), |
@@ -94,6 +101,7 @@ impl ConvWith for CompletionItem { | |||
94 | kind: self.kind().map(|it| it.conv()), | 101 | kind: self.kind().map(|it| it.conv()), |
95 | text_edit: Some(text_edit), | 102 | text_edit: Some(text_edit), |
96 | additional_text_edits, | 103 | additional_text_edits, |
104 | documentation: documentation, | ||
97 | ..Default::default() | 105 | ..Default::default() |
98 | }; | 106 | }; |
99 | res.insert_text_format = Some(match self.insert_text_format() { | 107 | res.insert_text_format = Some(match self.insert_text_format() { |