From bc3fee1c7c9a7ac0bb910c2f55f8baa5cb5b9727 Mon Sep 17 00:00:00 2001 From: ulugbekna Date: Mon, 20 Apr 2026 23:44:36 +0200 Subject: [PATCH] update jsdoc Co-authored-by: Copilot --- .../inlineEdits/vscode-node/isInlineSuggestion.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/copilot/src/extension/inlineEdits/vscode-node/isInlineSuggestion.ts b/extensions/copilot/src/extension/inlineEdits/vscode-node/isInlineSuggestion.ts index ad774a69994..b1876d17e03 100644 --- a/extensions/copilot/src/extension/inlineEdits/vscode-node/isInlineSuggestion.ts +++ b/extensions/copilot/src/extension/inlineEdits/vscode-node/isInlineSuggestion.ts @@ -39,8 +39,12 @@ export function toInlineSuggestion(cursorPos: Position, doc: TextDocument, range /** * If the cursor is at the end of a line and the edit is an empty-range insertion - * at column 0 of the next line (with no leftover content after the insertion), - * rewrite it as a pure insertion at the cursor position. + * at column 0 of the next line, rewrite it as a pure insertion at the cursor + * position. This is allowed when either: + * - `newText` ends with a newline (any existing content on the target line is + * pushed onto the following line), or + * - `newText` contains a newline and the target line is fully consumed by the + * insertion (no leftover content after the insertion). */ function tryAdjustNextLineInsertion(cursorPos: Position, doc: TextDocument, range: Range, newText: string): InlineSuggestionEdit | undefined { if (!range.isEmpty) {