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

Function getServersForLanguage

src/cm/lsp/serverRegistry.ts:407–419  ·  view source on GitHub ↗
(
	languageId: string,
	options: GetServersOptions = {},
)

Source from the content-addressed store, hash-verified

405}
406
407export function getServersForLanguage(
408 languageId: string,
409 options: GetServersOptions = {},
410): LspServerDefinition[] {
411 const { includeDisabled = false } = options;
412 const langKey = toKey(languageId);
413 if (!langKey) return [];
414
415 return listServers().filter((server) => {
416 if (!includeDisabled && !server.enabled) return false;
417 return server.languages.includes(langKey);
418 });
419}
420
421export function onRegistryChange(listener: RegistryEventListener): () => void {
422 if (typeof listener !== "function") return () => {};

Callers 1

listForLanguageFunction · 0.90

Calls 2

listServersFunction · 0.85
toKeyFunction · 0.70

Tested by

no test coverage detected