Skip to content

Commit 48e251d

Browse files
committed
adding migrateSetting to keep old settings without resetting
1 parent 2905a5c commit 48e251d

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

packages/core/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@
473473
"c8": "^9.0.0",
474474
"circular-dependency-plugin": "^5.2.2",
475475
"css-loader": "^6.10.0",
476-
"esbuild-loader": "2.20.0",
476+
"esbuild-loader": "^4.3.0",
477477
"file-loader": "^6.2.0",
478478
"jsdom": "^23.0.1",
479479
"json-schema-to-typescript": "^13.1.1",
@@ -496,29 +496,29 @@
496496
"dependencies": {
497497
"@amzn/amazon-q-developer-streaming-client": "file:../../src.gen/@amzn/amazon-q-developer-streaming-client",
498498
"@amzn/codewhisperer-streaming": "file:../../src.gen/@amzn/codewhisperer-streaming",
499+
"@aws-sdk/client-api-gateway": "<3.696.0",
499500
"@aws-sdk/client-cloudformation": "<3.696.0",
500501
"@aws-sdk/client-cloudwatch-logs": "<3.696.0",
502+
"@aws-sdk/client-codecatalyst": "<3.696.0",
501503
"@aws-sdk/client-cognito-identity": "<3.696.0",
502504
"@aws-sdk/client-docdb": "<3.696.0",
503505
"@aws-sdk/client-docdb-elastic": "<3.696.0",
504506
"@aws-sdk/client-ec2": "<3.696.0",
505507
"@aws-sdk/client-iam": "<3.696.0",
506-
"@aws-sdk/client-s3": "<3.696.0",
507-
"@aws-sdk/client-api-gateway": "<3.696.0",
508-
"@aws-sdk/lib-storage": "<3.696.0",
509508
"@aws-sdk/client-lambda": "<3.696.0",
509+
"@aws-sdk/client-s3": "<3.696.0",
510510
"@aws-sdk/client-ssm": "<3.696.0",
511511
"@aws-sdk/client-sso": "<3.696.0",
512512
"@aws-sdk/client-sso-oidc": "<3.696.0",
513513
"@aws-sdk/credential-provider-env": "<3.696.0",
514514
"@aws-sdk/credential-provider-process": "<3.696.0",
515515
"@aws-sdk/credential-provider-sso": "<3.696.0",
516+
"@aws-sdk/lib-storage": "<3.696.0",
516517
"@aws-sdk/property-provider": "<3.696.0",
517518
"@aws-sdk/protocol-http": "<3.696.0",
519+
"@aws-sdk/s3-request-presigner": "<3.696.0",
518520
"@aws-sdk/smithy-client": "<3.696.0",
519521
"@aws-sdk/util-arn-parser": "<3.696.0",
520-
"@aws-sdk/client-codecatalyst": "<3.696.0",
521-
"@aws-sdk/s3-request-presigner": "<3.696.0",
522522
"@aws/mynah-ui": "^4.23.1",
523523
"@gerhobbelt/gitignore-parser": "^0.2.0-9",
524524
"@iarna/toml": "^2.2.5",

packages/core/src/codewhisperer/activation.ts

Lines changed: 3 additions & 0 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()

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
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 = {
99
showCodeWithReferences: Boolean, // eslint-disable-line id-length
@@ -18,6 +18,13 @@ 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 {
2229
return this.get(`showCodeWithReferences`, false)
2330
}

0 commit comments

Comments
 (0)