-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
FileSystemProvider gets reinitialized in a completely new JavaScript context #103181
Comments
I am confused. Is this a debugger issue or is this because the extension host restarted after changing the workspace? |
I have no idea what causes this. Were you able to reproduce? |
I am not trying ;-) I know that we don't do anything special for file system providers, esp nothing like creating new JS contexts. So, this can only an issue with debugging and/or when reloading the extension host. Did you try this when bundling and locally installing your extension? |
I don't think this is related to the extension host reloading, because this happens within the span of a single debugging session. Perhaps it is something with the debugger, but I really couldn't tell you, I have no knowledge of how the VS Code debugger works. I will try to bundle and install locally and report back if that helped. I don't know how to debug this further myself, so if you or anyone else capable of diagnosing this are not going to try and reproduce this, I think that will leave this issue at a dead end. |
For completeness' sake, when packaging the extension as VSIX and installing it through it, the problem persists: it seems as though the runtime is reloaded from under the extension as it is running. It is as if the module import caused the module to evaluate multiple times (clearing the cache in effect), which AFAIK is not the module loading behavior in either CJS nor ESM. I still don't know exactly what it is that causes this, but it seems safe to rule out it being a debugger / extension host window issue and instead firmly a runtime issue or an issue with my understanding/assumptions about how the runtime behaves. |
Do you see the same with the file system provider sample: https://marketplace.visualstudio.com/items?itemName=jrieken.vscode-memfs? |
Steps to Reproduce:
demo
directory appear and selectreal.eml
cache.ts
inextension.js
real.eml
file selected previouslyreal.eml
file virtual directory asstat
on the FS provider is called again even though it was already called while populating the node initiallycache.ts
module was reloaded for some reason and thisstat
call sees{}
not the populated cache object which was initialized before when the progress indicator appeared after clickingreal.eml
cache.ts
module global context which to me is indicative of a JavaScript context change/reload? (But the window did not reload...)Does this issue occur when all extensions are disabled?: N/A
The text was updated successfully, but these errors were encountered: