Implement simple file system provider to fetch files from containerized plugin #18405
Labels
area/editor/theia
Issues related to the che-theia IDE of Che
kind/task
Internal things, technical debt, and to-do tasks to be performed.
severity/P1
Has a major impact to usage or development of the system.
Milestone
Is your task related to a problem? Please describe.
Use case 1:
When VS Code extension runs in dedicate container, it can provide a Webview with own html content. For example will take a look on vscode-didact.
didactWebView.ts#L358-L372:
src="${scriptUri}"
constructs with schemevscode-resource
didactWebView.ts#L344:
When extension calls method to create a Webview it sets up a complete html content into a webview object:
didactWebView.ts#L409
So Theia receives the html content it performs preprocess income html content by replacing all links that have
vscode-resource
scheme:webview.ts#L393:
And in result Webview's html we have got links that looks like:
were service worker extracts path:
file/tmp/vscode-unpacked/redhat.vscode-didact.0.1.14.uteaiieoau.vscode-didact-0.1.14.vsix/extension/media/webviewslim.css
and tries to load such resources:webview.ts#L444-L486
As the result we have got 404 error, as Theia tries to load file from local container, not from remote ones, which is obvious.
Use case 2:
From discussion with @tsmaeder it turned out similar problem, when VS Code extension that run in remote container might call:
vscode.fs.watch(file, ...)
. Which will call watching for a file for a nonexistent file path.Describe the solution you'd like
It is possible to modify schema from
file
tofile-sidecar-${machineName}
and get URL for links like:But
fileService
under the hood tries to load the resource by given file system provider based on the given scheme:file-service.ts#L380-L402:
So we are missing file system providers for schema like
file-sidecar-${machineName}
which will communicate with the particular container to obtain remote files.There is an idea to create a simple file system provider as it has been done for
CheSideCarResourceResolver
: che-sidecar-resource.ts#L50-L67Describe alternatives you've considered
Additional context
Fixes: #16870
Might be somehow related: eclipse-theia/theia#8429 eclipse-theia/theia#8468
Does anybody has a some thoughts about this? cc @tsmaeder
The text was updated successfully, but these errors were encountered: