eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.29k stars 2.45k forks source link

Use `targetPlatform` when installing plugin from open-vsx #13825

Closed msujew closed 1 week ago

msujew commented 2 weeks ago

What it does

Closes https://github.com/eclipse-theia/theia/issues/11291 Closes https://github.com/eclipse-theia/theia/issues/13558

For a while now open-vsx has offered to query plugins using the targetPlatform filter. This adjusts Theia's open-vsx integration to respect the backend's target platform. This is related to https://github.com/eclipse-theia/theia/pull/12410, which implemented this feature for the CLI.

When using the filter, only plugin entries with the specified target platform are actually returned. That's why we have to also query universal after querying the platform specific plugins to ensure that we actually install the newest available extension.

Also closes https://github.com/eclipse-theia/theia/issues/11291 by using the new v2 API endpoint which returns more compact results.

How to test

Testing this works best when you have two different operating systems available. I used Windows (PC) and Ubuntu (Gitpod) to test this.

  1. Install a plugin with native dependencies such as the rust-analyzer
  2. Assert that the plugin starts up when opening a *.rs file (it currently crashes on master if you aren't accidentally on the correct OS)
  3. Assert that all the other plugin related features work as expected

Follow-ups

I'm not sure this is how the open-vsx API is intended to be used. Querying the API multiple times for different target platforms (i.e. the backend platform + universal) seems a bit counterintuitive. We can maybe improve on this.

Review checklist

Reminder for reviewers