Introduce share links in more places via a contrib (#177311)

* Introduce share links in more places via a contrib

* Update `build/lib/i18n.resources.json`
This commit is contained in:
Joyce Er
2023-03-16 01:15:15 -07:00
committed by GitHub
parent c97d5812f1
commit e9ff97aa0f
11 changed files with 152 additions and 78 deletions

View File

@@ -45,7 +45,10 @@ export function registerCommands(gitAPI: GitAPI): vscode.Disposable {
}
}));
disposables.add(vscode.commands.registerCommand('github.copyVscodeDevLink', async (context: LinkContext) => {
disposables.add(vscode.commands.registerCommand('github.copyVscodeDevLink', async (context: LinkContext, ranges?: vscode.Range[]) => {
if (Array.isArray(ranges) && ranges.every((range) => 'start' in range && 'end' in range) && context instanceof vscode.Uri) {
context = { uri: context, ranges };
}
return copyVscodeDevLink(gitAPI, true, context);
}));
@@ -53,10 +56,6 @@ export function registerCommands(gitAPI: GitAPI): vscode.Disposable {
return copyVscodeDevLink(gitAPI, false, context);
}));
disposables.add(vscode.commands.registerCommand('github.copyVscodeDevLinkWithoutRange', async (context: LinkContext) => {
return copyVscodeDevLink(gitAPI, true, context, false);
}));
disposables.add(vscode.commands.registerCommand('github.openOnVscodeDev', async () => {
return openVscodeDevLink(gitAPI);
}));