diff options
author | Jeremy A. Kolb <[email protected]> | 2018-10-30 18:07:14 +0000 |
---|---|---|
committer | Jeremy A. Kolb <[email protected]> | 2018-10-31 19:23:20 +0000 |
commit | 05eb489ec58fbcd36f8d68c74e42166b345a3a3f (patch) | |
tree | 17083b18fd209334833423728df1a170ea7a3905 /crates/ra_lsp_server/src/main_loop | |
parent | d2bcd1a38636a669d2232156fa29010a82e37a3e (diff) |
Useful comments from function signatures
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 4ac08e527..20cb5f772 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -5,7 +5,7 @@ use languageserver_types::{ | |||
5 | CodeActionResponse, Command, CompletionItem, CompletionItemKind, Diagnostic, | 5 | CodeActionResponse, Command, CompletionItem, CompletionItemKind, Diagnostic, |
6 | DiagnosticSeverity, DocumentSymbol, FoldingRange, FoldingRangeKind, FoldingRangeParams, | 6 | DiagnosticSeverity, DocumentSymbol, FoldingRange, FoldingRangeKind, FoldingRangeParams, |
7 | InsertTextFormat, Location, Position, SymbolInformation, TextDocumentIdentifier, TextEdit, | 7 | InsertTextFormat, Location, Position, SymbolInformation, TextDocumentIdentifier, TextEdit, |
8 | RenameParams, WorkspaceEdit, PrepareRenameResponse | 8 | RenameParams, WorkspaceEdit, PrepareRenameResponse, Documentation, MarkupContent, MarkupKind |
9 | }; | 9 | }; |
10 | use gen_lsp_server::ErrorCode; | 10 | use gen_lsp_server::ErrorCode; |
11 | use ra_analysis::{FileId, FoldKind, Query, RunnableKind}; | 11 | use ra_analysis::{FileId, FoldKind, Query, RunnableKind}; |
@@ -465,9 +465,18 @@ pub fn handle_signature_help( | |||
465 | }) | 465 | }) |
466 | .collect(); | 466 | .collect(); |
467 | 467 | ||
468 | let documentation = if let Some(doc) = descriptor.doc { | ||
469 | Some(Documentation::MarkupContent(MarkupContent { | ||
470 | kind: MarkupKind::Markdown, | ||
471 | value: doc | ||
472 | })) | ||
473 | } else { | ||
474 | None | ||
475 | }; | ||
476 | |||
468 | let sig_info = SignatureInformation { | 477 | let sig_info = SignatureInformation { |
469 | label: descriptor.label, | 478 | label: descriptor.label, |
470 | documentation: None, | 479 | documentation, |
471 | parameters: Some(parameters), | 480 | parameters: Some(parameters), |
472 | }; | 481 | }; |
473 | 482 | ||