Do not break completion for unsupported FS providers - #5536
Conversation
✅ Deploy Preview for continuedev canceled.
|
There was a problem hiding this comment.
Wow, this is a great find! I saw #5226 but didn't have a good hunch as to what the issue was since I wasn't aware of TextDocumentProvider vs FileSystemProvider.
Great implementation as well! The dynamic set is a smart solution.
Caveat: Similar calls to vscode.workspace.fs.stat and vscode.workspace.fs.readDirectory might be affected as well but I haven't seen it in the wild, so I didn't do anything there.
This feels quite likely. What are your thoughts on the following:
- Add similar wrapper methods in
extensions/vscode/src/util/ideUtils.ts - Don't implement, just wrap, but add a code comment indicating that we likely need to do something similar to
ideUtils.readFile
There aren't many instances of either stat or readDirectory so this seems worth the effort.
Happy to merge as-is however, and I can do that myself in a follow up PR.
|
Ok, I'll add the other wrappers |
bfccb4f to
253aacd
Compare
|
@Patrick-Erichsen added |
Signed-off-by: Fred Bricon <fbricon@gmail.com>
|
Excellent, appreciate the extra work adding |
|
@Patrick-Erichsen thanks for merging. I initially messed up the syntax for automatically closing multiple issues, can you please manually close #3795 and #5226 |
Thanks for your great work! I think I can close #5226 myself once released (and checked). |
Description
vscode-java uses a custom URI scheme,
jdt, to represent binary class files. However it only provides a TextDocumentProvider sojdt://URIS can be opened as documents. Because vscode-java doesn't (yet) provide a FileSystem provider, vscode.workspace.fs.readFile calls throw an ugly exception:Continue ends up handling these URIs most likely after performing some LSP calls that reach the Java language server.
The fix should be 2-fold:
jdtscheme, but that's gonna take some time (Hi @rgrunber)Basically, the idea is to centralize all vscode.workspace.fs.readFile calls in one place, and intercept/ignore such ENOPRO errors, then ignore known problematic schemes in subsequent calls.
Caveat: Similar calls to vscode.workspace.fs.stat and vscode.workspace.fs.readDirectory might be affected as well but I haven't seen it in the wild, so I didn't do anything there.[done]Fixes #4903,
Fixes #3795,
Fixes #5226
Checklist
Testing instructions
Open a Java project and try to complete in a java file referencing external classes.