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

Function getConfiguredRuntimeId

src/cm/lsp/runtimeSettings.ts:57–79  ·  view source on GitHub ↗
(
	server: LspServerDefinition,
	context: LspRuntimeContext = {},
)

Source from the content-addressed store, hash-verified

55}
56
57export function getConfiguredRuntimeId(
58 server: LspServerDefinition,
59 context: LspRuntimeContext = {},
60): string | null {
61 const settings = getRuntimeSettings();
62 const serverId = String(server.id || "").toLowerCase();
63 const serverOverride = toRuntimeId(settings.servers?.[serverId]);
64 if (serverOverride && serverOverride !== AUTO_RUNTIME_ID) {
65 return serverOverride;
66 }
67
68 const workspaceOverride = getWorkspaceRuntimeOverride(settings, context);
69 if (workspaceOverride && workspaceOverride !== AUTO_RUNTIME_ID) {
70 return workspaceOverride;
71 }
72
73 const defaultRuntime = toRuntimeId(settings.default);
74 if (defaultRuntime && defaultRuntime !== AUTO_RUNTIME_ID) {
75 return defaultRuntime;
76 }
77
78 return null;
79}
80
81export async function setDefaultRuntime(runtimeId: string): Promise<void> {
82 const current = appSettings.value?.lsp || {};

Callers 1

selectRuntimeProviderFunction · 0.90

Calls 4

getRuntimeSettingsFunction · 0.85
StringInterface · 0.85
toRuntimeIdFunction · 0.85

Tested by

no test coverage detected