Create a insiders.vscode.dev link when I use insiders for sharing (#156436)

Fixes #156255
This commit is contained in:
Alex Ross
2022-07-27 16:55:08 +02:00
committed by GitHub
parent c12aa6da6f
commit a3b712e04e

View File

@@ -9,9 +9,13 @@ import { publishRepository } from './publish';
import { DisposableStore } from './util';
import { getPermalink } from './links';
function getVscodeDevHost(): string {
return `https://${vscode.env.appName.toLowerCase().includes('insiders') ? 'insiders.' : ''}vscode.dev/github`;
}
async function copyVscodeDevLink(gitAPI: GitAPI, useSelection: boolean) {
try {
const permalink = getPermalink(gitAPI, useSelection, 'https://vscode.dev/github');
const permalink = getPermalink(gitAPI, useSelection, getVscodeDevHost());
if (permalink) {
return vscode.env.clipboard.writeText(permalink);
}
@@ -22,7 +26,7 @@ async function copyVscodeDevLink(gitAPI: GitAPI, useSelection: boolean) {
async function openVscodeDevLink(gitAPI: GitAPI): Promise<vscode.Uri | undefined> {
try {
const permalink = getPermalink(gitAPI, true, 'https://vscode.dev/github');
const permalink = getPermalink(gitAPI, true, getVscodeDevHost());
return permalink ? vscode.Uri.parse(permalink) : undefined;
} catch (err) {
vscode.window.showErrorMessage(err.message);