aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/conv.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server/src/conv.rs')
-rw-r--r--crates/ra_lsp_server/src/conv.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs
index 74e91c236..4d6ede316 100644
--- a/crates/ra_lsp_server/src/conv.rs
+++ b/crates/ra_lsp_server/src/conv.rs
@@ -174,6 +174,28 @@ impl Conv for ra_ide_api::Documentation {
174 } 174 }
175} 175}
176 176
177impl Conv for ra_ide_api::FunctionSignature {
178 type Output = lsp_types::SignatureInformation;
179 fn conv(self) -> Self::Output {
180 use lsp_types::{ParameterInformation, ParameterLabel, SignatureInformation};
181
182 let label = self.to_string();
183
184 let documentation = self.doc.map(|it| it.conv());
185
186 let parameters: Vec<ParameterInformation> = self
187 .parameters
188 .into_iter()
189 .map(|param| ParameterInformation {
190 label: ParameterLabel::Simple(param),
191 documentation: None,
192 })
193 .collect();
194
195 SignatureInformation { label, documentation, parameters: Some(parameters) }
196 }
197}
198
177impl ConvWith for TextEdit { 199impl ConvWith for TextEdit {
178 type Ctx = LineIndex; 200 type Ctx = LineIndex;
179 type Output = Vec<lsp_types::TextEdit>; 201 type Output = Vec<lsp_types::TextEdit>;