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

@@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Command, Disposable, commands } from 'vscode';
import { Disposable, commands } from 'vscode';
import { Model } from '../model';
import { getRemoteSourceActions, getRemoteSourceControlHistoryItemCommands, pickRemoteSource, provideRemoteSourceLinks } from '../remoteSource';
import { getRemoteSourceActions, pickRemoteSource } from '../remoteSource';
import { GitBaseExtensionImpl } from './extension';
import { API, PickRemoteSourceOptions, PickRemoteSourceResult, RemoteSourceAction, RemoteSourceProvider } from './git-base';
@@ -21,14 +21,6 @@ export class ApiImpl implements API {
return getRemoteSourceActions(this._model, url);
}
getRemoteSourceControlHistoryItemCommands(url: string): Promise<Command[] | undefined> {
return getRemoteSourceControlHistoryItemCommands(this._model, url);
}
provideRemoteSourceLinks(url: string, content: string): Promise<string> {
return provideRemoteSourceLinks(this._model, url, content);
}
registerRemoteSourceProvider(provider: RemoteSourceProvider): Disposable {
return this._model.registerRemoteSourceProvider(provider);
}

View File

@@ -9,8 +9,6 @@ export { ProviderResult } from 'vscode';
export interface API {
registerRemoteSourceProvider(provider: RemoteSourceProvider): Disposable;
getRemoteSourceActions(url: string): Promise<RemoteSourceAction[]>;
getRemoteSourceControlHistoryItemCommands(url: string): Promise<Command[] | undefined>;
provideRemoteSourceLinks(url: string, content: string): Promise<string | undefined>;
pickRemoteSource(options: PickRemoteSourceOptions): Promise<string | PickRemoteSourceResult | undefined>;
}
@@ -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): Promise<string | undefined>;
}