Skip to content

Commit 3bb5d93

Browse files
committed
fix: edit diff UI doesnt render correctly when the diff contains only space char or empty line
1 parent 5a3a504 commit 3bb5d93

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/amazonq/src/app/inline/EditRendering/svgGenerator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ export class SvgGenerationService {
432432
const line = originalCode[lineIndex]
433433

434434
// If line exists in modifiedLines as a key, process character diffs
435-
if (Array.from(modifiedLines.keys()).includes(line)) {
435+
if (Array.from(modifiedLines.keys()).includes(line) && line.trim().length > 0) {
436436
const modifiedLine = modifiedLines.get(line)!
437437
const changes = diffWordsWithSpace(line, modifiedLine)
438438

@@ -455,7 +455,7 @@ export class SvgGenerationService {
455455
originalRanges.push({
456456
line: lineIndex,
457457
start: 0,
458-
end: line.length,
458+
end: line.length ?? 30,
459459
})
460460
}
461461
}

packages/amazonq/src/app/inline/recommendationService.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ export class RecommendationService {
138138
* Edits leverage partialResultToken to achieve EditStreak such that clients can pull all continuous suggestions generated by the model within 1 EOS block.
139139
*/
140140
if (!isTriggerByDeletion && !request.partialResultToken && !EditSuggestionState.isEditSuggestionActive()) {
141-
const completionPromise: Promise<InlineCompletionListWithReferences> = languageClient.sendRequest(
142-
inlineCompletionWithReferencesRequestType.method,
143-
request,
144-
token
145-
)
146-
ps.push(completionPromise)
141+
// const completionPromise: Promise<InlineCompletionListWithReferences> = languageClient.sendRequest(
142+
// inlineCompletionWithReferencesRequestType.method,
143+
// request,
144+
// token
145+
// )
146+
// ps.push(completionPromise)
147147
}
148148

149149
/**

0 commit comments

Comments
 (0)