Repository: vscode
Issue: File Watcher overwrites external file changes for Jupyter Notebooks
Labels: under-discussion,notebook-serialization


Type: <b>Bug</b>

With "format on save" disabled, 

- In VS Code, create `test.py` with content `print("Hey there"    )`. Save to disk.
- In external terminal, run `black test.py`. Confirm file is updated to `print("Hey there")` in VS Code.
- In VS Code, create `test.ipynb` with single code cell with content `print("Hey there"    )`. Save to disk.
- In external terminal, run `black test.ipynb`. Confirm file is updated to `print("Hey there")` on disk.
- in VS Code, editor still shows `print("Hey there"    )`

VS Code version: Code 1.74.3 (97dec172d3256f8ca4bfb2143f3f76b503ca0534, 2023-01-09T17:07:18.579Z)
OS version: Darwin x64 22.2.0
Modes:
Sandboxed: Yes

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>metal: disabled_off<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_renderer: enabled_on<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: disabled_off|
|Load (avg)|3, 3, 4|
|Memory (System)|32.00GB (0.22GB free)|
|Process Argv|--verbose --crash-reporter-id 85b13b40-e460-4604-9d8a-42c882f15b48|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (32)</summary>

Extension|Author (truncated)|Version
---|---|---
vscode-sql-formatter|adp|1.4.4
emojisense|bie|0.9.1
markdown-emoji|bie|0.3.0
markdown-mermaid|bie|1.17.3
mermaid-markdown-syntax-highlighting|bpr|1.5.0
better-toml|bun|0.3.2
markdown-table-prettify|dar|3.6.0
vscode-markdownlint|Dav|0.49.0
vscode-eslint|dba|2.2.6
prettier-vscode|esb|9.10.4
shell-format|fox|7.2.2
todo-tree|Gru|0.0.220
vscode-graphviz|joa|0.0.6
vscode-peacock|joh|4.2.2
isort|ms-|2022.8.0
python|ms-|2022.20.2
vscode-pylance|ms-|2023.1.30
jupyter|ms-|2022.11.1003412109
jupyter-keymap|ms-|1.0.0
jupyter-renderers|ms-|1.0.14
vscode-jupyter-cell-tags|ms-|0.1.6
vscode-jupyter-slideshow|ms-|0.1.5
remote-ssh|ms-|0.94.0
remote-ssh-edit|ms-|0.84.0
remote-explorer|ms-|0.0.3
wordcount|ms-|0.1.0
vscode-yaml|red|1.11.0
markdown-preview-enhanced|shd|0.6.7
shopify-liquid|sis|3.2.2
character-count|ste|0.1.1
code-spell-checker|str|2.14.0
markdown-all-in-one|yzh|3.5.0


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
azure-dev_surveyone:30548225
vsccc:30610678
pyindex848cf:30577861
nodejswelcome1cf:30587006
2e4cg342:30602488
f6dab269:30613381
a9j8j154:30646983
vscsb:30628654

```

</details>

<!-- generated by issue reporter -->