Skip to content

VS Code not showing correct file content for virtual files that are changed on writeFile() #249906

Closed
@isc-bsaviano

Description

@isc-bsaviano

Steps to Reproduce:

  1. Download and install the modified version of the MemFS sample extension found below.
  2. Open this workspace:
{
	"folders": [
		{
			"name": "MemFS",
			"uri": "memfs:/"
		}
	],
	"settings": {}
}

You will see a file called issue.txt be automatically opened.
3. Observe that the contents of the MemFS Output channel look like this:

writeFile
readFile
--- content:
foo

---
stat
mtime 1748362486778
stat
mtime 1748362486778
stat
mtime 1748362486778

This is logging the FileSystemProvider events called on issue.txt.
4. Type a "b" after "foo" in issue.txt and save the file.
5. Observe that the editor is showing "foob", but that the text of the file returned by readFile() is now "foobar":

writeFile
stat
mtime 1748362634512
stat
mtime 1748362634512
readFile
--- content:
foobar

---

I expect that the content of the editor would match what is returned by readFile(), especially when the file's mtime has changed.

vscode-memfs-0.0.4.vsix.zip

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions