mirror of
https://github.com/helix-editor/helix.git
synced 2025-10-06 00:13:28 +02:00
minor: Move json deserialization into text_document_hover future
This follows a pattern used in the signature help request for example. Moving the json deserialization into the return future of `text_document_hover` makes the types easier for callers to work with.
This commit is contained in:
@@ -1119,7 +1119,7 @@ impl Client {
|
||||
text_document: lsp::TextDocumentIdentifier,
|
||||
position: lsp::Position,
|
||||
work_done_token: Option<lsp::ProgressToken>,
|
||||
) -> Option<impl Future<Output = Result<Value>>> {
|
||||
) -> Option<impl Future<Output = Result<Option<lsp::Hover>>>> {
|
||||
let capabilities = self.capabilities.get().unwrap();
|
||||
|
||||
// Return early if the server does not support hover.
|
||||
@@ -1140,7 +1140,8 @@ impl Client {
|
||||
// lsp::SignatureHelpContext
|
||||
};
|
||||
|
||||
Some(self.call::<lsp::request::HoverRequest>(params))
|
||||
let res = self.call::<lsp::request::HoverRequest>(params);
|
||||
Some(async move { Ok(serde_json::from_value(res.await?)?) })
|
||||
}
|
||||
|
||||
// formatting
|
||||
|
Reference in New Issue
Block a user