Skip to content

Format on paste feature removes inserted string #144658

Closed
@timocov

Description

@timocov

Issue Type: Bug

  1. Enable "Format on paste" setting
  2. In a typescript file paste string in quotes

=> editor removes inserted string. if you undo then you'll see inserted string

vscode-format-on-paste

Code from gif
class Foo {
    public bar(arg: string): string[] {
        return [];
    }
}

function func(): void {
    const foo = new Foo();
    foo.bar('').push('');
}

VS Code version: Code - Insiders 1.66.0-insider (45b4204, 2022-03-08T05:15:31.248Z)
OS version: Windows_NT x64 10.0.19044
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz (12 x 2592)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.75GB (16.67GB free)
Process Argv --crash-reporter-id 11681bbe-6fa9-4a86-a82f-8eb0c752dc92
Screen Reader no
VM 0%
Extensions: none
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
vscod805cf:30301675
pythonvspyt200:30323110
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30404738
wslgetstarted:30449409
vsclayoutctrt:30405800
dsvsc009:30440021
pythonvspyt640:30438691
vsbas813:30436447
vscscmwlcmc:30428972
azactmsal:30432848
vscgsvid1:30433757
dockersurvey3cf:30438169
pynewfile477:30443519

Metadata

Metadata

Assignees

Labels

*duplicateIssue identified as a duplicate of another issue(s)upstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions