From 559faae1530d0abf3937ec03d87bd8f571160b2d Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 7 Jul 2025 11:24:19 -0700 Subject: [PATCH] use exported diff lines limit --- core/tools/implementations/viewDiff.ts | 2 +- core/tools/implementations/viewDiff.vitest.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/tools/implementations/viewDiff.ts b/core/tools/implementations/viewDiff.ts index d3e7e2ef8..2b5da1ab8 100644 --- a/core/tools/implementations/viewDiff.ts +++ b/core/tools/implementations/viewDiff.ts @@ -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); diff --git a/core/tools/implementations/viewDiff.vitest.ts b/core/tools/implementations/viewDiff.vitest.ts index c9dfe211c..914e3a014 100644 --- a/core/tools/implementations/viewDiff.vitest.ts +++ b/core/tools/implementations/viewDiff.vitest.ts @@ -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",