vscode: workspace.applyEdit doesn't work if file is opened from read-only file system provider

Issue Type: Bug

If the file is open from a read-only file system provider (registered with vscode.workspace.registerFileSystemProvider(..., ..., { isReadonly: true } )), vscode.workspace.applyEdit doesn’t apply any edits to its buffer. It used to work in the previous version of insiders, and it works in the stable realease.

VS Code version: Code - Insiders 1.27.0-insider (e0a68266321d1518bc12428b71d80524461a275b, 2018-08-22T05:18:13.273Z) OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel® Core™ i7-6700 CPU @ 3.40GHz (8 x 3408)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 31.92GB (11.16GB free)
Process Argv C:\Program Files\Microsoft VS Code Insiders\Code - Insiders.exe
Screen Reader no
VM 0%
Extensions (2)
Extension Author (truncated) Version
cpptools ms- 0.18.1
csharp ms- 1.15.2

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@isidorn today’s insiders, 1.27.0, is good.

Also, in #53257, I already pointed out that extension should be able to make edits to read-only file, and you agreed to that, what has changed since then?

@IlyaBiryukov: About extension applying changes to a document opened from a read-only file system provider, we do need that working. The issue is the behavior of save. I think saving a document should just be disabled for read-only provider.

@bpasero commented on Jul 2 @IlyaBiryukov yeah good point, extensions still need to be able to make changes to the model in case it updates. We could maybe change our model in a way that a readonly model never shows up as dirty to the user.