Skip to content

Commit 9b95f32

Browse files
committed
rename cwsprChatCurrentFileXXX to cwsprChatFocusFileXXX
1 parent d90f7be commit 9b95f32

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

packages/amazonq/src/inlineChat/provider/inlineChatProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ export class InlineChatProvider {
8686
truncatedWorkspaceContextLength: 0,
8787
userInputContextLength: 0,
8888
truncatedUserInputContextLength: 0,
89-
currentFileContextLength: 0,
90-
truncatedCurrentFileContextLength: 0,
89+
focusFileContextLength: 0,
90+
truncatedFocusFileContextLength: 0,
9191
},
9292
},
9393
triggerID

packages/amazonq/test/unit/codewhispererChat/controllers/chat/chatRequest/converter.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('triggerPayloadToChatRequest', () => {
1515
trigger: ChatTriggerType.ChatMessage,
1616
contextLengths: {
1717
truncatedUserInputContextLength: 0,
18-
truncatedCurrentFileContextLength: 0,
18+
truncatedFocusFileContextLength: 0,
1919
truncatedWorkspaceContextLength: 0,
2020
truncatedAdditionalContextLengths: {
2121
promptContextLength: 0,
@@ -29,7 +29,7 @@ describe('triggerPayloadToChatRequest', () => {
2929
},
3030
workspaceContextLength: 0,
3131
userInputContextLength: 0,
32-
currentFileContextLength: 0,
32+
focusFileContextLength: 0,
3333
},
3434
context: [],
3535
documentReferences: [],
@@ -139,7 +139,7 @@ describe('Context Priority Truncation Tests', () => {
139139
useRelevantDocuments: true,
140140
contextLengths: {
141141
truncatedUserInputContextLength: 0,
142-
truncatedCurrentFileContextLength: 0,
142+
truncatedFocusFileContextLength: 0,
143143
truncatedWorkspaceContextLength: 0,
144144
truncatedAdditionalContextLengths: {
145145
promptContextLength: 0,
@@ -153,7 +153,7 @@ describe('Context Priority Truncation Tests', () => {
153153
},
154154
workspaceContextLength: 0,
155155
userInputContextLength: 0,
156-
currentFileContextLength: 0,
156+
focusFileContextLength: 0,
157157
},
158158
query: undefined,
159159
codeSelection: undefined,

packages/core/src/codewhispererChat/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ export const defaultContextLengths: ContextLengths = {
3737
truncatedWorkspaceContextLength: 0,
3838
userInputContextLength: 0,
3939
truncatedUserInputContextLength: 0,
40-
currentFileContextLength: 0,
41-
truncatedCurrentFileContextLength: 0,
40+
focusFileContextLength: 0,
41+
truncatedFocusFileContextLength: 0,
4242
}

packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ function preserveContexts(
205205
case ChatContextType.CurrentFile:
206206
truncationInfo = truncate(contexts as string, truncationInfo)
207207
triggerPayload.fileText = truncationInfo.textAfter
208-
triggerPayload.contextLengths.truncatedCurrentFileContextLength = truncationInfo.sizeAfter
208+
triggerPayload.contextLengths.truncatedFocusFileContextLength = truncationInfo.sizeAfter
209209
break
210210
case ChatContextType.UserSpecificPrompts:
211211
truncationInfo = truncateUserSpecificContexts(
@@ -279,7 +279,7 @@ function truncateWorkspaceContexts(
279279
function truncate(
280280
textBefore: string,
281281
truncationInfo: FlexibleTruncationInfo,
282-
isCurrentFile: Boolean = false
282+
isCurrentFile: boolean = false
283283
): FlexibleTruncationInfo {
284284
const sizeBefore = truncationInfo.sizeBefore + textBefore.length
285285

packages/core/src/codewhispererChat/controllers/chat/controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ export class ChatController {
10801080
}
10811081

10821082
triggerPayload.contextLengths.userInputContextLength = triggerPayload.message.length
1083-
triggerPayload.contextLengths.currentFileContextLength = triggerPayload.fileText.length
1083+
triggerPayload.contextLengths.focusFileContextLength = triggerPayload.fileText.length
10841084
const request = triggerPayloadToChatRequest(triggerPayload)
10851085
triggerPayload.documentReferences = this.mergeRelevantTextDocuments(triggerPayload.relevantTextDocuments)
10861086

packages/core/src/codewhispererChat/controllers/chat/model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ export type ContextLengths = {
205205
truncatedWorkspaceContextLength: number
206206
userInputContextLength: number
207207
truncatedUserInputContextLength: number
208-
currentFileContextLength: number
209-
truncatedCurrentFileContextLength: number
208+
focusFileContextLength: number
209+
truncatedFocusFileContextLength: number
210210
}
211211

212212
export type AdditionalContextLengths = {

packages/core/src/codewhispererChat/controllers/chat/telemetryHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,8 @@ export class CWCTelemetryHelper {
543543
cwsprChatPromptContextLength: triggerPayload.contextLengths.additionalContextLengths.promptContextLength,
544544
cwsprChatPromptContextTruncatedLength:
545545
triggerPayload.contextLengths.truncatedAdditionalContextLengths.promptContextLength,
546-
cwsprChatCurrentFileContextLength: triggerPayload.contextLengths.currentFileContextLength,
547-
cwsprChatCurrentFileContextTruncatedLength: triggerPayload.contextLengths.truncatedCurrentFileContextLength,
546+
cwsprChatFocusFileContextLength: triggerPayload.contextLengths.focusFileContextLength,
547+
cwsprChatFocusFileContextTruncatedLength: triggerPayload.contextLengths.truncatedFocusFileContextLength,
548548
cwsprChatUserInputContextLength: triggerPayload.contextLengths.userInputContextLength,
549549
cwsprChatUserInputContextTruncatedLength: triggerPayload.contextLengths.truncatedUserInputContextLength,
550550
cwsprChatWorkspaceContextLength: triggerPayload.contextLengths.workspaceContextLength,

packages/core/src/shared/telemetry/vscodeTelemetry.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,14 @@
230230
"description": "The number of executed operations"
231231
},
232232
{
233-
"name": "cwsprChatCurrentFileContextLength",
233+
"name": "cwsprChatFocusFileContextLength",
234234
"type": "int",
235-
"description": "cwsprChatCurrentFileContextLength"
235+
"description": "cwsprChatFocusFileContextLength"
236236
},
237237
{
238-
"name": "cwsprChatCurrentFileContextTruncatedLength",
238+
"name": "cwsprChatFocusFileContextTruncatedLength",
239239
"type": "int",
240-
"description": "cwsprChatCurrentFileContextTruncatedLength"
240+
"description": "cwsprChatFocusFileContextTruncatedLength"
241241
},
242242
{
243243
"name": "cwsprChatUserInputContextLength",
@@ -1184,11 +1184,11 @@
11841184
"type": "cwsprChatConversationType"
11851185
},
11861186
{
1187-
"type": "cwsprChatCurrentFileContextLength",
1187+
"type": "cwsprChatFocusFileContextLength",
11881188
"required": false
11891189
},
11901190
{
1191-
"type": "cwsprChatCurrentFileContextTruncatedLength",
1191+
"type": "cwsprChatFocusFileContextTruncatedLength",
11921192
"required": false
11931193
},
11941194
{

0 commit comments

Comments
 (0)