eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.99k stars 1.19k forks source link

Make it possible to install VS Code web-extensions #22320

Open azatsarynnyy opened 1 year ago

azatsarynnyy commented 1 year ago

Is your task related to a problem? Please describe

When the user tries to install a web-extension, e.g. vscodevim.Vim, the installation fails with: image From the logs: [error] Error: No extension gallery service configured.

When the user clicks the Try Downloading Manually... button, Che-Code downloads the vsix file, and then the user is able to install the extension with the help of the Install from VSIX... command.

A web-extension that is running in a browser extension host (instead of a remote extension host) should be installed without any errors.

Describe the solution you'd like

Most likely, the problem is that in Che-Code there's no extensionsGallery.resourceUrlTemplate specified in the product.json file. It looks mandatory for installing the web-extensions. We need to check that.

Describe alternatives you've considered

No response

Additional context

No response

azatsarynnyy commented 1 year ago

this quick patch should fix the problem https://github.com/che-incubator/che-code/pull/248 but need to test more thoroughly + adapt to a custom OpenVSX

azatsarynnyy commented 1 year ago

My quick patch to set the resourceUrlTemplate fixes the [error] Error: No extension gallery service configured. But the requested URL is incorrect.

2023-06-28 17:34:45.715 [info] Installing extension: vscodevim.vim
2023-06-28 17:34:46.130 [info] Request to 'https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/oss-dev/web-extension-resource/open-vsx.org/vscode/unpkg/vscodevim/vim/1.25.2/extension' failed with status code 404
2023-06-28 17:34:46.130 [warning] Error while fetching extension resources list Not Found

Needs more investigation.

che-bot commented 10 months ago

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

azatsarynnyy commented 10 months ago

/remove-lifecycle stale

azatsarynnyy commented 2 months ago

One more example of the extension reporting the same error https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings

azatsarynnyy commented 1 month ago

I found out how to install such kinds of web (UI) extensions like https://open-vsx.org/extension/vscodevim/vim or https://open-vsx.org/extension/k--kato/intellij-idea-keybindings

There's a Remote: Extension Kind setting in Che-Code.

image

It allows to override where an extension should be run.

Adding the following section to the settings.json file

"remote.extensionKind": {
        "k--kato.intellij-idea-keybindings": [
            "workspace"
        ],
        "vscodevim.vim": [
            "workspace"
        ]
    }

allowed me to install both mentioned extensions.

AObuchow commented 1 month ago

@azatsarynnyy that's amazing, I'm glad to hear there's finally a workaround for this :grin:

It's a shame that you have to manually specify which web-extensions you want to allow to be installed locally -- would be nice if there was a way for us to force all web-extensions to be installed in the workspace with a setting the in remote settings.json.

Still, a workaround is a huge improvement here :D