Skip to content

Commit 006093b

Browse files
Merge master into feature/amazonqLSP
2 parents 8587fba + 3e42f81 commit 006093b

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
@@ -95,6 +95,9 @@ let localize: nls.LocalizeFunc
9595
export async function activate(context: ExtContext): Promise<void> {
9696
localize = nls.loadMessageBundle()
9797

98+
// Import old CodeWhisperer settings into Amazon Q
99+
await CodeWhispererSettings.instance.importSettings()
100+
98101
// initialize AuthUtil earlier to make sure it can listen to connection change events.
99102
const auth = AuthUtil.instance
100103
auth.initCodeWhispererHooks()
@@ -147,7 +150,7 @@ export async function activate(context: ExtContext): Promise<void> {
147150
EditorContext.updateTabSize(getTabSizeSetting())
148151
}
149152

150-
if (configurationChangeEvent.affectsConfiguration('amazonQ.showInlineCodeSuggestionsWithCodeReferences')) {
153+
if (configurationChangeEvent.affectsConfiguration('amazonQ.showCodeWithReferences')) {
151154
ReferenceLogViewProvider.instance.update()
152155
if (auth.isEnterpriseSsoInUse()) {
153156
await vscode.window
@@ -203,7 +206,7 @@ export async function activate(context: ExtContext): Promise<void> {
203206
if (id === 'codewhisperer') {
204207
await vscode.commands.executeCommand(
205208
'workbench.action.openSettings',
206-
`@id:amazonQ.showInlineCodeSuggestionsWithCodeReferences`
209+
`@id:amazonQ.showCodeWithReferences`
207210
)
208211
} else {
209212
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
@@ -22,7 +22,7 @@ export const amazonqSettings = {
2222
"AmazonQLspManifestMessage": {},
2323
"AmazonQ-WorkspaceLspManifestMessage":{}
2424
},
25-
"amazonQ.showInlineCodeSuggestionsWithCodeReferences": {},
25+
"amazonQ.showCodeWithReferences": {},
2626
"amazonQ.allowFeatureDevelopmentToRunCodeAndTests": {},
2727
"amazonQ.importRecommendationForInlineCodeSuggestions": {},
2828
"amazonQ.shareContentWithAWS": {},

0 commit comments

Comments
 (0)