Separate quick diff API from SCM (#170544)

* Separate quick diff API from SCM
Part 1: split up the API.
upcoming in part 2: In editor UX for multiple quick diffs.
Fixes #169012

* Respond to review feedback

Co-authored-by: João Moreno <joao.moreno@microsoft.com>
This commit is contained in:
Alex Ross
2023-01-12 11:19:41 +01:00
committed by GitHub
parent 6d40104789
commit 04f0fb46ff
13 changed files with 255 additions and 42 deletions

View File

@@ -96,6 +96,7 @@ import { DebugConfigurationProviderTriggerKind } from 'vs/workbench/contrib/debu
import { IExtHostLocalizationService } from 'vs/workbench/api/common/extHostLocalizationService';
import { EditSessionIdentityMatch } from 'vs/platform/workspace/common/editSessions';
import { ExtHostProfileContentHandlers } from 'vs/workbench/api/common/extHostProfileContentHandler';
import { ExtHostQuickDiff } from 'vs/workbench/api/common/extHostQuickDiff';
export interface IExtensionRegistries {
mine: ExtensionDescriptionRegistry;
@@ -175,6 +176,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
const extHostFileSystemEvent = rpcProtocol.set(ExtHostContext.ExtHostFileSystemEventService, new ExtHostFileSystemEventService(rpcProtocol, extHostLogService, extHostDocumentsAndEditors));
const extHostQuickOpen = rpcProtocol.set(ExtHostContext.ExtHostQuickOpen, createExtHostQuickOpen(rpcProtocol, extHostWorkspace, extHostCommands));
const extHostSCM = rpcProtocol.set(ExtHostContext.ExtHostSCM, new ExtHostSCM(rpcProtocol, extHostCommands, extHostLogService));
const extHostQuickDiff = rpcProtocol.set(ExtHostContext.ExtHostQuickDiff, new ExtHostQuickDiff(rpcProtocol));
const extHostComment = rpcProtocol.set(ExtHostContext.ExtHostComments, createExtHostComments(rpcProtocol, extHostCommands, extHostDocuments));
const extHostProgress = rpcProtocol.set(ExtHostContext.ExtHostProgress, new ExtHostProgress(rpcProtocol.getProxy(MainContext.MainThreadProgress)));
const extHostLabelService = rpcProtocol.set(ExtHostContext.ExtHosLabelService, new ExtHostLabelService(rpcProtocol));
@@ -802,6 +804,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
checkProposedApiEnabled(extension, 'profileContentHandlers');
return extHostProfileContentHandlers.registrProfileContentHandler(extension, id, handler);
},
async registerQuickDiffProvider(quickDiffProvider: vscode.QuickDiffProvider, label: string, rootUri?: vscode.Uri): Promise<vscode.Disposable> {
checkProposedApiEnabled(extension, 'quickDiffProvider');
return extHostQuickDiff.registerQuickDiffProvider(quickDiffProvider, label, rootUri);
},
get tabGroups(): vscode.TabGroups {
return extHostEditorTabs.tabGroups;
}