@codingame/monaco-vscode-extensions-service-override 2.0.3 → 2.1.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.
Files changed (25) hide show
  1. package/package.json +3 -3
  2. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +22 -127
  3. package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +0 -5
  4. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +3 -31
  5. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +2 -1
  6. package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +32 -9
  7. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +7 -3
  8. package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +3 -3
  9. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +1 -1
  10. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +1 -1
  11. package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +6 -5
  12. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +3 -2
  13. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +11 -8
  14. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +2 -2
  15. package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +1 -1
  16. package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +27 -105
  17. package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +37 -10
  18. package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +14 -16
  19. package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +5 -1
  20. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +4 -1
  21. package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +5 -1
  22. package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +125 -0
  23. package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +3 -2
  24. package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +22 -114
  25. package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +1 -120
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-extensions-service-override",
3
- "version": "2.0.3",
3
+ "version": "2.1.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,9 +18,9 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@2.0.3",
21
+ "vscode": "npm:@codingame/monaco-vscode-api@2.1.0",
22
22
  "vscode-marked": "npm:marked@=3.0.2",
23
23
  "vscode-semver": "npm:semver@=5.5.0",
24
- "@codingame/monaco-vscode-files-service-override": "2.0.3"
24
+ "@codingame/monaco-vscode-files-service-override": "2.1.0"
25
25
  }
26
26
  }
@@ -1,134 +1,28 @@
1
1
  import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
