Repository: vscode
Issue: Retrying opening a file with a custom editor always gives the same error
Labels: bug,custom-editors


Type: <b>Bug</b>

- Create a file that VSCode opens with a custom editor (I tried this with both the [NBT Viewer](https://marketplace.visualstudio.com/items?itemName=Misodee.vscode-nbt) extension and the [custom-editor-sample](https://github.com/microsoft/vscode-extension-samples/tree/main/custom-editor-sample) extension)
- Open the file with the custom editor
- Close VSCode
- Rename the file
- Open VSCode again
- An error will be shown when loading the custom editor for the file, because the file could not be found
- Rename the file back to its original name
- Click the "Try again" button

Expected behaviour: The file should now be read by VSCode and opened with the custom editor, since it is available in the file system again

Actual behaviour: Opening the file always gives the same error that was given the first time VSCode tried to open it. This persists until the window is reloaded.

VS Code version: Code 1.94.2 (384ff7382de624fb94dbaf6da11977bba1ecd427, 2024-10-09T16:08:44.566Z)
OS version: Windows_NT x64 10.0.19045
Modes:

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

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz (8 x 2794)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: unavailable_off<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled<br>webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|15.88GB (7.85GB free)|
|Process Argv|--crash-reporter-id 4efcda03-7d5c-4622-bde5-e0749e30e6a5|
|Screen Reader|no|
|VM|40%|
</details><details><summary>Extensions (22)</summary>

Extension|Author (truncated)|Version
---|---|---
vscode-sqlite|ale|0.14.1
tasks-shell-input|aug|1.12.4
vscode-eslint|dba|3.0.10
ev3dev-browser|ev3|1.2.1
vscode-nbt|Mis|0.9.2
debugpy|ms-|2024.10.0
isort|ms-|2023.10.1
python|ms-|2024.16.1
jupyter|ms-|2024.9.1
jupyter-keymap|ms-|1.1.2
jupyter-renderers|ms-|1.0.19
vscode-jupyter-cell-tags|ms-|0.1.9
vscode-jupyter-slideshow|ms-|0.1.6
vsliveshare|ms-|1.0.5941
commandcrafter|Pap|0.1.0
inline-html|pus|0.3.10
binary-viewer|Qia|1.1.1
rust-analyzer|rus|0.3.2137
shader|sle|1.1.5
vscode-mc-shader|Str|0.9.9
lua|sum|3.11.1
vscode-lldb|vad|1.11.0


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

```
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
vscaat:30438848
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
pythongtdpath:30769146
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
accentitlementsc:30995553
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
f3je6385:31013174
a69g1124:31058053
dvdeprecation:31068756
dwnewjupytercf:31046870
impr_priority:31102340
nativerepl1:31139838
refactort:31108082
pythonrstrctxt:31112756
wkspc-onlycs-t:31132770
nativeloc2:31134642
wkspc-ranged-t:31151552
cf971741:31144450
defaultse:31146405
iacca2:31156134
notype1:31157159
controlgs:31153265
5fd0e150:31155592

```

</details>

<!-- generated by issue reporter -->