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

Function performInstallCheck

src/cm/lsp/serverLauncher.ts:872–905  ·  view source on GitHub ↗
(
  server: LspServerDefinition,
  launcher: LauncherConfig | undefined,
  cacheKey: string,
)

Source from the content-addressed store, hash-verified

870}
871
872async function performInstallCheck(
873 server: LspServerDefinition,
874 launcher: LauncherConfig | undefined,
875 cacheKey: string,
876): Promise<boolean> {
877 try {
878 const checkCommand =
879 launcher?.checkCommand || buildDerivedCheckCommand(server);
880 if (checkCommand) {
881 await runQuickCommand(checkCommand);
882 }
883 checkedCommands.set(cacheKey, STATUS_PRESENT);
884 return true;
885 } catch (error) {
886 if (!getInstallCommand(server, "install")) {
887 checkedCommands.set(cacheKey, STATUS_FAILED);
888 console.warn(
889 `LSP server ${server.id} is missing check command result and has no installer.`,
890 error,
891 );
892 throw error;
893 }
894
895 const installed = await installServer(server, "install", {
896 promptConfirm: true,
897 });
898 if (!installed) {
899 checkedCommands.set(cacheKey, STATUS_DECLINED);
900 return false;
901 }
902 checkedCommands.set(cacheKey, STATUS_PRESENT);
903 return true;
904 }
905}
906
907async function startInteractiveServer(
908 command: string,

Callers 1

ensureInstalledFunction · 0.85

Calls 5

runQuickCommandFunction · 0.90
buildDerivedCheckCommandFunction · 0.85
setMethod · 0.80
getInstallCommandFunction · 0.70
installServerFunction · 0.70

Tested by

no test coverage detected