MCPcopy Create free account
hub / github.com/angular/angular / resolveServerPath

Function resolveServerPath

ngp-vscode-ng-language-service/tests/test_helpers.ts:54–68  ·  view source on GitHub ↗

* Locates the bundled language server: the Bazel-built bundle when running under * Bazel, otherwise the `dist/` output of `build.js`.

()

Source from the content-addressed store, hash-verified

52 * Bazel, otherwise the `dist/` output of `build.js`.
53 */
54async function resolveServerPath(): Promise<string> {
55 const runfiles = process.env['JS_BINARY__RUNFILES'] || process.env['RUNFILES_DIR'];
56 const candidates = runfiles
57 ? ['_main', 'angular', ''].map((ws) => path.join(runfiles, ws, SERVER_RUNFILES_PATH))
58 : [];
59 candidates.push(path.resolve(TESTS_DIR, '../dist/server/server.js'));
60
61 for (const candidate of candidates) {
62 try {
63 await fs.access(candidate);
64 return candidate;
65 } catch {}
66 }
67 throw new Error(`Server bundle not found. Checked:\n${candidates.join('\n')}`);
68}
69
70export async function startTestServer(workspacePath: string) {
71 console.log('[LSP TEST DEBUG] Starting tsgo...');

Callers 1

startTestServerFunction · 0.85

Calls 5

mapMethod · 0.80
accessMethod · 0.80
joinMethod · 0.65
resolveMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected