@codingame/monaco-vscode-extensions-service-override 1.83.16 → 1.85.0-next.0
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/extensions.js +2 -2
- package/localExtensionHost.d.ts +1 -0
- package/package.json +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +4 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +9 -88
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +216 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +3 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +7 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +8 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +6 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +16 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +3 -75
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +102 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +6 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +16 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +25 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +36 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +34 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +4 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +136 -28
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +2 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +67 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +8 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +25 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +8 -13
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +40 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +141 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +342 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1197 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +117 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +83 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +543 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +292 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +169 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +111 -73
- package/vscode/src/vs/workbench/contrib/chat/common/chatRequestParser.js +195 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +260 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +5 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +26 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +6 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +6 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +8 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +6 -4
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +6 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +24 -10
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +113 -34
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +17 -8
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +5 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +18 -8
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +7 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +5 -5
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +2 -1
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +7 -4
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +17 -12
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +17 -148
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +161 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +2 -0
- package/vscode/src/vs/platform/files/common/watcher.js +0 -71
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +0 -52
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +0 -49
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +0 -25
|
@@ -20,6 +20,7 @@ import { isGroupEditorMoveEvent } from 'vscode/vscode/vs/workbench/common/editor
|
|
|
20
20
|
import { InteractiveEditorInput } from '../../contrib/interactive/browser/interactiveEditorInput.js';
|
|
21
21
|
import { MergeEditorInput } from '../../contrib/mergeEditor/browser/mergeEditorInput.js';
|
|
22
22
|
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
23
|
+
import { ChatEditorInput } from '../../contrib/chat/browser/chatEditorInput.js';
|
|
23
24
|
|
|
24
25
|
let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
25
26
|
constructor(extHostContext, _editorGroupsService, _configurationService, _logService, editorService) {
|
|
@@ -42,7 +43,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
42
43
|
}));
|
|
43
44
|
this._dispoables.add(this._editorGroupsService.onDidAddGroup(() => this._createTabsModel()));
|
|
44
45
|
this._dispoables.add(this._editorGroupsService.onDidRemoveGroup(() => this._createTabsModel()));
|
|
45
|
-
this._editorGroupsService.whenReady.then(() => this._createTabsModel());
|
|
46
|
+
this._editorGroupsService.mainPart.whenReady.then(() => this._createTabsModel());
|
|
46
47
|
}
|
|
47
48
|
dispose() {
|
|
48
49
|
this._groupLookup.clear();
|
|
@@ -143,6 +144,12 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
143
144
|
inputBoxUri: editor.inputResource
|
|
144
145
|
};
|
|
145
146
|
}
|
|
147
|
+
if (editor instanceof ChatEditorInput) {
|
|
148
|
+
return {
|
|
149
|
+
kind: 10 ,
|
|
150
|
+
providerId: editor.providerId ?? 'unknown',
|
|
151
|
+
};
|
|
152
|
+
}
|
|
146
153
|
return { kind: 0 };
|
|
147
154
|
}
|
|
148
155
|
_generateTabId(editor, groupId) {
|
|
@@ -347,42 +354,42 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
347
354
|
else {
|
|
348
355
|
return;
|
|
349
356
|
}
|
|
350
|
-
case
|
|
357
|
+
case 8 :
|
|
351
358
|
if (event.editor !== undefined && event.editorIndex !== undefined) {
|
|
352
359
|
this._onDidTabLabelChange(groupId, event.editor, event.editorIndex);
|
|
353
360
|
break;
|
|
354
361
|
}
|
|
355
|
-
case
|
|
362
|
+
case 4 :
|
|
356
363
|
if (event.editor !== undefined && event.editorIndex !== undefined) {
|
|
357
364
|
this._onDidTabOpen(groupId, event.editor, event.editorIndex);
|
|
358
365
|
break;
|
|
359
366
|
}
|
|
360
|
-
case
|
|
367
|
+
case 5 :
|
|
361
368
|
if (event.editorIndex !== undefined) {
|
|
362
369
|
this._onDidTabClose(groupId, event.editorIndex);
|
|
363
370
|
break;
|
|
364
371
|
}
|
|
365
|
-
case
|
|
372
|
+
case 7 :
|
|
366
373
|
if (event.editorIndex !== undefined) {
|
|
367
374
|
this._onDidTabActiveChange(groupId, event.editorIndex);
|
|
368
375
|
break;
|
|
369
376
|
}
|
|
370
|
-
case
|
|
377
|
+
case 12 :
|
|
371
378
|
if (event.editorIndex !== undefined && event.editor !== undefined) {
|
|
372
379
|
this._onDidTabDirty(groupId, event.editorIndex, event.editor);
|
|
373
380
|
break;
|
|
374
381
|
}
|
|
375
|
-
case
|
|
382
|
+
case 11 :
|
|
376
383
|
if (event.editorIndex !== undefined && event.editor !== undefined) {
|
|
377
384
|
this._onDidTabPinChange(groupId, event.editorIndex, event.editor);
|
|
378
385
|
break;
|
|
379
386
|
}
|
|
380
|
-
case
|
|
387
|
+
case 10 :
|
|
381
388
|
if (event.editorIndex !== undefined && event.editor !== undefined) {
|
|
382
389
|
this._onDidTabPreviewChange(groupId, event.editorIndex, event.editor);
|
|
383
390
|
break;
|
|
384
391
|
}
|
|
385
|
-
case
|
|
392
|
+
case 6 :
|
|
386
393
|
if (isGroupEditorMoveEvent(event) && event.editor && event.editorIndex !== undefined && event.oldEditorIndex !== undefined) {
|
|
387
394
|
this._onDidTabMove(groupId, event.editorIndex, event.oldEditorIndex, event.editor);
|
|
388
395
|
break;
|
|
@@ -2,28 +2,17 @@ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.
|
|
|
2
2
|
import { Emitter, Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
3
3
|
import { DisposableMap, DisposableStore, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
4
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
5
|
-
import { FilePermission, FileSystemProviderErrorCode, FileType, FileOperationError, toFileSystemProviderErrorCode } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
5
|
+
import { IFileService, FilePermission, FileSystemProviderErrorCode, FileType, FileOperationError, toFileSystemProviderErrorCode } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
6
6
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
7
7
|
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
8
8
|
import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
9
|
-
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
10
|
-
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
11
|
-
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
12
|
-
import { IWorkbenchFileService } from 'vscode/vscode/vs/workbench/services/files/common/files';
|
|
13
|
-
import { normalizeWatcherPattern } from '../../../platform/files/common/watcher.js';
|
|
14
|
-
import { GLOBSTAR } from 'monaco-editor/esm/vs/base/common/glob.js';
|
|
15
|
-
import { rtrim } from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
16
9
|
|
|
17
10
|
var MainThreadFileSystem_1;
|
|
18
11
|
let MainThreadFileSystem = MainThreadFileSystem_1 = class MainThreadFileSystem {
|
|
19
|
-
constructor(extHostContext, _fileService
|
|
12
|
+
constructor(extHostContext, _fileService) {
|
|
20
13
|
this._fileService = _fileService;
|
|
21
|
-
this._contextService = _contextService;
|
|
22
|
-
this._logService = _logService;
|
|
23
|
-
this._configurationService = _configurationService;
|
|
24
14
|
this._fileProvider = ( new DisposableMap());
|
|
25
15
|
this._disposables = ( new DisposableStore());
|
|
26
|
-
this._watches = ( new DisposableMap());
|
|
27
16
|
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostFileSystem));
|
|
28
17
|
const infoProxy = ( extHostContext.getProxy(ExtHostContext.ExtHostFileSystemInfo));
|
|
29
18
|
for (const entry of _fileService.listCapabilities()) {
|
|
@@ -35,7 +24,6 @@ let MainThreadFileSystem = MainThreadFileSystem_1 = class MainThreadFileSystem {
|
|
|
35
24
|
dispose() {
|
|
36
25
|
this._disposables.dispose();
|
|
37
26
|
this._fileProvider.dispose();
|
|
38
|
-
this._watches.dispose();
|
|
39
27
|
}
|
|
40
28
|
async $registerFileSystemProvider(handle, scheme, capabilities, readonlyMessage) {
|
|
41
29
|
this._fileProvider.set(handle, ( new RemoteFileSystemProvider(
|
|
@@ -141,70 +129,10 @@ let MainThreadFileSystem = MainThreadFileSystem_1 = class MainThreadFileSystem {
|
|
|
141
129
|
$ensureActivation(scheme) {
|
|
142
130
|
return this._fileService.activateProvider(scheme);
|
|
143
131
|
}
|
|
144
|
-
async $watch(extensionId, session, resource, unvalidatedOpts) {
|
|
145
|
-
const uri = URI.revive(resource);
|
|
146
|
-
const workspaceFolder = this._contextService.getWorkspaceFolder(uri);
|
|
147
|
-
const opts = { ...unvalidatedOpts };
|
|
148
|
-
if (opts.recursive) {
|
|
149
|
-
try {
|
|
150
|
-
const stat = await this._fileService.stat(uri);
|
|
151
|
-
if (!stat.isDirectory) {
|
|
152
|
-
opts.recursive = false;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
catch (error) {
|
|
156
|
-
this._logService.error(`MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session}): ${error}`);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
if (workspaceFolder && opts.recursive) {
|
|
160
|
-
this._logService.trace(`MainThreadFileSystem#$watch(): ignoring request to start watching because path is inside workspace (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session})`);
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
this._logService.trace(`MainThreadFileSystem#$watch(): request to start watching (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session})`);
|
|
164
|
-
if (opts.recursive) {
|
|
165
|
-
const config = this._configurationService.getValue();
|
|
166
|
-
if (config.files?.watcherExclude) {
|
|
167
|
-
for (const key in config.files.watcherExclude) {
|
|
168
|
-
if (config.files.watcherExclude[key] === true) {
|
|
169
|
-
opts.excludes.push(key);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
else if (workspaceFolder) {
|
|
175
|
-
const config = this._configurationService.getValue();
|
|
176
|
-
if (config.files?.watcherExclude) {
|
|
177
|
-
for (const key in config.files.watcherExclude) {
|
|
178
|
-
if (config.files.watcherExclude[key] === true) {
|
|
179
|
-
if (!opts.includes) {
|
|
180
|
-
opts.includes = [];
|
|
181
|
-
}
|
|
182
|
-
const includePattern = `${rtrim(key, '/')}/${GLOBSTAR}`;
|
|
183
|
-
opts.includes.push(normalizeWatcherPattern(workspaceFolder.uri.fsPath, includePattern));
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
if (!opts.includes || opts.includes.length === 0) {
|
|
188
|
-
this._logService.trace(`MainThreadFileSystem#$watch(): ignoring request to start watching because path is inside workspace and no excludes are configured (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session})`);
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
const subscription = this._fileService.watch(uri, opts);
|
|
193
|
-
this._watches.set(session, subscription);
|
|
194
|
-
}
|
|
195
|
-
$unwatch(session) {
|
|
196
|
-
if (( this._watches.has(session))) {
|
|
197
|
-
this._logService.trace(`MainThreadFileSystem#$unwatch(): request to stop watching (session: ${session})`);
|
|
198
|
-
this._watches.deleteAndDispose(session);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
132
|
};
|
|
202
133
|
MainThreadFileSystem = MainThreadFileSystem_1 = __decorate([
|
|
203
134
|
extHostNamedCustomer(MainContext.MainThreadFileSystem),
|
|
204
|
-
( __param(1,
|
|
205
|
-
( __param(2, IWorkspaceContextService)),
|
|
206
|
-
( __param(3, ILogService)),
|
|
207
|
-
( __param(4, IConfigurationService))
|
|
135
|
+
( __param(1, IFileService))
|
|
208
136
|
], MainThreadFileSystem);
|
|
209
137
|
class RemoteFileSystemProvider {
|
|
210
138
|
constructor(fileService, scheme, capabilities, readOnlyMessage, _handle, _proxy) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
2
|
+
import { DisposableStore, DisposableMap } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
3
|
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
4
|
-
import {
|
|
5
|
-
import { ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
4
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
5
|
+
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
6
6
|
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
7
7
|
import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService';
|
|
8
8
|
import { IBulkEditService } from 'monaco-editor/esm/vs/editor/browser/services/bulkEditService.js';
|
|
@@ -17,22 +17,34 @@ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
|
17
17
|
import { IEnvironmentService } from 'monaco-editor/esm/vs/platform/environment/common/environment.js';
|
|
18
18
|
import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
|
|
19
19
|
import { reviveWorkspaceEditDto } from './mainThreadBulkEdits.js';
|
|
20
|
+
import { GLOBSTAR } from 'monaco-editor/esm/vs/base/common/glob.js';
|
|
21
|
+
import { rtrim } from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
22
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
23
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
24
|
+
import { normalizeWatcherPattern } from 'vscode/vscode/vs/platform/files/common/watcher';
|
|
25
|
+
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
20
26
|
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
21
27
|
|
|
22
28
|
var MainThreadFileSystemEventService_1;
|
|
23
29
|
let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
|
|
24
30
|
static { MainThreadFileSystemEventService_1 = this; }
|
|
25
31
|
static { this.MementoKeyAdditionalEdits = `file.particpants.additionalEdits`; }
|
|
26
|
-
constructor(extHostContext,
|
|
32
|
+
constructor(extHostContext, _fileService, workingCopyFileService, bulkEditService, progressService, dialogService, storageService, logService, envService, uriIdentService, _contextService, _logService, _configurationService) {
|
|
33
|
+
this._fileService = _fileService;
|
|
34
|
+
this._contextService = _contextService;
|
|
35
|
+
this._logService = _logService;
|
|
36
|
+
this._configurationService = _configurationService;
|
|
27
37
|
this._listener = ( new DisposableStore());
|
|
28
|
-
|
|
29
|
-
this.
|
|
30
|
-
|
|
38
|
+
this._watches = ( new DisposableMap());
|
|
39
|
+
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostFileSystemEventService));
|
|
40
|
+
this._listener.add(_fileService.onDidFilesChange(event => {
|
|
41
|
+
this._proxy.$onFileEvent({
|
|
31
42
|
created: event.rawAdded,
|
|
32
43
|
changed: event.rawUpdated,
|
|
33
44
|
deleted: event.rawDeleted
|
|
34
45
|
});
|
|
35
46
|
}));
|
|
47
|
+
const that = this;
|
|
36
48
|
const fileOperationParticipant = new (class {
|
|
37
49
|
async participate(files, operation, undoInfo, timeout, token) {
|
|
38
50
|
if (undoInfo?.isUndoing) {
|
|
@@ -46,7 +58,7 @@ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
|
|
|
46
58
|
cancellable: true,
|
|
47
59
|
delay: Math.min(timeout / 2, 3000)
|
|
48
60
|
}, () => {
|
|
49
|
-
const onWillEvent =
|
|
61
|
+
const onWillEvent = that._proxy.$onWillRunFileOperation(operation, files, timeout, cts.token);
|
|
50
62
|
return raceCancellation(onWillEvent, cts.token);
|
|
51
63
|
}, () => {
|
|
52
64
|
cts.cancel();
|
|
@@ -242,14 +254,90 @@ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
|
|
|
242
254
|
}
|
|
243
255
|
});
|
|
244
256
|
this._listener.add(workingCopyFileService.addFileOperationParticipant(fileOperationParticipant));
|
|
245
|
-
this._listener.add(workingCopyFileService.onDidRunWorkingCopyFileOperation(e =>
|
|
257
|
+
this._listener.add(workingCopyFileService.onDidRunWorkingCopyFileOperation(e => this._proxy.$onDidRunFileOperation(e.operation, e.files)));
|
|
258
|
+
}
|
|
259
|
+
async $watch(extensionId, session, resource, unvalidatedOpts, correlate) {
|
|
260
|
+
const uri = URI.revive(resource);
|
|
261
|
+
const opts = {
|
|
262
|
+
...unvalidatedOpts
|
|
263
|
+
};
|
|
264
|
+
if (opts.recursive) {
|
|
265
|
+
try {
|
|
266
|
+
const stat = await this._fileService.stat(uri);
|
|
267
|
+
if (!stat.isDirectory) {
|
|
268
|
+
opts.recursive = false;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
this._logService.error(`MainThreadFileSystemEventService#$watch(): failed to stat a resource for file watching (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session}): ${error}`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
if (correlate) {
|
|
276
|
+
this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching correlated (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session})`);
|
|
277
|
+
const watcherDisposables = ( new DisposableStore());
|
|
278
|
+
const subscription = watcherDisposables.add(this._fileService.createWatcher(uri, opts));
|
|
279
|
+
watcherDisposables.add(subscription.onDidChange(event => {
|
|
280
|
+
this._proxy.$onFileEvent({
|
|
281
|
+
session,
|
|
282
|
+
created: event.rawAdded,
|
|
283
|
+
changed: event.rawUpdated,
|
|
284
|
+
deleted: event.rawDeleted
|
|
285
|
+
});
|
|
286
|
+
}));
|
|
287
|
+
this._watches.set(session, watcherDisposables);
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
const workspaceFolder = this._contextService.getWorkspaceFolder(uri);
|
|
291
|
+
if (workspaceFolder && opts.recursive) {
|
|
292
|
+
this._logService.trace(`MainThreadFileSystemEventService#$watch(): ignoring request to start watching because path is inside workspace (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session})`);
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching uncorrelated (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session})`);
|
|
296
|
+
if (opts.recursive && opts.excludes.length === 0) {
|
|
297
|
+
const config = this._configurationService.getValue();
|
|
298
|
+
if (config.files?.watcherExclude) {
|
|
299
|
+
for (const key in config.files.watcherExclude) {
|
|
300
|
+
if (config.files.watcherExclude[key] === true) {
|
|
301
|
+
opts.excludes.push(key);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
else if (workspaceFolder) {
|
|
307
|
+
const config = this._configurationService.getValue();
|
|
308
|
+
if (config.files?.watcherExclude) {
|
|
309
|
+
for (const key in config.files.watcherExclude) {
|
|
310
|
+
if (config.files.watcherExclude[key] === true) {
|
|
311
|
+
if (!opts.includes) {
|
|
312
|
+
opts.includes = [];
|
|
313
|
+
}
|
|
314
|
+
const includePattern = `${rtrim(key, '/')}/${GLOBSTAR}`;
|
|
315
|
+
opts.includes.push(normalizeWatcherPattern(workspaceFolder.uri.fsPath, includePattern));
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (!opts.includes || opts.includes.length === 0) {
|
|
320
|
+
this._logService.trace(`MainThreadFileSystemEventService#$watch(): ignoring request to start watching because path is inside workspace and no excludes are configured (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session})`);
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
const subscription = this._fileService.watch(uri, opts);
|
|
325
|
+
this._watches.set(session, subscription);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
$unwatch(session) {
|
|
329
|
+
if (( this._watches.has(session))) {
|
|
330
|
+
this._logService.trace(`MainThreadFileSystemEventService#$unwatch(): request to stop watching (session: ${session})`);
|
|
331
|
+
this._watches.deleteAndDispose(session);
|
|
332
|
+
}
|
|
246
333
|
}
|
|
247
334
|
dispose() {
|
|
248
335
|
this._listener.dispose();
|
|
336
|
+
this._watches.dispose();
|
|
249
337
|
}
|
|
250
338
|
};
|
|
251
339
|
MainThreadFileSystemEventService = MainThreadFileSystemEventService_1 = __decorate([
|
|
252
|
-
|
|
340
|
+
extHostNamedCustomer(MainContext.MainThreadFileSystemEventService),
|
|
253
341
|
( __param(1, IFileService)),
|
|
254
342
|
( __param(2, IWorkingCopyFileService)),
|
|
255
343
|
( __param(3, IBulkEditService)),
|
|
@@ -258,7 +346,10 @@ MainThreadFileSystemEventService = MainThreadFileSystemEventService_1 = __decora
|
|
|
258
346
|
( __param(6, IStorageService)),
|
|
259
347
|
( __param(7, ILogService)),
|
|
260
348
|
( __param(8, IEnvironmentService)),
|
|
261
|
-
( __param(9, IUriIdentityService))
|
|
349
|
+
( __param(9, IUriIdentityService)),
|
|
350
|
+
( __param(10, IWorkspaceContextService)),
|
|
351
|
+
( __param(11, ILogService)),
|
|
352
|
+
( __param(12, IConfigurationService))
|
|
262
353
|
], MainThreadFileSystemEventService);
|
|
263
354
|
registerAction2(class ResetMemento extends Action2 {
|
|
264
355
|
constructor() {
|
|
@@ -17,10 +17,11 @@ let MainThreadInlineChat = class MainThreadInlineChat {
|
|
|
17
17
|
dispose() {
|
|
18
18
|
this._registrations.dispose();
|
|
19
19
|
}
|
|
20
|
-
async $registerInteractiveEditorProvider(handle, label, debugName, supportsFeedback) {
|
|
20
|
+
async $registerInteractiveEditorProvider(handle, label, debugName, supportsFeedback, supportsFollowups, supportIssueReporting) {
|
|
21
21
|
const unreg = this._inlineChatService.addProvider({
|
|
22
22
|
debugName,
|
|
23
23
|
label,
|
|
24
|
+
supportIssueReporting,
|
|
24
25
|
prepareInlineChatSession: async (model, range, token) => {
|
|
25
26
|
const session = await this._proxy.$prepareSession(handle, model.uri, range, token);
|
|
26
27
|
if (!session) {
|
|
@@ -46,6 +47,9 @@ let MainThreadInlineChat = class MainThreadInlineChat {
|
|
|
46
47
|
this._progresses.delete(request.requestId);
|
|
47
48
|
}
|
|
48
49
|
},
|
|
50
|
+
provideFollowups: !supportsFollowups ? undefined : async (session, response, token) => {
|
|
51
|
+
return this._proxy.$provideFollowups(handle, session.id, response.id, token);
|
|
52
|
+
},
|
|
49
53
|
handleInlineChatResponseFeedback: !supportsFeedback ? undefined : async (session, response, kind) => {
|
|
50
54
|
this._proxy.$handleFeedback(handle, session.id, response.id, kind);
|
|
51
55
|
}
|
|
@@ -53,7 +57,7 @@ let MainThreadInlineChat = class MainThreadInlineChat {
|
|
|
53
57
|
this._registrations.set(handle, unreg);
|
|
54
58
|
}
|
|
55
59
|
async $handleProgressChunk(requestId, chunk) {
|
|
56
|
-
this._progresses.get(requestId)?.report(chunk);
|
|
60
|
+
await Promise.resolve(this._progresses.get(requestId)?.report(chunk));
|
|
57
61
|
}
|
|
58
62
|
async $unregisterInteractiveEditorProvider(handle) {
|
|
59
63
|
this._registrations.deleteAndDispose(handle);
|
|
@@ -24,6 +24,22 @@ let MainThreadIssueReporter = class MainThreadIssueReporter extends Disposable {
|
|
|
24
24
|
$unregisterIssueUriRequestHandler(extensionId) {
|
|
25
25
|
this._registrations.deleteAndDispose(extensionId);
|
|
26
26
|
}
|
|
27
|
+
$registerIssueDataProvider(extensionId) {
|
|
28
|
+
const provider = {
|
|
29
|
+
provideIssueExtensionData: async (token) => {
|
|
30
|
+
const parts = await this._proxy.$getIssueReporterData(extensionId, token);
|
|
31
|
+
return parts;
|
|
32
|
+
},
|
|
33
|
+
provideIssueExtensionTemplate: async (token) => {
|
|
34
|
+
const parts = await this._proxy.$getIssueReporterTemplate(extensionId, token);
|
|
35
|
+
return parts;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
this._registrations.set(extensionId, this._issueService.registerIssueDataProvider(extensionId, provider));
|
|
39
|
+
}
|
|
40
|
+
$unregisterIssueDataProvider(extensionId) {
|
|
41
|
+
this._registrations.deleteAndDispose(extensionId);
|
|
42
|
+
}
|
|
27
43
|
};
|
|
28
44
|
MainThreadIssueReporter = __decorate([
|
|
29
45
|
extHostNamedCustomer(MainContext.MainThreadIssueReporter),
|
|
@@ -19,6 +19,8 @@ import { WorkspaceSymbolProviderRegistry } from 'vscode/vscode/vs/workbench/cont
|
|
|
19
19
|
import { TypeHierarchyProviderRegistry } from 'vscode/vscode/vs/workbench/contrib/typeHierarchy/common/typeHierarchy';
|
|
20
20
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
21
21
|
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
22
|
+
import { ResourceMap } from 'monaco-editor/esm/vs/base/common/map.js';
|
|
23
|
+
import { isFalsyOrEmpty } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
22
24
|
|
|
23
25
|
var MainThreadLanguageFeatures_1;
|
|
24
26
|
let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThreadLanguageFeatures extends Disposable {
|
|
@@ -237,6 +239,29 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
|
|
|
237
239
|
}
|
|
238
240
|
}));
|
|
239
241
|
}
|
|
242
|
+
$registerMultiDocumentHighlightProvider(handle, selector) {
|
|
243
|
+
this._registrations.set(handle, this._languageFeaturesService.multiDocumentHighlightProvider.register(selector, {
|
|
244
|
+
selector: selector,
|
|
245
|
+
provideMultiDocumentHighlights: (model, position, otherModels, token) => {
|
|
246
|
+
return this._proxy.$provideMultiDocumentHighlights(handle, model.uri, position, ( otherModels.map(model => model.uri)), token).then(dto => {
|
|
247
|
+
if (isFalsyOrEmpty(dto)) {
|
|
248
|
+
return undefined;
|
|
249
|
+
}
|
|
250
|
+
const result = ( new ResourceMap());
|
|
251
|
+
dto?.forEach(value => {
|
|
252
|
+
const uri = URI.revive(value.uri);
|
|
253
|
+
if (( result.has(uri))) {
|
|
254
|
+
result.get(uri).push(...value.highlights);
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
result.set(uri, value.highlights);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
return result;
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
}));
|
|
264
|
+
}
|
|
240
265
|
$registerLinkedEditingRangeProvider(handle, selector) {
|
|
241
266
|
this._registrations.set(handle, this._languageFeaturesService.linkedEditingRangeProvider.register(selector, {
|
|
242
267
|
provideLinkedEditingRanges: async (model, position, token) => {
|
|
@@ -5,6 +5,7 @@ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
|
5
5
|
import { DisposableStore, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
6
6
|
import { StopWatch } from 'monaco-editor/esm/vs/base/common/stopwatch.js';
|
|
7
7
|
import { assertType } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
8
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
8
9
|
import { CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
9
10
|
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
10
11
|
import { NotebookDto } from './mainThreadNotebookDto.js';
|
|
@@ -13,6 +14,8 @@ import { INotebookService, SimpleNotebookProviderInfo } from 'vscode/vscode/vs/w
|
|
|
13
14
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
14
15
|
import { SerializableObjectWithBuffers } from 'vscode/vscode/vs/workbench/services/extensions/common/proxyIdentifier';
|
|
15
16
|
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
17
|
+
import { revive } from 'monaco-editor/esm/vs/base/common/marshalling.js';
|
|
18
|
+
import { coalesce } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
16
19
|
|
|
17
20
|
let MainThreadNotebooks = class MainThreadNotebooks {
|
|
18
21
|
constructor(extHostContext, _notebookService, _cellStatusBarService, _logService) {
|
|
@@ -65,6 +68,39 @@ let MainThreadNotebooks = class MainThreadNotebooks {
|
|
|
65
68
|
resource: uri
|
|
66
69
|
};
|
|
67
70
|
},
|
|
71
|
+
searchInNotebooks: async (textQuery, token, allPriorityInfo) => {
|
|
72
|
+
const contributedType = this._notebookService.getContributedNotebookType(viewType);
|
|
73
|
+
if (!contributedType) {
|
|
74
|
+
return { results: [], limitHit: false };
|
|
75
|
+
}
|
|
76
|
+
const fileNames = contributedType.selectors;
|
|
77
|
+
const includes = ( fileNames.map((selector) => {
|
|
78
|
+
const globPattern = selector.include || selector;
|
|
79
|
+
return ( globPattern.toString());
|
|
80
|
+
}));
|
|
81
|
+
if (!includes.length) {
|
|
82
|
+
return {
|
|
83
|
+
results: [], limitHit: false
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const thisPriorityInfo = coalesce([{ isFromSettings: false, filenamePatterns: includes }, ...(allPriorityInfo.get(viewType) ?? [])]);
|
|
87
|
+
const otherEditorsPriorityInfo = Array.from(( allPriorityInfo.keys()))
|
|
88
|
+
.flatMap(key => {
|
|
89
|
+
if (key !== viewType) {
|
|
90
|
+
return allPriorityInfo.get(key) ?? [];
|
|
91
|
+
}
|
|
92
|
+
return [];
|
|
93
|
+
});
|
|
94
|
+
const searchComplete = await this._proxy.$searchInNotebooks(handle, textQuery, thisPriorityInfo, otherEditorsPriorityInfo, token);
|
|
95
|
+
const revivedResults = ( searchComplete.results.map(result => {
|
|
96
|
+
const resource = URI.revive(result.resource);
|
|
97
|
+
return {
|
|
98
|
+
resource,
|
|
99
|
+
cellResults: ( result.cellResults.map(e => revive(e)))
|
|
100
|
+
};
|
|
101
|
+
}));
|
|
102
|
+
return { results: revivedResults, limitHit: searchComplete.limitHit };
|
|
103
|
+
}
|
|
68
104
|
}));
|
|
69
105
|
if (data) {
|
|
70
106
|
disposables.add(this._notebookService.registerContributedNotebookType(viewType, data));
|
|
@@ -13,13 +13,14 @@ import { INotebookExecutionStateService, NotebookExecutionType } from 'vscode/vs
|
|
|
13
13
|
import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
|
|
14
14
|
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
15
15
|
import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
16
|
+
import { AsyncIterableSource } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
16
17
|
|
|
17
18
|
class MainThreadKernel {
|
|
18
19
|
get preloadUris() {
|
|
19
20
|
return ( this.preloads.map(p => p.uri));
|
|
20
21
|
}
|
|
21
22
|
get preloadProvides() {
|
|
22
|
-
return
|
|
23
|
+
return this.preloads.flatMap(p => p.provides);
|
|
23
24
|
}
|
|
24
25
|
constructor(data, _languageService) {
|
|
25
26
|
this._languageService = _languageService;
|
|
@@ -34,6 +35,7 @@ class MainThreadKernel {
|
|
|
34
35
|
this.detail = data.detail;
|
|
35
36
|
this.supportedLanguages = isNonEmptyArray(data.supportedLanguages) ? data.supportedLanguages : _languageService.getRegisteredLanguageIds();
|
|
36
37
|
this.implementsExecutionOrder = data.supportsExecutionOrder ?? false;
|
|
38
|
+
this.hasVariableProvider = data.hasVariableProvider ?? false;
|
|
37
39
|
this.localResourceRoot = URI.revive(data.extensionLocation);
|
|
38
40
|
this.preloads = data.preloads?.map(u => ({ uri: URI.revive(u.uri), provides: u.provides })) ?? [];
|
|
39
41
|
}
|
|
@@ -63,6 +65,10 @@ class MainThreadKernel {
|
|
|
63
65
|
this.implementsInterrupt = data.supportsInterrupt;
|
|
64
66
|
event.hasInterruptHandler = true;
|
|
65
67
|
}
|
|
68
|
+
if (data.hasVariableProvider !== undefined) {
|
|
69
|
+
this.hasVariableProvider = data.hasVariableProvider;
|
|
70
|
+
event.hasVariableProvider = true;
|
|
71
|
+
}
|
|
66
72
|
this._onDidChange.fire(event);
|
|
67
73
|
}
|
|
68
74
|
}
|
|
@@ -85,6 +91,8 @@ let MainThreadNotebookKernels = class MainThreadNotebookKernels {
|
|
|
85
91
|
this._kernelSourceActionProvidersEventRegistrations = ( new Map());
|
|
86
92
|
this._executions = ( new Map());
|
|
87
93
|
this._notebookExecutions = ( new Map());
|
|
94
|
+
this.variableRequestIndex = 0;
|
|
95
|
+
this.variableRequestMap = ( new Map());
|
|
88
96
|
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebookKernels));
|
|
89
97
|
notebookEditorService.listNotebookEditors().forEach(this._onEditorAdd, this);
|
|
90
98
|
notebookEditorService.onDidAddNotebookEditor(this._onEditorAdd, this, this._disposables);
|
|
@@ -161,6 +169,12 @@ let MainThreadNotebookKernels = class MainThreadNotebookKernels {
|
|
|
161
169
|
}
|
|
162
170
|
return didSend;
|
|
163
171
|
}
|
|
172
|
+
$receiveVariable(requestId, variable) {
|
|
173
|
+
const source = this.variableRequestMap.get(requestId);
|
|
174
|
+
if (source) {
|
|
175
|
+
source.emitOne(variable);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
164
178
|
async $addKernel(handle, data) {
|
|
165
179
|
const that = this;
|
|
166
180
|
const kernel = new (class extends MainThreadKernel {
|
|
@@ -170,6 +184,22 @@ let MainThreadNotebookKernels = class MainThreadNotebookKernels {
|
|
|
170
184
|
async cancelNotebookCellExecution(uri, handles) {
|
|
171
185
|
await that._proxy.$cancelCells(handle, uri, handles);
|
|
172
186
|
}
|
|
187
|
+
provideVariables(notebookUri, parentName, kind, start, token) {
|
|
188
|
+
const requestId = `${handle}variables${that.variableRequestIndex++}`;
|
|
189
|
+
if (( that.variableRequestMap.has(requestId))) {
|
|
190
|
+
return that.variableRequestMap.get(requestId).asyncIterable;
|
|
191
|
+
}
|
|
192
|
+
const source = ( new AsyncIterableSource());
|
|
193
|
+
that.variableRequestMap.set(requestId, source);
|
|
194
|
+
that._proxy.$provideVariables(handle, requestId, notebookUri, parentName, kind, start, token).then(() => {
|
|
195
|
+
source.resolve();
|
|
196
|
+
that.variableRequestMap.delete(requestId);
|
|
197
|
+
}).catch((err) => {
|
|
198
|
+
source.reject(err);
|
|
199
|
+
that.variableRequestMap.delete(requestId);
|
|
200
|
+
});
|
|
201
|
+
return source.asyncIterable;
|
|
202
|
+
}
|
|
173
203
|
})(data, this._languageService);
|
|
174
204
|
const listener = this._notebookKernelService.onDidChangeSelectedNotebooks(e => {
|
|
175
205
|
if (e.oldKernel === kernel.id) {
|
|
@@ -328,6 +358,9 @@ let MainThreadNotebookKernels = class MainThreadNotebookKernels {
|
|
|
328
358
|
emitter.fire(undefined);
|
|
329
359
|
}
|
|
330
360
|
}
|
|
361
|
+
$variablesUpdated(notebookUri) {
|
|
362
|
+
this._notebookKernelService.notifyVariablesChange(URI.revive(notebookUri));
|
|
363
|
+
}
|
|
331
364
|
};
|
|
332
365
|
MainThreadNotebookKernels = __decorate([
|
|
333
366
|
extHostNamedCustomer(MainContext.MainThreadNotebookKernels),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
3
|
-
import {
|
|
3
|
+
import { DisposableMap } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
4
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
5
5
|
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
6
6
|
import { IQuickDiffService } from 'vscode/vscode/vs/workbench/contrib/scm/common/quickDiff';
|
|
@@ -9,8 +9,7 @@ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCu
|
|
|
9
9
|
let MainThreadQuickDiff = class MainThreadQuickDiff {
|
|
10
10
|
constructor(extHostContext, quickDiffService) {
|
|
11
11
|
this.quickDiffService = quickDiffService;
|
|
12
|
-
this.
|
|
13
|
-
this.providerDisposables = ( new Map());
|
|
12
|
+
this.providerDisposables = ( new DisposableMap());
|
|
14
13
|
this.proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostQuickDiff));
|
|
15
14
|
}
|
|
16
15
|
async $registerQuickDiffProvider(handle, selector, label, rootUri) {
|
|
@@ -23,22 +22,16 @@ let MainThreadQuickDiff = class MainThreadQuickDiff {
|
|
|
23
22
|
return URI.revive(await this.proxy.$provideOriginalResource(handle, uri, ( new CancellationTokenSource()).token));
|
|
24
23
|
}
|
|
25
24
|
};
|
|
26
|
-
this.providers.set(handle, provider);
|
|
27
25
|
const disposable = this.quickDiffService.addQuickDiffProvider(provider);
|
|
28
26
|
this.providerDisposables.set(handle, disposable);
|
|
29
27
|
}
|
|
30
28
|
async $unregisterQuickDiffProvider(handle) {
|
|
31
|
-
if (( this.providers.has(handle))) {
|
|
32
|
-
this.providers.delete(handle);
|
|
33
|
-
}
|
|
34
29
|
if (( this.providerDisposables.has(handle))) {
|
|
35
|
-
this.providerDisposables.
|
|
30
|
+
this.providerDisposables.deleteAndDispose(handle);
|
|
36
31
|
}
|
|
37
32
|
}
|
|
38
33
|
dispose() {
|
|
39
|
-
this.
|
|
40
|
-
dispose(( this.providerDisposables.values()));
|
|
41
|
-
this.providerDisposables.clear();
|
|
34
|
+
this.providerDisposables.dispose();
|
|
42
35
|
}
|
|
43
36
|
};
|
|
44
37
|
MainThreadQuickDiff = __decorate([
|