MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / resolveSimulatorUrl

Function resolveSimulatorUrl

packages/vscode-extension/extension.js:48–69  ·  view source on GitHub ↗
(context)

Source from the content-addressed store, hash-verified

46}
47
48async function resolveSimulatorUrl(context) {
49 const serverUrl = getServerUrl();
50 if (await isServerHealthy(serverUrl)) {
51 return serverUrl;
52 }
53
54 const serviceUrl = await resolveExistingServiceUrl(serverUrl);
55 if (serviceUrl) {
56 outputChannel.appendLine(`Using existing SimDeck service at ${serviceUrl}`);
57 return serviceUrl;
58 }
59
60 const config = vscode.workspace.getConfiguration("simdeck");
61 const autoStart = getAutoStartService(config);
62 if (!autoStart) {
63 throw new Error(
64 `SimDeck is not reachable at ${serverUrl} or ${DEFAULT_SERVICE_URL}. Enable auto-start or launch the service manually.`,
65 );
66 }
67
68 return await startProjectService(context);
69}
70
71async function resolveExistingServiceUrl(preferredUrl) {
72 for (const serviceUrl of serviceUrlCandidates(preferredUrl)) {

Callers 1

activateFunction · 0.85

Calls 5

getServerUrlFunction · 0.85
isServerHealthyFunction · 0.85
getAutoStartServiceFunction · 0.85
startProjectServiceFunction · 0.85

Tested by

no test coverage detected