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:
@@ -18,7 +18,9 @@ function asRemoteSource(raw: any): RemoteSource {
|
||||
const protocol = workspace.getConfiguration('github').get<'https' | 'ssh'>('gitProtocol');
|
||||
return {
|
||||
name: `$(github) ${raw.full_name}`,
|
||||
description: raw.description || undefined,
|
||||
description: `${raw.stargazers_count > 0 ? `$(star-full) ${raw.stargazers_count}` : ''
|
||||
}`,
|
||||
detail: raw.description || undefined,
|
||||
url: protocol === 'https' ? raw.clone_url : raw.ssh_url
|
||||
};
|
||||
}
|
||||
@@ -75,6 +77,8 @@ export class GithubRemoteSourceProvider implements RemoteSourceProvider {
|
||||
return [];
|
||||
}
|
||||
|
||||
query += ` fork:true`;
|
||||
|
||||
const raw = await octokit.search.repos({ q: query, sort: 'stars' });
|
||||
return raw.data.items.map(asRemoteSource);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user