Skip to content

Commit 159aeff

Browse files
committed
fixup! fixup! fixup! fixup! fixup! fix(lsp): install failure does not give enough info
1 parent ffe2527 commit 159aeff

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

packages/core/src/amazonq/lsp/lspClient.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import { ChildProcess } from '../../shared/utilities/processUtils'
4747
const localize = nls.loadMessageBundle()
4848

4949
const key = crypto.randomBytes(32)
50-
const logger = getLogger('amazonqLsp')
50+
const logger = getLogger('amazonqLsp.lspClient')
5151

5252
/**
5353
* LspClient manages the API call between VS Code extension and LSP server
@@ -83,7 +83,7 @@ export class LspClient {
8383
const resp = await this.client?.sendRequest(BuildIndexRequestType, encryptedRequest)
8484
return resp
8585
} catch (e) {
86-
logger.error(`LspClient: buildIndex error: ${e}`)
86+
logger.error(`buildIndex error: ${e}`)
8787
return undefined
8888
}
8989
}
@@ -98,7 +98,7 @@ export class LspClient {
9898
const resp = await this.client?.sendRequest(QueryVectorIndexRequestType, encryptedRequest)
9999
return resp
100100
} catch (e) {
101-
logger.error(`LspClient: queryVectorIndex error: ${e}`)
101+
logger.error(`queryVectorIndex error: ${e}`)
102102
return []
103103
}
104104
}
@@ -114,7 +114,7 @@ export class LspClient {
114114
const resp: any = await this.client?.sendRequest(QueryInlineProjectContextRequestType, encrypted)
115115
return resp
116116
} catch (e) {
117-
logger.error(`LspClient: queryInlineProjectContext error: ${e}`)
117+
logger.error(`queryInlineProjectContext error: ${e}`)
118118
throw e
119119
}
120120
}
@@ -135,7 +135,7 @@ export class LspClient {
135135
const resp = await this.client?.sendRequest(UpdateIndexV2RequestType, encryptedRequest)
136136
return resp
137137
} catch (e) {
138-
logger.error(`LspClient: updateIndex error: ${e}`)
138+
logger.error(`updateIndex error: ${e}`)
139139
return undefined
140140
}
141141
}
@@ -147,7 +147,7 @@ export class LspClient {
147147
const resp: any = await this.client?.sendRequest(QueryRepomapIndexRequestType, await this.encrypt(request))
148148
return resp
149149
} catch (e) {
150-
logger.error(`LspClient: QueryRepomapIndex error: ${e}`)
150+
logger.error(`QueryRepomapIndex error: ${e}`)
151151
throw e
152152
}
153153
}
@@ -160,7 +160,7 @@ export class LspClient {
160160
)
161161
return resp
162162
} catch (e) {
163-
logger.error(`LspClient: queryInlineProjectContext error: ${e}`)
163+
logger.error(`queryInlineProjectContext error: ${e}`)
164164
throw e
165165
}
166166
}
@@ -177,7 +177,7 @@ export class LspClient {
177177
)
178178
return resp
179179
} catch (e) {
180-
logger.error(`LspClient: getContextCommandItems error: ${e}`)
180+
logger.error(`getContextCommandItems error: ${e}`)
181181
throw e
182182
}
183183
}
@@ -193,7 +193,7 @@ export class LspClient {
193193
)
194194
return resp || []
195195
} catch (e) {
196-
logger.error(`LspClient: getContextCommandPrompt error: ${e}`)
196+
logger.error(`getContextCommandPrompt error: ${e}`)
197197
throw e
198198
}
199199
}
@@ -207,7 +207,7 @@ export class LspClient {
207207
)
208208
return resp
209209
} catch (e) {
210-
logger.error(`LspClient: getIndexSequenceNumber error: ${e}`)
210+
logger.error(`getIndexSequenceNumber error: ${e}`)
211211
throw e
212212
}
213213
}
@@ -235,9 +235,9 @@ async function validateNodeExe(nodePath: string, lsp: string, args: string[]) {
235235
const r = await proc.run()
236236
const ok = r.exitCode === 0 && r.stdout.includes('ok')
237237
if (!ok) {
238-
const msg = `amazonqLsp: failed to run basic "node -e" test (exitcode=${r.exitCode}): ${proc}`
238+
const msg = `failed to run basic "node -e" test (exitcode=${r.exitCode}): ${proc}`
239239
logger.error(msg)
240-
throw new ToolkitError(msg)
240+
throw new ToolkitError(`amazonqLsp: ${msg}`)
241241
}
242242

243243
// Check that we can start `node …/lsp.js --stdio …`.
@@ -416,7 +416,7 @@ export async function activate(extensionContext: ExtensionContext, resourcePaths
416416
toDispose.push(disposableFunc)
417417
},
418418
(reason) => {
419-
logger.error('LspClient.instance.client.onReady() failed: %O', reason)
419+
logger.error('client.onReady() failed: %O', reason)
420420
}
421421
)
422422
}

packages/core/src/shared/logger/logger.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type LogTopic =
1414
| 'lsp'
1515
| 'amazonqWorkspaceLsp'
1616
| 'amazonqLsp'
17+
| 'amazonqLsp.lspClient'
1718
| 'chat'
1819
| 'stepfunctions'
1920
| 'unknown'

0 commit comments

Comments
 (0)