MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / collectHoverLanguages

Function collectHoverLanguages

src/cm/lsp/tooltipExtensions.ts:228–242  ·  view source on GitHub ↗
(
	contents: Hover["contents"],
	result = new Set<string>(),
)

Source from the content-addressed store, hash-verified

226}
227
228function collectHoverLanguages(
229 contents: Hover["contents"],
230 result = new Set<string>(),
231): Set<string> {
232 if (Array.isArray(contents)) {
233 contents.forEach((content) => collectHoverLanguages(content, result));
234 } else if (typeof contents === "string") {
235 collectMarkdownLanguages(contents, result);
236 } else if ("language" in contents) {
237 if (contents.language) result.add(contents.language);
238 } else if (contents.kind === "markdown") {
239 collectMarkdownLanguages(contents.value, result);
240 }
241 return result;
242}
243
244async function loadHoverContentLanguages(contents: Hover["contents"]): Promise<void> {
245 const languageTags = collectHoverLanguages(contents);

Callers 1

Calls 2

collectMarkdownLanguagesFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected