From b01684393a122886374ee6c1aea0f739fb729d9b Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Thu, 13 Feb 2025 00:37:43 -0800 Subject: [PATCH] streaming works! --- .../contrib/void/browser/inlineDiffsService.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/inlineDiffsService.ts b/src/vs/workbench/contrib/void/browser/inlineDiffsService.ts index 38a1a46f..ead98264 100644 --- a/src/vs/workbench/contrib/void/browser/inlineDiffsService.ts +++ b/src/vs/workbench/contrib/void/browser/inlineDiffsService.ts @@ -700,7 +700,7 @@ class InlineDiffsService extends Disposable implements IInlineDiffsService { } weAreWriting = false - private async _writeText(uri: URI, text: string, range: IRange, { shouldRealignDiffAreas }: { shouldRealignDiffAreas: boolean }) { + private _writeText(uri: URI, text: string, range: IRange, { shouldRealignDiffAreas }: { shouldRealignDiffAreas: boolean }) { const model = this._getModel(uri) if (!model) return const uriStr = this._readURI(uri, range) @@ -1322,9 +1322,7 @@ Please output SEARCH/REPLACE blocks to make the change. Return ONLY your suggest continue } const [startLine, endLine] = foundInCode - console.log('FOUND!', foundInCode) - console.log('ADDING', blockNum) const adding: Omit = { type: 'DiffZone', originalCode: block.orig, @@ -1345,8 +1343,7 @@ Please output SEARCH/REPLACE blocks to make the change. Return ONLY your suggest diffareaidOfBlockNum.push(diffZone.diffareaid) - latestStreamLocationMutable = { line: diffZone.endLine, addedSplitYet: false, col: 1, originalCodeStartLine: 1 } - + latestStreamLocationMutable = { line: diffZone.startLine, addedSplitYet: false, col: 1, originalCodeStartLine: 1 } } const deltaFinalText = block.final.substring((oldBlocks[blockNum]?.final ?? '').length, Infinity) @@ -1365,11 +1362,9 @@ Please output SEARCH/REPLACE blocks to make the change. Return ONLY your suggest this._refreshStylesAndDiffsInURI(uri) }, onFinalMessage: async ({ fullText }) => { - // 1. wait 500ms and fix lint errors - call lint error workflow // (update react state to say "Fixing errors") const blocks = extractSearchReplaceBlocks(fullText, { ORIGINAL, DIVIDER, FINAL }) - console.log('FULLTEXT', fullText, blocks) for (let blockNum = 0; blockNum < blocks.length; blockNum += 1) { const block = blocks[blockNum] @@ -1377,7 +1372,7 @@ Please output SEARCH/REPLACE blocks to make the change. Return ONLY your suggest const diffZone = this.diffAreaOfId[diffareaid] if (diffZone?.type !== 'DiffZone') continue - await this._writeText(uri, block.final, + this._writeText(uri, block.final, { startLineNumber: diffZone.startLine, startColumn: 1, endLineNumber: diffZone.endLine, endColumn: Number.MAX_SAFE_INTEGER }, // 1-indexed { shouldRealignDiffAreas: true } )