|
3 | 3 |
|
4 | 4 | use lsp_types::{ |
5 | 5 | self, CreateFile, DiagnosticSeverity, DocumentChangeOperation, DocumentChanges, Documentation, |
6 | | - Location, LocationLink, MarkupContent, MarkupKind, Position, Range, RenameFile, ResourceOp, |
7 | | - SemanticTokenModifier, SemanticTokenType, SymbolKind, TextDocumentEdit, TextDocumentIdentifier, |
8 | | - TextDocumentItem, TextDocumentPositionParams, Url, VersionedTextDocumentIdentifier, |
9 | | - WorkspaceEdit, |
| 6 | + Location, LocationLink, MarkupContent, MarkupKind, ParameterInformation, ParameterLabel, |
| 7 | + Position, Range, RenameFile, ResourceOp, SemanticTokenModifier, SemanticTokenType, |
| 8 | + SignatureInformation, SymbolKind, TextDocumentEdit, TextDocumentIdentifier, TextDocumentItem, |
| 9 | + TextDocumentPositionParams, Url, VersionedTextDocumentIdentifier, WorkspaceEdit, |
10 | 10 | }; |
11 | 11 | use ra_ide::{ |
12 | 12 | translate_offset_with_edit, CompletionItem, CompletionItemKind, FileId, FilePosition, |
@@ -220,17 +220,20 @@ impl Conv for ra_ide::Documentation { |
220 | 220 | } |
221 | 221 | } |
222 | 222 |
|
223 | | -impl Conv for ra_ide::FunctionSignature { |
| 223 | +impl ConvWith<bool> for ra_ide::FunctionSignature { |
224 | 224 | type Output = lsp_types::SignatureInformation; |
225 | | - fn conv(self) -> Self::Output { |
226 | | - use lsp_types::{ParameterInformation, ParameterLabel, SignatureInformation}; |
227 | | - |
228 | | - let label = self.to_string(); |
229 | | - |
230 | | - let documentation = self.doc.map(|it| it.conv()); |
| 225 | + fn conv_with(self, concise: bool) -> Self::Output { |
| 226 | + let (label, documentation, params) = if concise { |
| 227 | + let mut params = self.parameters; |
| 228 | + if self.has_self_param { |
| 229 | + params.remove(0); |
| 230 | + } |
| 231 | + (params.join(", "), None, params) |
| 232 | + } else { |
| 233 | + (self.to_string(), self.doc.map(|it| it.conv()), self.parameters) |
| 234 | + }; |
231 | 235 |
|
232 | | - let parameters: Vec<ParameterInformation> = self |
233 | | - .parameters |
| 236 | + let parameters: Vec<ParameterInformation> = params |
234 | 237 | .into_iter() |
235 | 238 | .map(|param| ParameterInformation { |
236 | 239 | label: ParameterLabel::Simple(param), |
|
0 commit comments