2
+ import { Disposable, DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
3
3
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
4
4
  import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
5
- import { getAuthenticationProviderActivationEvent, addAccountUsage, readAllowedExtensions, readAccountUsages, removeAccountUsage } from 'vscode/vscode/vs/workbench/services/authentication/browser/authenticationService';
5
+ import { getAuthenticationProviderActivationEvent, addAccountUsage } from 'vscode/vscode/vs/workbench/services/authentication/browser/authenticationService';
6
6
  import { IAuthenticationService } from 'vscode/vscode/vs/workbench/services/authentication/common/authentication';
7
7
  import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
8
8
  import '../../../../../../override/vs/platform/dialogs/common/dialogs.js';
9
9
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
10
10
  import Severity from 'vscode/vscode/vs/base/common/severity';
11
- import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput';
12
11
  import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
13
- import { fromNow } from 'vscode/vscode/vs/base/common/date';
14
12
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
15
13
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
14
+ import { Emitter } from 'vscode/vscode/vs/base/common/event';
16
15
  import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
17
16
 
18
17
  class MainThreadAuthenticationProvider extends Disposable {
19
- constructor(_proxy, id, label, supportsMultipleAccounts, notificationService, storageService, quickInputService, dialogService) {
18
+ constructor(_proxy, id, label, supportsMultipleAccounts, notificationService, onDidChangeSessionsEmitter) {
20
19
  super();
21
20
  this._proxy = _proxy;
22
21
  this.id = id;
23
22
  this.label = label;
24
23
  this.supportsMultipleAccounts = supportsMultipleAccounts;
25
24
  this.notificationService = notificationService;
26
- this.storageService = storageService;
27
- this.quickInputService = quickInputService;
28
- this.dialogService = dialogService;
29
- }
30
- manageTrustedExtensions(accountName) {
31
- const allowedExtensions = readAllowedExtensions(this.storageService, this.id, accountName);
32
- if (!allowedExtensions.length) {
33
- this.dialogService.info(( localizeWithPath(
34
- 'vs/workbench/api/browser/mainThreadAuthentication',
35
- 'noTrustedExtensions',
36
- "This account has not been used by any extensions."
37
- )));
38
- return;
39
- }
40
- const quickPick = this.quickInputService.createQuickPick();
41
- quickPick.canSelectMany = true;
42
- quickPick.customButton = true;
43
- quickPick.customLabel = ( localizeWithPath(
44
- 'vs/workbench/api/browser/mainThreadAuthentication',
45
- 'manageTrustedExtensions.cancel',
46
- 'Cancel'
47
- ));
48
- const usages = readAccountUsages(this.storageService, this.id, accountName);
49
- const items = ( allowedExtensions.map(extension => {
50
- const usage = usages.find(usage => extension.id === usage.extensionId);
51
- return {
52
- label: extension.name,
53
- description: usage
54
- ? ( localizeWithPath(
55
- 'vs/workbench/api/browser/mainThreadAuthentication',
56
- { key: 'accountLastUsedDate', comment: ['The placeholder {0} is a string with time information, such as "3 days ago"'] },
57
- "Last used this account {0}",
58
- fromNow(usage.lastUsed, true)
59
- ))
60
- : ( localizeWithPath(
61
- 'vs/workbench/api/browser/mainThreadAuthentication',
62
- 'notUsed',
63
- "Has not used this account"
64
- )),
65
- extension
66
- };
67
- }));
68
- quickPick.items = items;
69
- quickPick.selectedItems = items.filter(item => item.extension.allowed === undefined || item.extension.allowed);
70
- quickPick.title = ( localizeWithPath(
71
- 'vs/workbench/api/browser/mainThreadAuthentication',
72
- 'manageTrustedExtensions',
73
- "Manage Trusted Extensions"
74
- ));
75
- quickPick.placeholder = ( localizeWithPath(
76
- 'vs/workbench/api/browser/mainThreadAuthentication',
77
- 'manageExtensions',
78
- "Choose which extensions can access this account"
79
- ));
80
- quickPick.onDidAccept(() => {
81
- const updatedAllowedList = ( quickPick.items
82
- .map(i => i.extension));
83
- this.storageService.store(`${this.id}-${accountName}`, JSON.stringify(updatedAllowedList), -1 , 0 );
84
- quickPick.dispose();
85
- });
86
- quickPick.onDidChangeSelection((changed) => {
87
- quickPick.items.forEach(item => {
88
- if (item.extension) {
89
- item.extension.allowed = false;
90
- }
91
- });
92
- changed.forEach((item) => item.extension.allowed = true);
93
- });
94
- quickPick.onDidHide(() => {
95
- quickPick.dispose();
96
- });
97
- quickPick.onDidCustom(() => {
98
- quickPick.hide();
99
- });
100
- quickPick.show();
101
- }
102
- async removeAccountSessions(accountName, sessions) {
103
- const accountUsages = readAccountUsages(this.storageService, this.id, accountName);
104
- const { confirmed } = await this.dialogService.confirm({
105
- type: Severity.Info,
106
- message: accountUsages.length
107
- ? ( localizeWithPath(
108
- 'vs/workbench/api/browser/mainThreadAuthentication',
109
- 'signOutMessage',
110
- "The account '{0}' has been used by: \n\n{1}\n\n Sign out from these extensions?",
111
- accountName,
112
- ( accountUsages.map(usage => usage.extensionName)).join('\n')
113
- ))
114
- : ( localizeWithPath(
115
- 'vs/workbench/api/browser/mainThreadAuthentication',
116
- 'signOutMessageSimple',
117
- "Sign out of '{0}'?",
118
- accountName
119
- )),
120
- primaryButton: ( localizeWithPath(
121
- 'vs/workbench/api/browser/mainThreadAuthentication',
122
- { key: 'signOut', comment: ['&& denotes a mnemonic'] },
123
- "&&Sign Out"
124
- ))
125
- });
126
- if (confirmed) {
127
- const removeSessionPromises = ( sessions.map(session => this.removeSession(session.id)));
128
- await Promise.all(removeSessionPromises);
129
- removeAccountUsage(this.storageService, this.id, accountName);
130
- this.storageService.remove(`${this.id}-${accountName}`, -1 );
131
- }
25
+ this.onDidChangeSessions = onDidChangeSessionsEmitter.event;
132
26
  }
133
27
  async getSessions(scopes) {
134
28
  return this._proxy.$getSessions(this.id, scopes);
@@ -146,45 +40,47 @@ class MainThreadAuthenticationProvider extends Disposable {
146
40
  }
147
41
  }
148
42
  let MainThreadAuthentication = class MainThreadAuthentication extends Disposable {
149
- constructor(extHostContext, authenticationService, dialogService, storageService, notificationService, quickInputService, extensionService, telemetryService) {
43
+ constructor(extHostContext, authenticationService, dialogService, storageService, notificationService, extensionService, telemetryService) {
150
44
  super();
151
45
  this.authenticationService = authenticationService;
152
46
  this.dialogService = dialogService;
153
47
  this.storageService = storageService;
154
48
  this.notificationService = notificationService;
155
- this.quickInputService = quickInputService;
156
49
  this.extensionService = extensionService;
157
50
  this.telemetryService = telemetryService;
51
+ this._registrations = this._register(( new DisposableMap()));
158
52
  this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostAuthentication));
159
53
  this._register(this.authenticationService.onDidChangeSessions(e => {
160
54
  this._proxy.$onDidChangeAuthenticationSessions(e.providerId, e.label);
161
55
  }));
162
- this._proxy.$setProviders(this.authenticationService.declaredProviders);
163
- this._register(this.authenticationService.onDidChangeDeclaredProviders(e => {
164
- this._proxy.$setProviders(e);
165
- }));
166
56
  }
167
57
  async $registerAuthenticationProvider(id, label, supportsMultipleAccounts) {
58
+ const emitter = ( new Emitter());
59
+ this._registrations.set(id, emitter);
168
60
  const provider = ( new MainThreadAuthenticationProvider(
169
61
  this._proxy,
170
62
  id,
171
63
  label,
172
64
  supportsMultipleAccounts,
173
65
  this.notificationService,
174
- this.storageService,
175
- this.quickInputService,
176
- this.dialogService
66
+ emitter
177
67
  ));
178
68
  this.authenticationService.registerAuthenticationProvider(id, provider);
179
69
  }
180
70
  $unregisterAuthenticationProvider(id) {
71
+ this._registrations.deleteAndDispose(id);
181
72
  this.authenticationService.unregisterAuthenticationProvider(id);
182
73
  }
183
- $ensureProvider(id) {
184
- return this.extensionService.activateByEvent(getAuthenticationProviderActivationEvent(id), 1 );
74
+ async $ensureProvider(id) {
75
+ if (!this.authenticationService.isAuthenticationProviderRegistered(id)) {
76
+ return await this.extensionService.activateByEvent(getAuthenticationProviderActivationEvent(id), 1 );
77
+ }
185
78
  }
186
- $sendDidChangeSessions(id, event) {
187
- this.authenticationService.sessionsUpdate(id, event);
79
+ $sendDidChangeSessions(providerId, event) {
80
+ const obj = this._registrations.get(providerId);
81
+ if (obj instanceof Emitter) {
82
+ obj.fire(event);
83
+ }
188
84
  }
189
85
  $removeSession(providerId, sessionId) {
190
86
  return this.authenticationService.removeSession(providerId, sessionId);
@@ -324,9 +220,8 @@ MainThreadAuthentication = __decorate([
324
220
  ( __param(2, IDialogService)),
325
221
  ( __param(3, IStorageService)),
326
222
  ( __param(4, INotificationService)),
327
- ( __param(5, IQuickInputService)),
328
- ( __param(6, IExtensionService)),
329
- ( __param(7, ITelemetryService))
223
+ ( __param(5, IExtensionService)),
224
+ ( __param(6, ITelemetryService))
330
225
  ], MainThreadAuthentication);
331
226
 
332
227
  export { MainThreadAuthentication, MainThreadAuthenticationProvider };
@@ -17,11 +17,6 @@ let MainThreadChat = class MainThreadChat extends Disposable {
17
17
  this._providerRegistrations = this._register(( new DisposableMap()));
18
18
  this._stateEmitters = ( new Map());
19
19
  this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostChat));
20
- this._register(this._chatService.onDidPerformUserAction(e => {
21
- if (!e.agentId) {
22
- this._proxy.$onDidPerformUserAction(e);
23
- }
24
- }));
25
20
  }
26
21
  $transferChatSession(sessionId, toWorkspace) {
27
22
  const sessionIdStr = this._chatService.getSessionId(sessionId);
@@ -1,5 +1,4 @@
1
1
  import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { DeferredPromise } from 'vscode/vscode/vs/base/common/async';
3
2
  import { Disposable, DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
4
3
  import { revive } from 'vscode/vscode/vs/base/common/marshalling';
5
4
  import { escapeRegExpCharacters } from 'vscode/vscode/vs/base/common/strings';
@@ -28,8 +27,6 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
28
27
  this._agents = this._register(( new DisposableMap()));
29
28
  this._agentCompletionProviders = this._register(( new DisposableMap()));
30
29
  this._pendingProgress = ( new Map());
31
- this._responsePartHandlePool = 0;
32
- this._activeResponsePartPromises = ( new Map());
33
30
  this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostChatAgents2));
34
31
  this._register(this._chatService.onDidDisposeSession(e => {
35
32
  this._proxy.$releaseSession(e.sessionId);
@@ -60,7 +57,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
60
57
  invoke: async (request, progress, history, token) => {
61
58
  this._pendingProgress.set(request.requestId, progress);
62
59
  try {
63
- return (await this._proxy.$invokeAgent(handle, request.sessionId, request.requestId, request, { history }, token)) ?? {};
60
+ return (await this._proxy.$invokeAgent(handle, request, { history }, token)) ?? {};
64
61
  }
65
62
  finally {
66
63
  this._pendingProgress.delete(request.requestId);
@@ -95,32 +92,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
95
92
  data.hasFollowups = metadataUpdate.hasFollowups;
96
93
  this._chatAgentService.updateAgent(data.name, revive(metadataUpdate));
97
94
  }
98
- async $handleProgressChunk(requestId, progress, responsePartHandle) {
99
- if (progress.kind === 'asyncContent') {
100
- const handle = ++this._responsePartHandlePool;
101
- const responsePartId = `${requestId}_${handle}`;
102
- const deferredContentPromise = ( new DeferredPromise());
103
- this._activeResponsePartPromises.set(responsePartId, deferredContentPromise);
104
- this._pendingProgress.get(requestId)?.({ ...progress, resolvedContent: deferredContentPromise.p });
105
- return handle;
106
- }
107
- else if (typeof responsePartHandle === 'number') {
108
- const responsePartId = `${requestId}_${responsePartHandle}`;
109
- const deferredContentPromise = this._activeResponsePartPromises.get(responsePartId);
110
- if (deferredContentPromise && progress.kind === 'treeData') {
111
- const withRevivedUris = revive(progress);
112
- deferredContentPromise.complete(withRevivedUris);
113
- this._activeResponsePartPromises.delete(responsePartId);
114
- }
115
- else if (deferredContentPromise && progress.kind === 'content') {
116
- deferredContentPromise.complete(progress.content);
117
- this._activeResponsePartPromises.delete(responsePartId);
118
- }
119
- return responsePartHandle;
120
- }
121
- if (progress.kind === 'treeData') {
122
- return;
123
- }
95
+ async $handleProgressChunk(requestId, progress) {
124
96
  const revivedProgress = revive(progress);
125
97
  this._pendingProgress.get(requestId)?.(revivedProgress);
126
98
  }
@@ -165,7 +137,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
165
137
  kind: 18 ,
166
138
  detail: v.detail,
167
139
  documentation: v.documentation,
168
- command: { id: AddDynamicVariableAction.ID, title: '', arguments: [{ widget, range: rangeAfterInsert, variableData: v.values }] }
140
+ command: { id: AddDynamicVariableAction.ID, title: '', arguments: [{ widget, range: rangeAfterInsert, variableData: revive(v.values) }] }
169
141
  };
170
142
  }));
171
143
  return {
@@ -9,13 +9,14 @@ import { ICommentService } from 'vscode/vscode/vs/workbench/contrib/comments/bro
9
9
  import { CommentsPanel } from '../../contrib/comments/browser/commentsView.js';
10
10
  import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
11
11
  import { COMMENTS_VIEW_ID, COMMENTS_VIEW_TITLE, COMMENTS_VIEW_STORAGE_ID } from '../../contrib/comments/browser/commentsTreeViewer.js';
12
- import { IViewsService, IViewDescriptorService, Extensions } from 'vscode/vscode/vs/workbench/common/views';
12
+ import { IViewDescriptorService, Extensions } from 'vscode/vscode/vs/workbench/common/views';
13
13
  import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
14
14
  import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
15
15
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
16
16
  import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
17
17
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
18
18
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
19
+ import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
19
20
 
20
21
  class MainThreadCommentThread {
21
22
  get input() {
@@ -1,19 +1,23 @@
1
1
  import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
2
  import { DisposableStore, DisposableMap, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
3
  import { URI } from 'vscode/vscode/vs/base/common/uri';
4
- import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
4
+ import { IDebugService, IDebugVisualization } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
5
5
  import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
6
6
  import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
7
7
  import Severity from 'vscode/vscode/vs/base/common/severity';
8
8
  import { AbstractDebugAdapter } from 'vscode/vscode/vs/workbench/contrib/debug/common/abstractDebugAdapter';
9
9
  import { isSessionAttach, convertToVSCPaths, convertToDAPaths } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugUtils';
10
10
  import { ErrorNoTelemetry } from 'vscode/vscode/vs/base/common/errors';
11
+ import { IDebugVisualizerService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugVisualizers';
12
+ import { ExtensionIdentifier } from 'vscode/vscode/vs/platform/extensions/common/extensions';
11
13
 
12
14
  let MainThreadDebugService = class MainThreadDebugService {
13
- constructor(extHostContext, debugService) {
15
+ constructor(extHostContext, debugService, visualizerService) {
14
16
  this.debugService = debugService;
17
+ this.visualizerService = visualizerService;
15
18
  this._toDispose = ( new DisposableStore());
16
19
  this._debugAdaptersHandleCounter = 1;
20
+ this._visualizerHandles = ( new Map());
17
21
  this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostDebugService));
18
22
  const sessionListeners = ( new DisposableMap());
19
23
  this._toDispose.add(sessionListeners);
@@ -32,15 +36,17 @@ let MainThreadDebugService = class MainThreadDebugService {
32
36
  }
33
37
  store.add(session.onDidCustomEvent(event => this._proxy.$acceptDebugSessionCustomEvent(this.getSessionDto(session), event)));
34
38
  }));
35
- this._toDispose.add(debugService.onDidEndSession(session => {
39
+ this._toDispose.add(debugService.onDidEndSession(({ session, restart }) => {
36
40
  this._proxy.$acceptDebugSessionTerminated(this.getSessionDto(session));
37
- this._sessions.delete(session.getId());
41
+ this._extHostKnownSessions.delete(session.getId());
42
+ if (!restart) {
43
+ sessionListeners.deleteAndDispose(session);
44
+ }
38
45
  for (const [handle, value] of this._debugAdapters) {
39
46
  if (value.session === session) {
40
47
  this._debugAdapters.delete(handle);
41
48
  }
42
49
  }
43
- sessionListeners.deleteAndDispose(session);
44
50
  }));
45
51
  this._toDispose.add(debugService.getViewModel().onDidFocusSession(session => {
46
52
  this._proxy.$acceptDebugSessionActiveChanged(this.getSessionDto(session));
@@ -53,7 +59,7 @@ let MainThreadDebugService = class MainThreadDebugService {
53
59
  this._debugAdapters = ( new Map());
54
60
  this._debugConfigurationProviders = ( new Map());
55
61
  this._debugAdapterDescriptorFactories = ( new Map());
56
- this._sessions = ( new Set());
62
+ this._extHostKnownSessions = ( new Set());
57
63
  this._toDispose.add(this.debugService.getViewModel().onDidFocusThread(({ thread, explicit, session }) => {
58
64
  if (session) {
59
65
  const dto = {
@@ -77,6 +83,22 @@ let MainThreadDebugService = class MainThreadDebugService {
77
83
  }));
78
84
  this.sendBreakpointsAndListen();
79
85
  }
86
+ $registerDebugVisualizer(extensionId, id) {
87
+ const handle = this.visualizerService.register({
88
+ extensionId: ( new ExtensionIdentifier(extensionId)),
89
+ id,
90
+ disposeDebugVisualizers: ids => this._proxy.$disposeDebugVisualizers(ids),
91
+ executeDebugVisualizerCommand: id => this._proxy.$executeDebugVisualizerCommand(id),
92
+ provideDebugVisualizers: (context, token) => this._proxy.$provideDebugVisualizers(extensionId, id, context, token).then(r => ( r.map(IDebugVisualization.deserialize))),
93
+ resolveDebugVisualizer: (viz, token) => this._proxy.$resolveDebugVisualizer(viz.id, token),
94
+ });
95
+ this._visualizerHandles.set(`${extensionId}/${id}`, handle);
96
+ }
97
+ $unregisterDebugVisualizer(extensionId, id) {
98
+ const key = `${extensionId}/${id}`;
99
+ this._visualizerHandles.get(key)?.dispose();
100
+ this._visualizerHandles.delete(key);
101
+ }
80
102
  sendBreakpointsAndListen() {
81
103
  this._toDispose.add(this.debugService.getModel().onDidChangeBreakpoints(e => {
82
104
  if (e && !e.sessionOnly) {
@@ -288,12 +310,12 @@ let MainThreadDebugService = class MainThreadDebugService {
288
310
  return adapter;
289
311
  }
290
312
  $sessionCached(sessionID) {
291
- this._sessions.add(sessionID);
313
+ this._extHostKnownSessions.add(sessionID);
292
314
  }
293
315
  getSessionDto(session) {
294
316
  if (session) {
295
317
  const sessionID = session.getId();
296
- if (( this._sessions.has(sessionID))) {
318
+ if (( this._extHostKnownSessions.has(sessionID))) {
297
319
  return sessionID;
298
320
  }
299
321
  else {
@@ -356,7 +378,8 @@ let MainThreadDebugService = class MainThreadDebugService {
356
378
  };
357
379
  MainThreadDebugService = __decorate([
358
380
  extHostNamedCustomer(MainContext.MainThreadDebugService),
359
- ( __param(1, IDebugService))
381
+ ( __param(1, IDebugService)),
382
+ ( __param(2, IDebugVisualizerService))
360
383
  ], MainThreadDebugService);
361
384
  class ExtensionHostDebugAdapter extends AbstractDebugAdapter {
362
385
  constructor(_ds, _handle, _proxy, session) {
@@ -44,7 +44,7 @@ let MainThreadDocumentContentProviders = class MainThreadDocumentContentProvider
44
44
  $unregisterTextContentProvider(handle) {
45
45
  this._resourceContentProvider.deleteAndDispose(handle);
46
46
  }
47
- $onVirtualDocumentChange(uri, value) {
47
+ async $onVirtualDocumentChange(uri, value) {
48
48
  const model = this._modelService.getModel(URI.revive(uri));
49
49
  if (!model) {
50
50
  return;
@@ -53,7 +53,8 @@ let MainThreadDocumentContentProviders = class MainThreadDocumentContentProvider
53
53
  pending?.cancel();
54
54
  const myToken = ( new CancellationTokenSource());
55
55
  this._pendingUpdate.set(model.id, myToken);
56
- this._editorWorkerService.computeMoreMinimalEdits(model.uri, [{ text: value, range: model.getFullModelRange() }]).then(edits => {
56
+ try {
57
+ const edits = await this._editorWorkerService.computeMoreMinimalEdits(model.uri, [{ text: value, range: model.getFullModelRange() }]);
57
58
  this._pendingUpdate.delete(model.id);
58
59
  if (myToken.token.isCancellationRequested) {
59
60
  return;
@@ -61,7 +62,10 @@ let MainThreadDocumentContentProviders = class MainThreadDocumentContentProvider
61
62
  if (edits && edits.length > 0) {
62
63
  model.applyEdits(( edits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text))));
63
64
  }
64
- }).catch(onUnexpectedError);
65
+ }
66
+ catch (error) {
67
+ onUnexpectedError(error);
68
+ }
65
69
  }
66
70
  };
67
71
  MainThreadDocumentContentProviders = __decorate([
@@ -59,6 +59,7 @@ class MainThreadTextEditorProperties {
59
59
  insertSpaces: modelOptions.insertSpaces,
60
60
  tabSize: modelOptions.tabSize,
61
61
  indentSize: modelOptions.indentSize,
62
+ originalIndentSize: modelOptions.originalIndentSize,
62
63
  cursorStyle: cursorStyle,
63
64
  lineNumbers: lineNumbers
64
65
  };
@@ -396,10 +397,9 @@ class MainThreadTextEditor {
396
397
  if (!snippetController) {
397
398
  return false;
398
399
  }
399
- const selections = ( ranges.map(r => ( new Selection(r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn))));
400
- this._codeEditor.setSelections(selections);
401
400
  this._codeEditor.focus();
402
- snippetController.insert(template, {
401
+ const edits = ( ranges.map(range => ({ range: Range.lift(range), template })));
402
+ snippetController.apply(edits, {
403
403
  overwriteBefore: 0, overwriteAfter: 0,
404
404
  undoStopBefore: opts.undoStopBefore, undoStopAfter: opts.undoStopAfter,
405
405
  clipboardText
@@ -43,7 +43,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
43
43
  }));
44
44
  this._dispoables.add(this._editorGroupsService.onDidAddGroup(() => this._createTabsModel()));
45
45
  this._dispoables.add(this._editorGroupsService.onDidRemoveGroup(() => this._createTabsModel()));
46
- this._editorGroupsService.mainPart.whenReady.then(() => this._createTabsModel());
46
+ this._editorGroupsService.whenReady.then(() => this._createTabsModel());
47
47
  }
48
48
  dispose() {
49
49
  this._groupLookup.clear();
@@ -203,7 +203,7 @@ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
203
203
  checkbox: { label: ( localizeWithPath(
204
204
  'vs/workbench/api/browser/mainThreadFileSystemEventService',
205
205
  'again',
206
- "Don't ask again"
206
+ "Do not ask me again"
207
207
  )) }
208
208
  });
209
209
  if (result === Choice.Cancel) {
@@ -9,7 +9,8 @@ let MainThreadIssueReporter = class MainThreadIssueReporter extends Disposable {
9
9
  constructor(context, _issueService) {
10
10
  super();
11
11
  this._issueService = _issueService;
12
- this._registrations = this._register(( new DisposableMap()));
12
+ this._registrationsUri = this._register(( new DisposableMap()));
13
+ this._registrationsData = this._register(( new DisposableMap()));
13
14
  this._proxy = ( context.getProxy(ExtHostContext.ExtHostIssueReporter));
14
15
  }
15
16
  $registerIssueUriRequestHandler(extensionId) {
@@ -19,10 +20,10 @@ let MainThreadIssueReporter = class MainThreadIssueReporter extends Disposable {
19
20
  return ( URI.from(parts));
20
21
  }
21
22
  };
22
- this._registrations.set(extensionId, this._issueService.registerIssueUriRequestHandler(extensionId, handler));
23
+ this._registrationsUri.set(extensionId, this._issueService.registerIssueUriRequestHandler(extensionId, handler));
23
24
  }
24
25
  $unregisterIssueUriRequestHandler(extensionId) {
25
- this._registrations.deleteAndDispose(extensionId);
26
+ this._registrationsUri.deleteAndDispose(extensionId);
26
27
  }
27
28
  $registerIssueDataProvider(extensionId) {
28
29
  const provider = {
@@ -35,10 +36,10 @@ let MainThreadIssueReporter = class MainThreadIssueReporter extends Disposable {
35
36
  return parts;
36
37
  }
37
38
  };
38
- this._registrations.set(extensionId, this._issueService.registerIssueDataProvider(extensionId, provider));
39
+ this._registrationsData.set(extensionId, this._issueService.registerIssueDataProvider(extensionId, provider));
39
40
  }
40
41
  $unregisterIssueDataProvider(extensionId) {
41
- this._registrations.deleteAndDispose(extensionId);
42
+ this._registrationsData.deleteAndDispose(extensionId);
42
43
  }
43
44
  };
44
45
  MainThreadIssueReporter = __decorate([
@@ -552,7 +552,8 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
552
552
  return {
553
553
  ...hint,
554
554
  tooltip: result.tooltip,
555
- label: revive(result.label)
555
+ label: revive(result.label),
556
+ textEdits: result.textEdits
556
557
  };
557
558
  };
558
559
  }
@@ -828,7 +829,7 @@ let MainThreadPasteEditProvider = class MainThreadPasteEditProvider {
828
829
  };
829
830
  }
830
831
  if (metadata.supportsPaste) {
831
- this.provideDocumentPasteEdits = async (model, selections, dataTransfer, token) => {
832
+ this.provideDocumentPasteEdits = async (model, selections, dataTransfer, context, token) => {
832
833
  const request = this.dataTransfers.add(dataTransfer);
833
834
  try {
834
835
  const dataTransferDto = await DataTransfer.from(dataTransfer);
@@ -6,14 +6,21 @@ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCu
6
6
  import '../../../../../../override/vs/platform/dialogs/common/dialogs.js';
7
7
  import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
8
8
  import { Event } from 'vscode/vscode/vs/base/common/event';
9
+ import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
9
10
  import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
10
11
 
11
12
  let MainThreadMessageService = class MainThreadMessageService {
12
- constructor(extHostContext, _notificationService, _dialogService) {
13
+ constructor(extHostContext, _notificationService, _dialogService, extensionService) {
13
14
  this._notificationService = _notificationService;
14
15
  this._dialogService = _dialogService;
16
+ this.extensionsListener = extensionService.onDidChangeExtensions(e => {
17
+ for (const extension of e.removed) {
18
+ this._notificationService.removeFilter(extension.identifier.value);
19
+ }
20
+ });
15
21
  }
16
22
  dispose() {
23
+ this.extensionsListener.dispose();
17
24
  }
18
25
  $showMessage(severity, message, options, commands) {
19
26
  if (options.modal) {
@@ -37,12 +44,7 @@ let MainThreadMessageService = class MainThreadMessageService {
37
44
  let source;
38
45
  if (options.source) {
39
46
  source = {
40
- label: ( localizeWithPath(
41
- 'vs/workbench/api/browser/mainThreadMessageService',
42
- 'extensionSource',
43
- "{0} (Extension)",
44
- options.source.label
45
- )),
47
+ label: options.source.label,
46
48
  id: options.source.identifier.value
47
49
  };
48
50
  }
@@ -112,7 +114,8 @@ let MainThreadMessageService = class MainThreadMessageService {
112
114
  MainThreadMessageService = __decorate([
113
115
  extHostNamedCustomer(MainContext.MainThreadMessageService),
114
116
  ( __param(1, INotificationService)),
115
- ( __param(2, IDialogService))
117
+ ( __param(2, IDialogService)),
118
+ ( __param(3, IExtensionService))
116
119
  ], MainThreadMessageService);
117
120
 
118
121
  export { MainThreadMessageService };
@@ -184,14 +184,14 @@ let MainThreadNotebookKernels = class MainThreadNotebookKernels {
184
184
  async cancelNotebookCellExecution(uri, handles) {
185
185
  await that._proxy.$cancelCells(handle, uri, handles);
186
186
  }
187
- provideVariables(notebookUri, parentName, kind, start, token) {
187
+ provideVariables(notebookUri, parentId, kind, start, token) {
188
188
  const requestId = `${handle}variables${that.variableRequestIndex++}`;
189
189
  if (( that.variableRequestMap.has(requestId))) {
190
190
  return that.variableRequestMap.get(requestId).asyncIterable;
191
191
  }
192
192
  const source = ( new AsyncIterableSource());
193
193
  that.variableRequestMap.set(requestId, source);
194
- that._proxy.$provideVariables(handle, requestId, notebookUri, parentName, kind, start, token).then(() => {
194
+ that._proxy.$provideVariables(handle, requestId, notebookUri, parentId, kind, start, token).then(() => {
195
195
  source.resolve();
196
196
  that.variableRequestMap.delete(requestId);
197
197
  }).catch((err) => {
@@ -6,7 +6,7 @@ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCu
6
6
  import { URI } from 'vscode/vscode/vs/base/common/uri';
7
7
  import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
8
8
  import { Event } from 'vscode/vscode/vs/base/common/event';
9
- import { IViewsService } from 'vscode/vscode/vs/workbench/common/views';
9
+ import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
10
10
  import { isNumber } from 'vscode/vscode/vs/base/common/types';
11
11
 
12
12
  var MainThreadOutputService_1;