eclipse-theia / theia

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

Cannot use GitLens in Theia #14335

Open meng-jpg opened 2 days ago

meng-jpg commented 2 days ago

Bug Description:

A number of buttons in GitLens sidebar are in the state of grey unable to click, and most of the clickable buttons have no response after clicking. For example, Open a Folder or Repository, Start Here (Welcome), Open GitLens Settings, Connect an Integration, Commands.

截屏2024-10-21 10 45 50

When I try to login from GitLens: Sign In to GitKraken in the command panel, I get the following error:

截屏2024-10-21 10 51 52

Steps to Reproduce:

  1. Install GitLens — Git supercharged
  2. Click buttons in the GitLens sidebar
  3. Nothing will happen

Additional Information

JonasHelming commented 2 days ago

@tsmaeder

tsmaeder commented 1 day ago

Confirmed on Windows 11/1.54.0 when doing "sign into gitkraken" from the command quickpick

tsmaeder commented 1 day ago

This is a bug in GitLens: they call vscode.env.openExternal() with a string instead of an URI as documented in https://code.visualstudio.com/api/references/vscode-api#env. And it seems they are even doing this on purpose https://github.com/gitkraken/vscode-gitlens/blob/main/src/system/vscode/utils.ts#L280. @meng-jpg I would suggest you open an issue with gitkraken so that they are aware folks are using their product on Theia and that it's not working if they rely on VS Code implementation details. Considering GitLens is a very popular extension, we still probably want to be bug-compatible in this case.

meng-jpg commented 1 day ago

This is a bug in GitLens: they call vscode.env.openExternal() with a string instead of an URI as documented in https://code.visualstudio.com/api/references/vscode-api#env. And it seems they are even doing this on purpose https://github.com/gitkraken/vscode-gitlens/blob/main/src/system/vscode/utils.ts#L280. @meng-jpg I would suggest you open an issue with gitkraken so that they are aware folks are using their product on Theia and that it's not working if they rely on VS Code implementation details. Considering GitLens is a very popular extension, we still probably want to be bug-compatible in this case.

Thank you for your advice. I have submitted the issue to gitkraken and am waiting for a reply.

msujew commented 1 day ago

@tsmaeder Without invalidating what you said, it seems like passing a string actually "fixes" a bug in VS Code related to incorrectly encoded URI strings. Apparently it's unfixable due to backwards compatibility, see https://github.com/microsoft/vscode/issues/156859#issuecomment-1263474264 (related to the discussion surrounding URIs we had a while back). It seems like the VS Code people want to use URL in addition to URI, but that change hasn't landed yet.

We should consider supporting string in the meantime, since this actually resolves the issue. I'm not a big fan of this myself, but the VS Code team coded themselves (and us by proxy) into a corner here.

tsmaeder commented 1 day ago

Yeah, I remember I've seen this one before. It's kind sad, though, that in five years, they couldn't be arsed to add an alternative signature to the API.