Browse Source

Fixes #2014 workaround vscode encoding bug

See also: https://github.com/microsoft/vscode/issues/85930
main
Eric Amodio 2 years ago
parent
commit
ab3a242a08
2 changed files with 8 additions and 1 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +7
    -1
      src/git/remotes/provider.ts

+ 1
- 0
CHANGELOG.md View File

@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## Fixed
- Fixes [#2014](https://github.com/gitkraken/vscode-gitlens/issues/2014) - '#' encoded incorrectly
- Fixes [#1787](https://github.com/gitkraken/vscode-gitlens/issues/1787) - Remove '-review' from Gerrit Remote reviewDomain() — thanks to [PR #1954](https://github.com/gitkraken/vscode-gitlens/pull/1954) by Felipe Santos ([@felipecrs](https://github.com/felipecrs))
- Fixes [#1902](https://github.com/gitkraken/vscode-gitlens/issues/1902) - Support replacing mirror/replica domain with main domain for remote provider — thanks to [PR #1954](https://github.com/gitkraken/vscode-gitlens/pull/1954) by Felipe Santos ([@felipecrs](https://github.com/felipecrs))

+ 7
- 1
src/git/remotes/provider.ts View File

@ -231,7 +231,13 @@ export abstract class RemoteProvider implements RemoteProviderReference {
private async openUrl(url?: string): Promise<boolean | undefined> {
if (url == null) return undefined;
return env.openExternal(Uri.parse(url));
const uri = Uri.parse(url);
// Pass a string to openExternal to avoid double encoding issues: https://github.com/microsoft/vscode/issues/85930
if (uri.path.includes('#')) {
// .d.ts currently says it only supports a Uri, but it actually accepts a string too
return (env.openExternal as unknown as (target: string) => Thenable<boolean>)(uri.toString());
}
return env.openExternal(uri);
}
protected encodeUrl(url: string): string;

Loading…
Cancel
Save