Skip to content

Commit ace3cbc

Browse files
authored
feat(amazonq): rename CodeWhisperer settings #4695
Problem Rename settings from CodeWhisperer to Amazon Q. Solution - Log level and telemetry will now be aws level configurations. They are shared between toolkit & Q. - Migrating old settings to new settings is not in scope of this PR.
1 parent 26af5a6 commit ace3cbc

File tree

10 files changed

+27
-61
lines changed

10 files changed

+27
-61
lines changed

packages/amazonq/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@
4848
"contributes": {
4949
"configuration": {
5050
"type": "object",
51-
"title": "%AWS.productName%",
51+
"title": "%AWS.amazonq.productName%",
5252
"cloud9": {
5353
"cn": {
54-
"title": "%AWS.productName.cn%"
54+
"title": "%AWS.amazonq.productName.cn%"
5555
}
5656
},
5757
"properties": {
58-
"aws.amazonq.logLevel": {
58+
"aws.logLevel": {
5959
"type": "string",
6060
"default": "debug",
6161
"enum": [
@@ -79,7 +79,7 @@
7979
}
8080
}
8181
},
82-
"aws.amazonq.telemetry": {
82+
"aws.telemetry": {
8383
"type": "boolean",
8484
"default": true,
8585
"markdownDescription": "%AWS.configuration.description.telemetry%",
@@ -89,7 +89,7 @@
8989
}
9090
}
9191
},
92-
"aws.amazonq.suppressPrompts": {
92+
"aws.amazonQ.suppressPrompts": {
9393
"type": "object",
9494
"description": "%AWS.configuration.description.suppressPrompts%",
9595
"default": {},
@@ -113,23 +113,23 @@
113113
},
114114
"additionalProperties": false
115115
},
116-
"aws.codeWhisperer.includeSuggestionsWithCodeReferences": {
116+
"aws.amazonQ.includeSuggestionsWithCodeReferences": {
117117
"type": "boolean",
118118
"markdownDescription": "%AWS.configuration.description.codewhisperer%",
119119
"default": true
120120
},
121-
"aws.codeWhisperer.importRecommendation": {
121+
"aws.amazonQ.importRecommendation": {
122122
"type": "boolean",
123123
"description": "%AWS.configuration.description.codewhisperer.importRecommendation%",
124124
"default": true
125125
},
126-
"aws.codeWhisperer.shareCodeWhispererContentWithAWS": {
126+
"aws.amazonQ.shareCodeWhispererContentWithAWS": {
127127
"type": "boolean",
128128
"markdownDescription": "%AWS.configuration.description.codewhisperer.shareCodeWhispererContentWithAWS%",
129129
"default": true,
130130
"scope": "application"
131131
},
132-
"aws.codeWhisperer.javaCompilationOutput": {
132+
"aws.amazonQ.javaCompilationOutput": {
133133
"type": "string",
134134
"default": "",
135135
"description": "Provide the ABSOLUTE path which is used to store java project compilation results."

packages/amazonq/scripts/build/syncPackageJson.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function main() {
2626

2727
const coreSettings = coreLibPackageJson.contributes.configuration.properties
2828
Object.keys(coreSettings).forEach(key => {
29-
if (key.startsWith('aws.amazonq') || key.startsWith('aws.codeWhisperer')) {
29+
if (key.startsWith('aws.amazonQ')) {
3030
packageJson.contributes.configuration.properties[key] = coreSettings[key]
3131
}
3232
})

packages/core/package.json

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -238,41 +238,7 @@
238238
"description": "%AWS.configuration.description.lambda.recentlyUploaded%",
239239
"default": []
240240
},
241-
"aws.amazonq.logLevel": {
242-
"type": "string",
243-
"default": "debug",
244-
"enum": [
245-
"error",
246-
"warn",
247-
"info",
248-
"verbose",
249-
"debug"
250-
],
251-
"enumDescriptions": [
252-
"Errors Only",
253-
"Errors and Warnings",
254-
"Errors, Warnings, and Info",
255-
"Errors, Warnings, Info, and Verbose",
256-
"Errors, Warnings, Info, Verbose, and Debug"
257-
],
258-
"markdownDescription": "%AWS.configuration.description.logLevel%",
259-
"cloud9": {
260-
"cn": {
261-
"markdownDescription": "%AWS.configuration.description.logLevel.cn%"
262-
}
263-
}
264-
},
265-
"aws.amazonq.telemetry": {
266-
"type": "boolean",
267-
"default": true,
268-
"markdownDescription": "%AWS.configuration.description.telemetry%",
269-
"cloud9": {
270-
"cn": {
271-
"markdownDescription": "%AWS.configuration.description.telemetry.cn%"
272-
}
273-
}
274-
},
275-
"aws.amazonq.suppressPrompts": {
241+
"aws.amazonQ.suppressPrompts": {
276242
"type": "object",
277243
"description": "%AWS.configuration.description.suppressPrompts%",
278244
"default": {},
@@ -296,23 +262,23 @@
296262
},
297263
"additionalProperties": false
298264
},
299-
"aws.codeWhisperer.includeSuggestionsWithCodeReferences": {
265+
"aws.amazonQ.includeSuggestionsWithCodeReferences": {
300266
"type": "boolean",
301267
"markdownDescription": "%AWS.configuration.description.codewhisperer%",
302268
"default": true
303269
},
304-
"aws.codeWhisperer.importRecommendation": {
270+
"aws.amazonQ.importRecommendation": {
305271
"type": "boolean",
306272
"description": "%AWS.configuration.description.codewhisperer.importRecommendation%",
307273
"default": true
308274
},
309-
"aws.codeWhisperer.shareCodeWhispererContentWithAWS": {
275+
"aws.amazonQ.shareCodeWhispererContentWithAWS": {
310276
"type": "boolean",
311277
"markdownDescription": "%AWS.configuration.description.codewhisperer.shareCodeWhispererContentWithAWS%",
312278
"default": true,
313279
"scope": "application"
314280
},
315-
"aws.codeWhisperer.javaCompilationOutput": {
281+
"aws.amazonQ.javaCompilationOutput": {
316282
"type": "string",
317283
"default": "",
318284
"description": "Provide the ABSOLUTE path which is used to store java project compilation results."

packages/core/package.nls.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"AWS.title.cn": "Amazon",
44
"AWS.productName": "AWS Toolkit",
55
"AWS.productName.cn": "Amazon Toolkit",
6+
"AWS.amazonq.productName": "Amazon Q",
7+
"AWS.amazonq.productName.cn": "Amazon Q",
68
"AWS.codecatalyst.submenu.title": "Manage CodeCatalyst",
79
"AWS.configuration.profileDescription": "The name of the credential profile to obtain credentials from.",
810
"AWS.configuration.description.lambda.recentlyUploaded": "Recently selected Lambda upload targets.",

packages/core/src/codewhisperer/activation.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ export async function activate(context: ExtContext): Promise<void> {
113113
EditorContext.updateTabSize(getTabSizeSetting())
114114
}
115115

116-
if (
117-
configurationChangeEvent.affectsConfiguration('aws.codeWhisperer.includeSuggestionsWithCodeReferences')
118-
) {
116+
if (configurationChangeEvent.affectsConfiguration('aws.amazonQ.includeSuggestionsWithCodeReferences')) {
119117
ReferenceLogViewProvider.instance.update()
120118
if (auth.isEnterpriseSsoInUse()) {
121119
await vscode.window
@@ -131,7 +129,7 @@ export async function activate(context: ExtContext): Promise<void> {
131129
}
132130
}
133131

134-
if (configurationChangeEvent.affectsConfiguration('aws.codeWhisperer.shareCodeWhispererContentWithAWS')) {
132+
if (configurationChangeEvent.affectsConfiguration('aws.amazonQ.shareCodeWhispererContentWithAWS')) {
135133
if (auth.isEnterpriseSsoInUse()) {
136134
await vscode.window
137135
.showInformationMessage(
@@ -170,10 +168,10 @@ export async function activate(context: ExtContext): Promise<void> {
170168
if (id === 'codewhisperer') {
171169
await vscode.commands.executeCommand(
172170
'workbench.action.openSettings',
173-
`@id:aws.codeWhisperer.includeSuggestionsWithCodeReferences`
171+
`@id:aws.amazonQ.includeSuggestionsWithCodeReferences`
174172
)
175173
} else {
176-
await vscode.commands.executeCommand('workbench.action.openSettings', `aws.codeWhisperer`)
174+
await vscode.commands.executeCommand('workbench.action.openSettings', `aws.amazonQ`)
177175
}
178176
}),
179177
Commands.register('aws.codewhisperer.refreshAnnotation', async (forceProceed: boolean = false) => {

packages/core/src/codewhisperer/commands/startSecurityScan.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export function errorPromptHelper(error: Error) {
263263
)
264264
.then(async resp => {
265265
if (resp === viewSettings) {
266-
openSettings('aws.codeWhisperer.javaCompilationOutput').catch(e => {
266+
openSettings('aws.amazonQ.javaCompilationOutput').catch(e => {
267267
getLogger().error('openSettings failed: %s', (e as Error).message)
268268
})
269269
}

packages/core/src/codewhisperer/util/codewhispererSettings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const description = {
99
importRecommendation: Boolean,
1010
shareCodeWhispererContentWithAWS: Boolean,
1111
}
12-
export class CodeWhispererSettings extends fromExtensionManifest('aws.codeWhisperer', description) {
12+
export class CodeWhispererSettings extends fromExtensionManifest('aws.amazonQ', description) {
1313
public isSuggestionsWithCodeReferencesEnabled(): boolean {
1414
return this.get(`includeSuggestionsWithCodeReferences`, false)
1515
}

packages/core/src/codewhisperer/util/dependencyGraph/javaDependencyGraph.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export class JavaDependencyGraph extends DependencyGraph {
244244
}
245245

246246
private autoDetectClasspath(projectPath: string, projectName: string, extension: string) {
247-
const compileOutput = vscode.workspace.getConfiguration('aws.codeWhisperer').get('javaCompilationOutput')
247+
const compileOutput = vscode.workspace.getConfiguration('aws.amazonQ').get('javaCompilationOutput')
248248
if (compileOutput && typeof compileOutput === 'string') {
249249
this._outputDirs.add(compileOutput)
250250
}

packages/core/src/shared/settings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,10 +637,10 @@ export class ToolkitPromptSettings extends Settings.define(
637637
}
638638
}
639639

640-
export const amazonQPrompts = settingsProps['aws.amazonq.suppressPrompts'].properties
640+
export const amazonQPrompts = settingsProps['aws.amazonQ.suppressPrompts'].properties
641641
type amazonQPromptName = keyof typeof amazonQPrompts
642642
export class AmazonQPromptSettings extends Settings.define(
643-
'aws.amazonq.suppressPrompts',
643+
'aws.amazonQ.suppressPrompts',
644644
toRecord(keys(amazonQPrompts), () => Boolean)
645645
) {
646646
public async isPromptEnabled(promptName: amazonQPromptName): Promise<boolean> {

packages/toolkit/scripts/build/handlePackageJson.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function main() {
4141

4242
// Remove Amazon Q extension settings stored in core
4343
Object.keys(coreSettings).forEach(key => {
44-
if (key.startsWith('aws.amazonq') || key.startsWith('aws.codeWhisperer')) {
44+
if (key.startsWith('aws.amazonQ')) {
4545
delete coreSettings[key]
4646
}
4747
})

0 commit comments

Comments
 (0)