Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Expand Up @@ -76,15 +76,15 @@ test("readFileRangeImpl handles out-of-bounds ranges gracefully", async () => {
"file:///test.txt",
{
start: { line: 99, character: 0 }, // 100 - 1
end: { line: 104, character: Number.MAX_SAFE_INTEGER }, // 105 - 1
end: { line: 104, character: 2147483647 }, // 105 - 1 (Int.MAX_VALUE for Kotlin compatibility)
},
);

expect(mockIdePartialRange.readRangeInFile).toHaveBeenCalledWith(
"file:///test.txt",
{
start: { line: 4, character: 0 }, // 5 - 1
end: { line: 99, character: Number.MAX_SAFE_INTEGER }, // 100 - 1
end: { line: 99, character: 2147483647 }, // 100 - 1 (Int.MAX_VALUE for Kotlin compatibility)
},
);
});
Expand Down Expand Up @@ -199,6 +199,6 @@ test("readFileRangeImpl handles normal ranges correctly", async () => {
// Verify correct 0-based conversion
expect(mockIde.readRangeInFile).toHaveBeenCalledWith("file:///test.txt", {
start: { line: 1, character: 0 }, // 2 - 1
end: { line: 3, character: Number.MAX_SAFE_INTEGER }, // 4 - 1
end: { line: 3, character: 2147483647 }, // 4 - 1 (Int.MAX_VALUE for Kotlin compatibility)
});
});
2 changes: 1 addition & 1 deletion core/tools/implementations/readFileRange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const readFileRangeImpl: ToolImpl = async (args, extras) => {
},
end: {
line: endLine - 1, // Convert from 1-based to 0-based
character: Number.MAX_SAFE_INTEGER, // Read to end of line
character: 2147483647, // Read to end of line (Int.MAX_VALUE for Kotlin compatibility)
},
});

Expand Down
Loading