Git - extract history item detail provider (#238041)

* Initial refactor of hover commands

* Delete old code for hover commands

* More refactoring
This commit is contained in:
Ladislau Szomoru
2025-01-16 11:37:27 +01:00
committed by GitHub
parent 47cff90e28
commit eaba97f995
20 changed files with 182 additions and 150 deletions

View File

@@ -9,9 +9,7 @@ export { ProviderResult } from 'vscode';
export interface API {
registerRemoteSourceProvider(provider: RemoteSourceProvider): Disposable;
getRemoteSourceActions(url: string): Promise<RemoteSourceAction[]>;
getRemoteSourceControlHistoryItemCommands(url: string): Promise<Command[] | undefined>;
pickRemoteSource(options: PickRemoteSourceOptions): Promise<string | PickRemoteSourceResult | undefined>;
provideRemoteSourceLinks(url: string, content: string): ProviderResult<string>;
}
export interface GitBaseExtension {
@@ -83,8 +81,6 @@ export interface RemoteSourceProvider {
getBranches?(url: string): ProviderResult<string[]>;
getRemoteSourceActions?(url: string): ProviderResult<RemoteSourceAction[]>;
getRemoteSourceControlHistoryItemCommands?(url: string): ProviderResult<Command[]>;
getRecentRemoteSources?(query?: string): ProviderResult<RecentRemoteSource[]>;
getRemoteSources(query?: string): ProviderResult<RemoteSource[]>;
provideRemoteSourceLinks?(url: string, content: string): ProviderResult<string>;
}

View File

@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Uri, Event, Disposable, ProviderResult, Command } from 'vscode';
import { Uri, Event, Disposable, ProviderResult, Command, SourceControlHistoryItem } from 'vscode';
export { ProviderResult } from 'vscode';
export interface Git {
@@ -289,6 +289,11 @@ export interface BranchProtectionProvider {
provideBranchProtection(): BranchProtection[];
}
export interface SourceControlHistoryItemDetailProvider {
provideHoverCommands(repository: Repository): Promise<Command[] | undefined>;
provideMessageLinks(repository: Repository, message: string): Promise<string | undefined>;
}
export type APIState = 'uninitialized' | 'initialized';
export interface PublishEvent {
@@ -316,6 +321,7 @@ export interface API {
registerPostCommitCommandsProvider(provider: PostCommitCommandsProvider): Disposable;
registerPushErrorHandler(handler: PushErrorHandler): Disposable;
registerBranchProtectionProvider(root: Uri, provider: BranchProtectionProvider): Disposable;
registerSourceControlHistoryItemDetailProvider(provider: SourceControlHistoryItemDetailProvider): Disposable;
}
export interface GitExtension {