-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Allow running remote extensions in the web worker extension host #141322
Comments
Further details on this. I tested the vscode-css-fomatter example project as mentioned in the docs. Although it has a |
@thegecko The web worker extension host has more limitations compared to the nodejs extension host. That's why we will mostly prefer to run an extension on the nodejs extension host if a nodejs extension host is available. In the case of
In case an extension would use
That being said, this is pretty complex and has a lot of corner cases, like for example if an extension somehow got installed remotely instead of locally, etc. |
Thanks for the feedback @alexdima
This is exactly what I want to happen and I'm glad this is the intent. However this setup yields the following error in Codespaces:
I'll create a small extension to repro the issue... |
Simple VSCode extension which replicates this issue: https://github.com/thegecko/vscode-extension This extension has both It fails to load in codespaces. |
Erk.
I upload it to the workspace and install it from there :/ How can I test this without publishing it? |
@sandy081 How can we simulate a browser "installed" extension? i.e. I think it would need to be returned from here -- vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts Lines 1002 to 1004 in a514979
|
You can side load a browser installed extension using the command - |
Thanks, glad to see this is possible but currently trying to work out how to make it work. Using a @aeschli Should this URI be fully qualified to the root of the running container or support variables? |
Following these steps: I was able to prove the expected behaviour as working in https://vscode.dev Is there a way to test this in codespaces or can I assume it will just work the same and not use the other extension hosts? |
@thegecko With Codespaces, you mean the Codespaces Web UI? Out of the VS Code sources you can emulate this by running
(more documentation is on the way) |
IMO the extension should be able to run in the Web UI of a code server. Maybe the bug is here: vscode/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts Line 356 in 5c6672c
Do we also need a |
@aeschli This is not a bug and it is working as designed. Above code is to show the state of the extension and it resonates with how extensions are enabled in different extension hosts. It seems this extension cannot run in any of our extension hosts because:
In this case neither remote extension host nor web worker extension host can run this extension because former is missing main entry point and the latter does not find this extension. We do not generally run extensions across extension hosts - @alexdima please correct me if I am wrong. |
Thanks for the ongoing feedback.
Yeah, starting a codespace and getting the extension to install and run in the web extensionHost.
I'm confused, the example I shared mimics the setup outlined above by @alexdima which should result in
The example has
This would be a shame as the only workaround I have is to distribute multiple extensions which only differ in how |
We've met today and agreed that this is a bug. However, it is very late to fix this for January. To align with the documentation at https://code.visualstudio.com/api/advanced-topics/extension-host We agree:
|
Thanks for persisting with this and glad there is agreement. I understand this fix is too late for the current release :) Let me know if I can help in any way. |
…be also served from the server, i.e. they don't need to be installed locally (in the browser storage) (#141322)
@sandy081 I pushed the change in the |
@alexdima Pushed changes in
|
To verify, please try out the following:
|
I had to disable this again due to integration test failures. We'll try again via a PR. |
Does this issue occur when all extensions are disabled?: N/A
Issue:
There seems to be a mismatch in details about how to run an extension in a specified extension host versus reality.
In my situation I have an extension which I'd like to run in the following way:
local extension host
.web extension host
.Looking at the information outlined here:
https://code.visualstudio.com/api/advanced-topics/extension-host
I believe I need to describe this extension with
extensionKind: [ui]
to request it is run in thelocal extension host
. The details for this extensionKind explicitly outlines:In the case of VS Code for the Web with Codespaces, where no local extension host is available, such an extension can not load, unless it is *also* a web extension. It will then be loaded in the web extension host
Which leads me to believe I can also describe this as a
web extension
as outlined here:https://code.visualstudio.com/api/extension-guides/web-extensions
Which states:
Extensions can have both browser and main entry points in order to run in browser and in Node.js runtimes.
My extension has both a
main
and abrowser
entry point, as this seems to be supported in the link above and I would expect thebrowser
entrypoint to be used in the web extension host and themain
entrypoint anywhere else.When running the extension on the desktop (normally or using remote), this seems to work as expected, however the web flavours of VS Code fail to load the extension with the error:
This extension is disabled because it is not supported in Visual Studio Code for the Web
Question
Before I delve into the (rather complicated) loading code, I'd like to understand the intent here and whether the expectation is that an extension can be setup to run in this way.
The text was updated successfully, but these errors were encountered: