Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
isc-bsaviano opened this issue May 27, 2025 · 3 comments · May be fixed by #249945
Open

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

isc-bsaviano opened this issue May 27, 2025 · 3 comments · May be fixed by #249945

Comments

@isc-bsaviano
Copy link

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

@isc-bsaviano
Copy link
Author

Here's my version info:

Version: 1.101.0-insider
Commit: 9bb394b
Date: 2025-05-27T06:34:19.809Z
Electron: 35.4.0
ElectronBuildId: 11602177
Chromium: 134.0.6998.205
Node.js: 22.15.0
V8: 13.4.114.21-electron.0
OS: Darwin arm64 24.5.0

@bpasero
Copy link
Member

bpasero commented May 28, 2025

@isc-bsaviano I would prefer if you could show me a repo with the changes you did to the extension to run it from the sources

@bpasero bpasero added info-needed Issue requires more information from poster confirmation-pending labels May 28, 2025
@isc-bsaviano
Copy link
Author

@bpasero bpasero removed the info-needed Issue requires more information from poster label May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants