MCPcopy
hub / github.com/graphql/graphiql / HoverAdapter

Class HoverAdapter

packages/monaco-graphql/src/languageFeatures.ts:290–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected