mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 06:21:50 +01:00
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:
@@ -3,7 +3,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { QuickPickItem, window, QuickPick, QuickPickItemKind, l10n, Disposable, Command } from 'vscode';
|
||||
import { QuickPickItem, window, QuickPick, QuickPickItemKind, l10n, Disposable } from 'vscode';
|
||||
import { RemoteSourceProvider, RemoteSource, PickRemoteSourceOptions, PickRemoteSourceResult, RemoteSourceAction } from './api/git-base';
|
||||
import { Model } from './model';
|
||||
import { throttle, debounce } from './decorators';
|
||||
@@ -123,32 +123,6 @@ export async function getRemoteSourceActions(model: Model, url: string): Promise
|
||||
return remoteSourceActions;
|
||||
}
|
||||
|
||||
export async function getRemoteSourceControlHistoryItemCommands(model: Model, url: string): Promise<Command[] | undefined> {
|
||||
const providers = model.getRemoteProviders();
|
||||
|
||||
const remoteSourceCommands = [];
|
||||
for (const provider of providers) {
|
||||
remoteSourceCommands.push(...(await provider.getRemoteSourceControlHistoryItemCommands?.(url) ?? []));
|
||||
}
|
||||
|
||||
return remoteSourceCommands.length > 0 ? remoteSourceCommands : undefined;
|
||||
}
|
||||
|
||||
export async function provideRemoteSourceLinks(model: Model, url: string, content: string): Promise<string> {
|
||||
const providers = model.getRemoteProviders();
|
||||
|
||||
for (const provider of providers) {
|
||||
const parsedContent = await provider.provideRemoteSourceLinks?.(url, content);
|
||||
if (!parsedContent) {
|
||||
continue;
|
||||
}
|
||||
|
||||
content = parsedContent;
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
export async function pickRemoteSource(model: Model, options: PickRemoteSourceOptions & { branch?: false | undefined }): Promise<string | undefined>;
|
||||
export async function pickRemoteSource(model: Model, options: PickRemoteSourceOptions & { branch: true }): Promise<PickRemoteSourceResult | undefined>;
|
||||
export async function pickRemoteSource(model: Model, options: PickRemoteSourceOptions = {}): Promise<string | PickRemoteSourceResult | undefined> {
|
||||
|
||||
Reference in New Issue
Block a user