Skip to content

Commit 5d3f2e0

Browse files
authored
Improve suggestion applying (#6187)
Part of #6171
1 parent 554e4ca commit 5d3f2e0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/github/prComment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export class GHPRComment extends CommentBase {
304304
const match = this.rawComment.body.match(SUGGESTION_EXPRESSION);
305305
const suggestionBody = match?.groups?.suggestion;
306306
if (match) {
307-
return suggestionBody ? `${suggestionBody}\n` : '';
307+
return suggestionBody ? suggestionBody : '';
308308
}
309309
}
310310

src/view/reviewCommentController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ ${suggestionInformation.suggestionContent}
957957
throw new Error('Cannot find the editor to apply the suggestion to.');
958958
}
959959
await editor.edit(builder => {
960-
builder.replace(range.with(undefined, new vscode.Position(range.end.line + 1, 0)), suggestion);
960+
builder.replace(range.with(undefined, editor.document.lineAt(range.end.line).range.end), suggestion);
961961
});
962962
}
963963

0 commit comments

Comments
 (0)