feat(plugins): diffs of up to 8 MiB per side from open-diff (#3445)

views.open-diff and content tab reply diffs accept 8 MiB per side (was 1 MiB). A larger side fails with invalid("diff too large: the <side> side is over 8 MiB") from the host call and "Diff too large" for a web view's open-diff message, so plugins can tell the size limit from a malformed request. WIT docs updated and plugin components rebuilt.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-15 03:32:29 +08:00
1 джерело 519c8ad8fc
коміт ea644dcdb0
93 files changed
+110 -56

No files matched your search

+7 -1
Переглянути файл
@@ -261,8 +261,14 @@ describe("plugin-backed content editor tabs", () => {
diffs.splice(2);
expect(() => openPluginDiffRequest({ left: "a", right: 1 }, 10)).toThrow();
expect(() => openPluginDiffRequest({ left: "a", right: "b", fileName: "x\ny" }, 10)).toThrow();
expect(() => openPluginDiffRequest({ left: "a", right: "b" }, 4 << 20)).toThrow();
expect(() => openPluginDiffRequest({ left: "a", right: "b" }, 40 << 20)).toThrow();
expect(diffs).toHaveLength(2);
// Lock files and generated code: several MiB per side open; past the limit the error says why.
const big = "x".repeat(5 << 20);
openPluginDiffRequest({ left: big, right: big + "y" }, 10 << 20);
expect(diffs).toHaveLength(3);
const huge = "x".repeat((8 << 20) + 1);
expect(() => openPluginDiffRequest({ left: "a", right: huge }, huge.length)).toThrow(/Diff too large/);
} finally {
unregisterDiff();
}