Skip to content

Commit 3e42f81

Browse files
authored
Merge pull request aws#6770 from atonaamz/master
feat(amazonq): update reference tracker checkbox label
2 parents 89b9c4d + 07dd7a0 commit 3e42f81

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "/review: rename setting `showInlineCodeSuggestionsWithCodeReferences` to `showCodeWithReferences`"
4+
}

packages/amazonq/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
},
123123
"additionalProperties": false
124124
},
125-
"amazonQ.showInlineCodeSuggestionsWithCodeReferences": {
125+
"amazonQ.showCodeWithReferences": {
126126
"type": "boolean",
127127
"markdownDescription": "%AWS.configuration.description.amazonq%",
128128
"default": true

packages/core/src/codewhisperer/activation.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ export async function activate(context: ExtContext): Promise<void> {
104104
localize = nls.loadMessageBundle()
105105
const codewhispererSettings = CodeWhispererSettings.instance
106106

107+
// Import old CodeWhisperer settings into Amazon Q
108+
await CodeWhispererSettings.instance.importSettings()
109+
107110
// initialize AuthUtil earlier to make sure it can listen to connection change events.
108111
const auth = AuthUtil.instance
109112
auth.initCodeWhispererHooks()
@@ -156,7 +159,7 @@ export async function activate(context: ExtContext): Promise<void> {
156159
EditorContext.updateTabSize(getTabSizeSetting())
157160
}
158161

159-
if (configurationChangeEvent.affectsConfiguration('amazonQ.showInlineCodeSuggestionsWithCodeReferences')) {
162+
if (configurationChangeEvent.affectsConfiguration('amazonQ.showCodeWithReferences')) {
160163
ReferenceLogViewProvider.instance.update()
161164
if (auth.isEnterpriseSsoInUse()) {
162165
await vscode.window
@@ -212,7 +215,7 @@ export async function activate(context: ExtContext): Promise<void> {
212215
if (id === 'codewhisperer') {
213216
await vscode.commands.executeCommand(
214217
'workbench.action.openSettings',
215-
`@id:amazonQ.showInlineCodeSuggestionsWithCodeReferences`
218+
`@id:amazonQ.showCodeWithReferences`
216219
)
217220
} else {
218221
await openSettings('amazonQ')

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5-
import { fromExtensionManifest } from '../../shared/settings'
65
import { ArrayConstructor } from '../../shared/utilities/typeConstructors'
6+
import { fromExtensionManifest, migrateSetting } from '../../shared/settings'
77

88
const description = {
9-
showInlineCodeSuggestionsWithCodeReferences: Boolean, // eslint-disable-line id-length
9+
showCodeWithReferences: Boolean,
1010
importRecommendationForInlineCodeSuggestions: Boolean, // eslint-disable-line id-length
1111
shareContentWithAWS: Boolean,
1212
workspaceIndex: Boolean,
@@ -18,8 +18,15 @@ const description = {
1818
}
1919

2020
export class CodeWhispererSettings extends fromExtensionManifest('amazonQ', description) {
21+
// TODO: Remove after a few releases
22+
public async importSettings() {
23+
await migrateSetting(
24+
{ key: 'amazonQ.showInlineCodeSuggestionsWithCodeReferences', type: Boolean },
25+
{ key: 'amazonQ.showCodeWithReferences' }
26+
)
27+
}
2128
public isSuggestionsWithCodeReferencesEnabled(): boolean {
22-
return this.get(`showInlineCodeSuggestionsWithCodeReferences`, false)
29+
return this.get(`showCodeWithReferences`, false)
2330
}
2431
public isImportRecommendationEnabled(): boolean {
2532
return this.get(`importRecommendationForInlineCodeSuggestions`, false)

packages/core/src/shared/settings-amazonq.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const amazonqSettings = {
2020
"minIdeVersion": {},
2121
"ssoCacheError": {}
2222
},
23-
"amazonQ.showInlineCodeSuggestionsWithCodeReferences": {},
23+
"amazonQ.showCodeWithReferences": {},
2424
"amazonQ.allowFeatureDevelopmentToRunCodeAndTests": {},
2525
"amazonQ.importRecommendationForInlineCodeSuggestions": {},
2626
"amazonQ.shareContentWithAWS": {},

0 commit comments

Comments
 (0)