Skip to content

Editor appears to be hanging loading file after re-registering FileSystemProvider #61182

@IlyaBiryukov

Description

@IlyaBiryukov

Issue Type: Bug

VS Code version: Code 1.28.1 (3368db6, 2018-10-11T18:13:53.910Z)
OS version: Windows_NT x64 10.0.17763

When VSCode opens a document with custom scheme, if at this point the file system provider registered for this scheme is disposed, VSCode editor just keeps loading the document forever, even if a new file system provider is registered for the same scheme.

We have to dispose of the file system provider and register a new one because we want to change read-only status of the provider. The only way to do that is to do dispose-re-register for the same scheme.

Ideally, if VSCode allowed to change read-only status of the provider on the fly, without the need for disposing-re-registering, this should help us avoid the issue.

Or, alternatively, If VSCode cannot load the document because the file system provider got disposed in the middle of reading, VSCode should not try to load the document anymore and should close its editor window.

When this issue happens I see a TypeError exception is thrown:

TypeError: Cannot read property 'readFile' of undefined
    at e.$readFile (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:492:286)
    at t._doInvokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:640:888)
    at t._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:640:554)
    at t._receiveRequest (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:639:126)
    at t._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:638:59)
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:635:926
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:98:138
    at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:99:496)
    at a (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:154:213)
    at Socket.n._socketDataListener (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:154:432)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20)

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalityfile-explorerExplorer widget issuesremoteRemote system operations issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions