|
4 | 4 | */ |
5 | 5 |
|
6 | 6 | import vscode from 'vscode' |
| 7 | +import path from 'path' |
7 | 8 | import { startLanguageServer } from './client' |
8 | | -import { AmazonQLspInstaller } from './lspInstaller' |
| 9 | +import { AmazonQResourcePaths } from './lspInstaller' |
9 | 10 | import { lspSetupStage, ToolkitError, messages } from 'aws-core-vscode/shared' |
10 | 11 |
|
11 | 12 | export async function activate(ctx: vscode.ExtensionContext): Promise<void> { |
12 | 13 | try { |
13 | 14 | await lspSetupStage('all', async () => { |
14 | | - const installResult = await new AmazonQLspInstaller().resolve() |
15 | | - await lspSetupStage('launch', async () => await startLanguageServer(ctx, installResult.resourcePaths)) |
| 15 | + // Use local servers instead of downloading |
| 16 | + const resourcesPath = path.join(ctx.extensionPath, 'resources') |
| 17 | + // Define paths to local resources |
| 18 | + const resourcePaths: AmazonQResourcePaths = { |
| 19 | + lsp: path.join(resourcesPath, 'servers/aws-lsp-codewhisperer.js'), |
| 20 | + node: path.join(resourcesPath, 'servers/node'), |
| 21 | + ripGrep: path.join(resourcesPath, 'servers/ripgrep/rg'), |
| 22 | + ui: path.join(resourcesPath, 'clients/amazonq-ui.js'), |
| 23 | + } |
| 24 | + // Log paths for debugging |
| 25 | + // eslint-disable-next-line aws-toolkits/no-console-log |
| 26 | + console.log('Amazon Q Resource Paths:', { |
| 27 | + extensionPath: ctx.extensionPath, |
| 28 | + resourcesPath: resourcesPath, |
| 29 | + lsp: resourcePaths.lsp, |
| 30 | + node: resourcePaths.node, |
| 31 | + ripGrep: resourcePaths.ripGrep, |
| 32 | + ui: resourcePaths.ui, |
| 33 | + }) |
| 34 | + |
| 35 | + await lspSetupStage('launch', async () => await startLanguageServer(ctx, resourcePaths)) |
16 | 36 | }) |
17 | 37 | } catch (err) { |
18 | 38 | const e = err as ToolkitError |
|
0 commit comments