Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Feature",
"description": "/review: update reference tracker checkbox label"
}
2 changes: 1 addition & 1 deletion packages/amazonq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
},
"additionalProperties": false
},
"amazonQ.showInlineCodeSuggestionsWithCodeReferences": {
"amazonQ.showCodeWithReferences": {
"type": "boolean",
"markdownDescription": "%AWS.configuration.description.amazonq%",
"default": true
Expand Down
7 changes: 5 additions & 2 deletions packages/core/src/codewhisperer/activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ export async function activate(context: ExtContext): Promise<void> {
localize = nls.loadMessageBundle()
const codewhispererSettings = CodeWhispererSettings.instance

// Import old CodeWhisperer settings into Amazon Q
await CodeWhispererSettings.instance.importSettings()

// initialize AuthUtil earlier to make sure it can listen to connection change events.
const auth = AuthUtil.instance
auth.initCodeWhispererHooks()
Expand Down Expand Up @@ -156,7 +159,7 @@ export async function activate(context: ExtContext): Promise<void> {
EditorContext.updateTabSize(getTabSizeSetting())
}

if (configurationChangeEvent.affectsConfiguration('amazonQ.showInlineCodeSuggestionsWithCodeReferences')) {
if (configurationChangeEvent.affectsConfiguration('amazonQ.showCodeWithReferences')) {
ReferenceLogViewProvider.instance.update()
if (auth.isEnterpriseSsoInUse()) {
await vscode.window
Expand Down Expand Up @@ -212,7 +215,7 @@ export async function activate(context: ExtContext): Promise<void> {
if (id === 'codewhisperer') {
await vscode.commands.executeCommand(
'workbench.action.openSettings',
`@id:amazonQ.showInlineCodeSuggestionsWithCodeReferences`
`@id:amazonQ.showCodeWithReferences`
)
} else {
await openSettings('amazonQ')
Expand Down
13 changes: 10 additions & 3 deletions packages/core/src/codewhisperer/util/codewhispererSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import { fromExtensionManifest } from '../../shared/settings'
import { ArrayConstructor } from '../../shared/utilities/typeConstructors'
import { fromExtensionManifest, migrateSetting } from '../../shared/settings'

const description = {
showInlineCodeSuggestionsWithCodeReferences: Boolean, // eslint-disable-line id-length
showCodeWithReferences: Boolean, // eslint-disable-line id-length
importRecommendationForInlineCodeSuggestions: Boolean, // eslint-disable-line id-length
shareContentWithAWS: Boolean,
workspaceIndex: Boolean,
Expand All @@ -18,8 +18,15 @@ const description = {
}

export class CodeWhispererSettings extends fromExtensionManifest('amazonQ', description) {
// TODO: Remove after a few releases
public async importSettings() {
await migrateSetting(
{ key: 'amazonQ.showInlineCodeSuggestionsWithCodeReferences', type: Boolean },
{ key: 'amazonQ.showCodeWithReferences' }
)
}
public isSuggestionsWithCodeReferencesEnabled(): boolean {
return this.get(`showInlineCodeSuggestionsWithCodeReferences`, false)
return this.get(`showCodeWithReferences`, false)
}
public isImportRecommendationEnabled(): boolean {
return this.get(`importRecommendationForInlineCodeSuggestions`, false)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/shared/settings-amazonq.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const amazonqSettings = {
"minIdeVersion": {},
"ssoCacheError": {}
},
"amazonQ.showInlineCodeSuggestionsWithCodeReferences": {},
"amazonQ.showCodeWithReferences": {},
"amazonQ.allowFeatureDevelopmentToRunCodeAndTests": {},
"amazonQ.importRecommendationForInlineCodeSuggestions": {},
"amazonQ.shareContentWithAWS": {},
Expand Down
Loading