Skip to content

Commit b910472

Browse files
authored
Merge pull request aws#6889 from ctlai95/print-read-range
fix(chat): fsRead doesn't show readRange
2 parents 22a132d + 953e32e commit b910472

File tree

1 file changed

+15
-1
lines changed
  • packages/core/src/codewhispererChat/tools

1 file changed

+15
-1
lines changed

packages/core/src/codewhispererChat/tools/fsRead.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,21 @@ export class FsRead {
5050
public queueDescription(updates: Writable): void {
5151
const fileName = path.basename(this.fsPath)
5252
const fileUri = vscode.Uri.file(this.fsPath)
53-
updates.write(`Reading: [${fileName}](${fileUri})`)
53+
updates.write(`Reading file: [${fileName}](${fileUri}), `)
54+
55+
const [start, end] = this.readRange ?? []
56+
57+
if (start && end) {
58+
updates.write(`from line ${start} to ${end}`)
59+
} else if (start) {
60+
if (start > 0) {
61+
updates.write(`from line ${start} to end of file`)
62+
} else {
63+
updates.write(`${start} line from the end of file to end of file`)
64+
}
65+
} else {
66+
updates.write('all lines')
67+
}
5468
updates.end()
5569
}
5670

0 commit comments

Comments
 (0)