Prepare editor to display multiple LSP hover responses for the same place (#9868)
This commit is contained in:
parent
ce37885f49
commit
80242584e7
3 changed files with 163 additions and 106 deletions
|
@ -5189,20 +5189,22 @@ impl Project {
|
|||
buffer: &Model<Buffer>,
|
||||
position: PointUtf16,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> Task<Result<Option<Hover>>> {
|
||||
self.request_lsp(
|
||||
) -> Task<Result<Vec<Hover>>> {
|
||||
let request_task = self.request_lsp(
|
||||
buffer.clone(),
|
||||
LanguageServerToQuery::Primary,
|
||||
GetHover { position },
|
||||
cx,
|
||||
)
|
||||
);
|
||||
cx.spawn(|_, _| async move { request_task.await.map(|hover| hover.into_iter().collect()) })
|
||||
}
|
||||
|
||||
pub fn hover<T: ToPointUtf16>(
|
||||
&self,
|
||||
buffer: &Model<Buffer>,
|
||||
position: T,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> Task<Result<Option<Hover>>> {
|
||||
) -> Task<Result<Vec<Hover>>> {
|
||||
let position = position.to_point_utf16(buffer.read(cx));
|
||||
self.hover_impl(buffer, position, cx)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue