GitHub - add "Open on GitHub" to blame hover (#237514)

* WIP - saving my work

* Refactor hover rendering code
This commit is contained in:
Ladislau Szomoru
2025-01-08 20:34:54 +01:00
committed by GitHub
parent 1329d03879
commit dca80ea667
11 changed files with 147 additions and 57 deletions

View File

@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Uri, env, l10n, workspace } from 'vscode';
import { Command, Uri, env, l10n, workspace } from 'vscode';
import { RemoteSourceProvider, RemoteSource, RemoteSourceAction } from './typings/git-base';
import { getOctokit } from './auth';
import { Octokit } from '@octokit/rest';
@@ -136,4 +136,18 @@ export class GithubRemoteSourceProvider implements RemoteSourceProvider {
}
}];
}
async getRemoteSourceControlHistoryItemCommands(url: string): Promise<Command[]> {
const repository = getRepositoryFromUrl(url);
if (!repository) {
return [];
}
return [{
title: l10n.t('{0} Open on GitHub', '$(github)'),
tooltip: l10n.t('Open on GitHub'),
command: 'github.openOnGitHub',
arguments: [url]
}];
}
}