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

Method doHover

packages/monaco-graphql/src/GraphQLWorker.ts:77–109  ·  view source on GitHub ↗
(uri: string, position: monaco.Position)

Source from the content-addressed store, hash-verified

75 }
76
77 public async doHover(uri: string, position: monaco.Position) {
78 try {
79 const documentModel = this._getTextModel(uri);
80 const document = documentModel?.getValue();
81 if (!document) {
82 return null;
83 }
84 const graphQLPosition = toGraphQLPosition(position);
85
86 const hover = this._languageService.getHover(
87 uri,
88 document,
89 graphQLPosition,
90 );
91
92 return {
93 content: hover,
94 range: toMonacoRange(
95 getRange(
96 {
97 column: graphQLPosition.character,
98 line: graphQLPosition.line,
99 },
100 document,
101 ),
102 ),
103 };
104 } catch (err) {
105 // eslint-disable-next-line no-console
106 console.error(err);
107 return null;
108 }
109 }
110
111 public async doGetVariablesJSONSchema(uri: string): Promise<unknown> {
112 const documentModel = this._getTextModel(uri);

Callers 1

provideHoverMethod · 0.80

Calls 5

_getTextModelMethod · 0.95
toGraphQLPositionFunction · 0.90
toMonacoRangeFunction · 0.90
getRangeFunction · 0.90
errorMethod · 0.45

Tested by

no test coverage detected