MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / setupHover

Function setupHover

packages/monaco/src/lsp.ts:174–203  ·  view source on GitHub ↗
(
    documentUri: string,
    languageId: string,
    connection: ProtocolConnection,
    initResponse: InitializeResult<any>
)

Source from the content-addressed store, hash-verified

172}
173
174function setupHover(
175 documentUri: string,
176 languageId: string,
177 connection: ProtocolConnection,
178 initResponse: InitializeResult<any>
179) {
180 if (!initResponse.capabilities.hoverProvider) {
181 return;
182 }
183
184 // TODO: registration is global, this will break with multiple editors
185 monaco.languages.registerHoverProvider(languageId, {
186 async provideHover(_, position, token) {
187 const params: HoverParams = {
188 position: {
189 line: position.lineNumber - 1,
190 character: position.column - 1
191 },
192 textDocument: {
193 uri: documentUri
194 }
195 };
196 const response = await connection.sendRequest(HoverRequest.type, params, token);
197 if (response === null) {
198 return null;
199 }
200 return lspToMonacoHover(response);
201 }
202 });
203}
204
205function setupSignatureHelp(
206 documentUri: string,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected