Skip to content
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

Enable private extension manager on web-based VS Code instance #26

Open
lachaib opened this issue Oct 6, 2020 · 11 comments
Open

Enable private extension manager on web-based VS Code instance #26

lachaib opened this issue Oct 6, 2020 · 11 comments
Labels
blocked Currently unable to fix this issue enhancement New feature or request

Comments

@lachaib
Copy link
Contributor

lachaib commented Oct 6, 2020

Hello,

While trying to use code-server to generate a remote workspace, I discovered that I couldn't install private extension manager. After investigation I realised it's due to extensionKind: ["workspace"] property in package.json.
I've clone the project, compiled it without the property and installed from vsix in my code-server, and I could see it working rather fine (at least it shows and installs extensions directly from my registry).

Would it be possible to remove this property from the package.json to make it properly working?

Thanks

@joelspadin-garmin
Copy link
Owner

Sorry, I missed the notification when you created this issue.

That is needed so that the main extension runs on the server when in a remote workspace. (The remote helper extension runs locally:

"extensionKind": [
"ui"
],
). I don't think I can remove that without breaking it for SSH, WSL, and Docker remote workspaces.

It sounds like this is an issue with code-server, as https://code.visualstudio.com/api/advanced-topics/remote-extensions#incorrect-execution-location indicates that most extensions fall into the "workspace" category.

As a workaround though, instead of removing extensionKind could you try setting it to this instead?

{
  "extensionKind": ["workspace", "ui"]
}

@lachaib
Copy link
Contributor Author

lachaib commented Nov 13, 2020

Hello,

My understanding was that ["workspace", "ui"] was the actual default behaviour, but sure, it can be set up explicitly as you suggest.

I don't think the issue is with code-server, but actually with how VS Code is listing the extensions from marketplace when run in browser mode compatibility. Somehow the extensions with kind "workspace" only will be considered as not available, while I checked that yours works fine or at least I didn't get to a point where I found limitations concerning where it is run.
Same happened trying to join a LiveShare session in browser mode.

@lachaib
Copy link
Contributor Author

lachaib commented Nov 13, 2020

image

Just to show how it's behaving in LiveShare browser mode 😄

It's kind of a shame given that LiveShare or code-server are really proficient ways to share a workspace for pair/mob-programming, helping a junior dev, or create code spaces on the cloud.
I'm thinking also about eclipse-che which is compatible with vsix plugins, that is also browser based and has similar use cases.

I will make the pull request if you agree to it and from that point on it'll be up to you to accept it or not 😉

@joelspadin-garmin
Copy link
Owner

Thanks for that error message. After tracking that down inside vscode's code, I found https://github.com/microsoft/vscode/blob/f74e473238aca7b79c08be761d99a0232838ca4c/src/vs/workbench/services/extensions/common/extensionsUtil.ts#L23-L26

Instead of ["workspace", "ui"], try ["workspace", "web"]. It looks like they may have forgotten to document the "web" option on the page I linked earlier.

@lachaib lachaib changed the title Remove extensionKind from package.json to enable plugin on browser mode Enable private extension manager on web-based VS Code instance Nov 19, 2020
@joelspadin-garmin
Copy link
Owner

I just published v1.4.0 with your fix in it. Thanks!

@lachaib
Copy link
Contributor Author

lachaib commented Nov 20, 2020

Just tested now that it's on marketplace but for some reason it's still refusing to install from LiveShare browser session (which I obviously didn't encounter when I installed from vsix), though now at least it appears on marketplace.

image

I cannot reopen this issue but if you can it'd be good so that we can track follow-up on this issue, otherwise I will open a new one.

@joelspadin-garmin
Copy link
Owner

Reopened. I've verified that the package.json in v1.4.0 does include "web" in its extensionKind, so there must be something else needed to make that work.

@joelspadin-garmin
Copy link
Owner

I also opened an issue on the vscode repo asking for clarification on how "web" is supposed to work, since I can't find any documentation for it.

@joelspadin-garmin joelspadin-garmin added the enhancement New feature or request label Nov 20, 2020
@lachaib
Copy link
Contributor Author

lachaib commented Nov 23, 2020

Found this documentation that might partially explain what needs to be done for an extension to work in web-browser, though I've not found anything related to the checks being performed and any extension that actually can be installed.

@joelspadin-garmin
Copy link
Owner

The response in microsoft/vscode#111043 was that web extensions are a work in progress and are not officially supported yet.

@joelspadin-garmin joelspadin-garmin added the blocked Currently unable to fix this issue label Nov 23, 2020
@joelspadin-garmin
Copy link
Owner

Based on the things linked in that document, I suspect this extension may not be possible to run in a browser currently. It uses https://github.com/npm/pacote which appears to use fs in ways that document says don't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Currently unable to fix this issue enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants