mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Useful comments from function signatures
This commit is contained in:
parent
d2bcd1a386
commit
05eb489ec5
5 changed files with 217 additions and 7 deletions
|
@ -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),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue