Skip to content

Commit 16d6a9d

Browse files
authored
fix: regex should match workspace text in bold style and startLine can be 0 (#1272)
* fix: regex should match workspace text in bold style and startLine can be 0 * fix: remove unintended debug lines
1 parent c816584 commit 16d6a9d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ export class AgenticChatController implements ChatHandlers {
413413

414414
const additionalContext = await this.#additionalContextProvider.getAdditionalContext(
415415
triggerContext,
416-
(params.prompt as any).context
416+
params.context
417417
)
418418
if (additionalContext.length) {
419419
triggerContext.documentReference =

server/aws-lsp-codewhisperer/src/language-server/agenticChat/context/agenticChatTriggerContext.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class AgenticChatTriggerContext {
119119
}
120120

121121
if (hasWorkspace) {
122-
promptContent = promptContent?.replace(/^@workspace\/?/, '')
122+
promptContent = promptContent?.replace(/\*\*@workspace\*\*/, '')
123123
}
124124

125125
// Get workspace documents if @workspace is used
@@ -161,8 +161,8 @@ export class AgenticChatTriggerContext {
161161
relativeFilePath: item.relativePath,
162162
programmingLanguage: programmingLanguage,
163163
type: filteredType,
164-
startLine: item.startLine || -1,
165-
endLine: item.endLine || -1,
164+
startLine: item.startLine ?? -1,
165+
endLine: item.endLine ?? -1,
166166
}
167167
relevantDocuments.push(relevantTextDocument)
168168
}

0 commit comments

Comments
 (0)