| 288 | } |
| 289 | |
| 290 | export class HoverAdapter implements languages.HoverProvider { |
| 291 | constructor(private _worker: WorkerAccessor) {} |
| 292 | |
| 293 | async provideHover( |
| 294 | model: editor.IReadOnlyModel, |
| 295 | position: monaco.Position, |
| 296 | _token: monaco.CancellationToken, |
| 297 | ): Promise<languages.Hover> { |
| 298 | const resource = model.uri; |
| 299 | const worker = await this._worker(model.uri); |
| 300 | const hoverItem = await worker.doHover(resource.toString(), position); |
| 301 | |
| 302 | if (hoverItem) { |
| 303 | return { |
| 304 | range: hoverItem.range, |
| 305 | contents: [{ value: hoverItem.content as string }], |
| 306 | }; |
| 307 | } |
| 308 | |
| 309 | return { |
| 310 | contents: [], |
| 311 | }; |
| 312 | } |
| 313 | |
| 314 | dispose() {} |
| 315 | } |
nothing calls this directly
no outgoing calls
no test coverage detected