mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Enrich Git extension's remote source provider API (#147613)
* Allow custom title in remote source picker * Include forks in query search results * Support `RemoteSource.detail` * Allow showing quickpicks in `getRemoteSources` * Allow custom placeholder and remote source icons * Add ability to customize placeholder * Register and show recently opened sources * Allow custom remote url labels * Add a separator label for remote sources * Update git-base typings * Make showing recent sources opt in * Add concept of recent remote source to `RemoteSourceProvider` concept * Recent sources should be sorted by timestamp * Pass current query to `getRemoteSources` * Fix applying query
This commit is contained in:
17
extensions/git-base/src/api/git-base.d.ts
vendored
17
extensions/git-base/src/api/git-base.d.ts
vendored
@@ -31,9 +31,12 @@ export interface GitBaseExtension {
|
||||
|
||||
export interface PickRemoteSourceOptions {
|
||||
readonly providerLabel?: (provider: RemoteSourceProvider) => string;
|
||||
readonly urlLabel?: string;
|
||||
readonly urlLabel?: string | ((url: string) => string);
|
||||
readonly providerName?: string;
|
||||
readonly title?: string;
|
||||
readonly placeholder?: string;
|
||||
readonly branch?: boolean; // then result is PickRemoteSourceResult
|
||||
readonly showRecentSources?: boolean;
|
||||
}
|
||||
|
||||
export interface PickRemoteSourceResult {
|
||||
@@ -44,17 +47,29 @@ export interface PickRemoteSourceResult {
|
||||
export interface RemoteSource {
|
||||
readonly name: string;
|
||||
readonly description?: string;
|
||||
readonly detail?: string;
|
||||
/**
|
||||
* Codicon name
|
||||
*/
|
||||
readonly icon?: string;
|
||||
readonly url: string | string[];
|
||||
}
|
||||
|
||||
export interface RecentRemoteSource extends RemoteSource {
|
||||
readonly timestamp: number;
|
||||
}
|
||||
|
||||
export interface RemoteSourceProvider {
|
||||
readonly name: string;
|
||||
/**
|
||||
* Codicon name
|
||||
*/
|
||||
readonly icon?: string;
|
||||
readonly label?: string;
|
||||
readonly placeholder?: string;
|
||||
readonly supportsQuery?: boolean;
|
||||
|
||||
getBranches?(url: string): ProviderResult<string[]>;
|
||||
getRecentRemoteSources?(query?: string): ProviderResult<RecentRemoteSource[]>;
|
||||
getRemoteSources(query?: string): ProviderResult<RemoteSource[]>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user