()
| 17 | let port: number | null = null; |
| 18 | |
| 19 | export function getProjectRoot(): string { |
| 20 | const workspaceFolders = vscode.workspace.workspaceFolders; |
| 21 | const workspacePath = workspaceFolders?.[0]?.uri.fsPath; |
| 22 | |
| 23 | if (!workspacePath) { |
| 24 | throw new Error('No workspace found'); |
| 25 | } |
| 26 | |
| 27 | return workspacePath; |
| 28 | } |
| 29 | |
| 30 | async function startServerOnAvailablePort(app: express.Express, startPort: number = 50001): Promise<{ server: ReturnType<typeof app.listen>, port: number }> { |
| 31 | let currentPort = startPort; |
no outgoing calls
no test coverage detected