microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.46k stars 29.36k forks source link

NotebookCellExecution.replaceOutput(...) appends output instead of replacing #173577

Open sourishkrout opened 1 year ago

sourishkrout commented 1 year ago

Type: Bug

In effect it will append the output similar to appendOutput but it appears to result in an additional OutputItem. Was this change intentional? The previous behavior can be somewhat mimicked calling exec.clearOutput() ahead of exec.replaceOutput(...).

Behavior has changed starting with v1.75.0.

exec.replaceOutput([ new NotebookCellOutput([ item ]) ])

Before: image

After: image

VS Code version: Code 1.75.0 (Universal) (e2816fe719a4026ffa1ee0189dc89bdfdbafb164, 2023-02-01T15:24:42.903Z) OS version: Darwin arm64 21.6.0 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|Apple M1 Max (10 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|3, 4, 5| |Memory (System)|64.00GB (7.24GB free)| |Process Argv|--crash-reporter-id 7fb42086-e800-4f9a-95e5-3ed5c376b388| |Screen Reader|no| |VM|0%|
Extensions (37) Extension|Author (truncated)|Version ---|---|--- tsl-problem-matcher|amo|0.6.2 vscode-eslint|dba|2.4.0 gitlens|eam|13.2.0 EditorConfig|Edi|0.16.4 prettier-vscode|esb|9.10.4 codespaces|Git|1.13.7 remotehub|Git|0.50.0 vscode-pull-request-github|Git|0.59.2023020215 gc-excelviewer|Gra|4.2.56 hcl|has|0.3.2 headwind|hey|1.7.0 vscode-docker|ms-|1.23.3 remote-containers|ms-|0.275.0 remote-ssh|ms-|0.96.0 remote-ssh-edit|ms-|0.84.0 remote-wsl|ms-|0.75.1 vscode-remote-extensionpack|ms-|0.23.0 azure-repos|ms-|0.26.0 hexeditor|ms-|1.9.11 remote-explorer|ms-|0.2.0 remote-repositories|ms-|0.28.0 vscode-github-issue-notebooks|ms-|0.0.128 sqltools|mtx|0.27.1 typescript-explorer|mxs|0.4.0 material-icon-theme|PKi|4.23.1 vscode-commons|red|0.0.6 vscode-yaml|red|1.11.0 synthwave-vscode|Rob|0.1.15 terrastate|roh|1.1.1 blueberry-cider|sf-|1.0.5 vscode-spotify|shy|3.2.1 marquee|sta|3.3.1669946006 runme|sta|0.5.1 stable|sta|0.8.1 rest-book|tan|6.2.1 vscode-mdx|uni|1.2.1 vim|vsc|1.24.3 (6 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256860 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931cf:30280410 vshan820:30294714 vstes263:30335439 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30410667 cppdebug:30492333 vscaac:30438847 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 azure-dev_surveyone:30548225 pyindex848:30577860 nodejswelcome1:30587005 3biah626:30602489 f6dab269:30613381 pythonsymbol12:30657548 a9j8j154:30646983 ```
sourishkrout commented 1 year ago

By the way, our extension's integration test caught it here: https://github.com/stateful/vscode-runme/actions/runs/4106093645/jobs/7083872801#step:7:148

We're using https://www.npmjs.com/package/wdio-vscode-service to run tests in C/I against vscode's stable release channel. Happy to help you guys get set up if you'd like to use it. Just give me a shout.

rebornix commented 1 year ago

@sourishkrout thanks for the detailed report, it really helps troubleshoot. I have ideas of how this happened, will take a look soon.

sourishkrout commented 1 year ago

@sourishkrout thanks for the detailed report, it really helps troubleshoot. I have ideas of how this happened, will take a look soon.

Are there any plans for a fix, @rebornix? I just checked in the latest release, and it's still an issue.

Version: 1.84.0 (Universal)
Commit: d037ac076cee195194f93ce6fe2bdfe2969cc82d
Date: 2023-11-01T11:30:19.406Z
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 22.5.0