Skip to content

Commit b9b70a9

Browse files
committed
feat(amazonq): add logs
1 parent e9ea808 commit b9b70a9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

packages/amazonq/src/lsp/client.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export async function startLanguageServer(
5151
extensionContext: vscode.ExtensionContext,
5252
resourcePaths: AmazonQResourcePaths
5353
) {
54+
logger.debug('starting amazon q language server')
5455
const toDispose = extensionContext.subscriptions
5556

5657
const serverModule = resourcePaths.lsp
@@ -81,6 +82,8 @@ export async function startLanguageServer(
8182
executable = [resourcePaths.node]
8283
}
8384

85+
logger.debug('creating the server options')
86+
8487
const memoryWarnThreshold = 1024 * processUtils.oneMB
8588
const serverOptions = createServerOptions({
8689
encryptionKey,
@@ -161,7 +164,9 @@ export async function startLanguageServer(
161164

162165
const auth = new AmazonQLspAuth(client)
163166

167+
logger.debug('waiting for the client to be ready')
164168
return client.onReady().then(async () => {
169+
logger.debug('client is ready')
165170
await auth.refreshConnection()
166171

167172
if (Experiments.instance.get('amazonqLSPInline', false)) {

packages/core/src/shared/lsp/utils/platform.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ function getEncryptionInit(key: Buffer): string {
3131
*/
3232
export async function validateNodeExe(nodePath: string[], lsp: string, args: string[], logger: Logger) {
3333
const bin = nodePath[0]
34+
35+
logger.debug('validating node can launch')
3436
// Check that we can start `node` by itself.
3537
const proc = new ChildProcess(bin, [...nodePath.slice(1), '-e', 'console.log("ok " + process.version)'], {
3638
logging: 'no',
@@ -42,7 +44,9 @@ export async function validateNodeExe(nodePath: string[], lsp: string, args: str
4244
logger.error(msg)
4345
throw new ToolkitError(`amazonqLsp: ${msg}`)
4446
}
47+
logger.debug('node process is OK')
4548

49+
logger.debug('testing if language server can be started')
4650
// Check that we can start `node …/lsp.js --stdio …`.
4751
const lspProc = new ChildProcess(bin, [...nodePath.slice(1), lsp, ...args], { logging: 'no' })
4852
try {
@@ -74,6 +78,7 @@ export async function validateNodeExe(nodePath: string[], lsp: string, args: str
7478
} finally {
7579
lspProc.stop(true)
7680
}
81+
logger.debug('language server process is OK')
7782
}
7883

7984
export function createServerOptions({

0 commit comments

Comments
 (0)