use exported diff lines limit

This commit is contained in:
Dallin Romney 2025-07-07 11:24:19 -07:00
parent 6635d021b7
commit 559faae153
2 changed files with 2 additions and 4 deletions

View file

@ -2,7 +2,7 @@ import { ToolImpl } from ".";
import { ContextItem } from "../..";
import { getDiffsFromCache } from "../../autocomplete/snippets/gitDiffCache";
const DEFAULT_GIT_DIFF_LINE_LIMIT = 5000;
export const DEFAULT_GIT_DIFF_LINE_LIMIT = 5000;
export const viewDiffImpl: ToolImpl = async (args, extras) => {
const diffs = await getDiffsFromCache(extras.ide); // const diffs = await extras.ide.getDiff(true);

View file

@ -1,5 +1,5 @@
import { expect, test, vi } from "vitest";
import { viewDiffImpl } from "./viewDiff";
import { DEFAULT_GIT_DIFF_LINE_LIMIT, viewDiffImpl } from "./viewDiff";
// Mock the getDiffsFromCache function
vi.mock("../../autocomplete/snippets/gitDiffCache", () => ({
@ -37,8 +37,6 @@ test("viewDiff should not truncate diffs under line limit", async () => {
});
test("viewDiff should truncate diffs exceeding line limit", async () => {
const DEFAULT_GIT_DIFF_LINE_LIMIT = 5000;
// Create a large diff that exceeds the line limit
const largeDiffLines = Array(DEFAULT_GIT_DIFF_LINE_LIMIT + 1000).fill(
"line content",