diff --git a/packages/amazonq/test/unit/codewhisperer/service/recommendationHandler.test.ts b/packages/amazonq/test/unit/codewhisperer/service/recommendationHandler.test.ts index 4bc10329f81..d8855796df0 100644 --- a/packages/amazonq/test/unit/codewhisperer/service/recommendationHandler.test.ts +++ b/packages/amazonq/test/unit/codewhisperer/service/recommendationHandler.test.ts @@ -125,7 +125,7 @@ describe('recommendationHandler', function () { supplementalContextItems: [], contentsLength: 100, latency: 0, - strategy: 'Empty', + strategy: 'empty', }) sinon.stub(performance, 'now').returns(0.0) session.startPos = new vscode.Position(1, 0) diff --git a/packages/core/src/codewhisperer/models/model.ts b/packages/core/src/codewhisperer/models/model.ts index 8e8e58d5fea..c9b3ca7c51a 100644 --- a/packages/core/src/codewhisperer/models/model.ts +++ b/packages/core/src/codewhisperer/models/model.ts @@ -47,11 +47,11 @@ export const vsCodeState: VsCodeState = { isFreeTierLimitReached: false, } -export type UtgStrategy = 'ByName' | 'ByContent' +export type UtgStrategy = 'byName' | 'byContent' export type CrossFileStrategy = 'opentabs' | 'codemap' | 'bm25' | 'default' -export type SupplementalContextStrategy = CrossFileStrategy | UtgStrategy | 'Empty' +export type SupplementalContextStrategy = CrossFileStrategy | UtgStrategy | 'empty' export type PatchInfo = { name: string diff --git a/packages/core/src/codewhisperer/util/supplementalContext/crossFileContextUtil.ts b/packages/core/src/codewhisperer/util/supplementalContext/crossFileContextUtil.ts index 41a0504099e..f4688e2b5a9 100644 --- a/packages/core/src/codewhisperer/util/supplementalContext/crossFileContextUtil.ts +++ b/packages/core/src/codewhisperer/util/supplementalContext/crossFileContextUtil.ts @@ -88,13 +88,13 @@ export async function fetchSupplementalContextForSrc( const supContext = (await opentabsContextPromise) ?? [] return { supplementalContextItems: supContext, - strategy: supContext.length === 0 ? 'Empty' : 'opentabs', + strategy: supContext.length === 0 ? 'empty' : 'opentabs', } } // codemap will use opentabs context plus repomap if it's present if (supplementalContextConfig === 'codemap') { - let strategy: SupplementalContextStrategy = 'Empty' + let strategy: SupplementalContextStrategy = 'empty' let hasCodemap: boolean = false let hasOpentabs: boolean = false const opentabsContextAndCodemap = await waitUntil( @@ -132,7 +132,7 @@ export async function fetchSupplementalContextForSrc( } else if (hasOpentabs) { strategy = 'opentabs' } else { - strategy = 'Empty' + strategy = 'empty' } return { @@ -161,7 +161,7 @@ export async function fetchSupplementalContextForSrc( const supContext = opentabsContext ?? [] return { supplementalContextItems: supContext, - strategy: supContext.length === 0 ? 'Empty' : 'opentabs', + strategy: supContext.length === 0 ? 'empty' : 'opentabs', } } diff --git a/packages/core/src/codewhisperer/util/supplementalContext/supplementalContextUtil.ts b/packages/core/src/codewhisperer/util/supplementalContext/supplementalContextUtil.ts index 5cb7c2bfb83..03f9d59b3f2 100644 --- a/packages/core/src/codewhisperer/util/supplementalContext/supplementalContextUtil.ts +++ b/packages/core/src/codewhisperer/util/supplementalContext/supplementalContextUtil.ts @@ -58,7 +58,7 @@ export async function fetchSupplementalContext( supplementalContextItems: [], contentsLength: 0, latency: performance.now() - timesBeforeFetching, - strategy: 'Empty', + strategy: 'empty', } } else { getLogger().error( diff --git a/packages/core/src/codewhisperer/util/supplementalContext/utgUtils.ts b/packages/core/src/codewhisperer/util/supplementalContext/utgUtils.ts index 63c29dc1c9a..a39a48183b0 100644 --- a/packages/core/src/codewhisperer/util/supplementalContext/utgUtils.ts +++ b/packages/core/src/codewhisperer/util/supplementalContext/utgUtils.ts @@ -54,7 +54,7 @@ export async function fetchSupplementalContextForTest( const shouldProceed = shouldFetchUtgContext(editor.document.languageId) if (!shouldProceed) { - return shouldProceed === undefined ? undefined : { supplementalContextItems: [], strategy: 'Empty' } + return shouldProceed === undefined ? undefined : { supplementalContextItems: [], strategy: 'empty' } } const languageConfig = utgLanguageConfigs[editor.document.languageId] @@ -69,10 +69,10 @@ export async function fetchSupplementalContextForTest( return { supplementalContextItems: await generateSupplementalContextFromFocalFile( crossSourceFile, - 'ByName', + 'byName', cancellationToken ), - strategy: 'ByName', + strategy: 'byName', } } throwIfCancelled(cancellationToken) @@ -84,10 +84,10 @@ export async function fetchSupplementalContextForTest( return { supplementalContextItems: await generateSupplementalContextFromFocalFile( crossSourceFile, - 'ByContent', + 'byContent', cancellationToken ), - strategy: 'ByContent', + strategy: 'byContent', } } @@ -95,7 +95,7 @@ export async function fetchSupplementalContextForTest( getLogger().debug(`CodeWhisperer failed to fetch utg context`) return { supplementalContextItems: [], - strategy: 'Empty', + strategy: 'empty', } }