From 05eb489ec58fbcd36f8d68c74e42166b345a3a3f Mon Sep 17 00:00:00 2001 From: "Jeremy A. Kolb" Date: Tue, 30 Oct 2018 14:07:14 -0400 Subject: Useful comments from function signatures --- crates/ra_lsp_server/src/main_loop/handlers.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'crates/ra_lsp_server/src/main_loop') 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::{ CodeActionResponse, Command, CompletionItem, CompletionItemKind, Diagnostic, DiagnosticSeverity, DocumentSymbol, FoldingRange, FoldingRangeKind, FoldingRangeParams, InsertTextFormat, Location, Position, SymbolInformation, TextDocumentIdentifier, TextEdit, - RenameParams, WorkspaceEdit, PrepareRenameResponse + RenameParams, WorkspaceEdit, PrepareRenameResponse, Documentation, MarkupContent, MarkupKind }; use gen_lsp_server::ErrorCode; use ra_analysis::{FileId, FoldKind, Query, RunnableKind}; @@ -465,9 +465,18 @@ pub fn handle_signature_help( }) .collect(); + let documentation = if let Some(doc) = descriptor.doc { + Some(Documentation::MarkupContent(MarkupContent { + kind: MarkupKind::Markdown, + value: doc + })) + } else { + None + }; + let sig_info = SignatureInformation { label: descriptor.label, - documentation: None, + documentation, parameters: Some(parameters), }; -- cgit v1.2.3