diff --git a/src/vs/workbench/contrib/void/browser/findDiffs.ts b/src/vs/workbench/contrib/void/browser/findDiffs.ts index c88debd3..e83ffc14 100644 --- a/src/vs/workbench/contrib/void/browser/findDiffs.ts +++ b/src/vs/workbench/contrib/void/browser/findDiffs.ts @@ -1,8 +1,9 @@ import { Range } from 'vscode'; -import { diffLines, Change } from 'diff'; import { Diff } from './registerInlineDiffs'; +import { diffLines } from './react/out/util/diffLines.js' + type Fields = | 'type' | 'originalCode' @@ -27,7 +28,7 @@ export type SuggestedEdit = { export function findDiffs(oldStr: string, newStr: string) { // an ordered list of every original line, line added to the new file, and line removed from the old file (order is unambiguous, think about it) - const lineByLineChanges: Change[] = diffLines(oldStr, newStr); + const lineByLineChanges = diffLines(oldStr, newStr); lineByLineChanges.push({ value: '', added: false, removed: false }) // add a dummy so we flush any streaks we haven't yet at the very end (!line.added && !line.removed) let oldFileLineNum: number = 0; diff --git a/src/vs/workbench/contrib/void/browser/react/src/util/diffLines.tsx b/src/vs/workbench/contrib/void/browser/react/src/util/diffLines.tsx new file mode 100644 index 00000000..753a7ba8 --- /dev/null +++ b/src/vs/workbench/contrib/void/browser/react/src/util/diffLines.tsx @@ -0,0 +1,3 @@ +import { diffLines, Change } from 'diff'; + +export { diffLines, Change } diff --git a/src/vs/workbench/contrib/void/browser/react/tsup.config.js b/src/vs/workbench/contrib/void/browser/react/tsup.config.js index 5a4d83b9..0d3ab8ca 100644 --- a/src/vs/workbench/contrib/void/browser/react/tsup.config.js +++ b/src/vs/workbench/contrib/void/browser/react/tsup.config.js @@ -5,6 +5,7 @@ export default defineConfig({ './src2/sidebar-tsx/Sidebar.tsx', './src2/util/sendLLMMessage.tsx', './src2/util/posthog.tsx', + './src2/util/diffLines.tsx', ], outDir: './out', format: ['esm'], @@ -14,10 +15,10 @@ export default defineConfig({ clean: true, platform: 'browser', target: 'esnext', - injectStyle: true, // bundle css into the output file + // injectStyle: true, // bundle css into the output file outExtension: () => ({ js: '.js' }), // default behavior is to take local files and make them internal (bundle them) and take imports like 'react' and leave them external (don't bundle them), we want the opposite in many ways - noExternal: [ // noExternal means we should take these things and make them not external (bundle them into the output file) + noExternal: [ // noExternal means we should take these things and make them not external (bundle them into the output file) - anything that doesn't start with a "." needs to be force-flagged as not external /^(?!\.).*$/ ], external: [ // these imports should be kept external ../../../ are external (this is just an optimization so the output file doesn't re-implement functions)