@codingame/monaco-vscode-extensions-service-override 1.83.7 → 1.83.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/webWorkerExtensionHostIframe.html +123 -0
- package/extensions.d.ts +12 -13
- package/extensions.js +456 -0
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +8 -0
- package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +3 -0
- package/package.json +5 -3
- package/tools/url.js +10 -0
- package/tools.js +5 -0
- package/vscode/src/vs/base/common/console.js +59 -0
- package/vscode/src/vs/base/common/prefixTree.js +131 -0
- package/vscode/src/vs/platform/files/common/watcher.js +71 -0
- package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +27 -0
- package/vscode/src/vs/platform/log/browser/log.js +26 -0
- package/vscode/src/vs/platform/remote/common/managedSocket.js +98 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +31 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +330 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +174 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +52 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +61 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +31 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +107 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +94 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +541 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +80 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +578 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +387 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +102 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +69 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +75 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +249 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +370 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +22 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +41 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +411 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +475 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +227 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +317 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +280 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +283 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +28 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +33 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +27 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +947 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +78 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +78 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +93 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +118 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +158 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +123 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +188 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +129 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +131 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +341 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +25 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +48 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +76 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadProfilContentHandlers.js +38 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +185 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +30 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +463 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +148 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +70 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +50 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +53 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +72 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +731 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +53 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +412 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +182 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +55 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +313 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +223 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +110 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +61 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +29 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +283 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +100 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +135 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +57 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +273 -0
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.api.impl.d.ts +2 -2
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostConfiguration.d.ts +3 -3
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionService.d.ts +3 -4
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostManagedSockets.d.ts +2 -2
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTerminalService.d.ts +19 -20
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTunnelService.d.ts +7 -8
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostWorkspace.d.ts +25 -26
- package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +35 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +217 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +57 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +51 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +92 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +648 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +297 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +62 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +109 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +109 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +331 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +380 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +5 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1196 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +19 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +334 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +543 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +178 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +101 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +57 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +145 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +3 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +73 -0
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +83 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +179 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +5 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +144 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +482 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +6 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +85 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +56 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +110 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +260 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +616 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +309 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +38 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +167 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +80 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +70 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +108 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +506 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +132 -0
- package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +103 -0
- package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +28 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +25 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +336 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +46 -0
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +283 -0
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +273 -0
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +52 -0
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +1093 -0
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +41 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +25 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +643 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +274 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +58 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +80 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +64 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +49 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +220 -0
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +5 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +79 -0
- package/vscode-proposed.d.ts +0 -3872
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.protocol.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionActivator.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostFileSystemInfo.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostInitDataService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostLocalizationService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostRpcService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostStoragePaths.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTypes.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostUriTransformerService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/worker/extHostExtensionService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/services/search/common/queryBuilder.d.ts +0 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
|
|
3
|
+
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
4
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
5
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
6
|
+
|
|
7
|
+
function reviveIconPathUris(iconPath) {
|
|
8
|
+
iconPath.dark = URI.revive(iconPath.dark);
|
|
9
|
+
if (iconPath.light) {
|
|
10
|
+
iconPath.light = URI.revive(iconPath.light);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
let MainThreadQuickOpen = class MainThreadQuickOpen {
|
|
14
|
+
constructor(extHostContext, quickInputService) {
|
|
15
|
+
this._items = {};
|
|
16
|
+
this.sessions = ( new Map());
|
|
17
|
+
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostQuickOpen));
|
|
18
|
+
this._quickInputService = quickInputService;
|
|
19
|
+
}
|
|
20
|
+
dispose() {
|
|
21
|
+
}
|
|
22
|
+
$show(instance, options, token) {
|
|
23
|
+
const contents = ( new Promise((resolve, reject) => {
|
|
24
|
+
this._items[instance] = { resolve, reject };
|
|
25
|
+
}));
|
|
26
|
+
options = {
|
|
27
|
+
...options,
|
|
28
|
+
onDidFocus: el => {
|
|
29
|
+
if (el) {
|
|
30
|
+
this._proxy.$onItemSelected(el.handle);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
if (options.canPickMany) {
|
|
35
|
+
return this._quickInputService.pick(contents, options, token).then(items => {
|
|
36
|
+
if (items) {
|
|
37
|
+
return ( items.map(item => item.handle));
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return this._quickInputService.pick(contents, options, token).then(item => {
|
|
44
|
+
if (item) {
|
|
45
|
+
return item.handle;
|
|
46
|
+
}
|
|
47
|
+
return undefined;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
$setItems(instance, items) {
|
|
52
|
+
if (this._items[instance]) {
|
|
53
|
+
this._items[instance].resolve(items);
|
|
54
|
+
delete this._items[instance];
|
|
55
|
+
}
|
|
56
|
+
return Promise.resolve();
|
|
57
|
+
}
|
|
58
|
+
$setError(instance, error) {
|
|
59
|
+
if (this._items[instance]) {
|
|
60
|
+
this._items[instance].reject(error);
|
|
61
|
+
delete this._items[instance];
|
|
62
|
+
}
|
|
63
|
+
return Promise.resolve();
|
|
64
|
+
}
|
|
65
|
+
$input(options, validateInput, token) {
|
|
66
|
+
const inputOptions = Object.create(null);
|
|
67
|
+
if (options) {
|
|
68
|
+
inputOptions.title = options.title;
|
|
69
|
+
inputOptions.password = options.password;
|
|
70
|
+
inputOptions.placeHolder = options.placeHolder;
|
|
71
|
+
inputOptions.valueSelection = options.valueSelection;
|
|
72
|
+
inputOptions.prompt = options.prompt;
|
|
73
|
+
inputOptions.value = options.value;
|
|
74
|
+
inputOptions.ignoreFocusLost = options.ignoreFocusOut;
|
|
75
|
+
}
|
|
76
|
+
if (validateInput) {
|
|
77
|
+
inputOptions.validateInput = (value) => {
|
|
78
|
+
return this._proxy.$validateInput(value);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return this._quickInputService.input(inputOptions, token);
|
|
82
|
+
}
|
|
83
|
+
$createOrUpdate(params) {
|
|
84
|
+
const sessionId = params.id;
|
|
85
|
+
let session = this.sessions.get(sessionId);
|
|
86
|
+
if (!session) {
|
|
87
|
+
const input = params.type === 'quickPick' ? this._quickInputService.createQuickPick() : this._quickInputService.createInputBox();
|
|
88
|
+
input.onDidAccept(() => {
|
|
89
|
+
this._proxy.$onDidAccept(sessionId);
|
|
90
|
+
});
|
|
91
|
+
input.onDidTriggerButton(button => {
|
|
92
|
+
this._proxy.$onDidTriggerButton(sessionId, button.handle);
|
|
93
|
+
});
|
|
94
|
+
input.onDidChangeValue(value => {
|
|
95
|
+
this._proxy.$onDidChangeValue(sessionId, value);
|
|
96
|
+
});
|
|
97
|
+
input.onDidHide(() => {
|
|
98
|
+
this._proxy.$onDidHide(sessionId);
|
|
99
|
+
});
|
|
100
|
+
if (params.type === 'quickPick') {
|
|
101
|
+
const quickpick = input;
|
|
102
|
+
quickpick.onDidChangeActive(items => {
|
|
103
|
+
this._proxy.$onDidChangeActive(sessionId, ( items.map(item => item.handle)));
|
|
104
|
+
});
|
|
105
|
+
quickpick.onDidChangeSelection(items => {
|
|
106
|
+
this._proxy.$onDidChangeSelection(sessionId, ( items.map(item => item.handle)));
|
|
107
|
+
});
|
|
108
|
+
quickpick.onDidTriggerItemButton((e) => {
|
|
109
|
+
this._proxy.$onDidTriggerItemButton(sessionId, e.item.handle, e.button.handle);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
session = {
|
|
113
|
+
input,
|
|
114
|
+
handlesToItems: ( new Map())
|
|
115
|
+
};
|
|
116
|
+
this.sessions.set(sessionId, session);
|
|
117
|
+
}
|
|
118
|
+
const { input, handlesToItems } = session;
|
|
119
|
+
for (const param in params) {
|
|
120
|
+
if (param === 'id' || param === 'type') {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if (param === 'visible') {
|
|
124
|
+
if (params.visible) {
|
|
125
|
+
input.show();
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
input.hide();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else if (param === 'items') {
|
|
132
|
+
handlesToItems.clear();
|
|
133
|
+
params[param].forEach((item) => {
|
|
134
|
+
if (item.type === 'separator') {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (item.buttons) {
|
|
138
|
+
item.buttons = ( item.buttons.map((button) => {
|
|
139
|
+
if (button.iconPath) {
|
|
140
|
+
reviveIconPathUris(button.iconPath);
|
|
141
|
+
}
|
|
142
|
+
return button;
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
handlesToItems.set(item.handle, item);
|
|
146
|
+
});
|
|
147
|
+
input[param] = params[param];
|
|
148
|
+
}
|
|
149
|
+
else if (param === 'activeItems' || param === 'selectedItems') {
|
|
150
|
+
input[param] = ( params[param]
|
|
151
|
+
.filter((handle) => ( handlesToItems.has(handle)))
|
|
152
|
+
.map((handle) => handlesToItems.get(handle)));
|
|
153
|
+
}
|
|
154
|
+
else if (param === 'buttons') {
|
|
155
|
+
input[param] = ( params.buttons.map(button => {
|
|
156
|
+
if (button.handle === -1) {
|
|
157
|
+
return this._quickInputService.backButton;
|
|
158
|
+
}
|
|
159
|
+
if (button.iconPath) {
|
|
160
|
+
reviveIconPathUris(button.iconPath);
|
|
161
|
+
}
|
|
162
|
+
return button;
|
|
163
|
+
}));
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
input[param] = params[param];
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return Promise.resolve(undefined);
|
|
170
|
+
}
|
|
171
|
+
$dispose(sessionId) {
|
|
172
|
+
const session = this.sessions.get(sessionId);
|
|
173
|
+
if (session) {
|
|
174
|
+
session.input.dispose();
|
|
175
|
+
this.sessions.delete(sessionId);
|
|
176
|
+
}
|
|
177
|
+
return Promise.resolve(undefined);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
MainThreadQuickOpen = __decorate([
|
|
181
|
+
extHostNamedCustomer(MainContext.MainThreadQuickOpen),
|
|
182
|
+
( __param(1, IQuickInputService))
|
|
183
|
+
], MainThreadQuickOpen);
|
|
184
|
+
|
|
185
|
+
export { MainThreadQuickOpen };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { extHostCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
3
|
+
import { ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
4
|
+
import { IRemoteAuthorityResolverService } from 'vscode/vscode/vs/platform/remote/common/remoteAuthorityResolver';
|
|
5
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
6
|
+
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
7
|
+
|
|
8
|
+
let MainThreadRemoteConnectionData = class MainThreadRemoteConnectionData extends Disposable {
|
|
9
|
+
constructor(extHostContext, _environmentService, remoteAuthorityResolverService) {
|
|
10
|
+
super();
|
|
11
|
+
this._environmentService = _environmentService;
|
|
12
|
+
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostExtensionService));
|
|
13
|
+
const remoteAuthority = this._environmentService.remoteAuthority;
|
|
14
|
+
if (remoteAuthority) {
|
|
15
|
+
this._register(remoteAuthorityResolverService.onDidChangeConnectionData(() => {
|
|
16
|
+
const connectionData = remoteAuthorityResolverService.getConnectionData(remoteAuthority);
|
|
17
|
+
if (connectionData) {
|
|
18
|
+
this._proxy.$updateRemoteConnectionData(connectionData);
|
|
19
|
+
}
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
MainThreadRemoteConnectionData = __decorate([
|
|
25
|
+
extHostCustomer,
|
|
26
|
+
( __param(1, IWorkbenchEnvironmentService)),
|
|
27
|
+
( __param(2, IRemoteAuthorityResolverService))
|
|
28
|
+
], MainThreadRemoteConnectionData);
|
|
29
|
+
|
|
30
|
+
export { MainThreadRemoteConnectionData };
|
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
3
|
+
import { Emitter, Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
4
|
+
import { DisposableStore, dispose, combinedDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
5
|
+
import { ISCMService, ISCMViewService } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm';
|
|
6
|
+
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
7
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
8
|
+
import { Sequence } from 'monaco-editor/esm/vs/base/common/sequence.js';
|
|
9
|
+
import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
10
|
+
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
11
|
+
import { IQuickDiffService } from 'vscode/vscode/vs/workbench/contrib/scm/common/quickDiff';
|
|
12
|
+
|
|
13
|
+
function getSCMHistoryItemIcon(historyItem) {
|
|
14
|
+
if (!historyItem.icon) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
else if (URI.isUri(historyItem.icon)) {
|
|
18
|
+
return URI.revive(historyItem.icon);
|
|
19
|
+
}
|
|
20
|
+
else if (ThemeIcon.isThemeIcon(historyItem.icon)) {
|
|
21
|
+
return historyItem.icon;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const icon = historyItem.icon;
|
|
25
|
+
return { light: URI.revive(icon.light), dark: URI.revive(icon.dark) };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
class MainThreadSCMResourceGroup {
|
|
29
|
+
get hideWhenEmpty() { return !!this.features.hideWhenEmpty; }
|
|
30
|
+
constructor(sourceControlHandle, handle, provider, features, label, id) {
|
|
31
|
+
this.sourceControlHandle = sourceControlHandle;
|
|
32
|
+
this.handle = handle;
|
|
33
|
+
this.provider = provider;
|
|
34
|
+
this.features = features;
|
|
35
|
+
this.label = label;
|
|
36
|
+
this.id = id;
|
|
37
|
+
this.elements = [];
|
|
38
|
+
this._onDidSplice = ( new Emitter());
|
|
39
|
+
this.onDidSplice = this._onDidSplice.event;
|
|
40
|
+
this._onDidChange = ( new Emitter());
|
|
41
|
+
this.onDidChange = this._onDidChange.event;
|
|
42
|
+
}
|
|
43
|
+
toJSON() {
|
|
44
|
+
return {
|
|
45
|
+
$mid: 4 ,
|
|
46
|
+
sourceControlHandle: this.sourceControlHandle,
|
|
47
|
+
groupHandle: this.handle
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
splice(start, deleteCount, toInsert) {
|
|
51
|
+
this.elements.splice(start, deleteCount, ...toInsert);
|
|
52
|
+
this._onDidSplice.fire({ start, deleteCount, toInsert });
|
|
53
|
+
}
|
|
54
|
+
$updateGroup(features) {
|
|
55
|
+
this.features = { ...this.features, ...features };
|
|
56
|
+
this._onDidChange.fire();
|
|
57
|
+
}
|
|
58
|
+
$updateGroupLabel(label) {
|
|
59
|
+
this.label = label;
|
|
60
|
+
this._onDidChange.fire();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
class MainThreadSCMResource {
|
|
64
|
+
constructor(proxy, sourceControlHandle, groupHandle, handle, sourceUri, resourceGroup, decorations, contextValue, command) {
|
|
65
|
+
this.proxy = proxy;
|
|
66
|
+
this.sourceControlHandle = sourceControlHandle;
|
|
67
|
+
this.groupHandle = groupHandle;
|
|
68
|
+
this.handle = handle;
|
|
69
|
+
this.sourceUri = sourceUri;
|
|
70
|
+
this.resourceGroup = resourceGroup;
|
|
71
|
+
this.decorations = decorations;
|
|
72
|
+
this.contextValue = contextValue;
|
|
73
|
+
this.command = command;
|
|
74
|
+
}
|
|
75
|
+
open(preserveFocus) {
|
|
76
|
+
return this.proxy.$executeResourceCommand(this.sourceControlHandle, this.groupHandle, this.handle, preserveFocus);
|
|
77
|
+
}
|
|
78
|
+
toJSON() {
|
|
79
|
+
return {
|
|
80
|
+
$mid: 3 ,
|
|
81
|
+
sourceControlHandle: this.sourceControlHandle,
|
|
82
|
+
groupHandle: this.groupHandle,
|
|
83
|
+
handle: this.handle
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
class MainThreadSCMHistoryProvider {
|
|
88
|
+
get actionButton() { return this._actionButton; }
|
|
89
|
+
set actionButton(actionButton) {
|
|
90
|
+
this._actionButton = actionButton;
|
|
91
|
+
this._onDidChangeActionButton.fire();
|
|
92
|
+
}
|
|
93
|
+
get currentHistoryItemGroup() { return this._currentHistoryItemGroup; }
|
|
94
|
+
set currentHistoryItemGroup(historyItemGroup) {
|
|
95
|
+
this._currentHistoryItemGroup = historyItemGroup;
|
|
96
|
+
this._onDidChangeCurrentHistoryItemGroup.fire();
|
|
97
|
+
}
|
|
98
|
+
constructor(proxy, handle) {
|
|
99
|
+
this.proxy = proxy;
|
|
100
|
+
this.handle = handle;
|
|
101
|
+
this._onDidChangeActionButton = ( new Emitter());
|
|
102
|
+
this.onDidChangeActionButton = this._onDidChangeActionButton.event;
|
|
103
|
+
this._onDidChangeCurrentHistoryItemGroup = ( new Emitter());
|
|
104
|
+
this.onDidChangeCurrentHistoryItemGroup = this._onDidChangeCurrentHistoryItemGroup.event;
|
|
105
|
+
}
|
|
106
|
+
async resolveHistoryItemGroupBase(historyItemGroupId) {
|
|
107
|
+
return this.proxy.$resolveHistoryItemGroupBase(this.handle, historyItemGroupId, CancellationToken.None);
|
|
108
|
+
}
|
|
109
|
+
async resolveHistoryItemGroupCommonAncestor(historyItemGroupId1, historyItemGroupId2) {
|
|
110
|
+
return this.proxy.$resolveHistoryItemGroupCommonAncestor(this.handle, historyItemGroupId1, historyItemGroupId2, CancellationToken.None);
|
|
111
|
+
}
|
|
112
|
+
async provideHistoryItems(historyItemGroupId, options) {
|
|
113
|
+
const historyItems = await this.proxy.$provideHistoryItems(this.handle, historyItemGroupId, options, CancellationToken.None);
|
|
114
|
+
return historyItems?.map(historyItem => ({ ...historyItem, icon: getSCMHistoryItemIcon(historyItem), }));
|
|
115
|
+
}
|
|
116
|
+
async provideHistoryItemChanges(historyItemId) {
|
|
117
|
+
const changes = await this.proxy.$provideHistoryItemChanges(this.handle, historyItemId, CancellationToken.None);
|
|
118
|
+
return changes?.map(change => ({
|
|
119
|
+
uri: URI.revive(change.uri),
|
|
120
|
+
originalUri: change.originalUri && URI.revive(change.originalUri),
|
|
121
|
+
modifiedUri: change.modifiedUri && URI.revive(change.modifiedUri),
|
|
122
|
+
renameUri: change.renameUri && URI.revive(change.renameUri)
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
class MainThreadSCMProvider {
|
|
127
|
+
static { this.ID_HANDLE = 0; }
|
|
128
|
+
get id() { return this._id; }
|
|
129
|
+
get handle() { return this._handle; }
|
|
130
|
+
get label() { return this._label; }
|
|
131
|
+
get rootUri() { return this._rootUri; }
|
|
132
|
+
get inputBoxDocumentUri() { return this._inputBoxDocumentUri; }
|
|
133
|
+
get contextValue() { return this._contextValue; }
|
|
134
|
+
get commitTemplate() { return this.features.commitTemplate || ''; }
|
|
135
|
+
get historyProvider() { return this._historyProvider; }
|
|
136
|
+
get acceptInputCommand() { return this.features.acceptInputCommand; }
|
|
137
|
+
get actionButton() { return this.features.actionButton ?? undefined; }
|
|
138
|
+
get statusBarCommands() { return this.features.statusBarCommands; }
|
|
139
|
+
get count() { return this.features.count; }
|
|
140
|
+
get onDidChangeStatusBarCommands() { return this._onDidChangeStatusBarCommands.event; }
|
|
141
|
+
constructor(proxy, _handle, _contextValue, _label, _rootUri, _inputBoxDocumentUri, _quickDiffService) {
|
|
142
|
+
this.proxy = proxy;
|
|
143
|
+
this._handle = _handle;
|
|
144
|
+
this._contextValue = _contextValue;
|
|
145
|
+
this._label = _label;
|
|
146
|
+
this._rootUri = _rootUri;
|
|
147
|
+
this._inputBoxDocumentUri = _inputBoxDocumentUri;
|
|
148
|
+
this._quickDiffService = _quickDiffService;
|
|
149
|
+
this._id = `scm${MainThreadSCMProvider.ID_HANDLE++}`;
|
|
150
|
+
this.groups = ( new Sequence());
|
|
151
|
+
this._groupsByHandle = Object.create(null);
|
|
152
|
+
this._onDidChangeResources = ( new Emitter());
|
|
153
|
+
this.onDidChangeResources = this._onDidChangeResources.event;
|
|
154
|
+
this.features = {};
|
|
155
|
+
this._onDidChangeCommitTemplate = ( new Emitter());
|
|
156
|
+
this.onDidChangeCommitTemplate = this._onDidChangeCommitTemplate.event;
|
|
157
|
+
this._onDidChangeStatusBarCommands = ( new Emitter());
|
|
158
|
+
this._onDidChangeHistoryProvider = ( new Emitter());
|
|
159
|
+
this.onDidChangeHistoryProvider = this._onDidChangeHistoryProvider.event;
|
|
160
|
+
this._onDidChange = ( new Emitter());
|
|
161
|
+
this.onDidChange = this._onDidChange.event;
|
|
162
|
+
this.isSCM = true;
|
|
163
|
+
}
|
|
164
|
+
$updateSourceControl(features) {
|
|
165
|
+
this.features = { ...this.features, ...features };
|
|
166
|
+
this._onDidChange.fire();
|
|
167
|
+
if (typeof features.commitTemplate !== 'undefined') {
|
|
168
|
+
this._onDidChangeCommitTemplate.fire(this.commitTemplate);
|
|
169
|
+
}
|
|
170
|
+
if (typeof features.statusBarCommands !== 'undefined') {
|
|
171
|
+
this._onDidChangeStatusBarCommands.fire(this.statusBarCommands);
|
|
172
|
+
}
|
|
173
|
+
if (features.hasQuickDiffProvider && !this._quickDiff) {
|
|
174
|
+
this._quickDiff = this._quickDiffService.addQuickDiffProvider({
|
|
175
|
+
label: features.quickDiffLabel ?? this.label,
|
|
176
|
+
rootUri: this.rootUri,
|
|
177
|
+
isSCM: this.isSCM,
|
|
178
|
+
getOriginalResource: (uri) => this.getOriginalResource(uri)
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
else if (features.hasQuickDiffProvider === false && this._quickDiff) {
|
|
182
|
+
this._quickDiff.dispose();
|
|
183
|
+
this._quickDiff = undefined;
|
|
184
|
+
}
|
|
185
|
+
if (features.hasHistoryProvider && !this._historyProvider) {
|
|
186
|
+
this._historyProvider = ( new MainThreadSCMHistoryProvider(this.proxy, this.handle));
|
|
187
|
+
this._onDidChangeHistoryProvider.fire();
|
|
188
|
+
}
|
|
189
|
+
else if (features.hasHistoryProvider === false && this._historyProvider) {
|
|
190
|
+
this._historyProvider = undefined;
|
|
191
|
+
this._onDidChangeHistoryProvider.fire();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
$registerGroups(_groups) {
|
|
195
|
+
const groups = ( _groups.map(([handle, id, label, features]) => {
|
|
196
|
+
const group = ( new MainThreadSCMResourceGroup(this.handle, handle, this, features, label, id));
|
|
197
|
+
this._groupsByHandle[handle] = group;
|
|
198
|
+
return group;
|
|
199
|
+
}));
|
|
200
|
+
this.groups.splice(this.groups.elements.length, 0, groups);
|
|
201
|
+
}
|
|
202
|
+
$updateGroup(handle, features) {
|
|
203
|
+
const group = this._groupsByHandle[handle];
|
|
204
|
+
if (!group) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
group.$updateGroup(features);
|
|
208
|
+
}
|
|
209
|
+
$updateGroupLabel(handle, label) {
|
|
210
|
+
const group = this._groupsByHandle[handle];
|
|
211
|
+
if (!group) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
group.$updateGroupLabel(label);
|
|
215
|
+
}
|
|
216
|
+
$spliceGroupResourceStates(splices) {
|
|
217
|
+
for (const [groupHandle, groupSlices] of splices) {
|
|
218
|
+
const group = this._groupsByHandle[groupHandle];
|
|
219
|
+
if (!group) {
|
|
220
|
+
console.warn(`SCM group ${groupHandle} not found in provider ${this.label}`);
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
groupSlices.reverse();
|
|
224
|
+
for (const [start, deleteCount, rawResources] of groupSlices) {
|
|
225
|
+
const resources = ( rawResources.map(rawResource => {
|
|
226
|
+
const [handle, sourceUri, icons, tooltip, strikeThrough, faded, contextValue, command] = rawResource;
|
|
227
|
+
const [light, dark] = icons;
|
|
228
|
+
const icon = ThemeIcon.isThemeIcon(light) ? light : URI.revive(light);
|
|
229
|
+
const iconDark = (ThemeIcon.isThemeIcon(dark) ? dark : URI.revive(dark)) || icon;
|
|
230
|
+
const decorations = {
|
|
231
|
+
icon: icon,
|
|
232
|
+
iconDark: iconDark,
|
|
233
|
+
tooltip,
|
|
234
|
+
strikeThrough,
|
|
235
|
+
faded
|
|
236
|
+
};
|
|
237
|
+
return ( new MainThreadSCMResource(
|
|
238
|
+
this.proxy,
|
|
239
|
+
this.handle,
|
|
240
|
+
groupHandle,
|
|
241
|
+
handle,
|
|
242
|
+
URI.revive(sourceUri),
|
|
243
|
+
group,
|
|
244
|
+
decorations,
|
|
245
|
+
contextValue || undefined,
|
|
246
|
+
command
|
|
247
|
+
));
|
|
248
|
+
}));
|
|
249
|
+
group.splice(start, deleteCount, resources);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
this._onDidChangeResources.fire();
|
|
253
|
+
}
|
|
254
|
+
$unregisterGroup(handle) {
|
|
255
|
+
const group = this._groupsByHandle[handle];
|
|
256
|
+
if (!group) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
delete this._groupsByHandle[handle];
|
|
260
|
+
this.groups.splice(this.groups.elements.indexOf(group), 1);
|
|
261
|
+
this._onDidChangeResources.fire();
|
|
262
|
+
}
|
|
263
|
+
async getOriginalResource(uri) {
|
|
264
|
+
if (!this.features.hasQuickDiffProvider) {
|
|
265
|
+
return null;
|
|
266
|
+
}
|
|
267
|
+
const result = await this.proxy.$provideOriginalResource(this.handle, uri, CancellationToken.None);
|
|
268
|
+
return result && URI.revive(result);
|
|
269
|
+
}
|
|
270
|
+
$onDidChangeHistoryProviderActionButton(actionButton) {
|
|
271
|
+
if (!this._historyProvider) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
this._historyProvider.actionButton = actionButton ?? undefined;
|
|
275
|
+
}
|
|
276
|
+
$onDidChangeHistoryProviderCurrentHistoryItemGroup(currentHistoryItemGroup) {
|
|
277
|
+
if (!this._historyProvider) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
this._historyProvider.currentHistoryItemGroup = currentHistoryItemGroup ?? undefined;
|
|
281
|
+
}
|
|
282
|
+
toJSON() {
|
|
283
|
+
return {
|
|
284
|
+
$mid: 5 ,
|
|
285
|
+
handle: this.handle
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
dispose() {
|
|
289
|
+
this._quickDiff?.dispose();
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
let MainThreadSCM = class MainThreadSCM {
|
|
293
|
+
constructor(extHostContext, scmService, scmViewService, quickDiffService) {
|
|
294
|
+
this.scmService = scmService;
|
|
295
|
+
this.scmViewService = scmViewService;
|
|
296
|
+
this.quickDiffService = quickDiffService;
|
|
297
|
+
this._repositories = ( new Map());
|
|
298
|
+
this._repositoryDisposables = ( new Map());
|
|
299
|
+
this._disposables = ( new DisposableStore());
|
|
300
|
+
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostSCM));
|
|
301
|
+
}
|
|
302
|
+
dispose() {
|
|
303
|
+
dispose(( this._repositories.values()));
|
|
304
|
+
this._repositories.clear();
|
|
305
|
+
dispose(( this._repositoryDisposables.values()));
|
|
306
|
+
this._repositoryDisposables.clear();
|
|
307
|
+
this._disposables.dispose();
|
|
308
|
+
}
|
|
309
|
+
$registerSourceControl(handle, id, label, rootUri, inputBoxDocumentUri) {
|
|
310
|
+
const provider = ( new MainThreadSCMProvider(
|
|
311
|
+
this._proxy,
|
|
312
|
+
handle,
|
|
313
|
+
id,
|
|
314
|
+
label,
|
|
315
|
+
rootUri ? URI.revive(rootUri) : undefined,
|
|
316
|
+
URI.revive(inputBoxDocumentUri),
|
|
317
|
+
this.quickDiffService
|
|
318
|
+
));
|
|
319
|
+
const repository = this.scmService.registerSCMProvider(provider);
|
|
320
|
+
this._repositories.set(handle, repository);
|
|
321
|
+
const disposable = combinedDisposable(Event.filter(this.scmViewService.onDidFocusRepository, r => r === repository)(_ => this._proxy.$setSelectedSourceControl(handle)), repository.input.onDidChange(({ value }) => this._proxy.$onInputBoxValueChange(handle, value)));
|
|
322
|
+
if (this.scmViewService.focusedRepository === repository) {
|
|
323
|
+
setTimeout(() => this._proxy.$setSelectedSourceControl(handle), 0);
|
|
324
|
+
}
|
|
325
|
+
if (repository.input.value) {
|
|
326
|
+
setTimeout(() => this._proxy.$onInputBoxValueChange(handle, repository.input.value), 0);
|
|
327
|
+
}
|
|
328
|
+
this._repositoryDisposables.set(handle, disposable);
|
|
329
|
+
}
|
|
330
|
+
$updateSourceControl(handle, features) {
|
|
331
|
+
const repository = this._repositories.get(handle);
|
|
332
|
+
if (!repository) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
const provider = repository.provider;
|
|
336
|
+
provider.$updateSourceControl(features);
|
|
337
|
+
}
|
|
338
|
+
$unregisterSourceControl(handle) {
|
|
339
|
+
const repository = this._repositories.get(handle);
|
|
340
|
+
if (!repository) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
this._repositoryDisposables.get(handle).dispose();
|
|
344
|
+
this._repositoryDisposables.delete(handle);
|
|
345
|
+
repository.dispose();
|
|
346
|
+
this._repositories.delete(handle);
|
|
347
|
+
}
|
|
348
|
+
$registerGroups(sourceControlHandle, groups, splices) {
|
|
349
|
+
const repository = this._repositories.get(sourceControlHandle);
|
|
350
|
+
if (!repository) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
const provider = repository.provider;
|
|
354
|
+
provider.$registerGroups(groups);
|
|
355
|
+
provider.$spliceGroupResourceStates(splices);
|
|
356
|
+
}
|
|
357
|
+
$updateGroup(sourceControlHandle, groupHandle, features) {
|
|
358
|
+
const repository = this._repositories.get(sourceControlHandle);
|
|
359
|
+
if (!repository) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
const provider = repository.provider;
|
|
363
|
+
provider.$updateGroup(groupHandle, features);
|
|
364
|
+
}
|
|
365
|
+
$updateGroupLabel(sourceControlHandle, groupHandle, label) {
|
|
366
|
+
const repository = this._repositories.get(sourceControlHandle);
|
|
367
|
+
if (!repository) {
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
const provider = repository.provider;
|
|
371
|
+
provider.$updateGroupLabel(groupHandle, label);
|
|
372
|
+
}
|
|
373
|
+
$spliceResourceStates(sourceControlHandle, splices) {
|
|
374
|
+
const repository = this._repositories.get(sourceControlHandle);
|
|
375
|
+
if (!repository) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
const provider = repository.provider;
|
|
379
|
+
provider.$spliceGroupResourceStates(splices);
|
|
380
|
+
}
|
|
381
|
+
$unregisterGroup(sourceControlHandle, handle) {
|
|
382
|
+
const repository = this._repositories.get(sourceControlHandle);
|
|
383
|
+
if (!repository) {
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
const provider = repository.provider;
|
|
387
|
+
provider.$unregisterGroup(handle);
|
|
388
|
+
}
|
|
389
|
+
$setInputBoxValue(sourceControlHandle, value) {
|
|
390
|
+
const repository = this._repositories.get(sourceControlHandle);
|
|
391
|
+
if (!repository) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
repository.input.setValue(value, false);
|
|
395
|
+
}
|
|
396
|
+
$setInputBoxPlaceholder(sourceControlHandle, placeholder) {
|
|
397
|
+
const repository = this._repositories.get(sourceControlHandle);
|
|
398
|
+
if (!repository) {
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
repository.input.placeholder = placeholder;
|
|
402
|
+
}
|
|
403
|
+
$setInputBoxEnablement(sourceControlHandle, enabled) {
|
|
404
|
+
const repository = this._repositories.get(sourceControlHandle);
|
|
405
|
+
if (!repository) {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
repository.input.enabled = enabled;
|
|
409
|
+
}
|
|
410
|
+
$setInputBoxVisibility(sourceControlHandle, visible) {
|
|
411
|
+
const repository = this._repositories.get(sourceControlHandle);
|
|
412
|
+
if (!repository) {
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
repository.input.visible = visible;
|
|
416
|
+
}
|
|
417
|
+
$showValidationMessage(sourceControlHandle, message, type) {
|
|
418
|
+
const repository = this._repositories.get(sourceControlHandle);
|
|
419
|
+
if (!repository) {
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
repository.input.showValidationMessage(message, type);
|
|
423
|
+
}
|
|
424
|
+
$setValidationProviderIsEnabled(sourceControlHandle, enabled) {
|
|
425
|
+
const repository = this._repositories.get(sourceControlHandle);
|
|
426
|
+
if (!repository) {
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
if (enabled) {
|
|
430
|
+
repository.input.validateInput = async (value, pos) => {
|
|
431
|
+
const result = await this._proxy.$validateInput(sourceControlHandle, value, pos);
|
|
432
|
+
return result && { message: result[0], type: result[1] };
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
repository.input.validateInput = async () => undefined;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
$onDidChangeHistoryProviderActionButton(sourceControlHandle, actionButton) {
|
|
440
|
+
const repository = this._repositories.get(sourceControlHandle);
|
|
441
|
+
if (!repository) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
const provider = repository.provider;
|
|
445
|
+
provider.$onDidChangeHistoryProviderActionButton(actionButton);
|
|
446
|
+
}
|
|
447
|
+
$onDidChangeHistoryProviderCurrentHistoryItemGroup(sourceControlHandle, historyItemGroup) {
|
|
448
|
+
const repository = this._repositories.get(sourceControlHandle);
|
|
449
|
+
if (!repository) {
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
const provider = repository.provider;
|
|
453
|
+
provider.$onDidChangeHistoryProviderCurrentHistoryItemGroup(historyItemGroup);
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
MainThreadSCM = __decorate([
|
|
457
|
+
extHostNamedCustomer(MainContext.MainThreadSCM),
|
|
458
|
+
( __param(1, ISCMService)),
|
|
459
|
+
( __param(2, ISCMViewService)),
|
|
460
|
+
( __param(3, IQuickDiffService))
|
|
461
|
+
], MainThreadSCM);
|
|
462
|
+
|
|
463
|
+
export { MainThreadSCM };
|