Skip to content

Commit 6ac1207

Browse files
authored
config(amazonq): codewhisperer endpoint via settings.json (#7761)
## Problem ## Solution allow devs to configure Q endpoint via vscode settings.json ``` "aws.dev.codewhispererService": { "endpoint": "https://codewhisperer/endpoint/", "region": "us-east-1" } ``` --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 0bfc338 commit 6ac1207

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

packages/amazonq/src/lsp/client.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {
3939
getClientId,
4040
extensionVersion,
4141
isSageMaker,
42+
DevSettings,
4243
} from 'aws-core-vscode/shared'
4344
import { processUtils } from 'aws-core-vscode/shared'
4445
import { activate } from './chat/activation'
@@ -129,6 +130,15 @@ export async function startLanguageServer(
129130

130131
await validateNodeExe(executable, resourcePaths.lsp, argv, logger)
131132

133+
const endpointOverride = DevSettings.instance.get('codewhispererService', {}).endpoint ?? undefined
134+
const textDocSection = {
135+
inlineEditSupport: Experiments.instance.get('amazonqLSPNEP', true),
136+
} as any
137+
138+
if (endpointOverride) {
139+
textDocSection.endpointOverride = endpointOverride
140+
}
141+
132142
// Options to control the language client
133143
const clientOptions: LanguageClientOptions = {
134144
// Register the server for json documents
@@ -177,9 +187,7 @@ export async function startLanguageServer(
177187
showLogs: true,
178188
},
179189
textDocument: {
180-
inlineCompletionWithReferences: {
181-
inlineEditSupport: Experiments.instance.get('amazonqLSPNEP', true),
182-
},
190+
inlineCompletionWithReferences: textDocSection,
183191
},
184192
},
185193
contextConfiguration: {

0 commit comments

Comments
 (0)