Skip to content

Insert at Cursor" in GitHub Copilot Chat often omits the last line of generated code #252131

Open
@IvanoValle-NUM

Description

@IvanoValle-NUM

Type: Bug

When using GitHub Copilot Chat in VS Code, clicking the "Insert at Cursor" button is supposed to insert the entire generated code block at the current cursor position in the open file. However, I frequently notice that the last line of the generated code is missing after insertion.

Steps to reproduce:

Open a file in VS Code and place the cursor at a desired location.

Ask GitHub Copilot Chat to generate a function header.

Click on the "Insert at Cursor" button.

Observe that the inserted header is missing its last line.

Many thanks
NUM S.p.A.
Ivano Valle

VS Code version: Code 1.101.1 (18e3a1e, 2025-06-18T13:35:12.605Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz (8 x 3392)
GPU Status 2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: unavailable_software
webnn: unavailable_software
Load (avg) undefined
Memory (System) 15.96GB (8.39GB free)
Process Argv --crash-reporter-id 7adfd56c-5924-4745-8368-b877fdb2faa5
Screen Reader no
VM 0%
Extensions (13)
Extension Author (truncated) Version
Bookmarks ale 13.5.0
copilot Git 1.336.0
copilot-chat Git 0.28.1
debugpy ms- 2025.8.0
python ms- 2025.8.0
vscode-pylance ms- 2025.6.1
cmake-tools ms- 1.20.53
cpptools ms- 1.26.2
cpptools-extension-pack ms- 1.3.1
makefile-tools ms- 0.12.17
notepadplusplus-keybindings ms- 1.0.7
cmake twx 0.0.17
win-ca uko 3.5.1

(1 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
vscrp:30673768
962ge761:30959799
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dwnewjupytercf:31046870
pythonrstrctxt:31112756
nativeloc1:31192215
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
9064b325:31222308
copilot_t_ci:31222730
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
c7cif404:31314491
pythonpulldiag:31325930
996jf627:31283433
pythonrdcb7:31303018
usemplatestapi:31297334
0aa6g176:31307128
7bj51361:31289155
jjjhb125:31275178
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
convertlamdaf:31329270
d784b465:31332230
i851h500:31332225
usemarketplace:31331644
id45c886:31333049

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions