| 349 | } |
| 350 | |
| 351 | function hoverRequest(plugin: LSPPlugin, pos: number) { |
| 352 | const client = plugin.client as typeof plugin.client & LspClientInternals; |
| 353 | if (client.hasCapability?.("hoverProvider") === false) { |
| 354 | return Promise.resolve(null); |
| 355 | } |
| 356 | |
| 357 | plugin.client.sync(); |
| 358 | return plugin.client.request<HoverParams, Hover | null>( |
| 359 | "textDocument/hover", |
| 360 | { |
| 361 | position: plugin.toPosition(pos), |
| 362 | textDocument: { uri: plugin.uri }, |
| 363 | }, |
| 364 | ); |
| 365 | } |
| 366 | |
| 367 | function lspTooltipSource( |
| 368 | view: EditorView, |