@codingame/monaco-vscode-api 1.69.23 → 1.76.0-next.1

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/dist/extHost.js CHANGED
@@ -1,46 +1,49 @@
1
- import { _ as __decorate, a as __param, E as Emitter, c as __classPrivateFieldSet, d as __classPrivateFieldGet } from './workspace.js';
2
- import { u as disposed, v as coalesceInPlace, C as ConsoleMainLogger, w as mapArrayOrNot, x as delta$1, y as readonly, N as NotImplementedError, R as ResourceSet } from './polyfill.js';
3
- import { b as IEditorService, I as IEditorGroupsService, h as IProductService, P as markAsFileSystemProviderError, u as FileSystemProviderErrorCode, A as ACTIVE_GROUP, p as SIDE_GROUP, k as IUriIdentityService, f as IPaneCompositePartService, j as ITextFileService, c as IFileService, l as IWorkbenchEnvironmentService, m as IWorkingCopyFileService, g as IPathService, e as ILanguageStatusService, d as IHostService, S as Services } from './services2.js';
4
- import { b as isStringArray, w as withUndefinedAsNull } from './types.js';
1
+ import { _ as __decorate, a as __param, E as Emitter$1, c as __classPrivateFieldSet, d as __classPrivateFieldGet } from './contextkey.js';
2
+ import { l as checkProposedApiEnabled, u as unsupported, c as IExtensionService, m as ILoggerService, n as isLogLevel, i as isProposedApiEnabled } from './missing-services.js';
3
+ import { b as IEditorService, I as IEditorGroupsService, h as IProductService, B as FileSystemProviderErrorCode, P as markAsFileSystemProviderError, A as ACTIVE_GROUP, p as SIDE_GROUP, Q as preferredSideBySideGroupDirection, S as Services, k as IUriIdentityService, f as IPaneCompositePartService, j as ITextFileService, c as IFileService, l as IWorkbenchEnvironmentService, m as IWorkingCopyFileService, g as IPathService, e as ILanguageStatusService, d as IHostService } from './services2.js';
4
+ import { z as disposed, h as isStringArray, w as withUndefinedAsNull, A as mapArrayOrNot, B as delta$1, C as readonly, D as NotImplementedError, E as encodeBase64 } from './polyfill.js';
5
5
  import { illegalArgument, canceled, transformErrorForSerialization, CancellationError, onUnexpectedError, onUnexpectedExternalError, isCancellationError } from 'monaco-editor/esm/vs/base/common/errors.js';
6
+ import { coalesceInPlace, equals as equals$1, coalesce, isNonEmptyArray, isFalsyOrEmpty, asArray, distinct } from 'monaco-editor/esm/vs/base/common/arrays.js';
6
7
  import { URI, uriToFsPath } from 'monaco-editor/esm/vs/base/common/uri.js';
7
- import { equals as equals$1, coalesce, isNonEmptyArray, isFalsyOrEmpty, asArray, distinct } from 'monaco-editor/esm/vs/base/common/arrays.js';
8
8
  import { generateUuid } from 'monaco-editor/esm/vs/base/common/uuid.js';
9
- import { isString, isArray, isNumber, validateConstraint, assertIsDefined, isObject, withNullAsUndefined, isUndefinedOrNull, isUndefined } from 'monaco-editor/esm/vs/base/common/types.js';
9
+ import { isNumber, isObject, isString, validateConstraint, assertIsDefined, withNullAsUndefined, isUndefinedOrNull, isUndefined } from 'monaco-editor/esm/vs/base/common/types.js';
10
10
  import { compare, equalsIgnoreCase, isFalsyOrWhitespace, nextCharLength, splitLines, regExpFlags, regExpLeadsToEndlessLoop } from 'monaco-editor/esm/vs/base/common/strings.js';
11
11
  import { Mimes } from 'monaco-editor/esm/vs/base/common/mime.js';
12
- import { ResourceMap, TernarySearchTree } from 'monaco-editor/esm/vs/base/common/map.js';
12
+ import { ResourceMap as ResourceMap$1 } from 'monaco-editor/esm/vs/base/common/map.js';
13
13
  import { MarkdownString as MarkdownString$2, parseHrefAndDimensions, isMarkdownString } from 'monaco-editor/esm/vs/base/common/htmlContent.js';
14
14
  import { marked as marked$1 } from 'monaco-editor/esm/vs/base/common/marked/marked.js';
15
15
  import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
16
+ import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
16
17
  import { MarkerSeverity, IMarkerService } from 'monaco-editor/esm/vs/platform/markers/common/markers.js';
17
18
  import { revive, parse } from 'monaco-editor/esm/vs/base/common/marshalling.js';
18
- import { equals, cloneAndChange, deepFreeze, mixin, deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
19
+ import { equals, mixin, cloneAndChange, deepFreeze, deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
19
20
  import { once } from 'monaco-editor/esm/vs/base/common/functional.js';
20
- import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
21
- import { createDecorator, IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
21
+ import { createStringDataTransferItem, VSDataTransfer, UriList } from 'monaco-editor/esm/vs/base/common/dataTransfer.js';
22
+ import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
23
+ import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
24
+ import { Disposable as Disposable$1, DisposableStore, dispose, toDisposable, DisposableMap, combinedDisposable, SafeDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
25
+ import { localize } from 'monaco-editor/esm/vs/nls.js';
26
+ import { ILogService, LogLevel } from 'monaco-editor/esm/vs/platform/log/common/log.js';
27
+ import { StopWatch } from 'monaco-editor/esm/vs/base/common/stopwatch.js';
22
28
  import { toErrorMessage } from 'monaco-editor/esm/vs/base/common/errorMessage.js';
23
- import { ILogService, LogLevel, LogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
24
- import { Disposable as Disposable$1, DisposableStore, dispose, toDisposable, combinedDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
25
- import { d as IExtensionService, u as unsupported, m as checkProposedApiEnabled, i as isProposedApiEnabled } from './missing-services.js';
26
29
  import { ICommandService, CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
27
- import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
28
30
  import { basename as basename$1, dirname as dirname$1, basenameOrAuthority, relativePath, ExtUri as ExtUri$1, extUri as extUri$1 } from 'monaco-editor/esm/vs/base/common/resources.js';
29
31
  import { DebounceEmitter, Event } from 'monaco-editor/esm/vs/base/common/event.js';
30
- import { localize } from 'monaco-editor/esm/vs/nls.js';
31
32
  import { RunOnceScheduler, disposableTimeout } from 'monaco-editor/esm/vs/base/common/async.js';
32
33
  import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation.js';
33
34
  import { MirrorTextModel } from 'monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js';
34
35
  import { ok } from 'monaco-editor/esm/vs/base/common/assert.js';
35
36
  import { getWordAtText, ensureValidWordDefinition } from 'monaco-editor/esm/vs/editor/common/core/wordHelper.js';
36
37
  import Severity$1 from 'monaco-editor/esm/vs/base/common/severity.js';
37
- import { ThemeIcon as ThemeIcon$1 } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
38
+ import { ThemeIcon as ThemeIcon$1 } from 'monaco-editor/esm/vs/base/common/themables.js';
39
+ import { LinkedList } from 'monaco-editor/esm/vs/base/common/linkedList.js';
38
40
  import { B as Barrier, r as raceCancellationError } from './async.js';
39
41
  import { INotificationService, Severity } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
40
42
  import { IWorkspaceContextService, Workspace, WorkspaceFolder } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
43
+ import { TernarySearchTree } from 'monaco-editor/esm/vs/base/common/ternarySearchTree.js';
41
44
  import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
45
+ import { toAction, Action } from 'monaco-editor/esm/vs/base/common/actions.js';
42
46
  import { IDialogService } from 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js';
43
- import { Action } from 'monaco-editor/esm/vs/base/common/actions.js';
44
47
  import { IProgressService, Progress } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
45
48
  import { EditOperation } from 'monaco-editor/esm/vs/editor/common/core/editOperation.js';
46
49
  import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
@@ -58,27 +61,292 @@ import { SnippetParser } from 'monaco-editor/esm/vs/editor/contrib/snippet/brows
58
61
  import { SnippetController2 } from 'monaco-editor/esm/vs/editor/contrib/snippet/browser/snippetController2.js';
59
62
  import { EditorState } from 'monaco-editor/esm/vs/editor/contrib/editorState/browser/editorState.js';
60
63
  import { TextEditorCursorStyle as TextEditorCursorStyle$1 } from 'monaco-editor/esm/vs/editor/common/config/editorOptions.js';
64
+ import { getCodeEditor, isCodeEditor, isDiffEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
61
65
  import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
66
+ import { IConfigurationService, getLanguageTagSettingPlainKey } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
62
67
  import { IClipboardService } from 'monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js';
63
- import { isCodeEditor, isDiffEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
64
68
  import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
65
69
  import { IEnvironmentService } from 'monaco-editor/esm/vs/platform/environment/common/environment.js';
66
70
  import { IBulkEditService, ResourceTextEdit, ResourceFileEdit, ResourceEdit } from 'monaco-editor/esm/vs/editor/browser/services/bulkEditService.js';
67
71
  import { IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
68
72
  import { encodeSemanticTokensDto } from 'monaco-editor/esm/vs/editor/common/services/semanticTokensDto.js';
69
73
  import { InlineCompletionTriggerKind as InlineCompletionTriggerKind$1 } from 'monaco-editor/esm/vs/editor/common/languages.js';
70
- import { StopWatch } from 'monaco-editor/esm/vs/base/common/stopwatch.js';
71
74
  import { LanguageFeatureRegistry } from 'monaco-editor/esm/vs/editor/common/languageFeatureRegistry.js';
72
75
  import { ILanguageConfigurationService } from 'monaco-editor/esm/vs/editor/common/languages/languageConfigurationRegistry.js';
73
76
  import { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
74
- import { createStringDataTransferItem, VSDataTransfer } from 'monaco-editor/esm/vs/base/common/dataTransfer.js';
75
77
  import { Configuration, ConfigurationChangeEvent } from 'monaco-editor/esm/vs/platform/configuration/common/configurationModels.js';
76
78
  import { Extensions, OVERRIDE_PROPERTY_REGEX as OVERRIDE_PROPERTY_REGEX$1 } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
77
- import { IConfigurationService, getLanguageTagSettingPlainKey } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
78
79
  import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
79
80
  import { Extensions as Extensions$1 } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
80
81
  import { ExtensionIdentifier } from 'monaco-editor/esm/vs/platform/extensions/common/extensions.js';
81
82
  import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
83
+ class EventProfiling {
84
+ constructor(name) {
85
+ this.listenerCount = 0;
86
+ this.invocationCount = 0;
87
+ this.elapsedOverall = 0;
88
+ this.durations = [];
89
+ this.name = `${name}_${EventProfiling._idPool++}`;
90
+ EventProfiling.all.add(this);
91
+ }
92
+ start(listenerCount) {
93
+ this._stopWatch = ( (new StopWatch(true)));
94
+ this.listenerCount = listenerCount;
95
+ }
96
+ stop() {
97
+ if (this._stopWatch) {
98
+ const elapsed = this._stopWatch.elapsed();
99
+ this.durations.push(elapsed);
100
+ this.elapsedOverall += elapsed;
101
+ this.invocationCount += 1;
102
+ this._stopWatch = undefined;
103
+ }
104
+ }
105
+ }
106
+ EventProfiling.all = ( (new Set()));
107
+ EventProfiling._idPool = 0;
108
+ let _globalLeakWarningThreshold = -1;
109
+ class LeakageMonitor {
110
+ constructor(threshold, name = ( (Math.random().toString(18))).slice(2, 5)) {
111
+ this.threshold = threshold;
112
+ this.name = name;
113
+ this._warnCountdown = 0;
114
+ }
115
+ dispose() {
116
+ this._stacks?.clear();
117
+ }
118
+ check(stack, listenerCount) {
119
+ const threshold = this.threshold;
120
+ if (threshold <= 0 || listenerCount < threshold) {
121
+ return undefined;
122
+ }
123
+ if (!this._stacks) {
124
+ this._stacks = ( (new Map()));
125
+ }
126
+ const count = (this._stacks.get(stack.value) || 0);
127
+ this._stacks.set(stack.value, count + 1);
128
+ this._warnCountdown -= 1;
129
+ if (this._warnCountdown <= 0) {
130
+ this._warnCountdown = threshold * 0.5;
131
+ let topStack;
132
+ let topCount = 0;
133
+ for (const [stack, count] of this._stacks) {
134
+ if (!topStack || topCount < count) {
135
+ topStack = stack;
136
+ topCount = count;
137
+ }
138
+ }
139
+ console.warn(`[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`);
140
+ console.warn(topStack);
141
+ }
142
+ return () => {
143
+ const count = (this._stacks.get(stack.value) || 0);
144
+ this._stacks.set(stack.value, count - 1);
145
+ };
146
+ }
147
+ }
148
+ class Stacktrace {
149
+ static create() {
150
+ return (
151
+ (new Stacktrace(( (new Error())).stack ?? ''))
152
+ );
153
+ }
154
+ constructor(value) {
155
+ this.value = value;
156
+ }
157
+ print() {
158
+ console.warn(this.value.split('\n').slice(2).join('\n'));
159
+ }
160
+ }
161
+ class Listener {
162
+ constructor(callback, callbackThis, stack) {
163
+ this.callback = callback;
164
+ this.callbackThis = callbackThis;
165
+ this.stack = stack;
166
+ this.subscription = ( (new SafeDisposable()));
167
+ }
168
+ invoke(e) {
169
+ this.callback.call(this.callbackThis, e);
170
+ }
171
+ }
172
+ class Emitter {
173
+ constructor(options) {
174
+ this._disposed = false;
175
+ this._options = options;
176
+ this._leakageMon = this._options?.leakWarningThreshold ? ( (new LeakageMonitor(this._options?.leakWarningThreshold ?? _globalLeakWarningThreshold))) : undefined;
177
+ this._perfMon = this._options?._profName ? ( (new EventProfiling(this._options._profName))) : undefined;
178
+ this._deliveryQueue = this._options?.deliveryQueue;
179
+ }
180
+ dispose() {
181
+ if (!this._disposed) {
182
+ this._disposed = true;
183
+ if (this._listeners) {
184
+ this._listeners.clear();
185
+ }
186
+ this._deliveryQueue?.clear(this);
187
+ this._options?.onDidRemoveLastListener?.();
188
+ this._leakageMon?.dispose();
189
+ }
190
+ }
191
+ get event() {
192
+ if (!this._event) {
193
+ this._event = (callback, thisArgs, disposables) => {
194
+ if (!this._listeners) {
195
+ this._listeners = ( (new LinkedList()));
196
+ }
197
+ if (this._leakageMon && this._listeners.size > this._leakageMon.threshold * 3) {
198
+ console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`);
199
+ return Disposable$1.None;
200
+ }
201
+ const firstListener = this._listeners.isEmpty();
202
+ if (firstListener && this._options?.onWillAddFirstListener) {
203
+ this._options.onWillAddFirstListener(this);
204
+ }
205
+ let removeMonitor;
206
+ let stack;
207
+ if (this._leakageMon && this._listeners.size >= Math.ceil(this._leakageMon.threshold * 0.2)) {
208
+ stack = Stacktrace.create();
209
+ removeMonitor = this._leakageMon.check(stack, this._listeners.size + 1);
210
+ }
211
+ const listener = ( (new Listener(callback, thisArgs, stack)));
212
+ const removeListener = this._listeners.push(listener);
213
+ if (firstListener && this._options?.onDidAddFirstListener) {
214
+ this._options.onDidAddFirstListener(this);
215
+ }
216
+ if (this._options?.onDidAddListener) {
217
+ this._options.onDidAddListener(this, callback, thisArgs);
218
+ }
219
+ const result = listener.subscription.set(() => {
220
+ removeMonitor?.();
221
+ if (!this._disposed) {
222
+ this._options?.onWillRemoveListener?.(this);
223
+ removeListener();
224
+ if (this._options && this._options.onDidRemoveLastListener) {
225
+ const hasListeners = (this._listeners && !this._listeners.isEmpty());
226
+ if (!hasListeners) {
227
+ this._options.onDidRemoveLastListener(this);
228
+ }
229
+ }
230
+ }
231
+ });
232
+ if (disposables instanceof DisposableStore) {
233
+ disposables.add(result);
234
+ }
235
+ else if (Array.isArray(disposables)) {
236
+ disposables.push(result);
237
+ }
238
+ return result;
239
+ };
240
+ }
241
+ return this._event;
242
+ }
243
+ fire(event) {
244
+ if (this._listeners) {
245
+ if (!this._deliveryQueue) {
246
+ this._deliveryQueue = ( (new PrivateEventDeliveryQueue()));
247
+ }
248
+ for (const listener of this._listeners) {
249
+ this._deliveryQueue.push(this, listener, event);
250
+ }
251
+ this._perfMon?.start(this._deliveryQueue.size);
252
+ this._deliveryQueue.deliver();
253
+ this._perfMon?.stop();
254
+ }
255
+ }
256
+ hasListeners() {
257
+ if (!this._listeners) {
258
+ return false;
259
+ }
260
+ return !this._listeners.isEmpty();
261
+ }
262
+ }
263
+ class EventDeliveryQueue {
264
+ constructor() {
265
+ this._queue = ( (new LinkedList()));
266
+ }
267
+ get size() {
268
+ return this._queue.size;
269
+ }
270
+ push(emitter, listener, event) {
271
+ this._queue.push(( (new EventDeliveryQueueElement(emitter, listener, event))));
272
+ }
273
+ clear(emitter) {
274
+ const newQueue = ( (new LinkedList()));
275
+ for (const element of this._queue) {
276
+ if (element.emitter !== emitter) {
277
+ newQueue.push(element);
278
+ }
279
+ }
280
+ this._queue = newQueue;
281
+ }
282
+ deliver() {
283
+ while (this._queue.size > 0) {
284
+ const element = this._queue.shift();
285
+ try {
286
+ element.listener.invoke(element.event);
287
+ }
288
+ catch (e) {
289
+ onUnexpectedError(e);
290
+ }
291
+ }
292
+ }
293
+ }
294
+ class PrivateEventDeliveryQueue extends EventDeliveryQueue {
295
+ clear(emitter) {
296
+ this._queue.clear();
297
+ }
298
+ }
299
+ class EventDeliveryQueueElement {
300
+ constructor(emitter, listener, event) {
301
+ this.emitter = emitter;
302
+ this.listener = listener;
303
+ this.event = event;
304
+ }
305
+ }
306
+ class AsyncEmitter extends Emitter {
307
+ async fireAsync(data, token, promiseJoin) {
308
+ if (!this._listeners) {
309
+ return;
310
+ }
311
+ if (!this._asyncDeliveryQueue) {
312
+ this._asyncDeliveryQueue = ( (new LinkedList()));
313
+ }
314
+ for (const listener of this._listeners) {
315
+ this._asyncDeliveryQueue.push([listener, data]);
316
+ }
317
+ while (this._asyncDeliveryQueue.size > 0 && !token.isCancellationRequested) {
318
+ const [listener, data] = this._asyncDeliveryQueue.shift();
319
+ const thenables = [];
320
+ const event = {
321
+ ...data,
322
+ token,
323
+ waitUntil: (p) => {
324
+ if (Object.isFrozen(thenables)) {
325
+ throw new Error('waitUntil can NOT be called asynchronous');
326
+ }
327
+ if (promiseJoin) {
328
+ p = promiseJoin(p, listener.callback);
329
+ }
330
+ thenables.push(p);
331
+ }
332
+ };
333
+ try {
334
+ listener.invoke(event);
335
+ }
336
+ catch (e) {
337
+ onUnexpectedError(e);
338
+ continue;
339
+ }
340
+ await Promise.allSettled(thenables).then(values => {
341
+ for (const value of values) {
342
+ if (value.status === 'rejected') {
343
+ onUnexpectedError(value.reason);
344
+ }
345
+ }
346
+ });
347
+ }
348
+ }
349
+ }
82
350
  const CancellationTokenSource = monaco.CancellationTokenSource;
83
351
  function originalFSPath(uri) {
84
352
  return uriToFsPath(uri, true);
@@ -289,9 +557,9 @@ const contributionRegistry = ( (Registry.as(Extensions$1.JSONContribution)));
289
557
  class ConfigurationRegistry {
290
558
  constructor() {
291
559
  this.overrideIdentifiers = ( (new Set()));
292
- this._onDidSchemaChange = ( (new Emitter()));
560
+ this._onDidSchemaChange = ( (new Emitter$1()));
293
561
  this.onDidSchemaChange = this._onDidSchemaChange.event;
294
- this._onDidUpdateConfiguration = ( (new Emitter()));
562
+ this._onDidUpdateConfiguration = ( (new Emitter$1()));
295
563
  this.onDidUpdateConfiguration = this._onDidUpdateConfiguration.event;
296
564
  this.configurationDefaultsOverrides = ( (new Map()));
297
565
  this.defaultLanguageConfigurationOverridesNode = {
@@ -303,7 +571,13 @@ class ConfigurationRegistry {
303
571
  properties: {}
304
572
  };
305
573
  this.configurationContributors = [this.defaultLanguageConfigurationOverridesNode];
306
- this.resourceLanguageSettingsSchema = { properties: {}, patternProperties: {}, additionalProperties: false, errorMessage: 'Unknown editor configuration setting', allowTrailingCommas: true, allowComments: true };
574
+ this.resourceLanguageSettingsSchema = {
575
+ properties: {},
576
+ patternProperties: {},
577
+ additionalProperties: true,
578
+ allowTrailingCommas: true,
579
+ allowComments: true
580
+ };
307
581
  this.configurationProperties = {};
308
582
  this.policyConfigurations = ( (new Map()));
309
583
  this.excludedConfigurationProperties = {};
@@ -314,31 +588,38 @@ class ConfigurationRegistry {
314
588
  this.registerConfigurations([configuration], validate);
315
589
  }
316
590
  registerConfigurations(configurations, validate = true) {
317
- const properties = this.doRegisterConfigurations(configurations, validate);
591
+ const properties = ( (new Set()));
592
+ this.doRegisterConfigurations(configurations, validate, properties);
318
593
  contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);
319
594
  this._onDidSchemaChange.fire();
320
595
  this._onDidUpdateConfiguration.fire({ properties });
321
596
  }
322
597
  deregisterConfigurations(configurations) {
323
- const properties = this.doDeregisterConfigurations(configurations);
598
+ const properties = ( (new Set()));
599
+ this.doDeregisterConfigurations(configurations, properties);
324
600
  contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);
325
601
  this._onDidSchemaChange.fire();
326
602
  this._onDidUpdateConfiguration.fire({ properties });
327
603
  }
328
604
  updateConfigurations({ add, remove }) {
329
- const properties = [];
330
- properties.push(...this.doDeregisterConfigurations(remove));
331
- properties.push(...this.doRegisterConfigurations(add, false));
605
+ const properties = ( (new Set()));
606
+ this.doDeregisterConfigurations(remove, properties);
607
+ this.doRegisterConfigurations(add, false, properties);
332
608
  contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);
333
609
  this._onDidSchemaChange.fire();
334
- this._onDidUpdateConfiguration.fire({ properties: distinct(properties) });
610
+ this._onDidUpdateConfiguration.fire({ properties });
335
611
  }
336
612
  registerDefaultConfigurations(configurationDefaults) {
337
- const properties = [];
613
+ const properties = ( (new Set()));
614
+ this.doRegisterDefaultConfigurations(configurationDefaults, properties);
615
+ this._onDidSchemaChange.fire();
616
+ this._onDidUpdateConfiguration.fire({ properties, defaultsOverrides: true });
617
+ }
618
+ doRegisterDefaultConfigurations(configurationDefaults, bucket) {
338
619
  const overrideIdentifiers = [];
339
620
  for (const { overrides, source } of configurationDefaults) {
340
621
  for (const key in overrides) {
341
- properties.push(key);
622
+ bucket.add(key);
342
623
  if (OVERRIDE_PROPERTY_REGEX.test(key)) {
343
624
  const configurationDefaultOverride = this.configurationDefaultsOverrides.get(key);
344
625
  const valuesSources = configurationDefaultOverride?.valuesSources ?? ( (new Map()));
@@ -377,12 +658,15 @@ class ConfigurationRegistry {
377
658
  }
378
659
  }
379
660
  }
380
- this.registerOverrideIdentifiers(overrideIdentifiers);
661
+ this.doRegisterOverrideIdentifiers(overrideIdentifiers);
662
+ }
663
+ deregisterDefaultConfigurations(defaultConfigurations) {
664
+ const properties = ( (new Set()));
665
+ this.doDeregisterDefaultConfigurations(defaultConfigurations, properties);
381
666
  this._onDidSchemaChange.fire();
382
667
  this._onDidUpdateConfiguration.fire({ properties, defaultsOverrides: true });
383
668
  }
384
- deregisterDefaultConfigurations(defaultConfigurations) {
385
- const properties = [];
669
+ doDeregisterDefaultConfigurations(defaultConfigurations, bucket) {
386
670
  for (const { overrides, source } of defaultConfigurations) {
387
671
  for (const key in overrides) {
388
672
  const configurationDefaultsOverride = this.configurationDefaultsOverrides.get(key);
@@ -391,7 +675,7 @@ class ConfigurationRegistry {
391
675
  if (id !== configurationDefaultsOverrideSourceId) {
392
676
  continue;
393
677
  }
394
- properties.push(key);
678
+ bucket.add(key);
395
679
  this.configurationDefaultsOverrides.delete(key);
396
680
  if (OVERRIDE_PROPERTY_REGEX.test(key)) {
397
681
  delete this.configurationProperties[key];
@@ -407,33 +691,52 @@ class ConfigurationRegistry {
407
691
  }
408
692
  }
409
693
  this.updateOverridePropertyPatternKey();
694
+ }
695
+ deltaConfiguration(delta) {
696
+ let defaultsOverrides = false;
697
+ const properties = ( (new Set()));
698
+ if (delta.removedDefaults) {
699
+ this.doDeregisterDefaultConfigurations(delta.removedDefaults, properties);
700
+ defaultsOverrides = true;
701
+ }
702
+ if (delta.addedDefaults) {
703
+ this.doRegisterDefaultConfigurations(delta.addedDefaults, properties);
704
+ defaultsOverrides = true;
705
+ }
706
+ if (delta.removedConfigurations) {
707
+ this.doDeregisterConfigurations(delta.removedConfigurations, properties);
708
+ }
709
+ if (delta.addedConfigurations) {
710
+ this.doRegisterConfigurations(delta.addedConfigurations, false, properties);
711
+ }
410
712
  this._onDidSchemaChange.fire();
411
- this._onDidUpdateConfiguration.fire({ properties, defaultsOverrides: true });
713
+ this._onDidUpdateConfiguration.fire({ properties, defaultsOverrides });
412
714
  }
413
715
  notifyConfigurationSchemaUpdated(...configurations) {
414
716
  this._onDidSchemaChange.fire();
415
717
  }
416
718
  registerOverrideIdentifiers(overrideIdentifiers) {
719
+ this.doRegisterOverrideIdentifiers(overrideIdentifiers);
720
+ this._onDidSchemaChange.fire();
721
+ }
722
+ doRegisterOverrideIdentifiers(overrideIdentifiers) {
417
723
  for (const overrideIdentifier of overrideIdentifiers) {
418
724
  this.overrideIdentifiers.add(overrideIdentifier);
419
725
  }
420
726
  this.updateOverridePropertyPatternKey();
421
727
  }
422
- doRegisterConfigurations(configurations, validate) {
423
- const properties = [];
728
+ doRegisterConfigurations(configurations, validate, bucket) {
424
729
  configurations.forEach(configuration => {
425
- properties.push(...this.validateAndRegisterProperties(configuration, validate, configuration.extensionInfo, configuration.restrictedProperties));
730
+ this.validateAndRegisterProperties(configuration, validate, configuration.extensionInfo, configuration.restrictedProperties, undefined, bucket);
426
731
  this.configurationContributors.push(configuration);
427
732
  this.registerJSONConfiguration(configuration);
428
733
  });
429
- return properties;
430
734
  }
431
- doDeregisterConfigurations(configurations) {
432
- const properties = [];
735
+ doDeregisterConfigurations(configurations, bucket) {
433
736
  const deregisterConfiguration = (configuration) => {
434
737
  if (configuration.properties) {
435
738
  for (const key in configuration.properties) {
436
- properties.push(key);
739
+ bucket.add(key);
437
740
  const property = this.configurationProperties[key];
438
741
  if (property?.policy?.name) {
439
742
  this.policyConfigurations.delete(property.policy.name);
@@ -451,11 +754,9 @@ class ConfigurationRegistry {
451
754
  this.configurationContributors.splice(index, 1);
452
755
  }
453
756
  }
454
- return properties;
455
757
  }
456
- validateAndRegisterProperties(configuration, validate = true, extensionInfo, restrictedProperties, scope = 3 ) {
758
+ validateAndRegisterProperties(configuration, validate = true, extensionInfo, restrictedProperties, scope = 3 , bucket) {
457
759
  scope = isUndefinedOrNull(configuration.scope) ? scope : configuration.scope;
458
- const propertyKeys = [];
459
760
  const properties = configuration.properties;
460
761
  if (properties) {
461
762
  for (const key in properties) {
@@ -488,16 +789,15 @@ class ConfigurationRegistry {
488
789
  if (!properties[key].deprecationMessage && properties[key].markdownDeprecationMessage) {
489
790
  properties[key].deprecationMessage = properties[key].markdownDeprecationMessage;
490
791
  }
491
- propertyKeys.push(key);
792
+ bucket.add(key);
492
793
  }
493
794
  }
494
795
  const subNodes = configuration.allOf;
495
796
  if (subNodes) {
496
797
  for (const node of subNodes) {
497
- propertyKeys.push(...this.validateAndRegisterProperties(node, validate, extensionInfo, restrictedProperties, scope));
798
+ this.validateAndRegisterProperties(node, validate, extensionInfo, restrictedProperties, scope, bucket);
498
799
  }
499
800
  }
500
- return propertyKeys;
501
801
  }
502
802
  getConfigurations() {
503
803
  return this.configurationContributors;
@@ -577,7 +877,6 @@ class ConfigurationRegistry {
577
877
  };
578
878
  this.updatePropertyDefaultValue(overrideIdentifierProperty, resourceLanguagePropertiesSchema);
579
879
  }
580
- this._onDidSchemaChange.fire();
581
880
  }
582
881
  registerOverridePropertyPatternKey() {
583
882
  this._onDidSchemaChange.fire();
@@ -685,19 +984,126 @@ function getScopes() {
685
984
  return scopes;
686
985
  }
687
986
  const Position$2 = monaco.Position;
688
- const TELEMETRY_SETTING_ID = 'telemetry.telemetryLevel';
689
- const TELEMETRY_OLD_SETTING_ID = 'telemetry.enableTelemetry';
690
- const _simplePattern = /^(.+)\/(.+?)(;.+)?$/;
691
- function normalizeMimeType(mimeType, strict) {
692
- const match = _simplePattern.exec(mimeType);
693
- if (!match) {
694
- return strict
695
- ? undefined
696
- : mimeType;
987
+ var _a$2, _b;
988
+ class ResourceMapEntry {
989
+ constructor(uri, value) {
990
+ this.uri = uri;
991
+ this.value = value;
697
992
  }
698
- return `${match[1].toLowerCase()}/${match[2].toLowerCase()}${match[3] ?? ''}`;
699
993
  }
700
- const marked = marked$1.marked;
994
+ class ResourceMap {
995
+ constructor(mapOrKeyFn, toKey) {
996
+ this[_a$2] = 'ResourceMap';
997
+ if (mapOrKeyFn instanceof ResourceMap) {
998
+ this.map = ( (new Map(mapOrKeyFn.map)));
999
+ this.toKey = toKey ?? ResourceMap.defaultToKey;
1000
+ }
1001
+ else {
1002
+ this.map = ( (new Map()));
1003
+ this.toKey = mapOrKeyFn ?? ResourceMap.defaultToKey;
1004
+ }
1005
+ }
1006
+ set(resource, value) {
1007
+ this.map.set(this.toKey(resource), ( (new ResourceMapEntry(resource, value))));
1008
+ return this;
1009
+ }
1010
+ get(resource) {
1011
+ return this.map.get(this.toKey(resource))?.value;
1012
+ }
1013
+ has(resource) {
1014
+ return this.map.has(this.toKey(resource));
1015
+ }
1016
+ get size() {
1017
+ return this.map.size;
1018
+ }
1019
+ clear() {
1020
+ this.map.clear();
1021
+ }
1022
+ delete(resource) {
1023
+ return this.map.delete(this.toKey(resource));
1024
+ }
1025
+ forEach(clb, thisArg) {
1026
+ if (typeof thisArg !== 'undefined') {
1027
+ clb = clb.bind(thisArg);
1028
+ }
1029
+ for (const [_, entry] of this.map) {
1030
+ clb(entry.value, entry.uri, this);
1031
+ }
1032
+ }
1033
+ *values() {
1034
+ for (const entry of ( (this.map.values()))) {
1035
+ yield entry.value;
1036
+ }
1037
+ }
1038
+ *keys() {
1039
+ for (const entry of ( (this.map.values()))) {
1040
+ yield entry.uri;
1041
+ }
1042
+ }
1043
+ *entries() {
1044
+ for (const entry of ( (this.map.values()))) {
1045
+ yield [entry.uri, entry.value];
1046
+ }
1047
+ }
1048
+ *[(_a$2 = Symbol.toStringTag, Symbol.iterator)]() {
1049
+ for (const [, entry] of this.map) {
1050
+ yield [entry.uri, entry.value];
1051
+ }
1052
+ }
1053
+ }
1054
+ ResourceMap.defaultToKey = (resource) => ( (resource.toString()));
1055
+ class ResourceSet {
1056
+ constructor(entriesOrKey, toKey) {
1057
+ this[_b] = 'ResourceSet';
1058
+ if (!entriesOrKey || typeof entriesOrKey === 'function') {
1059
+ this._map = ( (new ResourceMap(entriesOrKey)));
1060
+ }
1061
+ else {
1062
+ this._map = ( (new ResourceMap(toKey)));
1063
+ entriesOrKey.forEach(this.add, this);
1064
+ }
1065
+ }
1066
+ get size() {
1067
+ return this._map.size;
1068
+ }
1069
+ add(value) {
1070
+ this._map.set(value, value);
1071
+ return this;
1072
+ }
1073
+ clear() {
1074
+ this._map.clear();
1075
+ }
1076
+ delete(value) {
1077
+ return this._map.delete(value);
1078
+ }
1079
+ forEach(callbackfn, thisArg) {
1080
+ this._map.forEach((_value, key) => callbackfn.call(thisArg, key, key, this));
1081
+ }
1082
+ has(value) {
1083
+ return this._map.has(value);
1084
+ }
1085
+ entries() {
1086
+ return this._map.entries();
1087
+ }
1088
+ keys() {
1089
+ return (
1090
+ (this._map.keys())
1091
+ );
1092
+ }
1093
+ values() {
1094
+ return (
1095
+ (this._map.keys())
1096
+ );
1097
+ }
1098
+ [(_b = Symbol.toStringTag, Symbol.iterator)]() {
1099
+ return (
1100
+ (this.keys())
1101
+ );
1102
+ }
1103
+ }
1104
+ const TELEMETRY_SETTING_ID = 'telemetry.telemetryLevel';
1105
+ const TELEMETRY_CRASH_REPORTER_SETTING_ID = 'telemetry.enableCrashReporter';
1106
+ const TELEMETRY_OLD_SETTING_ID = 'telemetry.enableTelemetry';
701
1107
  function diffSets(before, after) {
702
1108
  const removed = [];
703
1109
  const added = [];
@@ -736,20 +1142,173 @@ class Counter {
736
1142
  return this._next++;
737
1143
  }
738
1144
  }
1145
+ const _simplePattern = /^(.+)\/(.+?)(;.+)?$/;
1146
+ function normalizeMimeType(mimeType, strict) {
1147
+ const match = _simplePattern.exec(mimeType);
1148
+ if (!match) {
1149
+ return strict
1150
+ ? undefined
1151
+ : mimeType;
1152
+ }
1153
+ return `${match[1].toLowerCase()}/${match[2].toLowerCase()}${match[3] ?? ''}`;
1154
+ }
1155
+ var CellKind;
1156
+ ( ((function(CellKind) {
1157
+ CellKind[CellKind["Markup"] = 1] = "Markup";
1158
+ CellKind[CellKind["Code"] = 2] = "Code";
1159
+ })(CellKind || (CellKind = {}))));
1160
+ function isTextStreamMime(mimeType) {
1161
+ return ['application/vnd.code.notebook.stdout', 'application/vnd.code.notebook.stderr'].includes(mimeType);
1162
+ }
1163
+ const MOVE_CURSOR_1_LINE_COMMAND = `${String.fromCharCode(27)}[A`;
1164
+ MOVE_CURSOR_1_LINE_COMMAND.split('').map(c => c.charCodeAt(0));
1165
+ function getRemoteAuthority(uri) {
1166
+ return uri.scheme === Schemas.vscodeRemote ? uri.authority : undefined;
1167
+ }
1168
+ function getRemoteName(authority) {
1169
+ if (!authority) {
1170
+ return undefined;
1171
+ }
1172
+ const pos = authority.indexOf('+');
1173
+ if (pos < 0) {
1174
+ return authority;
1175
+ }
1176
+ return authority.substr(0, pos);
1177
+ }
1178
+ function getRemoteServerRootPath(product) {
1179
+ return `/${product.quality ?? 'oss'}-${product.commit ?? 'dev'}`;
1180
+ }
1181
+ class TelemetryTrustedValue {
1182
+ constructor(value) {
1183
+ this.value = value;
1184
+ }
1185
+ }
1186
+ const extensionTelemetryLogChannelId = 'extensionTelemetryLog';
1187
+ function supportsTelemetry(productService, environmentService) {
1188
+ if (!environmentService.isBuilt && !environmentService.disableTelemetry) {
1189
+ return true;
1190
+ }
1191
+ return !(environmentService.disableTelemetry || !productService.enableTelemetry || environmentService.extensionTestsLocationURI);
1192
+ }
1193
+ function getTelemetryLevel(configurationService) {
1194
+ const newConfig = configurationService.getValue(TELEMETRY_SETTING_ID);
1195
+ const crashReporterConfig = configurationService.getValue(TELEMETRY_CRASH_REPORTER_SETTING_ID);
1196
+ const oldConfig = configurationService.getValue(TELEMETRY_OLD_SETTING_ID);
1197
+ if (oldConfig === false || crashReporterConfig === false) {
1198
+ return 0 ;
1199
+ }
1200
+ switch (newConfig ?? "all" ) {
1201
+ case "all" :
1202
+ return 3 ;
1203
+ case "error" :
1204
+ return 2 ;
1205
+ case "crash" :
1206
+ return 1 ;
1207
+ case "off" :
1208
+ return 0 ;
1209
+ }
1210
+ }
1211
+ const telemetryAllowedAuthorities = ( (new Set(
1212
+ ['ssh-remote', 'dev-container', 'attached-container', 'wsl', 'tunnel', 'codespaces', 'amlext']
1213
+ )));
1214
+ function cleanRemoteAuthority(remoteAuthority) {
1215
+ if (!remoteAuthority) {
1216
+ return 'none';
1217
+ }
1218
+ const remoteName = getRemoteName(remoteAuthority);
1219
+ return telemetryAllowedAuthorities.has(remoteName) ? remoteName : 'other';
1220
+ }
1221
+ function anonymizeFilePaths(stack, cleanupPatterns) {
1222
+ if (!stack || (!stack.includes('/') && !stack.includes('\\'))) {
1223
+ return stack;
1224
+ }
1225
+ let updatedStack = stack;
1226
+ const cleanUpIndexes = [];
1227
+ for (const regexp of cleanupPatterns) {
1228
+ while (true) {
1229
+ const result = regexp.exec(stack);
1230
+ if (!result) {
1231
+ break;
1232
+ }
1233
+ cleanUpIndexes.push([result.index, regexp.lastIndex]);
1234
+ }
1235
+ }
1236
+ const nodeModulesRegex = /^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/;
1237
+ const fileRegex = /(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;
1238
+ let lastIndex = 0;
1239
+ updatedStack = '';
1240
+ while (true) {
1241
+ const result = fileRegex.exec(stack);
1242
+ if (!result) {
1243
+ break;
1244
+ }
1245
+ const overlappingRange = cleanUpIndexes.some(([start, end]) => result.index < end && start < fileRegex.lastIndex);
1246
+ if (!nodeModulesRegex.test(result[0]) && !overlappingRange) {
1247
+ updatedStack += stack.substring(lastIndex, result.index) + '<REDACTED: user-file-path>';
1248
+ lastIndex = fileRegex.lastIndex;
1249
+ }
1250
+ }
1251
+ if (lastIndex < stack.length) {
1252
+ updatedStack += stack.substr(lastIndex);
1253
+ }
1254
+ return updatedStack;
1255
+ }
1256
+ function removePropertiesWithPossibleUserInfo(property) {
1257
+ if (!property) {
1258
+ return property;
1259
+ }
1260
+ const value = property.toLowerCase();
1261
+ const userDataRegexes = [
1262
+ { label: 'Google API Key', regex: /AIza[A-Za-z0-9_\\\-]{35}/ },
1263
+ { label: 'Slack Token', regex: /xox[pbar]\-[A-Za-z0-9]/ },
1264
+ { label: 'Generic Secret', regex: /(key|token|sig|secret|signature|password|passwd|pwd|android:value)[^a-zA-Z0-9]/ },
1265
+ { label: 'Email', regex: /@[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+/ }
1266
+ ];
1267
+ for (const secretRegex of userDataRegexes) {
1268
+ if (secretRegex.regex.test(value)) {
1269
+ return `<REDACTED: ${secretRegex.label}>`;
1270
+ }
1271
+ }
1272
+ return property;
1273
+ }
1274
+ function cleanData(data, cleanUpPatterns) {
1275
+ return cloneAndChange(data, value => {
1276
+ if (value instanceof TelemetryTrustedValue) {
1277
+ return value.value;
1278
+ }
1279
+ if (typeof value === 'string') {
1280
+ let updatedProperty = value.replaceAll('%20', ' ');
1281
+ updatedProperty = anonymizeFilePaths(updatedProperty, cleanUpPatterns);
1282
+ for (const regexp of cleanUpPatterns) {
1283
+ updatedProperty = updatedProperty.replace(regexp, '');
1284
+ }
1285
+ updatedProperty = removePropertiesWithPossibleUserInfo(updatedProperty);
1286
+ return updatedProperty;
1287
+ }
1288
+ return undefined;
1289
+ });
1290
+ }
739
1291
  var _Disposable_callOnDispose, _MarkdownString_delegate, _DataTransfer_items, _a$1, _NotebookCellOutputItem_encoder;
740
1292
  var Disposable_1, Position_1, Range_1, Selection_1, TextEdit_1, NotebookEdit_1, SnippetString_1, Location_1, SymbolInformation_1, DocumentSymbol_1, CodeActionKind_1, MarkdownString_1, TaskGroup_1, Task_1, TreeItem_1, FileSystemError_1, TestMessage_1;
741
1293
  function es5ClassCompat(target) {
742
- function _() { return Reflect.construct(target, arguments, this.constructor); }
743
- Object.defineProperty(_, 'name', Object.getOwnPropertyDescriptor(target, 'name'));
744
- Object.setPrototypeOf(_, target);
745
- Object.setPrototypeOf(_.prototype, target.prototype);
746
- return _;
1294
+ const interceptFunctions = {
1295
+ apply: function () {
1296
+ const args = arguments.length === 1 ? [] : arguments[1];
1297
+ return Reflect.construct(target, args, arguments[0].constructor);
1298
+ },
1299
+ call: function () {
1300
+ if (arguments.length === 0) {
1301
+ return Reflect.construct(target, []);
1302
+ }
1303
+ else {
1304
+ const [thisArg, ...restArgs] = arguments;
1305
+ return Reflect.construct(target, restArgs, thisArg.constructor);
1306
+ }
1307
+ }
1308
+ };
1309
+ return Object.assign(target, interceptFunctions);
747
1310
  }
748
1311
  let Disposable = Disposable_1 = class Disposable {
749
- constructor(callOnDispose) {
750
- _Disposable_callOnDispose.set(this, void 0);
751
- __classPrivateFieldSet(this, _Disposable_callOnDispose, callOnDispose, "f");
752
- }
753
1312
  static from(...inDisposables) {
754
1313
  let disposables = inDisposables;
755
1314
  return (
@@ -765,6 +1324,10 @@ let Disposable = Disposable_1 = class Disposable {
765
1324
  }))
766
1325
  );
767
1326
  }
1327
+ constructor(callOnDispose) {
1328
+ _Disposable_callOnDispose.set(this, void 0);
1329
+ __classPrivateFieldSet(this, _Disposable_callOnDispose, callOnDispose, "f");
1330
+ }
768
1331
  dispose() {
769
1332
  if (typeof __classPrivateFieldGet(this, _Disposable_callOnDispose, "f") === 'function') {
770
1333
  __classPrivateFieldGet(this, _Disposable_callOnDispose, "f").call(this);
@@ -777,16 +1340,6 @@ Disposable = Disposable_1 = ( (__decorate([
777
1340
  es5ClassCompat
778
1341
  ], Disposable)));
779
1342
  let Position$1 = Position_1 = class Position {
780
- constructor(line, character) {
781
- if (line < 0) {
782
- throw illegalArgument('line must be non-negative');
783
- }
784
- if (character < 0) {
785
- throw illegalArgument('character must be non-negative');
786
- }
787
- this._line = line;
788
- this._character = character;
789
- }
790
1343
  static Min(...positions) {
791
1344
  if (positions.length === 0) {
792
1345
  throw new TypeError();
@@ -843,6 +1396,16 @@ let Position$1 = Position_1 = class Position {
843
1396
  get character() {
844
1397
  return this._character;
845
1398
  }
1399
+ constructor(line, character) {
1400
+ if (line < 0) {
1401
+ throw illegalArgument('line must be non-negative');
1402
+ }
1403
+ if (character < 0) {
1404
+ throw illegalArgument('character must be non-negative');
1405
+ }
1406
+ this._line = line;
1407
+ this._character = character;
1408
+ }
846
1409
  isBefore(other) {
847
1410
  if (this._line < other._line) {
848
1411
  return true;
@@ -941,29 +1504,6 @@ Position$1 = Position_1 = ( (__decorate([
941
1504
  es5ClassCompat
942
1505
  ], Position$1)));
943
1506
  let Range$1 = Range_1 = class Range {
944
- constructor(startLineOrStart, startColumnOrEnd, endLine, endColumn) {
945
- let start;
946
- let end;
947
- if (typeof startLineOrStart === 'number' && typeof startColumnOrEnd === 'number' && typeof endLine === 'number' && typeof endColumn === 'number') {
948
- start = ( (new Position$1(startLineOrStart, startColumnOrEnd)));
949
- end = ( (new Position$1(endLine, endColumn)));
950
- }
951
- else if (Position$1.isPosition(startLineOrStart) && Position$1.isPosition(startColumnOrEnd)) {
952
- start = Position$1.of(startLineOrStart);
953
- end = Position$1.of(startColumnOrEnd);
954
- }
955
- if (!start || !end) {
956
- throw new Error('Invalid arguments');
957
- }
958
- if (start.isBefore(end)) {
959
- this._start = start;
960
- this._end = end;
961
- }
962
- else {
963
- this._start = end;
964
- this._end = start;
965
- }
966
- }
967
1507
  static isRange(thing) {
968
1508
  if (thing instanceof Range_1) {
969
1509
  return true;
@@ -991,6 +1531,29 @@ let Range$1 = Range_1 = class Range {
991
1531
  get end() {
992
1532
  return this._end;
993
1533
  }
1534
+ constructor(startLineOrStart, startColumnOrEnd, endLine, endColumn) {
1535
+ let start;
1536
+ let end;
1537
+ if (typeof startLineOrStart === 'number' && typeof startColumnOrEnd === 'number' && typeof endLine === 'number' && typeof endColumn === 'number') {
1538
+ start = ( (new Position$1(startLineOrStart, startColumnOrEnd)));
1539
+ end = ( (new Position$1(endLine, endColumn)));
1540
+ }
1541
+ else if (Position$1.isPosition(startLineOrStart) && Position$1.isPosition(startColumnOrEnd)) {
1542
+ start = Position$1.of(startLineOrStart);
1543
+ end = Position$1.of(startColumnOrEnd);
1544
+ }
1545
+ if (!start || !end) {
1546
+ throw new Error('Invalid arguments');
1547
+ }
1548
+ if (start.isBefore(end)) {
1549
+ this._start = start;
1550
+ this._end = end;
1551
+ }
1552
+ else {
1553
+ this._start = end;
1554
+ this._end = start;
1555
+ }
1556
+ }
994
1557
  contains(positionOrRange) {
995
1558
  if (Range_1.isRange(positionOrRange)) {
996
1559
  return this.contains(positionOrRange.start)
@@ -1069,24 +1632,6 @@ Range$1 = Range_1 = ( (__decorate([
1069
1632
  es5ClassCompat
1070
1633
  ], Range$1)));
1071
1634
  let Selection$2 = Selection_1 = class Selection extends Range$1 {
1072
- constructor(anchorLineOrAnchor, anchorColumnOrActive, activeLine, activeColumn) {
1073
- let anchor;
1074
- let active;
1075
- if (typeof anchorLineOrAnchor === 'number' && typeof anchorColumnOrActive === 'number' && typeof activeLine === 'number' && typeof activeColumn === 'number') {
1076
- anchor = ( (new Position$1(anchorLineOrAnchor, anchorColumnOrActive)));
1077
- active = ( (new Position$1(activeLine, activeColumn)));
1078
- }
1079
- else if (Position$1.isPosition(anchorLineOrAnchor) && Position$1.isPosition(anchorColumnOrActive)) {
1080
- anchor = Position$1.of(anchorLineOrAnchor);
1081
- active = Position$1.of(anchorColumnOrActive);
1082
- }
1083
- if (!anchor || !active) {
1084
- throw new Error('Invalid arguments');
1085
- }
1086
- super(anchor, active);
1087
- this._anchor = anchor;
1088
- this._active = active;
1089
- }
1090
1635
  static isSelection(thing) {
1091
1636
  if (thing instanceof Selection_1) {
1092
1637
  return true;
@@ -1105,6 +1650,24 @@ let Selection$2 = Selection_1 = class Selection extends Range$1 {
1105
1650
  get active() {
1106
1651
  return this._active;
1107
1652
  }
1653
+ constructor(anchorLineOrAnchor, anchorColumnOrActive, activeLine, activeColumn) {
1654
+ let anchor;
1655
+ let active;
1656
+ if (typeof anchorLineOrAnchor === 'number' && typeof anchorColumnOrActive === 'number' && typeof activeLine === 'number' && typeof activeColumn === 'number') {
1657
+ anchor = ( (new Position$1(anchorLineOrAnchor, anchorColumnOrActive)));
1658
+ active = ( (new Position$1(activeLine, activeColumn)));
1659
+ }
1660
+ else if (Position$1.isPosition(anchorLineOrAnchor) && Position$1.isPosition(anchorColumnOrActive)) {
1661
+ anchor = Position$1.of(anchorLineOrAnchor);
1662
+ active = Position$1.of(anchorColumnOrActive);
1663
+ }
1664
+ if (!anchor || !active) {
1665
+ throw new Error('Invalid arguments');
1666
+ }
1667
+ super(anchor, active);
1668
+ this._anchor = anchor;
1669
+ this._active = active;
1670
+ }
1108
1671
  get isReversed() {
1109
1672
  return this._anchor === this._end;
1110
1673
  }
@@ -1132,10 +1695,6 @@ var EnvironmentVariableMutatorType;
1132
1695
  EnvironmentVariableMutatorType[EnvironmentVariableMutatorType["Prepend"] = 3] = "Prepend";
1133
1696
  })(EnvironmentVariableMutatorType || (EnvironmentVariableMutatorType = {}))));
1134
1697
  let TextEdit$1 = TextEdit_1 = class TextEdit {
1135
- constructor(range, newText) {
1136
- this._range = range;
1137
- this._newText = newText;
1138
- }
1139
1698
  static isTextEdit(thing) {
1140
1699
  if (thing instanceof TextEdit_1) {
1141
1700
  return true;
@@ -1192,6 +1751,10 @@ let TextEdit$1 = TextEdit_1 = class TextEdit {
1192
1751
  }
1193
1752
  this._newEol = value;
1194
1753
  }
1754
+ constructor(range, newText) {
1755
+ this._range = range;
1756
+ this._newText = newText;
1757
+ }
1195
1758
  toJSON() {
1196
1759
  return {
1197
1760
  range: this.range,
@@ -1204,10 +1767,6 @@ TextEdit$1 = TextEdit_1 = ( (__decorate([
1204
1767
  es5ClassCompat
1205
1768
  ], TextEdit$1)));
1206
1769
  let NotebookEdit = NotebookEdit_1 = class NotebookEdit {
1207
- constructor(range, newCells) {
1208
- this.range = range;
1209
- this.newCells = newCells;
1210
- }
1211
1770
  static isNotebookCellEdit(thing) {
1212
1771
  if (thing instanceof NotebookEdit_1) {
1213
1772
  return true;
@@ -1243,10 +1802,38 @@ let NotebookEdit = NotebookEdit_1 = class NotebookEdit {
1243
1802
  edit.newNotebookMetadata = newMetadata;
1244
1803
  return edit;
1245
1804
  }
1805
+ constructor(range, newCells) {
1806
+ this.range = range;
1807
+ this.newCells = newCells;
1808
+ }
1246
1809
  };
1247
1810
  NotebookEdit = NotebookEdit_1 = ( (__decorate([
1248
1811
  es5ClassCompat
1249
1812
  ], NotebookEdit)));
1813
+ class SnippetTextEdit {
1814
+ static isSnippetTextEdit(thing) {
1815
+ if (thing instanceof SnippetTextEdit) {
1816
+ return true;
1817
+ }
1818
+ if (!thing) {
1819
+ return false;
1820
+ }
1821
+ return Range$1.isRange(thing.range)
1822
+ && SnippetString.isSnippetString(thing.snippet);
1823
+ }
1824
+ static replace(range, snippet) {
1825
+ return (
1826
+ (new SnippetTextEdit(range, snippet))
1827
+ );
1828
+ }
1829
+ static insert(position, snippet) {
1830
+ return SnippetTextEdit.replace(( (new Range$1(position, position))), snippet);
1831
+ }
1832
+ constructor(range, snippet) {
1833
+ this.range = range;
1834
+ this.snippet = snippet;
1835
+ }
1836
+ }
1250
1837
  let WorkspaceEdit$1 = class WorkspaceEdit {
1251
1838
  constructor() {
1252
1839
  this._edits = [];
@@ -1266,40 +1853,18 @@ let WorkspaceEdit$1 = class WorkspaceEdit {
1266
1853
  replaceNotebookMetadata(uri, value, metadata) {
1267
1854
  this._edits.push({ _type: 3 , metadata, uri, edit: { editType: 5 , metadata: value }, notebookMetadata: value });
1268
1855
  }
1269
- replaceNotebookCells(uri, startOrRange, endOrCells, cellsOrMetadata, metadata) {
1270
- let start;
1271
- let end;
1272
- let cellData = [];
1273
- let workspaceEditMetadata;
1274
- if (NotebookRange$1.isNotebookRange(startOrRange) && NotebookCellData$1.isNotebookCellDataArray(endOrCells) && !NotebookCellData$1.isNotebookCellDataArray(cellsOrMetadata)) {
1275
- start = startOrRange.start;
1276
- end = startOrRange.end;
1277
- cellData = endOrCells;
1278
- workspaceEditMetadata = cellsOrMetadata;
1279
- }
1280
- else if (typeof startOrRange === 'number' && typeof endOrCells === 'number' && NotebookCellData$1.isNotebookCellDataArray(cellsOrMetadata)) {
1281
- start = startOrRange;
1282
- end = endOrCells;
1283
- cellData = cellsOrMetadata;
1284
- workspaceEditMetadata = metadata;
1285
- }
1286
- if (start === undefined || end === undefined) {
1287
- throw new Error('Invalid arguments');
1288
- }
1856
+ replaceNotebookCells(uri, startOrRange, cellData, metadata) {
1857
+ const start = startOrRange.start;
1858
+ const end = startOrRange.end;
1289
1859
  if (start !== end || cellData.length > 0) {
1290
- this._edits.push({ _type: 5 , uri, index: start, count: end - start, cells: cellData, metadata: workspaceEditMetadata });
1860
+ this._edits.push({ _type: 5 , uri, index: start, count: end - start, cells: cellData, metadata });
1291
1861
  }
1292
1862
  }
1293
1863
  replaceNotebookCellMetadata(uri, index, cellMetadata, metadata) {
1294
1864
  this._edits.push({ _type: 3 , metadata, uri, edit: { editType: 8 , index, metadata: cellMetadata } });
1295
1865
  }
1296
1866
  replace(uri, range, newText, metadata) {
1297
- if (typeof newText === 'string') {
1298
- this._edits.push({ _type: 2 , uri, edit: ( (new TextEdit$1(range, newText))), metadata });
1299
- }
1300
- else {
1301
- this._edits.push({ _type: 6 , uri, range, edit: newText, metadata });
1302
- }
1867
+ this._edits.push({ _type: 2 , uri, edit: ( (new TextEdit$1(range, newText))), metadata });
1303
1868
  }
1304
1869
  insert(resource, position, newText, metadata) {
1305
1870
  this.replace(resource, ( (new Range$1(position, position))), newText, metadata);
@@ -1314,30 +1879,50 @@ let WorkspaceEdit$1 = class WorkspaceEdit {
1314
1879
  if (!edits) {
1315
1880
  for (let i = 0; i < this._edits.length; i++) {
1316
1881
  const element = this._edits[i];
1317
- if (element._type === 2 && ( (element.uri.toString())) === ( (uri.toString()))) {
1318
- this._edits[i] = undefined;
1882
+ switch (element._type) {
1883
+ case 2 :
1884
+ case 6 :
1885
+ case 3 :
1886
+ case 5 :
1887
+ if (( (element.uri.toString())) === ( (uri.toString()))) {
1888
+ this._edits[i] = undefined;
1889
+ }
1890
+ break;
1319
1891
  }
1320
1892
  }
1321
1893
  coalesceInPlace(this._edits);
1322
1894
  }
1323
1895
  else {
1324
- for (const edit of edits) {
1325
- if (edit) {
1326
- if (NotebookEdit.isNotebookCellEdit(edit)) {
1327
- if (edit.newCellMetadata) {
1328
- this.replaceNotebookCellMetadata(uri, edit.range.start, edit.newCellMetadata);
1329
- }
1330
- else if (edit.newNotebookMetadata) {
1331
- this.replaceNotebookMetadata(uri, edit.newNotebookMetadata);
1332
- }
1333
- else {
1334
- this.replaceNotebookCells(uri, edit.range, edit.newCells);
1335
- }
1896
+ for (const editOrTuple of edits) {
1897
+ if (!editOrTuple) {
1898
+ continue;
1899
+ }
1900
+ let edit;
1901
+ let metadata;
1902
+ if (Array.isArray(editOrTuple)) {
1903
+ edit = editOrTuple[0];
1904
+ metadata = editOrTuple[1];
1905
+ }
1906
+ else {
1907
+ edit = editOrTuple;
1908
+ }
1909
+ if (NotebookEdit.isNotebookCellEdit(edit)) {
1910
+ if (edit.newCellMetadata) {
1911
+ this.replaceNotebookCellMetadata(uri, edit.range.start, edit.newCellMetadata, metadata);
1912
+ }
1913
+ else if (edit.newNotebookMetadata) {
1914
+ this.replaceNotebookMetadata(uri, edit.newNotebookMetadata, metadata);
1336
1915
  }
1337
1916
  else {
1338
- this._edits.push({ _type: 2 , uri, edit });
1917
+ this.replaceNotebookCells(uri, edit.range, edit.newCells, metadata);
1339
1918
  }
1340
1919
  }
1920
+ else if (SnippetTextEdit.isSnippetTextEdit(edit)) {
1921
+ this._edits.push({ _type: 6 , uri, range: edit.range, edit: edit.snippet, metadata });
1922
+ }
1923
+ else {
1924
+ this._edits.push({ _type: 2 , uri, edit, metadata });
1925
+ }
1341
1926
  }
1342
1927
  }
1343
1928
  }
@@ -1351,7 +1936,7 @@ let WorkspaceEdit$1 = class WorkspaceEdit {
1351
1936
  return res;
1352
1937
  }
1353
1938
  entries() {
1354
- const textEdits = ( (new ResourceMap()));
1939
+ const textEdits = ( (new ResourceMap$1()));
1355
1940
  for (const candidate of this._edits) {
1356
1941
  if (candidate._type === 2 ) {
1357
1942
  let textEdit = textEdits.get(candidate.uri);
@@ -1375,10 +1960,6 @@ WorkspaceEdit$1 = ( (__decorate([
1375
1960
  es5ClassCompat
1376
1961
  ], WorkspaceEdit$1)));
1377
1962
  let SnippetString = SnippetString_1 = class SnippetString {
1378
- constructor(value) {
1379
- this._tabstop = 1;
1380
- this.value = value || '';
1381
- }
1382
1963
  static isSnippetString(thing) {
1383
1964
  if (thing instanceof SnippetString_1) {
1384
1965
  return true;
@@ -1391,6 +1972,10 @@ let SnippetString = SnippetString_1 = class SnippetString {
1391
1972
  static _escape(value) {
1392
1973
  return value.replace(/\$|}|\\/g, '\\$&');
1393
1974
  }
1975
+ constructor(value) {
1976
+ this._tabstop = 1;
1977
+ this.value = value || '';
1978
+ }
1394
1979
  appendText(string) {
1395
1980
  this.value += SnippetString_1._escape(string);
1396
1981
  return this;
@@ -1464,6 +2049,16 @@ var DiagnosticSeverity$1;
1464
2049
  DiagnosticSeverity[DiagnosticSeverity["Error"] = 0] = "Error";
1465
2050
  })(DiagnosticSeverity$1 || (DiagnosticSeverity$1 = {}))));
1466
2051
  let Location = Location_1 = class Location {
2052
+ static isLocation(thing) {
2053
+ if (thing instanceof Location_1) {
2054
+ return true;
2055
+ }
2056
+ if (!thing) {
2057
+ return false;
2058
+ }
2059
+ return Range$1.isRange(thing.range)
2060
+ && URI.isUri(thing.uri);
2061
+ }
1467
2062
  constructor(uri, rangeOrPosition) {
1468
2063
  this.uri = uri;
1469
2064
  if (!rangeOrPosition) ;
@@ -1477,16 +2072,6 @@ let Location = Location_1 = class Location {
1477
2072
  throw new Error('Illegal argument');
1478
2073
  }
1479
2074
  }
1480
- static isLocation(thing) {
1481
- if (thing instanceof Location_1) {
1482
- return true;
1483
- }
1484
- if (!thing) {
1485
- return false;
1486
- }
1487
- return Range$1.isRange(thing.range)
1488
- && URI.isUri(thing.uri);
1489
- }
1490
2075
  toJSON() {
1491
2076
  return {
1492
2077
  uri: this.uri,
@@ -1498,10 +2083,6 @@ Location = Location_1 = ( (__decorate([
1498
2083
  es5ClassCompat
1499
2084
  ], Location)));
1500
2085
  let DiagnosticRelatedInformation$1 = class DiagnosticRelatedInformation {
1501
- constructor(location, message) {
1502
- this.location = location;
1503
- this.message = message;
1504
- }
1505
2086
  static is(thing) {
1506
2087
  if (!thing) {
1507
2088
  return false;
@@ -1511,6 +2092,10 @@ let DiagnosticRelatedInformation$1 = class DiagnosticRelatedInformation {
1511
2092
  && Range$1.isRange(thing.location.range)
1512
2093
  && URI.isUri(thing.location.uri);
1513
2094
  }
2095
+ constructor(location, message) {
2096
+ this.location = location;
2097
+ this.message = message;
2098
+ }
1514
2099
  static isEqual(a, b) {
1515
2100
  if (a === b) {
1516
2101
  return true;
@@ -1639,6 +2224,11 @@ var SymbolTag$1;
1639
2224
  SymbolTag[SymbolTag["Deprecated"] = 1] = "Deprecated";
1640
2225
  })(SymbolTag$1 || (SymbolTag$1 = {}))));
1641
2226
  let SymbolInformation = SymbolInformation_1 = class SymbolInformation {
2227
+ static validate(candidate) {
2228
+ if (!candidate.name) {
2229
+ throw new Error('name must not be falsy');
2230
+ }
2231
+ }
1642
2232
  constructor(name, kind, rangeOrContainer, locationOrUri, containerName) {
1643
2233
  this.name = name;
1644
2234
  this.kind = kind;
@@ -1654,11 +2244,6 @@ let SymbolInformation = SymbolInformation_1 = class SymbolInformation {
1654
2244
  }
1655
2245
  SymbolInformation_1.validate(this);
1656
2246
  }
1657
- static validate(candidate) {
1658
- if (!candidate.name) {
1659
- throw new Error('name must not be falsy');
1660
- }
1661
- }
1662
2247
  toJSON() {
1663
2248
  return {
1664
2249
  name: this.name,
@@ -1672,15 +2257,6 @@ SymbolInformation = SymbolInformation_1 = ( (__decorate([
1672
2257
  es5ClassCompat
1673
2258
  ], SymbolInformation)));
1674
2259
  let DocumentSymbol$1 = DocumentSymbol_1 = class DocumentSymbol {
1675
- constructor(name, detail, kind, range, selectionRange) {
1676
- this.name = name;
1677
- this.detail = detail;
1678
- this.kind = kind;
1679
- this.range = range;
1680
- this.selectionRange = selectionRange;
1681
- this.children = [];
1682
- DocumentSymbol_1.validate(this);
1683
- }
1684
2260
  static validate(candidate) {
1685
2261
  if (!candidate.name) {
1686
2262
  throw new Error('name must not be falsy');
@@ -1690,6 +2266,15 @@ let DocumentSymbol$1 = DocumentSymbol_1 = class DocumentSymbol {
1690
2266
  }
1691
2267
  candidate.children?.forEach(DocumentSymbol_1.validate);
1692
2268
  }
2269
+ constructor(name, detail, kind, range, selectionRange) {
2270
+ this.name = name;
2271
+ this.detail = detail;
2272
+ this.kind = kind;
2273
+ this.range = range;
2274
+ this.selectionRange = selectionRange;
2275
+ this.children = [];
2276
+ DocumentSymbol_1.validate(this);
2277
+ }
1693
2278
  };
1694
2279
  DocumentSymbol$1 = DocumentSymbol_1 = ( (__decorate([
1695
2280
  es5ClassCompat
@@ -1733,6 +2318,7 @@ CodeActionKind.QuickFix = CodeActionKind.Empty.append('quickfix');
1733
2318
  CodeActionKind.Refactor = CodeActionKind.Empty.append('refactor');
1734
2319
  CodeActionKind.RefactorExtract = CodeActionKind.Refactor.append('extract');
1735
2320
  CodeActionKind.RefactorInline = CodeActionKind.Refactor.append('inline');
2321
+ CodeActionKind.RefactorMove = CodeActionKind.Refactor.append('move');
1736
2322
  CodeActionKind.RefactorRewrite = CodeActionKind.Refactor.append('rewrite');
1737
2323
  CodeActionKind.Source = CodeActionKind.Empty.append('source');
1738
2324
  CodeActionKind.SourceOrganizeImports = CodeActionKind.Source.append('organizeImports');
@@ -1790,16 +2376,16 @@ CodeLens = ( (__decorate([
1790
2376
  es5ClassCompat
1791
2377
  ], CodeLens)));
1792
2378
  let MarkdownString$1 = MarkdownString_1 = class MarkdownString {
1793
- constructor(value, supportThemeIcons = false) {
1794
- _MarkdownString_delegate.set(this, void 0);
1795
- __classPrivateFieldSet(this, _MarkdownString_delegate, ( (new MarkdownString$2(value, { supportThemeIcons }))), "f");
1796
- }
1797
2379
  static isMarkdownString(thing) {
1798
2380
  if (thing instanceof MarkdownString_1) {
1799
2381
  return true;
1800
2382
  }
1801
2383
  return thing && thing.appendCodeblock && thing.appendMarkdown && thing.appendText && (thing.value !== undefined);
1802
2384
  }
2385
+ constructor(value, supportThemeIcons = false) {
2386
+ _MarkdownString_delegate.set(this, void 0);
2387
+ __classPrivateFieldSet(this, _MarkdownString_delegate, ( (new MarkdownString$2(value, { supportThemeIcons }))), "f");
2388
+ }
1803
2389
  get value() {
1804
2390
  return __classPrivateFieldGet(this, _MarkdownString_delegate, "f").value;
1805
2391
  }
@@ -2114,6 +2700,14 @@ let ColorPresentation$1 = class ColorPresentation {
2114
2700
  ColorPresentation$1 = ( (__decorate([
2115
2701
  es5ClassCompat
2116
2702
  ], ColorPresentation$1)));
2703
+ var TerminalExitReason;
2704
+ ( ((function(TerminalExitReason) {
2705
+ TerminalExitReason[TerminalExitReason["Unknown"] = 0] = "Unknown";
2706
+ TerminalExitReason[TerminalExitReason["Shutdown"] = 1] = "Shutdown";
2707
+ TerminalExitReason[TerminalExitReason["Process"] = 2] = "Process";
2708
+ TerminalExitReason[TerminalExitReason["User"] = 3] = "User";
2709
+ TerminalExitReason[TerminalExitReason["Extension"] = 4] = "Extension";
2710
+ })(TerminalExitReason || (TerminalExitReason = {}))));
2117
2711
  class TerminalLink {
2118
2712
  constructor(startIndex, length, tooltip) {
2119
2713
  this.startIndex = startIndex;
@@ -2156,16 +2750,6 @@ var TaskPanelKind;
2156
2750
  TaskPanelKind[TaskPanelKind["New"] = 3] = "New";
2157
2751
  })(TaskPanelKind || (TaskPanelKind = {}))));
2158
2752
  let TaskGroup = TaskGroup_1 = class TaskGroup {
2159
- constructor(id, label) {
2160
- this.label = label;
2161
- if (typeof id !== 'string') {
2162
- throw illegalArgument('name');
2163
- }
2164
- if (typeof label !== 'string') {
2165
- throw illegalArgument('name');
2166
- }
2167
- this._id = id;
2168
- }
2169
2753
  static from(value) {
2170
2754
  switch (value) {
2171
2755
  case 'clean':
@@ -2180,6 +2764,16 @@ let TaskGroup = TaskGroup_1 = class TaskGroup {
2180
2764
  return undefined;
2181
2765
  }
2182
2766
  }
2767
+ constructor(id, label) {
2768
+ this.label = label;
2769
+ if (typeof id !== 'string') {
2770
+ throw illegalArgument('name');
2771
+ }
2772
+ if (typeof label !== 'string') {
2773
+ throw illegalArgument('name');
2774
+ }
2775
+ this._id = id;
2776
+ }
2183
2777
  get id() {
2184
2778
  return this._id;
2185
2779
  }
@@ -2572,21 +3166,22 @@ var ProgressLocation$1;
2572
3166
  ProgressLocation[ProgressLocation["Notification"] = 15] = "Notification";
2573
3167
  })(ProgressLocation$1 || (ProgressLocation$1 = {}))));
2574
3168
  let TreeItem = TreeItem_1 = class TreeItem {
2575
- constructor(arg1, collapsibleState = TreeItemCollapsibleState.None) {
2576
- this.collapsibleState = collapsibleState;
2577
- if (URI.isUri(arg1)) {
2578
- this.resourceUri = arg1;
2579
- }
2580
- else {
2581
- this.label = arg1;
3169
+ static isTreeItem(thing, extension) {
3170
+ const treeItemThing = thing;
3171
+ if (treeItemThing.checkboxState !== undefined) {
3172
+ checkProposedApiEnabled(extension, 'treeItemCheckbox');
3173
+ const checkbox = isNumber(treeItemThing.checkboxState) ? treeItemThing.checkboxState :
3174
+ isObject(treeItemThing.checkboxState) && isNumber(treeItemThing.checkboxState.state) ? treeItemThing.checkboxState.state : undefined;
3175
+ const tooltip = !isNumber(treeItemThing.checkboxState) && isObject(treeItemThing.checkboxState) ? treeItemThing.checkboxState.tooltip : undefined;
3176
+ if (checkbox === undefined || (checkbox !== TreeItemCheckboxState.Checked && checkbox !== TreeItemCheckboxState.Unchecked) || (tooltip !== undefined && !isString(tooltip))) {
3177
+ console.log('INVALID tree item, invalid checkboxState', treeItemThing.checkboxState);
3178
+ return false;
3179
+ }
2582
3180
  }
2583
- }
2584
- static isTreeItem(thing) {
2585
3181
  if (thing instanceof TreeItem_1) {
2586
3182
  return true;
2587
3183
  }
2588
- const treeItemThing = thing;
2589
- if (treeItemThing.label !== undefined && !isString(treeItemThing.label) && !(treeItemThing.label.label)) {
3184
+ if (treeItemThing.label !== undefined && !isString(treeItemThing.label) && !(treeItemThing.label?.label)) {
2590
3185
  console.log('INVALID tree item, invalid label', treeItemThing.label);
2591
3186
  return false;
2592
3187
  }
@@ -2594,9 +3189,12 @@ let TreeItem = TreeItem_1 = class TreeItem {
2594
3189
  console.log('INVALID tree item, invalid id', treeItemThing.id);
2595
3190
  return false;
2596
3191
  }
2597
- if ((treeItemThing.iconPath !== undefined) && !isString(treeItemThing.iconPath) && !URI.isUri(treeItemThing.iconPath) && !isString(treeItemThing.iconPath.id)) {
2598
- console.log('INVALID tree item, invalid iconPath', treeItemThing.iconPath);
2599
- return false;
3192
+ if ((treeItemThing.iconPath !== undefined) && !isString(treeItemThing.iconPath) && !URI.isUri(treeItemThing.iconPath) && (!treeItemThing.iconPath || !isString(treeItemThing.iconPath.id))) {
3193
+ const asLightAndDarkThing = treeItemThing.iconPath;
3194
+ if (!asLightAndDarkThing || (!isString(asLightAndDarkThing.light) && !URI.isUri(asLightAndDarkThing.light) && !isString(asLightAndDarkThing.dark) && !URI.isUri(asLightAndDarkThing.dark))) {
3195
+ console.log('INVALID tree item, invalid iconPath', treeItemThing.iconPath);
3196
+ return false;
3197
+ }
2600
3198
  }
2601
3199
  if ((treeItemThing.description !== undefined) && !isString(treeItemThing.description) && (typeof treeItemThing.description !== 'boolean')) {
2602
3200
  console.log('INVALID tree item, invalid description', treeItemThing.description);
@@ -2622,12 +3220,21 @@ let TreeItem = TreeItem_1 = class TreeItem {
2622
3220
  console.log('INVALID tree item, invalid contextValue', treeItemThing.contextValue);
2623
3221
  return false;
2624
3222
  }
2625
- if ((treeItemThing.accessibilityInformation !== undefined) && !treeItemThing.accessibilityInformation.label) {
3223
+ if ((treeItemThing.accessibilityInformation !== undefined) && !treeItemThing.accessibilityInformation?.label) {
2626
3224
  console.log('INVALID tree item, invalid accessibilityInformation', treeItemThing.accessibilityInformation);
2627
3225
  return false;
2628
3226
  }
2629
3227
  return true;
2630
3228
  }
3229
+ constructor(arg1, collapsibleState = TreeItemCollapsibleState.None) {
3230
+ this.collapsibleState = collapsibleState;
3231
+ if (URI.isUri(arg1)) {
3232
+ this.resourceUri = arg1;
3233
+ }
3234
+ else {
3235
+ this.label = arg1;
3236
+ }
3237
+ }
2631
3238
  };
2632
3239
  TreeItem = TreeItem_1 = ( (__decorate([
2633
3240
  es5ClassCompat
@@ -2638,16 +3245,22 @@ var TreeItemCollapsibleState;
2638
3245
  TreeItemCollapsibleState[TreeItemCollapsibleState["Collapsed"] = 1] = "Collapsed";
2639
3246
  TreeItemCollapsibleState[TreeItemCollapsibleState["Expanded"] = 2] = "Expanded";
2640
3247
  })(TreeItemCollapsibleState || (TreeItemCollapsibleState = {}))));
3248
+ var TreeItemCheckboxState;
3249
+ ( ((function(TreeItemCheckboxState) {
3250
+ TreeItemCheckboxState[TreeItemCheckboxState["Unchecked"] = 0] = "Unchecked";
3251
+ TreeItemCheckboxState[TreeItemCheckboxState["Checked"] = 1] = "Checked";
3252
+ })(TreeItemCheckboxState || (TreeItemCheckboxState = {}))));
2641
3253
  let DataTransferItem$1 = class DataTransferItem {
2642
- constructor(value) {
2643
- this.value = value;
2644
- }
2645
3254
  async asString() {
2646
3255
  return typeof this.value === 'string' ? this.value : JSON.stringify(this.value);
2647
3256
  }
2648
3257
  asFile() {
2649
3258
  return undefined;
2650
3259
  }
3260
+ constructor(value, id) {
3261
+ this.value = value;
3262
+ this.id = id ?? generateUuid();
3263
+ }
2651
3264
  };
2652
3265
  DataTransferItem$1 = ( (__decorate([
2653
3266
  es5ClassCompat
@@ -2702,6 +3315,13 @@ let ThemeIcon = class ThemeIcon {
2702
3315
  this.id = id;
2703
3316
  this.color = color;
2704
3317
  }
3318
+ static isThemeIcon(thing) {
3319
+ if (typeof thing.id !== 'string') {
3320
+ console.log('INVALID ThemeIcon, invalid id', thing.id);
3321
+ return false;
3322
+ }
3323
+ return true;
3324
+ }
2705
3325
  };
2706
3326
  ThemeIcon = ( (__decorate([
2707
3327
  es5ClassCompat
@@ -2723,6 +3343,20 @@ var ConfigurationTarget;
2723
3343
  ConfigurationTarget[ConfigurationTarget["WorkspaceFolder"] = 3] = "WorkspaceFolder";
2724
3344
  })(ConfigurationTarget || (ConfigurationTarget = {}))));
2725
3345
  let RelativePattern = class RelativePattern {
3346
+ get base() {
3347
+ return this._base;
3348
+ }
3349
+ set base(base) {
3350
+ this._base = base;
3351
+ this._baseUri = URI.file(base);
3352
+ }
3353
+ get baseUri() {
3354
+ return this._baseUri;
3355
+ }
3356
+ set baseUri(baseUri) {
3357
+ this._baseUri = baseUri;
3358
+ this._base = baseUri.fsPath;
3359
+ }
2726
3360
  constructor(base, pattern) {
2727
3361
  if (typeof base !== 'string') {
2728
3362
  if (!base || !URI.isUri(base) && !URI.isUri(base.uri)) {
@@ -2743,20 +3377,6 @@ let RelativePattern = class RelativePattern {
2743
3377
  }
2744
3378
  this.pattern = pattern;
2745
3379
  }
2746
- get base() {
2747
- return this._base;
2748
- }
2749
- set base(base) {
2750
- this._base = base;
2751
- this._baseUri = URI.file(base);
2752
- }
2753
- get baseUri() {
2754
- return this._baseUri;
2755
- }
2756
- set baseUri(baseUri) {
2757
- this._baseUri = baseUri;
2758
- this._base = baseUri.fsPath;
2759
- }
2760
3380
  toJSON() {
2761
3381
  return {
2762
3382
  pattern: this.pattern,
@@ -2768,6 +3388,7 @@ let RelativePattern = class RelativePattern {
2768
3388
  RelativePattern = ( (__decorate([
2769
3389
  es5ClassCompat
2770
3390
  ], RelativePattern)));
3391
+ const breakpointIds = ( (new WeakMap()));
2771
3392
  let Breakpoint = class Breakpoint {
2772
3393
  constructor(enabled, condition, hitCondition, logMessage) {
2773
3394
  this.enabled = typeof enabled === 'boolean' ? enabled : true;
@@ -2783,7 +3404,7 @@ let Breakpoint = class Breakpoint {
2783
3404
  }
2784
3405
  get id() {
2785
3406
  if (!this._id) {
2786
- this._id = generateUuid();
3407
+ this._id = breakpointIds.get(this) ?? generateUuid();
2787
3408
  }
2788
3409
  return this._id;
2789
3410
  }
@@ -2861,11 +3482,6 @@ var InlineCompletionTriggerKind;
2861
3482
  InlineCompletionTriggerKind[InlineCompletionTriggerKind["Invoke"] = 0] = "Invoke";
2862
3483
  InlineCompletionTriggerKind[InlineCompletionTriggerKind["Automatic"] = 1] = "Automatic";
2863
3484
  })(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}))));
2864
- var InlineCompletionTriggerKindNew;
2865
- ( ((function(InlineCompletionTriggerKindNew) {
2866
- InlineCompletionTriggerKindNew[InlineCompletionTriggerKindNew["Invoke"] = 0] = "Invoke";
2867
- InlineCompletionTriggerKindNew[InlineCompletionTriggerKindNew["Automatic"] = 1] = "Automatic";
2868
- })(InlineCompletionTriggerKindNew || (InlineCompletionTriggerKindNew = {}))));
2869
3485
  let InlineValueText = class InlineValueText {
2870
3486
  constructor(range, text) {
2871
3487
  this.range = range;
@@ -2910,17 +3526,6 @@ var FileChangeType;
2910
3526
  FileChangeType[FileChangeType["Deleted"] = 3] = "Deleted";
2911
3527
  })(FileChangeType || (FileChangeType = {}))));
2912
3528
  let FileSystemError = FileSystemError_1 = class FileSystemError extends Error {
2913
- constructor(uriOrMessage, code = FileSystemProviderErrorCode.Unknown, terminator) {
2914
- super(URI.isUri(uriOrMessage) ? ( (uriOrMessage.toString(true))) : uriOrMessage);
2915
- this.code = terminator?.name ?? 'Unknown';
2916
- markAsFileSystemProviderError(this, code);
2917
- if (typeof Object.setPrototypeOf === 'function') {
2918
- Object.setPrototypeOf(this, FileSystemError_1.prototype);
2919
- }
2920
- if (typeof Error.captureStackTrace === 'function' && typeof terminator === 'function') {
2921
- Error.captureStackTrace(this, terminator);
2922
- }
2923
- }
2924
3529
  static FileExists(messageOrUri) {
2925
3530
  return (
2926
3531
  (new FileSystemError_1(
@@ -2975,6 +3580,15 @@ let FileSystemError = FileSystemError_1 = class FileSystemError extends Error {
2975
3580
  ))
2976
3581
  );
2977
3582
  }
3583
+ constructor(uriOrMessage, code = FileSystemProviderErrorCode.Unknown, terminator) {
3584
+ super(URI.isUri(uriOrMessage) ? ( (uriOrMessage.toString(true))) : uriOrMessage);
3585
+ this.code = terminator?.name ?? 'Unknown';
3586
+ markAsFileSystemProviderError(this, code);
3587
+ Object.setPrototypeOf(this, FileSystemError_1.prototype);
3588
+ if (typeof Error.captureStackTrace === 'function' && typeof terminator === 'function') {
3589
+ Error.captureStackTrace(this, terminator);
3590
+ }
3591
+ }
2978
3592
  };
2979
3593
  FileSystemError = FileSystemError_1 = ( (__decorate([
2980
3594
  es5ClassCompat
@@ -3005,6 +3619,11 @@ var CommentMode;
3005
3619
  CommentMode[CommentMode["Editing"] = 0] = "Editing";
3006
3620
  CommentMode[CommentMode["Preview"] = 1] = "Preview";
3007
3621
  })(CommentMode || (CommentMode = {}))));
3622
+ var CommentThreadState;
3623
+ ( ((function(CommentThreadState) {
3624
+ CommentThreadState[CommentThreadState["Unresolved"] = 0] = "Unresolved";
3625
+ CommentThreadState[CommentThreadState["Resolved"] = 1] = "Resolved";
3626
+ })(CommentThreadState || (CommentThreadState = {}))));
3008
3627
  class SemanticTokensLegend {
3009
3628
  constructor(tokenTypes, tokenModifiers = []) {
3010
3629
  this.tokenTypes = tokenTypes;
@@ -3208,13 +3827,8 @@ var ExtensionKind;
3208
3827
  ExtensionKind[ExtensionKind["Workspace"] = 2] = "Workspace";
3209
3828
  })(ExtensionKind || (ExtensionKind = {}))));
3210
3829
  class FileDecoration {
3211
- constructor(badge, tooltip, color) {
3212
- this.badge = badge;
3213
- this.tooltip = tooltip;
3214
- this.color = color;
3215
- }
3216
3830
  static validate(d) {
3217
- if (d.badge) {
3831
+ if (typeof d.badge === 'string') {
3218
3832
  let len = nextCharLength(d.badge, 0);
3219
3833
  if (len < d.badge.length) {
3220
3834
  len += nextCharLength(d.badge, len);
@@ -3223,29 +3837,23 @@ class FileDecoration {
3223
3837
  throw new Error(`The 'badge'-property must be undefined or a short character`);
3224
3838
  }
3225
3839
  }
3840
+ else if (d.badge) {
3841
+ if (!ThemeIcon.isThemeIcon(d.badge)) {
3842
+ throw new Error(`The 'badge'-property is not a valid ThemeIcon`);
3843
+ }
3844
+ }
3226
3845
  if (!d.color && !d.badge && !d.tooltip) {
3227
3846
  throw new Error(`The decoration is empty`);
3228
3847
  }
3229
3848
  return true;
3230
3849
  }
3850
+ constructor(badge, tooltip, color) {
3851
+ this.badge = badge;
3852
+ this.tooltip = tooltip;
3853
+ this.color = color;
3854
+ }
3231
3855
  }
3232
3856
  let NotebookRange$1 = class NotebookRange {
3233
- constructor(start, end) {
3234
- if (start < 0) {
3235
- throw illegalArgument('start must be positive');
3236
- }
3237
- if (end < 0) {
3238
- throw illegalArgument('end must be positive');
3239
- }
3240
- if (start <= end) {
3241
- this._start = start;
3242
- this._end = end;
3243
- }
3244
- else {
3245
- this._start = end;
3246
- this._end = start;
3247
- }
3248
- }
3249
3857
  static isNotebookRange(thing) {
3250
3858
  if (thing instanceof NotebookRange) {
3251
3859
  return true;
@@ -3265,6 +3873,22 @@ let NotebookRange$1 = class NotebookRange {
3265
3873
  get isEmpty() {
3266
3874
  return this._start === this._end;
3267
3875
  }
3876
+ constructor(start, end) {
3877
+ if (start < 0) {
3878
+ throw illegalArgument('start must be positive');
3879
+ }
3880
+ if (end < 0) {
3881
+ throw illegalArgument('end must be positive');
3882
+ }
3883
+ if (start <= end) {
3884
+ this._start = start;
3885
+ this._end = end;
3886
+ }
3887
+ else {
3888
+ this._start = end;
3889
+ this._end = start;
3890
+ }
3891
+ }
3268
3892
  with(change) {
3269
3893
  let start = this._start;
3270
3894
  let end = this._end;
@@ -3283,16 +3907,6 @@ let NotebookRange$1 = class NotebookRange {
3283
3907
  }
3284
3908
  };
3285
3909
  let NotebookCellData$1 = class NotebookCellData {
3286
- constructor(kind, value, languageId, mime, outputs, metadata, executionSummary) {
3287
- this.kind = kind;
3288
- this.value = value;
3289
- this.languageId = languageId;
3290
- this.mime = mime;
3291
- this.outputs = outputs ?? [];
3292
- this.metadata = metadata;
3293
- this.executionSummary = executionSummary;
3294
- NotebookCellData.validate(this);
3295
- }
3296
3910
  static validate(data) {
3297
3911
  if (typeof data.kind !== 'number') {
3298
3912
  throw new Error('NotebookCellData MUST have \'kind\' property');
@@ -3310,6 +3924,16 @@ let NotebookCellData$1 = class NotebookCellData {
3310
3924
  static isNotebookCellData(value) {
3311
3925
  return true;
3312
3926
  }
3927
+ constructor(kind, value, languageId, mime, outputs, metadata, executionSummary) {
3928
+ this.kind = kind;
3929
+ this.value = value;
3930
+ this.languageId = languageId;
3931
+ this.mime = mime;
3932
+ this.outputs = outputs ?? [];
3933
+ this.metadata = metadata;
3934
+ this.executionSummary = executionSummary;
3935
+ NotebookCellData.validate(this);
3936
+ }
3313
3937
  };
3314
3938
  class NotebookData {
3315
3939
  constructor(cells) {
@@ -3317,15 +3941,6 @@ class NotebookData {
3317
3941
  }
3318
3942
  }
3319
3943
  let NotebookCellOutputItem$1 = class NotebookCellOutputItem {
3320
- constructor(data, mime) {
3321
- this.data = data;
3322
- this.mime = mime;
3323
- const mimeNormalized = normalizeMimeType(mime, true);
3324
- if (!mimeNormalized) {
3325
- throw new Error(`INVALID mime type: ${mime}. Must be in the format "type/subtype[;optionalparameter]"`);
3326
- }
3327
- this.mime = mimeNormalized;
3328
- }
3329
3944
  static isNotebookCellOutputItem(obj) {
3330
3945
  if (obj instanceof NotebookCellOutputItem) {
3331
3946
  return true;
@@ -3365,21 +3980,19 @@ let NotebookCellOutputItem$1 = class NotebookCellOutputItem {
3365
3980
  const rawStr = JSON.stringify(value, undefined, '\t');
3366
3981
  return NotebookCellOutputItem.text(rawStr, mime);
3367
3982
  }
3983
+ constructor(data, mime) {
3984
+ this.data = data;
3985
+ this.mime = mime;
3986
+ const mimeNormalized = normalizeMimeType(mime, true);
3987
+ if (!mimeNormalized) {
3988
+ throw new Error(`INVALID mime type: ${mime}. Must be in the format "type/subtype[;optionalparameter]"`);
3989
+ }
3990
+ this.mime = mimeNormalized;
3991
+ }
3368
3992
  };
3369
3993
  _a$1 = NotebookCellOutputItem$1;
3370
3994
  _NotebookCellOutputItem_encoder = { value: ( (new TextEncoder())) };
3371
3995
  let NotebookCellOutput$1 = class NotebookCellOutput {
3372
- constructor(items, idOrMetadata, metadata) {
3373
- this.items = NotebookCellOutput.ensureUniqueMimeTypes(items, true);
3374
- if (typeof idOrMetadata === 'string') {
3375
- this.id = idOrMetadata;
3376
- this.metadata = metadata;
3377
- }
3378
- else {
3379
- this.id = generateUuid();
3380
- this.metadata = idOrMetadata ?? metadata;
3381
- }
3382
- }
3383
3996
  static isNotebookCellOutput(candidate) {
3384
3997
  if (candidate instanceof NotebookCellOutput) {
3385
3998
  return true;
@@ -3387,7 +4000,7 @@ let NotebookCellOutput$1 = class NotebookCellOutput {
3387
4000
  if (!candidate || typeof candidate !== 'object') {
3388
4001
  return false;
3389
4002
  }
3390
- return typeof candidate.id === 'string' && isArray(candidate.items);
4003
+ return typeof candidate.id === 'string' && Array.isArray(candidate.items);
3391
4004
  }
3392
4005
  static ensureUniqueMimeTypes(items, warn = false) {
3393
4006
  const seen = ( (new Set()));
@@ -3395,7 +4008,7 @@ let NotebookCellOutput$1 = class NotebookCellOutput {
3395
4008
  for (let i = 0; i < items.length; i++) {
3396
4009
  const item = items[i];
3397
4010
  const normalMime = normalizeMimeType(item.mime);
3398
- if (!seen.has(normalMime)) {
4011
+ if (!seen.has(normalMime) || isTextStreamMime(normalMime)) {
3399
4012
  seen.add(normalMime);
3400
4013
  continue;
3401
4014
  }
@@ -3409,6 +4022,17 @@ let NotebookCellOutput$1 = class NotebookCellOutput {
3409
4022
  }
3410
4023
  return items.filter((_item, index) => !removeIdx.has(index));
3411
4024
  }
4025
+ constructor(items, idOrMetadata, metadata) {
4026
+ this.items = NotebookCellOutput.ensureUniqueMimeTypes(items, true);
4027
+ if (typeof idOrMetadata === 'string') {
4028
+ this.id = idOrMetadata;
4029
+ this.metadata = metadata;
4030
+ }
4031
+ else {
4032
+ this.id = generateUuid();
4033
+ this.metadata = idOrMetadata ?? metadata;
4034
+ }
4035
+ }
3412
4036
  };
3413
4037
  var NotebookCellKind$1;
3414
4038
  ( ((function(NotebookCellKind) {
@@ -3474,15 +4098,15 @@ TestRunRequest = ( (__decorate([
3474
4098
  es5ClassCompat
3475
4099
  ], TestRunRequest)));
3476
4100
  let TestMessage = TestMessage_1 = class TestMessage {
3477
- constructor(message) {
3478
- this.message = message;
3479
- }
3480
4101
  static diff(message, expected, actual) {
3481
4102
  const msg = ( (new TestMessage_1(message)));
3482
4103
  msg.expectedOutput = expected;
3483
4104
  msg.actualOutput = actual;
3484
4105
  return msg;
3485
4106
  }
4107
+ constructor(message) {
4108
+ this.message = message;
4109
+ }
3486
4110
  };
3487
4111
  TestMessage = TestMessage_1 = ( (__decorate([
3488
4112
  es5ClassCompat
@@ -3562,23 +4186,7 @@ function cursorStyleToString(cursorStyle) {
3562
4186
  case TextEditorCursorStyle.UnderlineThin: return 'underline-thin';
3563
4187
  }
3564
4188
  }
3565
- var EditorActivation;
3566
- ( ((function(EditorActivation) {
3567
- EditorActivation[EditorActivation["ACTIVATE"] = 1] = "ACTIVATE";
3568
- EditorActivation[EditorActivation["RESTORE"] = 2] = "RESTORE";
3569
- EditorActivation[EditorActivation["PRESERVE"] = 3] = "PRESERVE";
3570
- })(EditorActivation || (EditorActivation = {}))));
3571
- var EditorResolution;
3572
- ( ((function(EditorResolution) {
3573
- EditorResolution[EditorResolution["PICK"] = 0] = "PICK";
3574
- EditorResolution[EditorResolution["DISABLED"] = 1] = "DISABLED";
3575
- EditorResolution[EditorResolution["EXCLUSIVE_ONLY"] = 2] = "EXCLUSIVE_ONLY";
3576
- })(EditorResolution || (EditorResolution = {}))));
3577
- var CellKind;
3578
- ( ((function(CellKind) {
3579
- CellKind[CellKind["Markup"] = 1] = "Markup";
3580
- CellKind[CellKind["Code"] = 2] = "Code";
3581
- })(CellKind || (CellKind = {}))));
4189
+ const marked = marked$1.marked;
3582
4190
  var Selection$1;
3583
4191
  ( ((function(Selection) {
3584
4192
  function to(selection) {
@@ -4069,7 +4677,7 @@ var TextEdit;
4069
4677
  })(TextEdit || (TextEdit = {}))));
4070
4678
  var WorkspaceEdit;
4071
4679
  ( ((function(WorkspaceEdit) {
4072
- function from(value, versionInfo, allowSnippetTextEdit) {
4680
+ function from(value, versionInfo) {
4073
4681
  const result = {
4074
4682
  edits: []
4075
4683
  };
@@ -4085,7 +4693,7 @@ var WorkspaceEdit;
4085
4693
  result.edits.push({
4086
4694
  oldResource: entry.from,
4087
4695
  newResource: entry.to,
4088
- options: entry.options,
4696
+ options: { ...entry.options, contentsBase64: entry.options?.contents && encodeBase64(VSBuffer.wrap(entry.options.contents)) },
4089
4697
  metadata: entry.metadata
4090
4698
  });
4091
4699
  }
@@ -4098,10 +4706,6 @@ var WorkspaceEdit;
4098
4706
  });
4099
4707
  }
4100
4708
  else if (entry._type === 6 ) {
4101
- if (!allowSnippetTextEdit) {
4102
- console.warn(`DROPPING snippet text edit because proposal IS NOT ENABLED`, entry);
4103
- continue;
4104
- }
4105
4709
  result.edits.push({
4106
4710
  resource: entry.uri,
4107
4711
  textEdit: {
@@ -4554,6 +5158,9 @@ var CompletionItemKind;
4554
5158
  var ParameterInformation;
4555
5159
  ( ((function(ParameterInformation) {
4556
5160
  function from(info) {
5161
+ if (typeof info.label !== 'string' && !Array.isArray(info.label)) {
5162
+ throw new TypeError('Invalid label');
5163
+ }
4557
5164
  return {
4558
5165
  label: info.label,
4559
5166
  documentation: MarkdownString.fromStrict(info.documentation)
@@ -4761,6 +5368,14 @@ var FoldingRange;
4761
5368
  return range;
4762
5369
  }
4763
5370
  FoldingRange.from = from;
5371
+ function to(r) {
5372
+ const range = { start: r.start - 1, end: r.end - 1 };
5373
+ if (r.kind) {
5374
+ range.kind = FoldingRangeKind.to(r.kind);
5375
+ }
5376
+ return range;
5377
+ }
5378
+ FoldingRange.to = to;
4764
5379
  })(FoldingRange || (FoldingRange = {}))));
4765
5380
  var FoldingRangeKind;
4766
5381
  ( ((function(FoldingRangeKind) {
@@ -4778,6 +5393,20 @@ var FoldingRangeKind;
4778
5393
  return undefined;
4779
5394
  }
4780
5395
  FoldingRangeKind.from = from;
5396
+ function to(kind) {
5397
+ if (kind) {
5398
+ switch (kind.value) {
5399
+ case FoldingRangeKind$2.Comment.value:
5400
+ return FoldingRangeKind$1.Comment;
5401
+ case FoldingRangeKind$2.Imports.value:
5402
+ return FoldingRangeKind$1.Imports;
5403
+ case FoldingRangeKind$2.Region.value:
5404
+ return FoldingRangeKind$1.Region;
5405
+ }
5406
+ }
5407
+ return undefined;
5408
+ }
5409
+ FoldingRangeKind.to = to;
4781
5410
  })(FoldingRangeKind || (FoldingRangeKind = {}))));
4782
5411
  var GlobPattern;
4783
5412
  ( ((function(GlobPattern) {
@@ -4987,7 +5616,7 @@ var TypeHierarchyItem;
4987
5616
  })(TypeHierarchyItem || (TypeHierarchyItem = {}))));
4988
5617
  var DataTransferItem;
4989
5618
  ( ((function(DataTransferItem) {
4990
- function toDataTransferItem(item, resolveFileData) {
5619
+ function to(mime, item, resolveFileData) {
4991
5620
  const file = item.fileData;
4992
5621
  if (file) {
4993
5622
  return new (class extends DataTransferItem$1 {
@@ -4998,19 +5627,58 @@ var DataTransferItem;
4998
5627
  data: once(() => resolveFileData()),
4999
5628
  };
5000
5629
  }
5001
- })('');
5630
+ })('', item.id);
5002
5631
  }
5003
- else {
5004
- return new DataTransferItem$1(item.asString);
5632
+ if (mime === Mimes.uriList && item.uriListData) {
5633
+ return new DataTransferItem$1(reviveUriList(item.uriListData));
5634
+ }
5635
+ return new DataTransferItem$1(item.asString);
5636
+ }
5637
+ DataTransferItem.to = to;
5638
+ async function from(mime, item) {
5639
+ const stringValue = await item.asString();
5640
+ if (mime === Mimes.uriList) {
5641
+ return {
5642
+ id: item.id,
5643
+ asString: stringValue,
5644
+ fileData: undefined,
5645
+ uriListData: serializeUriList(stringValue),
5646
+ };
5005
5647
  }
5648
+ const fileValue = item.asFile();
5649
+ return {
5650
+ id: item.id,
5651
+ asString: stringValue,
5652
+ fileData: fileValue ? { name: fileValue.name, uri: fileValue.uri } : undefined,
5653
+ };
5654
+ }
5655
+ DataTransferItem.from = from;
5656
+ function serializeUriList(stringValue) {
5657
+ return UriList.split(stringValue).map(part => {
5658
+ if (part.startsWith('#')) {
5659
+ return part;
5660
+ }
5661
+ try {
5662
+ return (
5663
+ (URI.parse(part))
5664
+ );
5665
+ }
5666
+ catch {
5667
+ }
5668
+ return part;
5669
+ });
5670
+ }
5671
+ function reviveUriList(parts) {
5672
+ return UriList.create(parts.map(part => {
5673
+ return typeof part === 'string' ? part : URI.revive(part);
5674
+ }));
5006
5675
  }
5007
- DataTransferItem.toDataTransferItem = toDataTransferItem;
5008
5676
  })(DataTransferItem || (DataTransferItem = {}))));
5009
5677
  var DataTransfer;
5010
5678
  ( ((function(DataTransfer) {
5011
5679
  function toDataTransfer(value, resolveFileData) {
5012
- const init = value.items.map(([type, item], index) => {
5013
- return [type, DataTransferItem.toDataTransferItem(item, () => resolveFileData(index))];
5680
+ const init = value.items.map(([type, item]) => {
5681
+ return [type, DataTransferItem.to(type, item, () => resolveFileData(item.id))];
5014
5682
  });
5015
5683
  return new DataTransfer$1(init);
5016
5684
  }
@@ -5020,12 +5688,7 @@ var DataTransfer;
5020
5688
  const promises = [];
5021
5689
  value.forEach((value, key) => {
5022
5690
  promises.push((async () => {
5023
- const stringValue = await value.asString();
5024
- const fileValue = value.asFile();
5025
- newDTO.items.push([key, {
5026
- asString: stringValue,
5027
- fileData: fileValue ? { name: fileValue.name, uri: fileValue.uri } : undefined,
5028
- }]);
5691
+ newDTO.items.push([key, await DataTransferItem.from(key, value)]);
5029
5692
  })());
5030
5693
  });
5031
5694
  await Promise.all(promises);
@@ -5062,12 +5725,6 @@ var TextEditorRevealType;
5062
5725
  TextEditorRevealType[TextEditorRevealType["InCenterIfOutsideViewport"] = 2] = "InCenterIfOutsideViewport";
5063
5726
  TextEditorRevealType[TextEditorRevealType["AtTop"] = 3] = "AtTop";
5064
5727
  })(TextEditorRevealType || (TextEditorRevealType = {}))));
5065
- function reviveWorkspaceEditDto(data) {
5066
- if (data && data.edits) {
5067
- revive(data);
5068
- }
5069
- return data;
5070
- }
5071
5728
  const MainContext = {
5072
5729
  MainThreadAuthentication: ( (createProxyIdentifier('MainThreadAuthentication'))),
5073
5730
  MainThreadBulkEdits: ( (createProxyIdentifier('MainThreadBulkEdits'))),
@@ -5095,6 +5752,7 @@ const MainContext = {
5095
5752
  MainThreadMessageService: ( (createProxyIdentifier('MainThreadMessageService'))),
5096
5753
  MainThreadOutputService: ( (createProxyIdentifier('MainThreadOutputService'))),
5097
5754
  MainThreadProgress: ( (createProxyIdentifier('MainThreadProgress'))),
5755
+ MainThreadQuickDiff: ( (createProxyIdentifier('MainThreadQuickDiff'))),
5098
5756
  MainThreadQuickOpen: ( (createProxyIdentifier('MainThreadQuickOpen'))),
5099
5757
  MainThreadStatusBar: ( (createProxyIdentifier('MainThreadStatusBar'))),
5100
5758
  MainThreadSecretState: ( (createProxyIdentifier('MainThreadSecretState'))),
@@ -5107,6 +5765,7 @@ const MainContext = {
5107
5765
  MainThreadCustomEditors: ( (createProxyIdentifier('MainThreadCustomEditors'))),
5108
5766
  MainThreadUrls: ( (createProxyIdentifier('MainThreadUrls'))),
5109
5767
  MainThreadUriOpeners: ( (createProxyIdentifier('MainThreadUriOpeners'))),
5768
+ MainThreadProfileContentHandlers: ( (createProxyIdentifier('MainThreadProfileContentHandlers'))),
5110
5769
  MainThreadWorkspace: ( (createProxyIdentifier('MainThreadWorkspace'))),
5111
5770
  MainThreadFileSystem: ( (createProxyIdentifier('MainThreadFileSystem'))),
5112
5771
  MainThreadExtensionService: ( (createProxyIdentifier('MainThreadExtensionService'))),
@@ -5125,6 +5784,7 @@ const MainContext = {
5125
5784
  MainThreadTunnelService: ( (createProxyIdentifier('MainThreadTunnelService'))),
5126
5785
  MainThreadTimeline: ( (createProxyIdentifier('MainThreadTimeline'))),
5127
5786
  MainThreadTesting: ( (createProxyIdentifier('MainThreadTesting'))),
5787
+ MainThreadLocalization: ( (createProxyIdentifier('MainThreadLocalizationShape')))
5128
5788
  };
5129
5789
  const ExtHostContext = {
5130
5790
  ExtHostCommands: ( (createProxyIdentifier('ExtHostCommands'))),
@@ -5144,6 +5804,7 @@ const ExtHostContext = {
5144
5804
  ExtHostLanguages: ( (createProxyIdentifier('ExtHostLanguages'))),
5145
5805
  ExtHostLanguageFeatures: ( (createProxyIdentifier('ExtHostLanguageFeatures'))),
5146
5806
  ExtHostQuickOpen: ( (createProxyIdentifier('ExtHostQuickOpen'))),
5807
+ ExtHostQuickDiff: ( (createProxyIdentifier('ExtHostQuickDiff'))),
5147
5808
  ExtHostExtensionService: ( (createProxyIdentifier('ExtHostExtensionService'))),
5148
5809
  ExtHostLogLevelServiceShape: ( (createProxyIdentifier('ExtHostLogLevelServiceShape'))),
5149
5810
  ExtHostTerminalService: ( (createProxyIdentifier('ExtHostTerminalService'))),
@@ -5164,6 +5825,7 @@ const ExtHostContext = {
5164
5825
  ExtHostStorage: ( (createProxyIdentifier('ExtHostStorage'))),
5165
5826
  ExtHostUrls: ( (createProxyIdentifier('ExtHostUrls'))),
5166
5827
  ExtHostUriOpeners: ( (createProxyIdentifier('ExtHostUriOpeners'))),
5828
+ ExtHostProfileContentHandlers: ( (createProxyIdentifier('ExtHostProfileContentHandlers'))),
5167
5829
  ExtHostOutputService: ( (createProxyIdentifier('ExtHostOutputService'))),
5168
5830
  ExtHosLabelService: ( (createProxyIdentifier('ExtHostLabelService'))),
5169
5831
  ExtHostNotebook: ( (createProxyIdentifier('ExtHostNotebook'))),
@@ -5178,17 +5840,245 @@ const ExtHostContext = {
5178
5840
  ExtHostTimeline: ( (createProxyIdentifier('ExtHostTimeline'))),
5179
5841
  ExtHostTesting: ( (createProxyIdentifier('ExtHostTesting'))),
5180
5842
  ExtHostTelemetry: ( (createProxyIdentifier('ExtHostTelemetry'))),
5843
+ ExtHostLocalization: ( (createProxyIdentifier('ExtHostLocalization'))),
5181
5844
  };
5182
5845
  const IExtHostRpcService = ( (createDecorator('IExtHostRpcService')));
5183
- var _ExtHostCommands_proxy, _ExtHostCommands_telemetry;
5846
+ const IExtHostInitDataService = ( (createDecorator('IExtHostInitDataService')));
5847
+ let ExtHostTelemetry = class ExtHostTelemetry extends Disposable$1 {
5848
+ constructor(initData, loggerService) {
5849
+ super();
5850
+ this.initData = initData;
5851
+ this.loggerService = loggerService;
5852
+ this._onDidChangeTelemetryEnabled = this._register(( (new Emitter$1())));
5853
+ this.onDidChangeTelemetryEnabled = this._onDidChangeTelemetryEnabled.event;
5854
+ this._onDidChangeTelemetryConfiguration = this._register(( (new Emitter$1())));
5855
+ this.onDidChangeTelemetryConfiguration = this._onDidChangeTelemetryConfiguration.event;
5856
+ this._productConfig = { usage: true, error: true };
5857
+ this._level = 0 ;
5858
+ this._telemetryIsSupported = false;
5859
+ this._inLoggingOnlyMode = false;
5860
+ this._telemetryLoggers = ( (new Map()));
5861
+ this.extHostTelemetryLogFile = URI.revive(this.initData.environment.extensionTelemetryLogResource);
5862
+ this._inLoggingOnlyMode = this.initData.environment.isExtensionTelemetryLoggingOnly;
5863
+ this._outputLogger = loggerService.createLogger(this.extHostTelemetryLogFile, { id: extensionTelemetryLogChannelId, name: ( (localize(
5864
+ 'extensionTelemetryLog',
5865
+ "Extension Telemetry{0}",
5866
+ this._inLoggingOnlyMode ? ' (Not Sent)' : ''
5867
+ ))), hidden: true });
5868
+ this._register(loggerService.onDidChangeLogLevel(arg => {
5869
+ if (isLogLevel(arg)) {
5870
+ this.updateLoggerVisibility();
5871
+ }
5872
+ }));
5873
+ this._outputLogger.info('Below are logs for extension telemetry events sent to the telemetry output channel API once the log level is set to trace.');
5874
+ this._outputLogger.info('===========================================================');
5875
+ }
5876
+ updateLoggerVisibility() {
5877
+ this.loggerService.setVisibility(this.extHostTelemetryLogFile, this._telemetryIsSupported && this.loggerService.getLogLevel() === LogLevel.Trace);
5878
+ }
5879
+ getTelemetryConfiguration() {
5880
+ return this._level === 3 ;
5881
+ }
5882
+ getTelemetryDetails() {
5883
+ return {
5884
+ isCrashEnabled: this._level >= 1 ,
5885
+ isErrorsEnabled: this._productConfig.error ? this._level >= 2 : false,
5886
+ isUsageEnabled: this._productConfig.usage ? this._level >= 3 : false
5887
+ };
5888
+ }
5889
+ instantiateLogger(extension, sender, options) {
5890
+ const telemetryDetails = this.getTelemetryDetails();
5891
+ const logger = ( (new ExtHostTelemetryLogger(
5892
+ sender,
5893
+ options,
5894
+ extension,
5895
+ this._outputLogger,
5896
+ this._inLoggingOnlyMode,
5897
+ this.getBuiltInCommonProperties(extension),
5898
+ { isUsageEnabled: telemetryDetails.isUsageEnabled, isErrorsEnabled: telemetryDetails.isErrorsEnabled }
5899
+ )));
5900
+ this._telemetryLoggers.set(extension.identifier.value, logger);
5901
+ return logger.apiTelemetryLogger;
5902
+ }
5903
+ $initializeTelemetryLevel(level, supportsTelemetry, productConfig) {
5904
+ this._level = level;
5905
+ this._telemetryIsSupported = supportsTelemetry;
5906
+ this._productConfig = productConfig ?? { usage: true, error: true };
5907
+ this.updateLoggerVisibility();
5908
+ }
5909
+ getBuiltInCommonProperties(extension) {
5910
+ const commonProperties = {};
5911
+ commonProperties['common.extname'] = `${extension.publisher}.${extension.name}`;
5912
+ commonProperties['common.extversion'] = extension.version;
5913
+ commonProperties['common.vscodemachineid'] = this.initData.telemetryInfo.machineId;
5914
+ commonProperties['common.vscodesessionid'] = this.initData.telemetryInfo.sessionId;
5915
+ commonProperties['common.vscodeversion'] = this.initData.version;
5916
+ commonProperties['common.isnewappinstall'] = isNewAppInstall(this.initData.telemetryInfo.firstSessionDate);
5917
+ commonProperties['common.product'] = this.initData.environment.appHost;
5918
+ switch (this.initData.uiKind) {
5919
+ case UIKind.Web:
5920
+ commonProperties['common.uikind'] = 'web';
5921
+ break;
5922
+ case UIKind.Desktop:
5923
+ commonProperties['common.uikind'] = 'desktop';
5924
+ break;
5925
+ default:
5926
+ commonProperties['common.uikind'] = 'unknown';
5927
+ }
5928
+ commonProperties['common.remotename'] = getRemoteName(cleanRemoteAuthority(this.initData.remote.authority));
5929
+ return commonProperties;
5930
+ }
5931
+ $onDidChangeTelemetryLevel(level) {
5932
+ this._oldTelemetryEnablement = this.getTelemetryConfiguration();
5933
+ this._level = level;
5934
+ const telemetryDetails = this.getTelemetryDetails();
5935
+ this._telemetryLoggers.forEach(logger => {
5936
+ logger.updateTelemetryEnablements(telemetryDetails.isUsageEnabled, telemetryDetails.isErrorsEnabled);
5937
+ });
5938
+ if (this._oldTelemetryEnablement !== this.getTelemetryConfiguration()) {
5939
+ this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration());
5940
+ }
5941
+ this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails());
5942
+ this.updateLoggerVisibility();
5943
+ }
5944
+ onExtensionError(extension, error) {
5945
+ const logger = this._telemetryLoggers.get(extension.value);
5946
+ if (!logger || logger.ignoreUnhandledExtHostErrors) {
5947
+ return false;
5948
+ }
5949
+ logger.logError(error);
5950
+ return true;
5951
+ }
5952
+ };
5953
+ ExtHostTelemetry = ( (__decorate([
5954
+ ( (__param(0, IExtHostInitDataService))),
5955
+ ( (__param(1, ILoggerService)))
5956
+ ], ExtHostTelemetry)));
5957
+ class ExtHostTelemetryLogger {
5958
+ static validateSender(sender) {
5959
+ if (typeof sender !== 'object') {
5960
+ throw new TypeError('TelemetrySender argument is invalid');
5961
+ }
5962
+ if (typeof sender.sendEventData !== 'function') {
5963
+ throw new TypeError('TelemetrySender.sendEventData must be a function');
5964
+ }
5965
+ if (typeof sender.sendErrorData !== 'function') {
5966
+ throw new TypeError('TelemetrySender.sendErrorData must be a function');
5967
+ }
5968
+ if (typeof sender.flush !== 'undefined' && typeof sender.flush !== 'function') {
5969
+ throw new TypeError('TelemetrySender.flush must be a function or undefined');
5970
+ }
5971
+ }
5972
+ constructor(sender, options, _extension, _logger, _inLoggingOnlyMode, _commonProperties, telemetryEnablements) {
5973
+ this._extension = _extension;
5974
+ this._logger = _logger;
5975
+ this._inLoggingOnlyMode = _inLoggingOnlyMode;
5976
+ this._commonProperties = _commonProperties;
5977
+ this._onDidChangeEnableStates = ( (new Emitter$1()));
5978
+ this.ignoreUnhandledExtHostErrors = options?.ignoreUnhandledErrors ?? false;
5979
+ this._ignoreBuiltinCommonProperties = options?.ignoreBuiltInCommonProperties ?? false;
5980
+ this._additionalCommonProperties = options?.additionalCommonProperties;
5981
+ this._sender = sender;
5982
+ this._telemetryEnablements = { isUsageEnabled: telemetryEnablements.isUsageEnabled, isErrorsEnabled: telemetryEnablements.isErrorsEnabled };
5983
+ }
5984
+ updateTelemetryEnablements(isUsageEnabled, isErrorsEnabled) {
5985
+ if (this._apiObject) {
5986
+ this._telemetryEnablements = { isUsageEnabled, isErrorsEnabled };
5987
+ this._onDidChangeEnableStates.fire(this._apiObject);
5988
+ }
5989
+ }
5990
+ mixInCommonPropsAndCleanData(data) {
5991
+ let updatedData = data.properties ?? data;
5992
+ updatedData = cleanData(updatedData, []);
5993
+ if (this._additionalCommonProperties) {
5994
+ updatedData = mixin(updatedData, this._additionalCommonProperties);
5995
+ }
5996
+ if (!this._ignoreBuiltinCommonProperties) {
5997
+ updatedData = mixin(updatedData, this._commonProperties);
5998
+ }
5999
+ if (data.properties) {
6000
+ data.properties = updatedData;
6001
+ }
6002
+ else {
6003
+ data = updatedData;
6004
+ }
6005
+ return data;
6006
+ }
6007
+ logEvent(eventName, data) {
6008
+ if (!this._sender) {
6009
+ return;
6010
+ }
6011
+ if (this._extension.publisher === 'vscode') {
6012
+ eventName = this._extension.name + '/' + eventName;
6013
+ }
6014
+ else {
6015
+ eventName = this._extension.identifier.value + '/' + eventName;
6016
+ }
6017
+ data = this.mixInCommonPropsAndCleanData(data || {});
6018
+ if (!this._inLoggingOnlyMode) {
6019
+ this._sender?.sendEventData(eventName, data);
6020
+ }
6021
+ this._logger.trace(eventName, data);
6022
+ }
6023
+ logUsage(eventName, data) {
6024
+ if (!this._telemetryEnablements.isUsageEnabled) {
6025
+ return;
6026
+ }
6027
+ this.logEvent(eventName, data);
6028
+ }
6029
+ logError(eventNameOrException, data) {
6030
+ if (!this._telemetryEnablements.isErrorsEnabled || !this._sender) {
6031
+ return;
6032
+ }
6033
+ if (typeof eventNameOrException === 'string') {
6034
+ this.logEvent(eventNameOrException, data);
6035
+ }
6036
+ else {
6037
+ this._sender.sendErrorData(eventNameOrException, data);
6038
+ }
6039
+ }
6040
+ get apiTelemetryLogger() {
6041
+ if (!this._apiObject) {
6042
+ const that = this;
6043
+ const obj = {
6044
+ logUsage: that.logUsage.bind(that),
6045
+ get isUsageEnabled() {
6046
+ return that._telemetryEnablements.isUsageEnabled;
6047
+ },
6048
+ get isErrorsEnabled() {
6049
+ return that._telemetryEnablements.isErrorsEnabled;
6050
+ },
6051
+ logError: that.logError.bind(that),
6052
+ dispose: that.dispose.bind(that),
6053
+ onDidChangeEnableStates: that._onDidChangeEnableStates.event.bind(that)
6054
+ };
6055
+ this._apiObject = ( (Object.freeze(obj)));
6056
+ }
6057
+ return this._apiObject;
6058
+ }
6059
+ dispose() {
6060
+ if (this._sender?.flush) {
6061
+ Promise.resolve(this._sender.flush()).then(this._sender = undefined);
6062
+ this._apiObject = undefined;
6063
+ }
6064
+ }
6065
+ }
6066
+ function isNewAppInstall(firstSessionDate) {
6067
+ const installAge = Date.now() - ( (new Date(firstSessionDate))).getTime();
6068
+ return isNaN(installAge) ? false : installAge < 1000 * 60 * 60 * 24;
6069
+ }
6070
+ const IExtHostTelemetry = ( (createDecorator('IExtHostTelemetry')));
6071
+ var _ExtHostCommands_proxy, _ExtHostCommands_telemetry, _ExtHostCommands_extHostTelemetry;
5184
6072
  let ExtHostCommands = class ExtHostCommands {
5185
- constructor(extHostRpc, logService) {
6073
+ constructor(extHostRpc, logService, extHostTelemetry) {
5186
6074
  _ExtHostCommands_proxy.set(this, void 0);
5187
6075
  this._commands = ( (new Map()));
5188
6076
  this._apiCommands = ( (new Map()));
5189
6077
  _ExtHostCommands_telemetry.set(this, void 0);
6078
+ _ExtHostCommands_extHostTelemetry.set(this, void 0);
5190
6079
  __classPrivateFieldSet(this, _ExtHostCommands_proxy, extHostRpc.getProxy(MainContext.MainThreadCommands), "f");
5191
6080
  this._logService = logService;
6081
+ __classPrivateFieldSet(this, _ExtHostCommands_extHostTelemetry, extHostTelemetry, "f");
5192
6082
  __classPrivateFieldSet(this, _ExtHostCommands_telemetry, extHostRpc.getProxy(MainContext.MainThreadTelemetry), "f");
5193
6083
  this.converter = ( (new CommandsConverter(this, id => {
5194
6084
  const candidate = this._apiCommands.get(id);
@@ -5327,7 +6217,6 @@ let ExtHostCommands = class ExtHostCommands {
5327
6217
  if (!command) {
5328
6218
  throw new Error('Unknown command');
5329
6219
  }
5330
- this._reportTelemetry(command, id);
5331
6220
  const { callback, thisArg, description } = command;
5332
6221
  if (description) {
5333
6222
  for (let i = 0; i < description.args.length; i++) {
@@ -5339,6 +6228,7 @@ let ExtHostCommands = class ExtHostCommands {
5339
6228
  }
5340
6229
  }
5341
6230
  }
6231
+ const stopWatch = StopWatch.create();
5342
6232
  try {
5343
6233
  return await callback.apply(thisArg, args);
5344
6234
  }
@@ -5353,6 +6243,10 @@ let ExtHostCommands = class ExtHostCommands {
5353
6243
  if (!annotateError) {
5354
6244
  throw err;
5355
6245
  }
6246
+ if (command.extension?.identifier) {
6247
+ const reported = __classPrivateFieldGet(this, _ExtHostCommands_extHostTelemetry, "f").onExtensionError(command.extension.identifier, err);
6248
+ this._logService.trace('forwarded error to extension?', reported, command.extension?.identifier);
6249
+ }
5356
6250
  throw new (class CommandError extends Error {
5357
6251
  constructor() {
5358
6252
  super(toErrorMessage(err));
@@ -5361,23 +6255,28 @@ let ExtHostCommands = class ExtHostCommands {
5361
6255
  }
5362
6256
  });
5363
6257
  }
6258
+ finally {
6259
+ this._reportTelemetry(command, id, stopWatch.elapsed());
6260
+ }
5364
6261
  }
5365
- _reportTelemetry(command, id) {
5366
- if (!command.extension || command.extension.isBuiltin) {
6262
+ _reportTelemetry(command, id, duration) {
6263
+ if (!command.extension) {
5367
6264
  return;
5368
6265
  }
5369
6266
  __classPrivateFieldGet(this, _ExtHostCommands_telemetry, "f").$publicLog2('Extension:ActionExecuted', {
5370
6267
  extensionId: command.extension.identifier.value,
5371
- id: id,
6268
+ id: ( (new TelemetryTrustedValue(id))),
6269
+ duration: duration,
5372
6270
  });
5373
6271
  }
5374
6272
  $executeContributedCommand(id, ...args) {
5375
6273
  this._logService.trace('ExtHostCommands#$executeContributedCommand', id);
5376
- if (!this._commands.has(id)) {
6274
+ const cmdHandler = this._commands.get(id);
6275
+ if (!cmdHandler) {
5377
6276
  return Promise.reject(( (new Error(`Contributed command '${id}' does not exist.`))));
5378
6277
  }
5379
6278
  else {
5380
- args = args.map(arg => this._argumentProcessors.reduce((r, p) => p.processArgument(r), arg));
6279
+ args = args.map(arg => this._argumentProcessors.reduce((r, p) => p.processArgument(r, cmdHandler.extension?.identifier), arg));
5381
6280
  return this._executeContributedCommand(id, args, true);
5382
6281
  }
5383
6282
  }
@@ -5401,17 +6300,20 @@ let ExtHostCommands = class ExtHostCommands {
5401
6300
  return Promise.resolve(result);
5402
6301
  }
5403
6302
  };
5404
- _ExtHostCommands_proxy = ( (new WeakMap())), _ExtHostCommands_telemetry = ( (new WeakMap()));
6303
+ _ExtHostCommands_proxy = ( (new WeakMap()));
6304
+ _ExtHostCommands_telemetry = ( (new WeakMap()));
6305
+ _ExtHostCommands_extHostTelemetry = ( (new WeakMap()));
5405
6306
  ExtHostCommands = ( (__decorate([
5406
6307
  ( (__param(0, IExtHostRpcService))),
5407
- ( (__param(1, ILogService)))
6308
+ ( (__param(1, ILogService))),
6309
+ ( (__param(2, IExtHostTelemetry)))
5408
6310
  ], ExtHostCommands)));
5409
6311
  class CommandsConverter {
5410
6312
  constructor(_commands, _lookupApiCommand, _logService) {
5411
6313
  this._commands = _commands;
5412
6314
  this._lookupApiCommand = _lookupApiCommand;
5413
6315
  this._logService = _logService;
5414
- this.delegatingCommandId = `_vscode_delegate_cmd_${( ( Date.now().toString(36)))}`;
6316
+ this.delegatingCommandId = `__vsc${( ( Date.now().toString(36)))}`;
5415
6317
  this._cache = ( (new Map()));
5416
6318
  this._cachIdPool = 0;
5417
6319
  this._commands.registerCommand(true, this.delegatingCommandId, this._executeConvertedCommand, this);
@@ -5435,7 +6337,7 @@ class CommandsConverter {
5435
6337
  result.arguments = apiCommand.args.map((arg, i) => arg.convert(command.arguments && command.arguments[i]));
5436
6338
  }
5437
6339
  else if (isNonEmptyArray(command.arguments)) {
5438
- const id = ++this._cachIdPool;
6340
+ const id = `${command.command}/${++this._cachIdPool}`;
5439
6341
  this._cache.set(id, command);
5440
6342
  disposables.add(toDisposable(() => {
5441
6343
  this._cache.delete(id);
@@ -5449,7 +6351,7 @@ class CommandsConverter {
5449
6351
  return result;
5450
6352
  }
5451
6353
  fromInternal(command) {
5452
- if (typeof command.$ident === 'number') {
6354
+ if (typeof command.$ident === 'string') {
5453
6355
  return this._cache.get(command.$ident);
5454
6356
  }
5455
6357
  else {
@@ -5467,7 +6369,7 @@ class CommandsConverter {
5467
6369
  const actualCmd = this.getActualCommand(...args);
5468
6370
  this._logService.trace('CommandsConverter#EXECUTE', args[0], actualCmd ? actualCmd.command : 'MISSING');
5469
6371
  if (!actualCmd) {
5470
- return Promise.reject('actual command NOT FOUND');
6372
+ return Promise.reject(`Actual command not found, wanted to execute ${args[0]}`);
5471
6373
  }
5472
6374
  return this._commands.executeCommand(actualCmd.command, ...(actualCmd.arguments || []));
5473
6375
  }
@@ -5511,7 +6413,7 @@ let MainThreadCommands = class MainThreadCommands {
5511
6413
  constructor(extHostContext, _commandService, _extensionService) {
5512
6414
  this._commandService = _commandService;
5513
6415
  this._extensionService = _extensionService;
5514
- this._commandRegistrations = ( (new Map()));
6416
+ this._commandRegistrations = ( (new DisposableMap()));
5515
6417
  this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostCommands);
5516
6418
  this._generateCommandsDocumentationRegistration = ( (CommandsRegistry.registerCommand(
5517
6419
  '_generateCommandsDocumentation',
@@ -5519,8 +6421,7 @@ let MainThreadCommands = class MainThreadCommands {
5519
6421
  )));
5520
6422
  }
5521
6423
  dispose() {
5522
- dispose(( (this._commandRegistrations.values())));
5523
- this._commandRegistrations.clear();
6424
+ this._commandRegistrations.dispose();
5524
6425
  this._generateCommandsDocumentationRegistration.dispose();
5525
6426
  }
5526
6427
  async _generateCommandsDocumentation() {
@@ -5545,11 +6446,7 @@ let MainThreadCommands = class MainThreadCommands {
5545
6446
  }))));
5546
6447
  }
5547
6448
  $unregisterCommand(id) {
5548
- const command = this._commandRegistrations.get(id);
5549
- if (command) {
5550
- command.dispose();
5551
- this._commandRegistrations.delete(id);
5552
- }
6449
+ this._commandRegistrations.deleteAndDispose(id);
5553
6450
  }
5554
6451
  $fireCommandActivationEvent(id) {
5555
6452
  const activationEvent = `onCommand:${id}`;
@@ -5659,15 +6556,16 @@ class ExtHostFileSystemInfo {
5659
6556
  const IExtHostFileSystemInfo = ( (createDecorator('IExtHostFileSystemInfo')));
5660
6557
  var _DiagnosticCollection_proxy, _DiagnosticCollection_onDidChangeDiagnostics, _DiagnosticCollection_data;
5661
6558
  class DiagnosticCollection {
5662
- constructor(_name, _owner, _maxDiagnosticsPerFile, extUri, proxy, onDidChangeDiagnostics) {
6559
+ constructor(_name, _owner, _maxDiagnosticsPerFile, _modelVersionIdProvider, extUri, proxy, onDidChangeDiagnostics) {
5663
6560
  this._name = _name;
5664
6561
  this._owner = _owner;
5665
6562
  this._maxDiagnosticsPerFile = _maxDiagnosticsPerFile;
6563
+ this._modelVersionIdProvider = _modelVersionIdProvider;
5666
6564
  _DiagnosticCollection_proxy.set(this, void 0);
5667
6565
  _DiagnosticCollection_onDidChangeDiagnostics.set(this, void 0);
5668
6566
  _DiagnosticCollection_data.set(this, void 0);
5669
6567
  this._isDisposed = false;
5670
- __classPrivateFieldSet(this, _DiagnosticCollection_data, ( (new ResourceMap(uri => extUri.getComparisonKey(uri)))), "f");
6568
+ __classPrivateFieldSet(this, _DiagnosticCollection_data, ( (new ResourceMap$1(uri => extUri.getComparisonKey(uri)))), "f");
5671
6569
  __classPrivateFieldSet(this, _DiagnosticCollection_proxy, proxy, "f");
5672
6570
  __classPrivateFieldSet(this, _DiagnosticCollection_onDidChangeDiagnostics, onDidChangeDiagnostics, "f");
5673
6571
  }
@@ -5739,7 +6637,7 @@ class DiagnosticCollection {
5739
6637
  orderLoop: for (let i = 0; i < 4; i++) {
5740
6638
  for (const diagnostic of diagnostics) {
5741
6639
  if (diagnostic.severity === order[i]) {
5742
- const len = marker.push(Diagnostic.from(diagnostic));
6640
+ const len = marker.push({ ...Diagnostic.from(diagnostic), modelVersionId: this._modelVersionIdProvider(uri) });
5743
6641
  if (len === this._maxDiagnosticsPerFile) {
5744
6642
  break orderLoop;
5745
6643
  }
@@ -5760,7 +6658,7 @@ class DiagnosticCollection {
5760
6658
  });
5761
6659
  }
5762
6660
  else {
5763
- marker = diagnostics.map(diag => Diagnostic.from(diag));
6661
+ marker = diagnostics.map(diag => ({ ...Diagnostic.from(diag), modelVersionId: this._modelVersionIdProvider(uri) }));
5764
6662
  }
5765
6663
  }
5766
6664
  entries.push([uri, marker]);
@@ -5823,23 +6721,24 @@ class DiagnosticCollection {
5823
6721
  }
5824
6722
  }
5825
6723
  let ExtHostDiagnostics = class ExtHostDiagnostics {
5826
- constructor(mainContext, _logService, _fileSystemInfoService) {
6724
+ static _mapper(last) {
6725
+ const map = ( (new ResourceMap$1()));
6726
+ for (const uri of last) {
6727
+ map.set(uri, uri);
6728
+ }
6729
+ return { uris: ( (Object.freeze(Array.from(( (map.values())))))) };
6730
+ }
6731
+ constructor(mainContext, _logService, _fileSystemInfoService, _extHostDocumentsAndEditors) {
5827
6732
  this._logService = _logService;
5828
6733
  this._fileSystemInfoService = _fileSystemInfoService;
6734
+ this._extHostDocumentsAndEditors = _extHostDocumentsAndEditors;
5829
6735
  this._collections = ( (new Map()));
5830
6736
  this._onDidChangeDiagnostics = ( (new DebounceEmitter({ merge: all => all.flat(), delay: 50 })));
5831
6737
  this.onDidChangeDiagnostics = Event.map(this._onDidChangeDiagnostics.event, ExtHostDiagnostics._mapper);
5832
6738
  this._proxy = mainContext.getProxy(MainContext.MainThreadDiagnostics);
5833
6739
  }
5834
- static _mapper(last) {
5835
- const map = ( (new ResourceMap()));
5836
- for (const uri of last) {
5837
- map.set(uri, uri);
5838
- }
5839
- return { uris: ( (Object.freeze(Array.from(( (map.values())))))) };
5840
- }
5841
6740
  createDiagnosticCollection(extensionId, name) {
5842
- const { _collections, _proxy, _onDidChangeDiagnostics, _logService, _fileSystemInfoService } = this;
6741
+ const { _collections, _proxy, _onDidChangeDiagnostics, _logService, _fileSystemInfoService, _extHostDocumentsAndEditors } = this;
5843
6742
  const loggingProxy = new (class {
5844
6743
  $changeMany(owner, entries) {
5845
6744
  _proxy.$changeMany(owner, entries);
@@ -5869,7 +6768,7 @@ let ExtHostDiagnostics = class ExtHostDiagnostics {
5869
6768
  }
5870
6769
  const result = new (class extends DiagnosticCollection {
5871
6770
  constructor() {
5872
- super(name, owner, ExtHostDiagnostics._maxDiagnosticsPerFile, _fileSystemInfoService.extUri, loggingProxy, _onDidChangeDiagnostics);
6771
+ super(name, owner, ExtHostDiagnostics._maxDiagnosticsPerFile, uri => _extHostDocumentsAndEditors.getDocument(uri)?.version, _fileSystemInfoService.extUri, loggingProxy, _onDidChangeDiagnostics);
5873
6772
  _collections.set(owner, this);
5874
6773
  }
5875
6774
  dispose() {
@@ -5916,6 +6815,7 @@ let ExtHostDiagnostics = class ExtHostDiagnostics {
5916
6815
  name,
5917
6816
  name,
5918
6817
  ExtHostDiagnostics._maxDiagnosticsPerFile,
6818
+ _uri => undefined,
5919
6819
  this._fileSystemInfoService.extUri,
5920
6820
  undefined,
5921
6821
  this._onDidChangeDiagnostics
@@ -5942,6 +6842,9 @@ function _transformIncomingURIs(obj, transformer, revive, depth) {
5942
6842
  if (obj.$mid === 1 ) {
5943
6843
  return revive ? URI.revive(transformer.transformIncoming(obj)) : transformer.transformIncoming(obj);
5944
6844
  }
6845
+ if (obj instanceof VSBuffer) {
6846
+ return null;
6847
+ }
5945
6848
  for (const key in obj) {
5946
6849
  if (Object.hasOwnProperty.call(obj, key)) {
5947
6850
  const r = _transformIncomingURIs(obj[key], transformer, revive, depth + 1);
@@ -6098,7 +7001,7 @@ class RPCProtocol extends Disposable$1 {
6098
7001
  constructor(protocol, logger = null, transformer = null) {
6099
7002
  super();
6100
7003
  this[_a] = true;
6101
- this._onDidChangeResponsiveState = this._register(( (new Emitter())));
7004
+ this._onDidChangeResponsiveState = this._register(( (new Emitter$1())));
6102
7005
  this.onDidChangeResponsiveState = this._onDidChangeResponsiveState.event;
6103
7006
  this._protocol = protocol;
6104
7007
  this._logger = logger;
@@ -6411,10 +7314,6 @@ class RPCProtocol extends Disposable$1 {
6411
7314
  _a = _RPCProtocolSymbol;
6412
7315
  RPCProtocol.UNRESPONSIVE_TIME = 3 * 1000;
6413
7316
  class MessageBuffer {
6414
- constructor(buff, offset) {
6415
- this._buff = buff;
6416
- this._offset = offset;
6417
- }
6418
7317
  static alloc(type, req, messageSize) {
6419
7318
  const result = ( (new MessageBuffer(VSBuffer.alloc(messageSize + 1 + 4 ), 0)));
6420
7319
  result.writeUInt8(type);
@@ -6429,6 +7328,10 @@ class MessageBuffer {
6429
7328
  get buffer() {
6430
7329
  return this._buff;
6431
7330
  }
7331
+ constructor(buff, offset) {
7332
+ this._buff = buff;
7333
+ this._offset = offset;
7334
+ }
6432
7335
  static sizeUInt8() {
6433
7336
  return 1;
6434
7337
  }
@@ -6795,12 +7698,12 @@ class BufferedEmitter {
6795
7698
  this._hasListeners = false;
6796
7699
  this._isDeliveringMessages = false;
6797
7700
  this._bufferedMessages = [];
6798
- this._emitter = ( (new Emitter({
6799
- onFirstListenerAdd: () => {
7701
+ this._emitter = ( (new Emitter$1({
7702
+ onWillAddFirstListener: () => {
6800
7703
  this._hasListeners = true;
6801
7704
  queueMicrotask(() => this._deliverMessages());
6802
7705
  },
6803
- onLastListenerRemove: () => {
7706
+ onDidRemoveLastListener: () => {
6804
7707
  this._hasListeners = false;
6805
7708
  }
6806
7709
  })));
@@ -7055,10 +7958,10 @@ class ExtHostDocumentLine {
7055
7958
  }
7056
7959
  class ExtHostDocuments {
7057
7960
  constructor(mainContext, documentsAndEditors) {
7058
- this._onDidAddDocument = ( (new Emitter()));
7059
- this._onDidRemoveDocument = ( (new Emitter()));
7060
- this._onDidChangeDocument = ( (new Emitter()));
7061
- this._onDidSaveDocument = ( (new Emitter()));
7961
+ this._onDidAddDocument = ( (new Emitter$1()));
7962
+ this._onDidRemoveDocument = ( (new Emitter$1()));
7963
+ this._onDidChangeDocument = ( (new Emitter$1()));
7964
+ this._onDidSaveDocument = ( (new Emitter$1()));
7062
7965
  this.onDidAddDocument = this._onDidAddDocument.event;
7063
7966
  this.onDidRemoveDocument = this._onDidRemoveDocument.event;
7064
7967
  this.onDidChangeDocument = this._onDidChangeDocument.event;
@@ -7196,7 +8099,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7196
8099
  this._workspace = workspace;
7197
8100
  this._commands = commands;
7198
8101
  }
7199
- showQuickPick(itemsOrItemsPromise, options, token = CancellationToken.None) {
8102
+ showQuickPick(extension, itemsOrItemsPromise, options, token = CancellationToken.None) {
7200
8103
  this._onDidSelectItem = undefined;
7201
8104
  const itemsPromise = Promise.resolve(itemsOrItemsPromise);
7202
8105
  const instance = ++this._instances;
@@ -7214,6 +8117,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7214
8117
  if (result === widgetClosedMarker) {
7215
8118
  return undefined;
7216
8119
  }
8120
+ const allowedTooltips = isProposedApiEnabled(extension, 'quickPickItemTooltip');
7217
8121
  return itemsPromise.then(items => {
7218
8122
  const pickItems = [];
7219
8123
  for (let handle = 0; handle < items.length; handle++) {
@@ -7225,12 +8129,16 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7225
8129
  pickItems.push({ type: 'separator', label: item.label });
7226
8130
  }
7227
8131
  else {
8132
+ if (item.tooltip && !allowedTooltips) {
8133
+ console.warn(`Extension '${extension.identifier.value}' uses a tooltip which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${extension.identifier.value}`);
8134
+ }
7228
8135
  pickItems.push({
7229
8136
  label: item.label,
7230
8137
  description: item.description,
7231
8138
  detail: item.detail,
7232
8139
  picked: item.picked,
7233
8140
  alwaysShow: item.alwaysShow,
8141
+ tooltip: allowedTooltips ? MarkdownString.fromStrict(item.tooltip) : undefined,
7234
8142
  handle
7235
8143
  });
7236
8144
  }
@@ -7327,9 +8235,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7327
8235
  }
7328
8236
  $onDidAccept(sessionId) {
7329
8237
  const session = this._sessions.get(sessionId);
7330
- if (session) {
7331
- session._fireDidAccept();
7332
- }
8238
+ session?._fireDidAccept();
7333
8239
  }
7334
8240
  $onDidChangeActive(sessionId, handles) {
7335
8241
  const session = this._sessions.get(sessionId);
@@ -7355,9 +8261,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7355
8261
  }
7356
8262
  $onDidHide(sessionId) {
7357
8263
  const session = this._sessions.get(sessionId);
7358
- if (session) {
7359
- session._fireDidHide();
7360
- }
8264
+ session?._fireDidHide();
7361
8265
  }
7362
8266
  }
7363
8267
  class ExtHostQuickInput {
@@ -7373,10 +8277,10 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7373
8277
  this._value = '';
7374
8278
  this._buttons = [];
7375
8279
  this._handlesToButtons = ( (new Map()));
7376
- this._onDidAcceptEmitter = ( (new Emitter()));
7377
- this._onDidChangeValueEmitter = ( (new Emitter()));
7378
- this._onDidTriggerButtonEmitter = ( (new Emitter()));
7379
- this._onDidHideEmitter = ( (new Emitter()));
8280
+ this._onDidAcceptEmitter = ( (new Emitter$1()));
8281
+ this._onDidChangeValueEmitter = ( (new Emitter$1()));
8282
+ this._onDidTriggerButtonEmitter = ( (new Emitter$1()));
8283
+ this._onDidHideEmitter = ( (new Emitter$1()));
7380
8284
  this._pendingUpdate = { id: this._id };
7381
8285
  this._disposed = false;
7382
8286
  this._disposables = [
@@ -7571,6 +8475,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7571
8475
  class ExtHostQuickPick extends ExtHostQuickInput {
7572
8476
  constructor(extension, onDispose) {
7573
8477
  super(extension.identifier, onDispose);
8478
+ this.extension = extension;
7574
8479
  this._items = [];
7575
8480
  this._handlesToItems = ( (new Map()));
7576
8481
  this._itemsToHandles = ( (new Map()));
@@ -7580,10 +8485,10 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7580
8485
  this._sortByLabel = true;
7581
8486
  this._keepScrollPosition = false;
7582
8487
  this._activeItems = [];
7583
- this._onDidChangeActiveEmitter = ( (new Emitter()));
8488
+ this._onDidChangeActiveEmitter = ( (new Emitter$1()));
7584
8489
  this._selectedItems = [];
7585
- this._onDidChangeSelectionEmitter = ( (new Emitter()));
7586
- this._onDidTriggerItemButtonEmitter = ( (new Emitter()));
8490
+ this._onDidChangeSelectionEmitter = ( (new Emitter$1()));
8491
+ this._onDidTriggerItemButtonEmitter = ( (new Emitter$1()));
7587
8492
  this.onDidChangeActive = this._onDidChangeActiveEmitter.event;
7588
8493
  this.onDidChangeSelection = this._onDidChangeSelectionEmitter.event;
7589
8494
  this.onDidTriggerItemButton = this._onDidTriggerItemButtonEmitter.event;
@@ -7601,6 +8506,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7601
8506
  this._handlesToItems.set(i, item);
7602
8507
  this._itemsToHandles.set(item, i);
7603
8508
  });
8509
+ const allowedTooltips = isProposedApiEnabled(this.extension, 'quickPickItemTooltip');
7604
8510
  const pickItems = [];
7605
8511
  for (let handle = 0; handle < items.length; handle++) {
7606
8512
  const item = items[handle];
@@ -7608,6 +8514,9 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7608
8514
  pickItems.push({ type: 'separator', label: item.label });
7609
8515
  }
7610
8516
  else {
8517
+ if (item.tooltip && !allowedTooltips) {
8518
+ console.warn(`Extension '${this.extension.identifier.value}' uses a tooltip which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${this.extension.identifier.value}`);
8519
+ }
7611
8520
  pickItems.push({
7612
8521
  handle,
7613
8522
  label: item.label,
@@ -7615,6 +8524,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7615
8524
  detail: item.detail,
7616
8525
  picked: item.picked,
7617
8526
  alwaysShow: item.alwaysShow,
8527
+ tooltip: allowedTooltips ? MarkdownString.fromStrict(item.tooltip) : undefined,
7618
8528
  buttons: item.buttons?.map((button, i) => {
7619
8529
  return {
7620
8530
  ...getIconPathOrClass(button),
@@ -7722,6 +8632,13 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7722
8632
  this._prompt = prompt;
7723
8633
  this.update({ prompt });
7724
8634
  }
8635
+ get valueSelection() {
8636
+ return this._valueSelection;
8637
+ }
8638
+ set valueSelection(valueSelection) {
8639
+ this._valueSelection = valueSelection;
8640
+ this.update({ valueSelection });
8641
+ }
7725
8642
  get validationMessage() {
7726
8643
  return this._validationMessage;
7727
8644
  }
@@ -7742,7 +8659,23 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7742
8659
  (new ExtHostQuickOpenImpl(workspace, commands))
7743
8660
  );
7744
8661
  }
7745
- const IExtHostInitDataService = ( (createDecorator('IExtHostInitDataService')));
8662
+ const IURITransformerService = ( (createDecorator('IURITransformerService')));
8663
+ class URITransformerService {
8664
+ constructor(delegate) {
8665
+ if (!delegate) {
8666
+ this.transformIncoming = arg => arg;
8667
+ this.transformOutgoing = arg => arg;
8668
+ this.transformOutgoingURI = arg => arg;
8669
+ this.transformOutgoingScheme = arg => arg;
8670
+ }
8671
+ else {
8672
+ this.transformIncoming = delegate.transformIncoming.bind(delegate);
8673
+ this.transformOutgoing = delegate.transformOutgoing.bind(delegate);
8674
+ this.transformOutgoingURI = delegate.transformOutgoingURI.bind(delegate);
8675
+ this.transformOutgoingScheme = delegate.transformOutgoingScheme.bind(delegate);
8676
+ }
8677
+ }
8678
+ }
7746
8679
  function resultIsMatch(result) {
7747
8680
  return !!result.preview;
7748
8681
  }
@@ -7768,17 +8701,6 @@ function ignorePathCasing(uri, extHostFileSystemInfo) {
7768
8701
  return !(capabilities && ((capabilities & 1024) ));
7769
8702
  }
7770
8703
  class ExtHostWorkspaceImpl extends Workspace {
7771
- constructor(id, _name, folders, transient, configuration, _isUntitled, ignorePathCasing) {
7772
- super(id, folders.map(f => ( (new WorkspaceFolder(f)))), transient, configuration, ignorePathCasing);
7773
- this._name = _name;
7774
- this._isUntitled = _isUntitled;
7775
- this._workspaceFolders = [];
7776
- this._structure = TernarySearchTree.forUris(ignorePathCasing);
7777
- folders.forEach(folder => {
7778
- this._workspaceFolders.push(folder);
7779
- this._structure.set(folder.uri, folder);
7780
- });
7781
- }
7782
8704
  static toExtHostWorkspace(data, previousConfirmedWorkspace, previousUnconfirmedWorkspace, extHostFileSystemInfo) {
7783
8705
  if (!data) {
7784
8706
  return { workspace: null, added: [], removed: [] };
@@ -7825,6 +8747,17 @@ class ExtHostWorkspaceImpl extends Workspace {
7825
8747
  }
7826
8748
  return undefined;
7827
8749
  }
8750
+ constructor(id, _name, folders, transient, configuration, _isUntitled, ignorePathCasing) {
8751
+ super(id, folders.map(f => ( (new WorkspaceFolder(f)))), transient, configuration, ignorePathCasing);
8752
+ this._name = _name;
8753
+ this._isUntitled = _isUntitled;
8754
+ this._workspaceFolders = [];
8755
+ this._structure = TernarySearchTree.forUris(ignorePathCasing);
8756
+ folders.forEach(folder => {
8757
+ this._workspaceFolders.push(folder);
8758
+ this._structure.set(folder.uri, folder);
8759
+ });
8760
+ }
7828
8761
  get name() {
7829
8762
  return this._name;
7830
8763
  }
@@ -7845,15 +8778,19 @@ class ExtHostWorkspaceImpl extends Workspace {
7845
8778
  }
7846
8779
  }
7847
8780
  let ExtHostWorkspace = class ExtHostWorkspace {
7848
- constructor(extHostRpc, initData, extHostFileSystemInfo, logService) {
7849
- this._onDidChangeWorkspace = ( (new Emitter()));
8781
+ constructor(extHostRpc, initData, extHostFileSystemInfo, logService, uriTransformerService) {
8782
+ this._onDidChangeWorkspace = ( (new Emitter$1()));
7850
8783
  this.onDidChangeWorkspace = this._onDidChangeWorkspace.event;
7851
- this._onDidGrantWorkspaceTrust = ( (new Emitter()));
8784
+ this._onDidGrantWorkspaceTrust = ( (new Emitter$1()));
7852
8785
  this.onDidGrantWorkspaceTrust = this._onDidGrantWorkspaceTrust.event;
7853
8786
  this._activeSearchCallbacks = [];
7854
8787
  this._trusted = false;
8788
+ this._editSessionIdentityProviders = ( (new Map()));
8789
+ this._providerHandlePool = 0;
8790
+ this._onWillCreateEditSessionIdentityEvent = ( (new AsyncEmitter()));
7855
8791
  this._logService = logService;
7856
8792
  this._extHostFileSystemInfo = extHostFileSystemInfo;
8793
+ this._uriTransformerService = uriTransformerService;
7857
8794
  this._requestIdProvider = ( (new Counter()));
7858
8795
  this._barrier = ( (new Barrier()));
7859
8796
  this._proxy = extHostRpc.getProxy(MainContext.MainThreadWorkspace);
@@ -8145,12 +9082,89 @@ let ExtHostWorkspace = class ExtHostWorkspace {
8145
9082
  this._onDidGrantWorkspaceTrust.fire();
8146
9083
  }
8147
9084
  }
9085
+ registerEditSessionIdentityProvider(scheme, provider) {
9086
+ if (this._editSessionIdentityProviders.has(scheme)) {
9087
+ throw new Error(`A provider has already been registered for scheme ${scheme}`);
9088
+ }
9089
+ this._editSessionIdentityProviders.set(scheme, provider);
9090
+ const outgoingScheme = this._uriTransformerService.transformOutgoingScheme(scheme);
9091
+ const handle = this._providerHandlePool++;
9092
+ this._proxy.$registerEditSessionIdentityProvider(handle, outgoingScheme);
9093
+ return toDisposable(() => {
9094
+ this._editSessionIdentityProviders.delete(scheme);
9095
+ this._proxy.$unregisterEditSessionIdentityProvider(handle);
9096
+ });
9097
+ }
9098
+ async $getEditSessionIdentifier(workspaceFolder, cancellationToken) {
9099
+ this._logService.info('Getting edit session identifier for workspaceFolder', workspaceFolder);
9100
+ const folder = await this.resolveWorkspaceFolder(URI.revive(workspaceFolder));
9101
+ if (!folder) {
9102
+ this._logService.warn('Unable to resolve workspace folder');
9103
+ return undefined;
9104
+ }
9105
+ this._logService.info('Invoking #provideEditSessionIdentity for workspaceFolder', folder);
9106
+ const provider = this._editSessionIdentityProviders.get(folder.uri.scheme);
9107
+ this._logService.info(`Provider for scheme ${folder.uri.scheme} is defined: `, !!provider);
9108
+ if (!provider) {
9109
+ return undefined;
9110
+ }
9111
+ const result = await provider.provideEditSessionIdentity(folder, cancellationToken);
9112
+ this._logService.info('Provider returned edit session identifier: ', result);
9113
+ if (!result) {
9114
+ return undefined;
9115
+ }
9116
+ return result;
9117
+ }
9118
+ async $provideEditSessionIdentityMatch(workspaceFolder, identity1, identity2, cancellationToken) {
9119
+ this._logService.info('Getting edit session identifier for workspaceFolder', workspaceFolder);
9120
+ const folder = await this.resolveWorkspaceFolder(URI.revive(workspaceFolder));
9121
+ if (!folder) {
9122
+ this._logService.warn('Unable to resolve workspace folder');
9123
+ return undefined;
9124
+ }
9125
+ this._logService.info('Invoking #provideEditSessionIdentity for workspaceFolder', folder);
9126
+ const provider = this._editSessionIdentityProviders.get(folder.uri.scheme);
9127
+ this._logService.info(`Provider for scheme ${folder.uri.scheme} is defined: `, !!provider);
9128
+ if (!provider) {
9129
+ return undefined;
9130
+ }
9131
+ const result = await provider.provideEditSessionIdentityMatch?.(identity1, identity2, cancellationToken);
9132
+ this._logService.info('Provider returned edit session identifier match result: ', result);
9133
+ if (!result) {
9134
+ return undefined;
9135
+ }
9136
+ return result;
9137
+ }
9138
+ getOnWillCreateEditSessionIdentityEvent(extension) {
9139
+ return (listener, thisArg, disposables) => {
9140
+ const wrappedListener = function wrapped(e) { listener.call(thisArg, e); };
9141
+ wrappedListener.extension = extension;
9142
+ return this._onWillCreateEditSessionIdentityEvent.event(wrappedListener, undefined, disposables);
9143
+ };
9144
+ }
9145
+ async $onWillCreateEditSessionIdentity(workspaceFolder, token, timeout) {
9146
+ const folder = await this.resolveWorkspaceFolder(URI.revive(workspaceFolder));
9147
+ if (folder === undefined) {
9148
+ throw new Error('Unable to resolve workspace folder');
9149
+ }
9150
+ await this._onWillCreateEditSessionIdentityEvent.fireAsync({ workspaceFolder: folder }, token, async (thenable, listener) => {
9151
+ const now = Date.now();
9152
+ await Promise.resolve(thenable);
9153
+ if (Date.now() - now > timeout) {
9154
+ this._logService.warn('SLOW edit session create-participant', listener.extension.identifier);
9155
+ }
9156
+ });
9157
+ if (token.isCancellationRequested) {
9158
+ return undefined;
9159
+ }
9160
+ }
8148
9161
  };
8149
9162
  ExtHostWorkspace = ( (__decorate([
8150
9163
  ( (__param(0, IExtHostRpcService))),
8151
9164
  ( (__param(1, IExtHostInitDataService))),
8152
9165
  ( (__param(2, IExtHostFileSystemInfo))),
8153
- ( (__param(3, ILogService)))
9166
+ ( (__param(3, ILogService))),
9167
+ ( (__param(4, IURITransformerService)))
8154
9168
  ], ExtHostWorkspace)));
8155
9169
  const IExtHostWorkspace = ( (createDecorator('IExtHostWorkspace')));
8156
9170
  function parseSearchInclude(include) {
@@ -8416,29 +9430,15 @@ let MainThreadMessageService = class MainThreadMessageService {
8416
9430
  _showMessage(severity, message, commands, options) {
8417
9431
  return (
8418
9432
  (new Promise(resolve => {
8419
- const primaryActions = [];
8420
- class MessageItemAction extends Action {
8421
- constructor(id, label, handle) {
8422
- super(id, label, undefined, true, () => {
8423
- resolve(handle);
8424
- return Promise.resolve();
8425
- });
8426
- }
8427
- }
8428
- class ManageExtensionAction extends Action {
8429
- constructor(id, label, commandService) {
8430
- super(id.value, label, undefined, true, () => {
8431
- return commandService.executeCommand('_extensions.manage', id.value);
8432
- });
9433
+ const primaryActions = commands.map(command => toAction({
9434
+ id: `_extension_message_handle_${command.handle}`,
9435
+ label: command.title,
9436
+ enabled: true,
9437
+ run: () => {
9438
+ resolve(command.handle);
9439
+ return Promise.resolve();
8433
9440
  }
8434
- }
8435
- commands.forEach(command => {
8436
- primaryActions.push(( (new MessageItemAction(
8437
- '_extension_message_handle_' + command.handle,
8438
- command.title,
8439
- command.handle
8440
- ))));
8441
- });
9441
+ }));
8442
9442
  let source;
8443
9443
  if (options.source) {
8444
9444
  source = {
@@ -8451,11 +9451,13 @@ let MainThreadMessageService = class MainThreadMessageService {
8451
9451
  }
8452
9452
  const secondaryActions = [];
8453
9453
  if (options.source) {
8454
- secondaryActions.push(( (new ManageExtensionAction(
8455
- options.source.identifier,
8456
- (localize('manageExtension', "Manage Extension")),
8457
- this._commandService
8458
- ))));
9454
+ secondaryActions.push(toAction({
9455
+ id: options.source.identifier.value,
9456
+ label: ( (localize('manageExtension', "Manage Extension"))),
9457
+ run: () => {
9458
+ return this._commandService.executeCommand('_extensions.manage', options.source.identifier.value);
9459
+ }
9460
+ }));
8459
9461
  }
8460
9462
  const messageHandle = this._notificationService.notify({
8461
9463
  severity,
@@ -8464,32 +9466,49 @@ let MainThreadMessageService = class MainThreadMessageService {
8464
9466
  source
8465
9467
  });
8466
9468
  Event.once(messageHandle.onDidClose)(() => {
8467
- dispose(primaryActions);
8468
- dispose(secondaryActions);
8469
9469
  resolve(undefined);
8470
9470
  });
8471
9471
  }))
8472
9472
  );
8473
9473
  }
8474
9474
  async _showModalMessage(severity, message, detail, commands, useCustom) {
8475
- let cancelId = undefined;
8476
- const buttons = commands.map((command, index) => {
8477
- if (command.isCloseAffordance === true) {
8478
- cancelId = index;
9475
+ const buttons = [];
9476
+ let cancelButton = undefined;
9477
+ for (const command of commands) {
9478
+ const button = {
9479
+ label: command.title,
9480
+ run: () => command.handle
9481
+ };
9482
+ if (command.isCloseAffordance) {
9483
+ cancelButton = button;
8479
9484
  }
8480
- return command.title;
8481
- });
8482
- if (cancelId === undefined) {
9485
+ else {
9486
+ buttons.push(button);
9487
+ }
9488
+ }
9489
+ if (!cancelButton) {
8483
9490
  if (buttons.length > 0) {
8484
- buttons.push(( (localize('cancel', "Cancel"))));
9491
+ cancelButton = {
9492
+ label: ( (localize('cancel', "Cancel"))),
9493
+ run: () => undefined
9494
+ };
8485
9495
  }
8486
9496
  else {
8487
- buttons.push(( (localize('ok', "OK"))));
9497
+ cancelButton = {
9498
+ label: ( (localize({ key: 'ok', comment: ['&& denotes a mnemonic'] }, "&&OK"))),
9499
+ run: () => undefined
9500
+ };
8488
9501
  }
8489
- cancelId = buttons.length - 1;
8490
9502
  }
8491
- const { choice } = await this._dialogService.show(severity, message, buttons, { cancelId, custom: useCustom, detail });
8492
- return choice === commands.length ? undefined : commands[choice].handle;
9503
+ const { result } = await this._dialogService.prompt({
9504
+ type: severity,
9505
+ message,
9506
+ detail,
9507
+ buttons,
9508
+ cancelButton,
9509
+ custom: useCustom
9510
+ });
9511
+ return result;
8493
9512
  }
8494
9513
  };
8495
9514
  MainThreadMessageService = ( (__decorate([
@@ -8524,9 +9543,7 @@ class ExtHostProgress {
8524
9543
  const progressEnd = (handle) => {
8525
9544
  this._proxy.$progressEnd(handle);
8526
9545
  this._mapHandleToCancellationSource.delete(handle);
8527
- if (source) {
8528
- source.dispose();
8529
- }
9546
+ source?.dispose();
8530
9547
  };
8531
9548
  let p;
8532
9549
  try {
@@ -8623,12 +9640,12 @@ let MainThreadDocumentContentProviders = class MainThreadDocumentContentProvider
8623
9640
  this._languageService = _languageService;
8624
9641
  this._modelService = _modelService;
8625
9642
  this._editorWorkerService = _editorWorkerService;
8626
- this._resourceContentProvider = ( (new Map()));
9643
+ this._resourceContentProvider = ( (new DisposableMap()));
8627
9644
  this._pendingUpdate = ( (new Map()));
8628
9645
  this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostDocumentContentProviders);
8629
9646
  }
8630
9647
  dispose() {
8631
- dispose(( (this._resourceContentProvider.values())));
9648
+ this._resourceContentProvider.dispose();
8632
9649
  dispose(( (this._pendingUpdate.values())));
8633
9650
  }
8634
9651
  $registerTextContentProvider(handle, scheme) {
@@ -8647,11 +9664,7 @@ let MainThreadDocumentContentProviders = class MainThreadDocumentContentProvider
8647
9664
  this._resourceContentProvider.set(handle, registration);
8648
9665
  }
8649
9666
  $unregisterTextContentProvider(handle) {
8650
- const registration = this._resourceContentProvider.get(handle);
8651
- if (registration) {
8652
- registration.dispose();
8653
- this._resourceContentProvider.delete(handle);
8654
- }
9667
+ this._resourceContentProvider.deleteAndDispose(handle);
8655
9668
  }
8656
9669
  $onVirtualDocumentChange(uri, value) {
8657
9670
  const model = this._modelService.getModel(URI.revive(uri));
@@ -8659,9 +9672,7 @@ let MainThreadDocumentContentProviders = class MainThreadDocumentContentProvider
8659
9672
  return;
8660
9673
  }
8661
9674
  const pending = this._pendingUpdate.get(model.id);
8662
- if (pending) {
8663
- pending.cancel();
8664
- }
9675
+ pending?.cancel();
8665
9676
  const myToken = ( (new CancellationTokenSource()));
8666
9677
  this._pendingUpdate.set(model.id, myToken);
8667
9678
  this._editorWorkerService.computeMoreMinimalEdits(model.uri, [{ text: value, range: model.getFullModelRange() }]).then(edits => {
@@ -8838,6 +9849,12 @@ class ExtHostTextEditorOptions {
8838
9849
  set tabSize(value) {
8839
9850
  that._setTabSize(value);
8840
9851
  },
9852
+ get indentSize() {
9853
+ return that._indentSize;
9854
+ },
9855
+ set indentSize(value) {
9856
+ that._setIndentSize(value);
9857
+ },
8841
9858
  get insertSpaces() {
8842
9859
  return that._insertSpaces;
8843
9860
  },
@@ -8860,6 +9877,7 @@ class ExtHostTextEditorOptions {
8860
9877
  }
8861
9878
  _accept(source) {
8862
9879
  this._tabSize = source.tabSize;
9880
+ this._indentSize = source.indentSize;
8863
9881
  this._insertSpaces = source.insertSpaces;
8864
9882
  this._cursorStyle = source.cursorStyle;
8865
9883
  this._lineNumbers = TextEditorLineNumbersStyle.to(source.lineNumbers);
@@ -8896,6 +9914,38 @@ class ExtHostTextEditorOptions {
8896
9914
  tabSize: tabSize
8897
9915
  }));
8898
9916
  }
9917
+ _validateIndentSize(value) {
9918
+ if (value === 'tabSize') {
9919
+ return 'tabSize';
9920
+ }
9921
+ if (typeof value === 'number') {
9922
+ const r = Math.floor(value);
9923
+ return (r > 0 ? r : null);
9924
+ }
9925
+ if (typeof value === 'string') {
9926
+ const r = parseInt(value, 10);
9927
+ if (isNaN(r)) {
9928
+ return null;
9929
+ }
9930
+ return (r > 0 ? r : null);
9931
+ }
9932
+ return null;
9933
+ }
9934
+ _setIndentSize(value) {
9935
+ const indentSize = this._validateIndentSize(value);
9936
+ if (indentSize === null) {
9937
+ return;
9938
+ }
9939
+ if (typeof indentSize === 'number') {
9940
+ if (this._indentSize === indentSize) {
9941
+ return;
9942
+ }
9943
+ this._indentSize = indentSize;
9944
+ }
9945
+ this._warnOnError('setIndentSize', this._proxy.$trySetOptions(this._id, {
9946
+ indentSize: indentSize
9947
+ }));
9948
+ }
8899
9949
  _validateInsertSpaces(value) {
8900
9950
  if (value === 'auto') {
8901
9951
  return 'auto';
@@ -8947,6 +9997,18 @@ class ExtHostTextEditorOptions {
8947
9997
  bulkConfigurationUpdate.tabSize = tabSize;
8948
9998
  }
8949
9999
  }
10000
+ if (typeof newOptions.indentSize !== 'undefined') {
10001
+ const indentSize = this._validateIndentSize(newOptions.indentSize);
10002
+ if (indentSize === 'tabSize') {
10003
+ hasUpdate = true;
10004
+ bulkConfigurationUpdate.indentSize = indentSize;
10005
+ }
10006
+ else if (typeof indentSize === 'number' && this._indentSize !== indentSize) {
10007
+ this._indentSize = indentSize;
10008
+ hasUpdate = true;
10009
+ bulkConfigurationUpdate.indentSize = indentSize;
10010
+ }
10011
+ }
8950
10012
  if (typeof newOptions.insertSpaces !== 'undefined') {
8951
10013
  const insertSpaces = this._validateInsertSpaces(newOptions.insertSpaces);
8952
10014
  if (insertSpaces === 'auto') {
@@ -8998,7 +10060,7 @@ class ExtHostTextEditor {
8998
10060
  const that = this;
8999
10061
  this.value = ( (Object.freeze({
9000
10062
  get document() {
9001
- return document.getValue();
10063
+ return document.value;
9002
10064
  },
9003
10065
  set document(_value) {
9004
10066
  throw readonly('document');
@@ -9047,7 +10109,7 @@ class ExtHostTextEditor {
9047
10109
  if (that._disposed) {
9048
10110
  return Promise.reject(( (new Error('TextEditor#edit not possible on closed editors'))));
9049
10111
  }
9050
- const edit = ( (new TextEditorEdit(document.getValue(), options)));
10112
+ const edit = ( (new TextEditorEdit(document.value, options)));
9051
10113
  callback(edit);
9052
10114
  return that._applyEdit(edit);
9053
10115
  },
@@ -9078,7 +10140,7 @@ class ExtHostTextEditor {
9078
10140
  }
9079
10141
  }
9080
10142
  }
9081
- return _proxy.$tryInsertSnippet(id, document.getValue().version, snippet.value, ranges, options);
10143
+ return _proxy.$tryInsertSnippet(id, document.value.version, snippet.value, ranges, options);
9082
10144
  },
9083
10145
  setDecorations(decorationType, ranges) {
9084
10146
  const willBeEmpty = (ranges.length === 0);
@@ -9213,11 +10275,11 @@ let ExtHostDocumentsAndEditors = class ExtHostDocumentsAndEditors {
9213
10275
  this._logService = _logService;
9214
10276
  this._activeEditorId = null;
9215
10277
  this._editors = ( (new Map()));
9216
- this._documents = ( (new ResourceMap()));
9217
- this._onDidAddDocuments = ( (new Emitter()));
9218
- this._onDidRemoveDocuments = ( (new Emitter()));
9219
- this._onDidChangeVisibleTextEditors = ( (new Emitter()));
9220
- this._onDidChangeActiveTextEditor = ( (new Emitter()));
10278
+ this._documents = ( (new ResourceMap$1()));
10279
+ this._onDidAddDocuments = ( (new Emitter$1()));
10280
+ this._onDidRemoveDocuments = ( (new Emitter$1()));
10281
+ this._onDidChangeVisibleTextEditors = ( (new Emitter$1()));
10282
+ this._onDidChangeActiveTextEditor = ( (new Emitter$1()));
9221
10283
  this.onDidAddDocuments = this._onDidAddDocuments.event;
9222
10284
  this.onDidRemoveDocuments = this._onDidRemoveDocuments.event;
9223
10285
  this.onDidChangeVisibleTextEditors = this._onDidChangeVisibleTextEditors.event;
@@ -9345,12 +10407,12 @@ ExtHostDocumentsAndEditors = ( (__decorate([
9345
10407
  class ExtHostEditors {
9346
10408
  constructor(mainContext, _extHostDocumentsAndEditors) {
9347
10409
  this._extHostDocumentsAndEditors = _extHostDocumentsAndEditors;
9348
- this._onDidChangeTextEditorSelection = ( (new Emitter()));
9349
- this._onDidChangeTextEditorOptions = ( (new Emitter()));
9350
- this._onDidChangeTextEditorVisibleRanges = ( (new Emitter()));
9351
- this._onDidChangeTextEditorViewColumn = ( (new Emitter()));
9352
- this._onDidChangeActiveTextEditor = ( (new Emitter()));
9353
- this._onDidChangeVisibleTextEditors = ( (new Emitter()));
10410
+ this._onDidChangeTextEditorSelection = ( (new Emitter$1()));
10411
+ this._onDidChangeTextEditorOptions = ( (new Emitter$1()));
10412
+ this._onDidChangeTextEditorVisibleRanges = ( (new Emitter$1()));
10413
+ this._onDidChangeTextEditorViewColumn = ( (new Emitter$1()));
10414
+ this._onDidChangeActiveTextEditor = ( (new Emitter$1()));
10415
+ this._onDidChangeVisibleTextEditors = ( (new Emitter$1()));
9354
10416
  this.onDidChangeTextEditorSelection = this._onDidChangeTextEditorSelection.event;
9355
10417
  this.onDidChangeTextEditorOptions = this._onDidChangeTextEditorOptions.event;
9356
10418
  this.onDidChangeTextEditorVisibleRanges = this._onDidChangeTextEditorVisibleRanges.event;
@@ -9540,9 +10602,9 @@ let MainThreadDocuments = class MainThreadDocuments extends Disposable$1 {
9540
10602
  this._environmentService = _environmentService;
9541
10603
  this._uriIdentityService = _uriIdentityService;
9542
10604
  this._pathService = _pathService;
9543
- this._onIsCaughtUpWithContentChanges = this._store.add(( (new Emitter())));
10605
+ this._onIsCaughtUpWithContentChanges = this._store.add(( (new Emitter$1())));
9544
10606
  this.onIsCaughtUpWithContentChanges = this._onIsCaughtUpWithContentChanges.event;
9545
- this._modelTrackers = ( (new ResourceMap()));
10607
+ this._modelTrackers = ( (new ResourceMap$1()));
9546
10608
  this._modelReferenceCollection = this._store.add(( (new BoundModelReferenceCollection(_uriIdentityService.extUri))));
9547
10609
  this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostDocuments);
9548
10610
  this._store.add(_modelService.onModelLanguageChanged(this._onModelModeChanged, this));
@@ -9689,13 +10751,8 @@ MainThreadDocuments = ( (__decorate([
9689
10751
  ( (__param(7, IWorkingCopyFileService))),
9690
10752
  ( (__param(8, IPathService)))
9691
10753
  ], MainThreadDocuments)));
9692
- const Selection = monaco.Selection;
9693
- class MainThreadTextEditorProperties {
9694
- constructor(selections, options, visibleRanges) {
9695
- this.selections = selections;
9696
- this.options = options;
9697
- this.visibleRanges = visibleRanges;
9698
- }
10754
+ const Selection = monaco.Selection;
10755
+ class MainThreadTextEditorProperties {
9699
10756
  static readFromEditor(previousProperties, model, codeEditor) {
9700
10757
  const selections = MainThreadTextEditorProperties._readSelectionsFromCodeEditor(previousProperties, codeEditor);
9701
10758
  const options = MainThreadTextEditorProperties._readOptionsFromCodeEditor(previousProperties, model, codeEditor);
@@ -9730,8 +10787,8 @@ class MainThreadTextEditorProperties {
9730
10787
  let lineNumbers;
9731
10788
  if (codeEditor) {
9732
10789
  const options = codeEditor.getOptions();
9733
- const lineNumbersOpts = options.get(62 );
9734
- cursorStyle = options.get(24 );
10790
+ const lineNumbersOpts = options.get(64 );
10791
+ cursorStyle = options.get(25 );
9735
10792
  lineNumbers = lineNumbersOpts.renderType;
9736
10793
  }
9737
10794
  else if (previousProperties) {
@@ -9746,6 +10803,7 @@ class MainThreadTextEditorProperties {
9746
10803
  return {
9747
10804
  insertSpaces: modelOptions.insertSpaces,
9748
10805
  tabSize: modelOptions.tabSize,
10806
+ indentSize: modelOptions.indentSize,
9749
10807
  cursorStyle: cursorStyle,
9750
10808
  lineNumbers: lineNumbers
9751
10809
  };
@@ -9756,6 +10814,11 @@ class MainThreadTextEditorProperties {
9756
10814
  }
9757
10815
  return [];
9758
10816
  }
10817
+ constructor(selections, options, visibleRanges) {
10818
+ this.selections = selections;
10819
+ this.options = options;
10820
+ this.visibleRanges = visibleRanges;
10821
+ }
9759
10822
  generateDelta(oldProps, selectionChangeSource) {
9760
10823
  const delta = {
9761
10824
  options: null,
@@ -9793,6 +10856,7 @@ class MainThreadTextEditorProperties {
9793
10856
  return true;
9794
10857
  }
9795
10858
  return (a.tabSize === b.tabSize
10859
+ && a.indentSize === b.indentSize
9796
10860
  && a.insertSpaces === b.insertSpaces
9797
10861
  && a.cursorStyle === b.cursorStyle
9798
10862
  && a.lineNumbers === b.lineNumbers);
@@ -9810,7 +10874,7 @@ class MainThreadTextEditor {
9810
10874
  this._mainThreadDocuments = mainThreadDocuments;
9811
10875
  this._modelService = modelService;
9812
10876
  this._clipboardService = clipboardService;
9813
- this._onPropertiesChanged = ( (new Emitter()));
10877
+ this._onPropertiesChanged = ( (new Emitter$1()));
9814
10878
  this._modelListeners.add(this._model.onDidChangeOptions((e) => {
9815
10879
  this._updatePropertiesNow(null);
9816
10880
  }));
@@ -9945,6 +11009,9 @@ class MainThreadTextEditor {
9945
11009
  if (typeof newConfiguration.tabSize !== 'undefined') {
9946
11010
  newOpts.tabSize = newConfiguration.tabSize;
9947
11011
  }
11012
+ if (typeof newConfiguration.indentSize !== 'undefined') {
11013
+ newOpts.indentSize = newConfiguration.indentSize;
11014
+ }
9948
11015
  this._model.updateOptions(newOpts);
9949
11016
  }
9950
11017
  setConfiguration(newConfiguration) {
@@ -10067,7 +11134,9 @@ class MainThreadTextEditor {
10067
11134
  return false;
10068
11135
  }
10069
11136
  }
10070
- if (this._codeEditor.getModel().getVersionId() !== modelVersionId) ;
11137
+ if (this._codeEditor.getModel().getVersionId() !== modelVersionId) {
11138
+ return false;
11139
+ }
10071
11140
  const snippetController = SnippetController2.get(this._codeEditor);
10072
11141
  if (!snippetController) {
10073
11142
  return false;
@@ -10083,31 +11152,44 @@ class MainThreadTextEditor {
10083
11152
  return true;
10084
11153
  }
10085
11154
  }
10086
- function columnToEditorGroup(editorGroupService, column) {
10087
- if (typeof column !== 'number' ||
10088
- column === ACTIVE_GROUP ||
10089
- (editorGroupService.count === 1 && editorGroupService.activeGroup.isEmpty)) {
10090
- return ACTIVE_GROUP;
10091
- }
10092
- if (column === SIDE_GROUP) {
10093
- return SIDE_GROUP;
11155
+ var EditorActivation;
11156
+ ( ((function(EditorActivation) {
11157
+ EditorActivation[EditorActivation["ACTIVATE"] = 1] = "ACTIVATE";
11158
+ EditorActivation[EditorActivation["RESTORE"] = 2] = "RESTORE";
11159
+ EditorActivation[EditorActivation["PRESERVE"] = 3] = "PRESERVE";
11160
+ })(EditorActivation || (EditorActivation = {}))));
11161
+ var EditorResolution;
11162
+ ( ((function(EditorResolution) {
11163
+ EditorResolution[EditorResolution["PICK"] = 0] = "PICK";
11164
+ EditorResolution[EditorResolution["EXCLUSIVE_ONLY"] = 1] = "EXCLUSIVE_ONLY";
11165
+ })(EditorResolution || (EditorResolution = {}))));
11166
+ function columnToEditorGroup(editorGroupService, configurationService, column = ACTIVE_GROUP) {
11167
+ if (column === ACTIVE_GROUP || column === SIDE_GROUP) {
11168
+ return column;
10094
11169
  }
10095
- const groupInColumn = editorGroupService.getGroups(2 )[column];
10096
- if (groupInColumn) {
10097
- return groupInColumn.id;
11170
+ let groupInColumn = editorGroupService.getGroups(2 )[column];
11171
+ if (!groupInColumn && column < 9) {
11172
+ for (let i = 0; i <= column; i++) {
11173
+ const editorGroups = editorGroupService.getGroups(2 );
11174
+ if (!editorGroups[i]) {
11175
+ editorGroupService.addGroup(editorGroups[i - 1], preferredSideBySideGroupDirection(configurationService));
11176
+ }
11177
+ }
11178
+ groupInColumn = editorGroupService.getGroups(2 )[column];
10098
11179
  }
10099
- return SIDE_GROUP;
11180
+ return groupInColumn?.id ?? SIDE_GROUP;
10100
11181
  }
10101
11182
  function editorGroupToColumn(editorGroupService, editorGroup) {
10102
11183
  const group = (typeof editorGroup === 'number') ? editorGroupService.getGroup(editorGroup) : editorGroup;
10103
11184
  return editorGroupService.getGroups(2 ).indexOf(group ?? editorGroupService.activeGroup);
10104
11185
  }
10105
11186
  let MainThreadTextEditors = class MainThreadTextEditors {
10106
- constructor(_editorLocator, extHostContext, _codeEditorService, _editorService, _editorGroupService) {
11187
+ constructor(_editorLocator, extHostContext, _codeEditorService, _editorService, _editorGroupService, _configurationService) {
10107
11188
  this._editorLocator = _editorLocator;
10108
11189
  this._codeEditorService = _codeEditorService;
10109
11190
  this._editorService = _editorService;
10110
11191
  this._editorGroupService = _editorGroupService;
11192
+ this._configurationService = _configurationService;
10111
11193
  this._toDispose = ( (new DisposableStore()));
10112
11194
  this._instanceId = String(++MainThreadTextEditors.INSTANCE_COUNT);
10113
11195
  this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostEditors);
@@ -10165,17 +11247,19 @@ let MainThreadTextEditors = class MainThreadTextEditors {
10165
11247
  pinned: options.pinned,
10166
11248
  selection: options.selection,
10167
11249
  activation: options.preserveFocus ? EditorActivation.RESTORE : undefined,
10168
- override: EditorResolution.DISABLED
11250
+ override: EditorResolution.EXCLUSIVE_ONLY
10169
11251
  };
10170
11252
  const input = {
10171
11253
  resource: uri,
10172
11254
  options: editorOptions
10173
11255
  };
10174
- const editor = await this._editorService.openEditor(input, columnToEditorGroup(this._editorGroupService, options.position));
11256
+ const editor = await this._editorService.openEditor(input, columnToEditorGroup(this._editorGroupService, this._configurationService, options.position));
10175
11257
  if (!editor) {
10176
11258
  return undefined;
10177
11259
  }
10178
- return this._editorLocator.findTextEditorIdFor(editor);
11260
+ const editorControl = editor.getControl();
11261
+ const codeEditor = getCodeEditor(editorControl);
11262
+ return codeEditor ? this._editorLocator.getIdOfCodeEditor(codeEditor) : undefined;
10179
11263
  }
10180
11264
  async $tryShowEditor(id, position) {
10181
11265
  const mainThreadEditor = this._editorLocator.getEditor(id);
@@ -10184,7 +11268,7 @@ let MainThreadTextEditors = class MainThreadTextEditors {
10184
11268
  await this._editorService.openEditor({
10185
11269
  resource: model.uri,
10186
11270
  options: { preserveFocus: false }
10187
- }, columnToEditorGroup(this._editorGroupService, position));
11271
+ }, columnToEditorGroup(this._editorGroupService, this._configurationService, position));
10188
11272
  return;
10189
11273
  }
10190
11274
  }
@@ -10292,7 +11376,8 @@ MainThreadTextEditors.INSTANCE_COUNT = 0;
10292
11376
  MainThreadTextEditors = ( (__decorate([
10293
11377
  ( (__param(2, ICodeEditorService))),
10294
11378
  ( (__param(3, IEditorService))),
10295
- ( (__param(4, IEditorGroupsService)))
11379
+ ( (__param(4, IEditorGroupsService))),
11380
+ ( (__param(5, IConfigurationService)))
10296
11381
  ], MainThreadTextEditors)));
10297
11382
  class AbstractTextEditor {}
10298
11383
  class TextEditorSnapshot {
@@ -10326,11 +11411,6 @@ class DocumentAndEditorStateDelta {
10326
11411
  }
10327
11412
  }
10328
11413
  class DocumentAndEditorState {
10329
- constructor(documents, textEditors, activeEditor) {
10330
- this.documents = documents;
10331
- this.textEditors = textEditors;
10332
- this.activeEditor = activeEditor;
10333
- }
10334
11414
  static compute(before, after) {
10335
11415
  if (!before) {
10336
11416
  return (
@@ -10359,6 +11439,11 @@ class DocumentAndEditorState {
10359
11439
  ))
10360
11440
  );
10361
11441
  }
11442
+ constructor(documents, textEditors, activeEditor) {
11443
+ this.documents = documents;
11444
+ this.textEditors = textEditors;
11445
+ this.activeEditor = activeEditor;
11446
+ }
10362
11447
  }
10363
11448
  let MainThreadDocumentAndEditorStateComputer = class MainThreadDocumentAndEditorStateComputer {
10364
11449
  constructor(_onDidChangeState, _modelService, _codeEditorService, _editorService, _paneCompositeService) {
@@ -10368,7 +11453,7 @@ let MainThreadDocumentAndEditorStateComputer = class MainThreadDocumentAndEditor
10368
11453
  this._editorService = _editorService;
10369
11454
  this._paneCompositeService = _paneCompositeService;
10370
11455
  this._toDispose = ( (new DisposableStore()));
10371
- this._toDisposeOnEditorRemove = ( (new Map()));
11456
+ this._toDisposeOnEditorRemove = ( (new DisposableMap()));
10372
11457
  this._activeEditorOrder = 0 ;
10373
11458
  this._modelService.onModelAdded(this._updateStateOnModelAdd, this, this._toDispose);
10374
11459
  this._modelService.onModelRemoved(_ => this._updateState(), this, this._toDispose);
@@ -10383,16 +11468,16 @@ let MainThreadDocumentAndEditorStateComputer = class MainThreadDocumentAndEditor
10383
11468
  }
10384
11469
  dispose() {
10385
11470
  this._toDispose.dispose();
11471
+ this._toDisposeOnEditorRemove.dispose();
10386
11472
  }
10387
11473
  _onDidAddEditor(e) {
10388
11474
  this._toDisposeOnEditorRemove.set(e.getId(), combinedDisposable(e.onDidChangeModel(() => this._updateState()), e.onDidFocusEditorText(() => this._updateState()), e.onDidFocusEditorWidget(() => this._updateState(e))));
10389
11475
  this._updateState();
10390
11476
  }
10391
11477
  _onDidRemoveEditor(e) {
10392
- const sub = this._toDisposeOnEditorRemove.get(e.getId());
10393
- if (sub) {
10394
- this._toDisposeOnEditorRemove.delete(e.getId());
10395
- sub.dispose();
11478
+ const id = e.getId();
11479
+ if (this._toDisposeOnEditorRemove.has(id)) {
11480
+ this._toDisposeOnEditorRemove.deleteAndDispose(id);
10396
11481
  this._updateState();
10397
11482
  }
10398
11483
  }
@@ -10484,7 +11569,7 @@ MainThreadDocumentAndEditorStateComputer = ( (__decorate([
10484
11569
  ( (__param(4, IPaneCompositePartService)))
10485
11570
  ], MainThreadDocumentAndEditorStateComputer)));
10486
11571
  let MainThreadDocumentsAndEditors = class MainThreadDocumentsAndEditors {
10487
- constructor(extHostContext, _modelService, _textFileService, _editorService, codeEditorService, fileService, textModelResolverService, _editorGroupService, paneCompositeService, environmentService, workingCopyFileService, uriIdentityService, _clipboardService, pathService, instantiationService) {
11572
+ constructor(extHostContext, _modelService, _textFileService, _editorService, codeEditorService, fileService, textModelResolverService, _editorGroupService, paneCompositeService, environmentService, workingCopyFileService, uriIdentityService, _clipboardService, pathService, configurationService) {
10488
11573
  this._modelService = _modelService;
10489
11574
  this._textFileService = _textFileService;
10490
11575
  this._editorService = _editorService;
@@ -10510,7 +11595,8 @@ let MainThreadDocumentsAndEditors = class MainThreadDocumentsAndEditors {
10510
11595
  extHostContext,
10511
11596
  codeEditorService,
10512
11597
  this._editorService,
10513
- this._editorGroupService
11598
+ this._editorGroupService,
11599
+ configurationService
10514
11600
  ))));
10515
11601
  extHostContext.set(MainContext.MainThreadTextEditors, this._mainThreadEditors);
10516
11602
  this._toDispose.add(( (new MainThreadDocumentAndEditorStateComputer(
@@ -10643,7 +11729,7 @@ MainThreadDocumentsAndEditors = ( (__decorate([
10643
11729
  ( (__param(11, IUriIdentityService))),
10644
11730
  ( (__param(12, IClipboardService))),
10645
11731
  ( (__param(13, IPathService))),
10646
- ( (__param(14, IInstantiationService)))
11732
+ ( (__param(14, IConfigurationService)))
10647
11733
  ], MainThreadDocumentsAndEditors)));
10648
11734
  let MainThreadDiagnostics = class MainThreadDiagnostics {
10649
11735
  constructor(extHostContext, _markerService, _uriIdentService) {
@@ -10705,47 +11791,29 @@ MainThreadDiagnostics = ( (__decorate([
10705
11791
  ( (__param(1, IMarkerService))),
10706
11792
  ( (__param(2, IUriIdentityService)))
10707
11793
  ], MainThreadDiagnostics)));
10708
- function supportsTelemetry(productService, environmentService) {
10709
- return !(environmentService.disableTelemetry || !productService.enableTelemetry || environmentService.extensionTestsLocationURI);
10710
- }
10711
- function getTelemetryLevel(configurationService) {
10712
- const newConfig = configurationService.getValue(TELEMETRY_SETTING_ID);
10713
- const crashReporterConfig = configurationService.getValue('telemetry.enableCrashReporter');
10714
- const oldConfig = configurationService.getValue(TELEMETRY_OLD_SETTING_ID);
10715
- if (oldConfig === false || crashReporterConfig === false) {
10716
- return 0 ;
10717
- }
10718
- switch (newConfig ?? "all" ) {
10719
- case "all" :
10720
- return 3 ;
10721
- case "error" :
10722
- return 2 ;
10723
- case "crash" :
10724
- return 1 ;
10725
- case "off" :
10726
- return 0 ;
10727
- }
10728
- }
10729
11794
  var MainThreadTelemetry_1;
10730
11795
  let MainThreadTelemetry = MainThreadTelemetry_1 = class MainThreadTelemetry extends Disposable$1 {
10731
- constructor(extHostContext, _telemetryService, _environmentService, _productService) {
11796
+ constructor(extHostContext, _telemetryService, _configurationService, _environmentService, _productService) {
10732
11797
  super();
10733
11798
  this._telemetryService = _telemetryService;
11799
+ this._configurationService = _configurationService;
10734
11800
  this._environmentService = _environmentService;
10735
11801
  this._productService = _productService;
10736
11802
  this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostTelemetry);
10737
11803
  if (supportsTelemetry(this._productService, this._environmentService)) {
10738
- this._register(_telemetryService.telemetryLevel.onDidChange(level => {
10739
- this._proxy.$onDidChangeTelemetryLevel(level);
11804
+ this._register(this._configurationService.onDidChangeConfiguration(e => {
11805
+ if (e.affectsConfiguration(TELEMETRY_SETTING_ID) || e.affectsConfiguration(TELEMETRY_OLD_SETTING_ID)) {
11806
+ this._proxy.$onDidChangeTelemetryLevel(this.telemetryLevel);
11807
+ }
10740
11808
  }));
10741
11809
  }
10742
- this._proxy.$initializeTelemetryLevel(this.telemetryLevel, this._productService.enabledTelemetryLevels);
11810
+ this._proxy.$initializeTelemetryLevel(this.telemetryLevel, supportsTelemetry(this._productService, this._environmentService), this._productService.enabledTelemetryLevels);
10743
11811
  }
10744
11812
  get telemetryLevel() {
10745
11813
  if (!supportsTelemetry(this._productService, this._environmentService)) {
10746
11814
  return 0 ;
10747
11815
  }
10748
- return this._telemetryService.telemetryLevel.value;
11816
+ return this._telemetryService.telemetryLevel;
10749
11817
  }
10750
11818
  $publicLog(eventName, data = Object.create(null)) {
10751
11819
  data[MainThreadTelemetry_1._name] = true;
@@ -10759,8 +11827,9 @@ MainThreadTelemetry._name = 'pluginHostTelemetry';
10759
11827
  MainThreadTelemetry = MainThreadTelemetry_1 = ( (__decorate([
10760
11828
  extHostNamedCustomer(MainContext.MainThreadTelemetry),
10761
11829
  ( (__param(1, ITelemetryService))),
10762
- ( (__param(2, IEnvironmentService))),
10763
- ( (__param(3, IProductService)))
11830
+ ( (__param(2, IConfigurationService))),
11831
+ ( (__param(3, IEnvironmentService))),
11832
+ ( (__param(4, IProductService)))
10764
11833
  ], MainThreadTelemetry)));
10765
11834
  let ExtHostBulkEdits = class ExtHostBulkEdits {
10766
11835
  constructor(extHostRpc, extHostDocumentsAndEditors) {
@@ -10770,22 +11839,15 @@ let ExtHostBulkEdits = class ExtHostBulkEdits {
10770
11839
  getNotebookDocumentVersion: () => undefined
10771
11840
  };
10772
11841
  }
10773
- applyWorkspaceEdit(edit, extension) {
10774
- const allowSnippetTextEdit = isProposedApiEnabled(extension, 'snippetWorkspaceEdit');
10775
- const dto = WorkspaceEdit.from(edit, this._versionInformationProvider, allowSnippetTextEdit);
10776
- return this._proxy.$tryApplyWorkspaceEdit(dto);
11842
+ applyWorkspaceEdit(edit, extension, metadata) {
11843
+ const dto = WorkspaceEdit.from(edit, this._versionInformationProvider);
11844
+ return this._proxy.$tryApplyWorkspaceEdit(dto, undefined, metadata?.isRefactoring ?? false);
10777
11845
  }
10778
11846
  };
10779
11847
  ExtHostBulkEdits = ( (__decorate([
10780
11848
  ( (__param(0, IExtHostRpcService)))
10781
11849
  ], ExtHostBulkEdits)));
10782
11850
  class ResourceNotebookCellEdit extends ResourceEdit {
10783
- constructor(resource, cellEdit, notebookVersionId = undefined, metadata) {
10784
- super(metadata);
10785
- this.resource = resource;
10786
- this.cellEdit = cellEdit;
10787
- this.notebookVersionId = notebookVersionId;
10788
- }
10789
11851
  static is(candidate) {
10790
11852
  if (candidate instanceof ResourceNotebookCellEdit) {
10791
11853
  return true;
@@ -10801,35 +11863,24 @@ class ResourceNotebookCellEdit extends ResourceEdit {
10801
11863
  (new ResourceNotebookCellEdit(edit.resource, edit.cellEdit, edit.notebookVersionId, edit.metadata))
10802
11864
  );
10803
11865
  }
10804
- }
10805
- function reviveWorkspaceEditDto2(data) {
10806
- const edits = reviveWorkspaceEditDto(data)?.edits;
10807
- if (!edits) {
10808
- return [];
11866
+ constructor(resource, cellEdit, notebookVersionId = undefined, metadata) {
11867
+ super(metadata);
11868
+ this.resource = resource;
11869
+ this.cellEdit = cellEdit;
11870
+ this.notebookVersionId = notebookVersionId;
10809
11871
  }
10810
- return edits.map(edit => {
10811
- if (ResourceTextEdit.is(edit)) {
10812
- return ResourceTextEdit.lift(edit);
10813
- }
10814
- if (ResourceFileEdit.is(edit)) {
10815
- return ResourceFileEdit.lift(edit);
10816
- }
10817
- if (ResourceNotebookCellEdit.is(edit)) {
10818
- return ResourceNotebookCellEdit.lift(edit);
10819
- }
10820
- throw new Error('Unsupported edit');
10821
- });
10822
11872
  }
10823
11873
  let MainThreadBulkEdits = class MainThreadBulkEdits {
10824
- constructor(_extHostContext, _bulkEditService, _logService) {
11874
+ constructor(_extHostContext, _bulkEditService, _logService, _uriIdentService) {
10825
11875
  this._bulkEditService = _bulkEditService;
10826
11876
  this._logService = _logService;
11877
+ this._uriIdentService = _uriIdentService;
10827
11878
  }
10828
11879
  dispose() { }
10829
- $tryApplyWorkspaceEdit(dto, undoRedoGroupId) {
10830
- const edits = reviveWorkspaceEditDto2(dto);
10831
- return this._bulkEditService.apply(edits, { undoRedoGroupId }).then(() => true, err => {
10832
- this._logService.warn('IGNORING workspace edit', err);
11880
+ $tryApplyWorkspaceEdit(dto, undoRedoGroupId, isRefactoring) {
11881
+ const edits = reviveWorkspaceEditDto(dto, this._uriIdentService);
11882
+ return this._bulkEditService.apply(edits, { undoRedoGroupId, respectAutoSaveConfig: isRefactoring }).then((res) => res.isApplied, err => {
11883
+ this._logService.warn(`IGNORING workspace edit: ${err}`);
10833
11884
  return false;
10834
11885
  });
10835
11886
  }
@@ -10837,8 +11888,28 @@ let MainThreadBulkEdits = class MainThreadBulkEdits {
10837
11888
  MainThreadBulkEdits = ( (__decorate([
10838
11889
  extHostNamedCustomer(MainContext.MainThreadBulkEdits),
10839
11890
  ( (__param(1, IBulkEditService))),
10840
- ( (__param(2, ILogService)))
11891
+ ( (__param(2, ILogService))),
11892
+ ( (__param(3, IUriIdentityService)))
10841
11893
  ], MainThreadBulkEdits)));
11894
+ function reviveWorkspaceEditDto(data, uriIdentityService) {
11895
+ if (!data || !data.edits) {
11896
+ return data;
11897
+ }
11898
+ const result = revive(data);
11899
+ for (const edit of result.edits) {
11900
+ if (ResourceTextEdit.is(edit)) {
11901
+ edit.resource = uriIdentityService.asCanonicalUri(edit.resource);
11902
+ }
11903
+ if (ResourceFileEdit.is(edit)) {
11904
+ edit.newResource = edit.newResource && uriIdentityService.asCanonicalUri(edit.newResource);
11905
+ edit.oldResource = edit.oldResource && uriIdentityService.asCanonicalUri(edit.oldResource);
11906
+ }
11907
+ if (ResourceNotebookCellEdit.is(edit)) {
11908
+ edit.resource = uriIdentityService.asCanonicalUri(edit.resource);
11909
+ }
11910
+ }
11911
+ return data;
11912
+ }
10842
11913
  class ExtHostLanguages {
10843
11914
  constructor(mainContext, _documents, _commands, _uriTransformer) {
10844
11915
  this._documents = _documents;
@@ -11003,7 +12074,7 @@ let MainThreadLanguages = class MainThreadLanguages {
11003
12074
  this._resolverService = _resolverService;
11004
12075
  this._languageStatusService = _languageStatusService;
11005
12076
  this._disposables = ( (new DisposableStore()));
11006
- this._status = ( (new Map()));
12077
+ this._status = ( (new DisposableMap()));
11007
12078
  this._proxy = _extHostContext.getProxy(ExtHostContext.ExtHostLanguages);
11008
12079
  this._proxy.$acceptLanguageIds(_languageService.getRegisteredLanguageIds());
11009
12080
  this._disposables.add(_languageService.onDidChange(_ => {
@@ -11012,10 +12083,7 @@ let MainThreadLanguages = class MainThreadLanguages {
11012
12083
  }
11013
12084
  dispose() {
11014
12085
  this._disposables.dispose();
11015
- for (const status of ( (this._status.values()))) {
11016
- status.dispose();
11017
- }
11018
- this._status.clear();
12086
+ this._status.dispose();
11019
12087
  }
11020
12088
  async $changeLanguage(resource, languageId) {
11021
12089
  if (!this._languageService.isRegisteredLanguageId(languageId)) {
@@ -11064,31 +12132,15 @@ MainThreadLanguages = ( (__decorate([
11064
12132
  ( (__param(3, ITextModelService))),
11065
12133
  ( (__param(4, ILanguageStatusService)))
11066
12134
  ], MainThreadLanguages)));
11067
- class URITransformerService {
11068
- constructor(delegate) {
11069
- if (!delegate) {
11070
- this.transformIncoming = arg => arg;
11071
- this.transformOutgoing = arg => arg;
11072
- this.transformOutgoingURI = arg => arg;
11073
- this.transformOutgoingScheme = arg => arg;
11074
- }
11075
- else {
11076
- this.transformIncoming = delegate.transformIncoming.bind(delegate);
11077
- this.transformOutgoing = delegate.transformOutgoing.bind(delegate);
11078
- this.transformOutgoingURI = delegate.transformOutgoingURI.bind(delegate);
11079
- this.transformOutgoingScheme = delegate.transformOutgoingScheme.bind(delegate);
11080
- }
11081
- }
11082
- }
11083
12135
  let ExtHostWindow = class ExtHostWindow {
12136
+ get state() { return this._state; }
11084
12137
  constructor(extHostRpc) {
11085
- this._onDidChangeWindowState = ( (new Emitter()));
12138
+ this._onDidChangeWindowState = ( (new Emitter$1()));
11086
12139
  this.onDidChangeWindowState = this._onDidChangeWindowState.event;
11087
12140
  this._state = ExtHostWindow.InitialState;
11088
12141
  this._proxy = extHostRpc.getProxy(MainContext.MainThreadWindow);
11089
12142
  this._proxy.$getWindowVisibility().then(isFocused => this.$onDidChangeWindowFocus(isFocused));
11090
12143
  }
11091
- get state() { return this._state; }
11092
12144
  $onDidChangeWindowFocus(focused) {
11093
12145
  if (focused === this._state.focused) {
11094
12146
  return;
@@ -11136,16 +12188,11 @@ let MainThreadWindow = class MainThreadWindow {
11136
12188
  this.hostService = hostService;
11137
12189
  this.openerService = openerService;
11138
12190
  this.disposables = ( (new DisposableStore()));
11139
- this.resolved = ( (new Map()));
11140
12191
  this.proxy = extHostContext.getProxy(ExtHostContext.ExtHostWindow);
11141
12192
  Event.latch(hostService.onDidChangeFocus)(this.proxy.$onDidChangeWindowFocus, this.proxy, this.disposables);
11142
12193
  }
11143
12194
  dispose() {
11144
12195
  this.disposables.dispose();
11145
- for (const value of ( (this.resolved.values()))) {
11146
- value.dispose();
11147
- }
11148
- this.resolved.clear();
11149
12196
  }
11150
12197
  $getWindowVisibility() {
11151
12198
  return Promise.resolve(this.hostService.hasFocus);
@@ -11205,38 +12252,6 @@ class ExtHostClipboard {
11205
12252
  })));
11206
12253
  }
11207
12254
  }
11208
- class ExtHostTelemetry {
11209
- constructor() {
11210
- this._onDidChangeTelemetryEnabled = ( (new Emitter()));
11211
- this.onDidChangeTelemetryEnabled = this._onDidChangeTelemetryEnabled.event;
11212
- this._onDidChangeTelemetryConfiguration = ( (new Emitter()));
11213
- this.onDidChangeTelemetryConfiguration = this._onDidChangeTelemetryConfiguration.event;
11214
- this._productConfig = { usage: true, error: true };
11215
- this._level = 0 ;
11216
- }
11217
- getTelemetryConfiguration() {
11218
- return this._level === 3 ;
11219
- }
11220
- getTelemetryDetails() {
11221
- return {
11222
- isCrashEnabled: this._level >= 1 ,
11223
- isErrorsEnabled: this._productConfig.error ? this._level >= 2 : false,
11224
- isUsageEnabled: this._productConfig.usage ? this._level >= 3 : false
11225
- };
11226
- }
11227
- $initializeTelemetryLevel(level, productConfig) {
11228
- this._level = level;
11229
- this._productConfig = productConfig || { usage: true, error: true };
11230
- }
11231
- $onDidChangeTelemetryLevel(level) {
11232
- this._oldTelemetryEnablement = this.getTelemetryConfiguration();
11233
- this._level = level;
11234
- if (this._oldTelemetryEnablement !== this.getTelemetryConfiguration()) {
11235
- this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration());
11236
- }
11237
- this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails());
11238
- }
11239
- }
11240
12255
  function reverseEndianness(arr) {
11241
12256
  for (let i = 0, len = arr.length; i < len; i += 4) {
11242
12257
  const b0 = arr[i + 0];
@@ -11668,7 +12683,7 @@ class CodeActionAdapter {
11668
12683
  title: candidate.title,
11669
12684
  command: candidate.command && this._commands.toInternal(candidate.command, disposables),
11670
12685
  diagnostics: candidate.diagnostics && candidate.diagnostics.map(Diagnostic.from),
11671
- edit: candidate.edit && WorkspaceEdit.from(candidate.edit, undefined, isProposedApiEnabled(this._extension, 'snippetWorkspaceEdit')),
12686
+ edit: candidate.edit && WorkspaceEdit.from(candidate.edit, undefined),
11672
12687
  kind: candidate.kind && candidate.kind.value,
11673
12688
  isPreferred: candidate.isPreferred,
11674
12689
  disabled: candidate.disabled?.reason
@@ -11688,7 +12703,7 @@ class CodeActionAdapter {
11688
12703
  }
11689
12704
  const resolvedItem = (await this._provider.resolveCodeAction(item, token)) ?? item;
11690
12705
  return resolvedItem?.edit
11691
- ? WorkspaceEdit.from(resolvedItem.edit, undefined, isProposedApiEnabled(this._extension, 'snippetWorkspaceEdit'))
12706
+ ? WorkspaceEdit.from(resolvedItem.edit, undefined)
11692
12707
  : undefined;
11693
12708
  }
11694
12709
  releaseCodeActions(cachedId) {
@@ -11723,8 +12738,8 @@ class DocumentPasteEditProvider {
11723
12738
  async providePasteEdits(requestId, resource, ranges, dataTransferDto, token) {
11724
12739
  const doc = this._documents.getDocument(resource);
11725
12740
  const vscodeRanges = ranges.map(range => Range.to(range));
11726
- const dataTransfer = DataTransfer.toDataTransfer(dataTransferDto, async (index) => {
11727
- return (await this._proxy.$resolvePasteFileData(this._handle, requestId, index)).buffer;
12741
+ const dataTransfer = DataTransfer.toDataTransfer(dataTransferDto, async (id) => {
12742
+ return (await this._proxy.$resolvePasteFileData(this._handle, requestId, id)).buffer;
11728
12743
  });
11729
12744
  const edit = await this._provider.provideDocumentPasteEdits(doc, vscodeRanges, dataTransfer, token);
11730
12745
  if (!edit) {
@@ -11732,7 +12747,7 @@ class DocumentPasteEditProvider {
11732
12747
  }
11733
12748
  return {
11734
12749
  insertText: typeof edit.insertText === 'string' ? edit.insertText : { snippet: edit.insertText.value },
11735
- additionalEdit: edit.additionalEdit ? WorkspaceEdit.from(edit.additionalEdit, undefined, true) : undefined,
12750
+ additionalEdit: edit.additionalEdit ? WorkspaceEdit.from(edit.additionalEdit, undefined) : undefined,
11736
12751
  };
11737
12752
  }
11738
12753
  }
@@ -11829,14 +12844,14 @@ class NavigateTypeAdapter {
11829
12844
  }
11830
12845
  }
11831
12846
  class RenameAdapter {
12847
+ static supportsResolving(provider) {
12848
+ return typeof provider.prepareRename === 'function';
12849
+ }
11832
12850
  constructor(_documents, _provider, _logService) {
11833
12851
  this._documents = _documents;
11834
12852
  this._provider = _provider;
11835
12853
  this._logService = _logService;
11836
12854
  }
11837
- static supportsResolving(provider) {
11838
- return typeof provider.prepareRename === 'function';
11839
- }
11840
12855
  async provideRenameEdits(resource, position, newName, token) {
11841
12856
  const doc = this._documents.getDocument(resource);
11842
12857
  const pos = Position.to(position);
@@ -12060,6 +13075,9 @@ class DocumentRangeSemanticTokensAdapter {
12060
13075
  }
12061
13076
  }
12062
13077
  class CompletionsAdapter {
13078
+ static supportsResolving(provider) {
13079
+ return typeof provider.resolveCompletionItem === 'function';
13080
+ }
12063
13081
  constructor(_documents, _commands, _provider, _apiDeprecation, _extension) {
12064
13082
  this._documents = _documents;
12065
13083
  this._commands = _commands;
@@ -12069,9 +13087,6 @@ class CompletionsAdapter {
12069
13087
  this._cache = ( (new Cache('CompletionItem')));
12070
13088
  this._disposables = ( (new Map()));
12071
13089
  }
12072
- static supportsResolving(provider) {
12073
- return typeof provider.resolveCompletionItem === 'function';
12074
- }
12075
13090
  async provideCompletionItems(resource, position, context, token) {
12076
13091
  const doc = this._documents.getDocument(resource);
12077
13092
  const pos = Position.to(position);
@@ -12128,20 +13143,23 @@ class CompletionsAdapter {
12128
13143
  if (!disposables) {
12129
13144
  throw Error('DisposableStore is missing...');
12130
13145
  }
13146
+ const command = this._commands.toInternal(item.command, disposables);
12131
13147
  const result = {
12132
13148
  x: id,
12133
13149
  ["a" ]: item.label,
12134
13150
  ["b" ]: item.kind !== undefined ? CompletionItemKind.from(item.kind) : undefined,
12135
- ["n" ]: item.tags && item.tags.map(CompletionItemTag.from),
13151
+ ["m" ]: item.tags && item.tags.map(CompletionItemTag.from),
12136
13152
  ["c" ]: item.detail,
12137
13153
  ["d" ]: typeof item.documentation === 'undefined' ? undefined : MarkdownString.fromStrict(item.documentation),
12138
13154
  ["e" ]: item.sortText !== item.label ? item.sortText : undefined,
12139
13155
  ["f" ]: item.filterText !== item.label ? item.filterText : undefined,
12140
13156
  ["g" ]: item.preselect || undefined,
12141
- ["i" ]: item.keepWhitespace ? 1 : 0,
12142
- ["k" ]: item.commitCharacters,
13157
+ ["i" ]: item.keepWhitespace ? 1 : 0 ,
13158
+ ["k" ]: item.commitCharacters?.join(''),
12143
13159
  ["l" ]: item.additionalTextEdits && item.additionalTextEdits.map(TextEdit.from),
12144
- ["m" ]: this._commands.toInternal(item.command, disposables),
13160
+ ["n" ]: command?.$ident,
13161
+ ["o" ]: command?.id,
13162
+ ["p" ]: command?.$ident ? undefined : command?.arguments,
12145
13163
  };
12146
13164
  if (item.textEdit) {
12147
13165
  this._apiDeprecation.report('CompletionItem.textEdit', this._extension, `Use 'CompletionItem.insertText' and 'CompletionItem.range' instead.`);
@@ -12179,6 +13197,7 @@ class InlineCompletionAdapterBase {
12179
13197
  }
12180
13198
  disposeCompletions(pid) { }
12181
13199
  handleDidShowCompletionItem(pid, idx) { }
13200
+ handlePartialAccept(pid, idx, acceptedCharacters) { }
12182
13201
  }
12183
13202
  class InlineCompletionAdapter extends InlineCompletionAdapterBase {
12184
13203
  constructor(_extension, _documents, _provider, _commands) {
@@ -12194,8 +13213,10 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
12194
13213
  [InlineCompletionTriggerKind$1.Explicit]: InlineCompletionTriggerKind.Invoke,
12195
13214
  };
12196
13215
  }
12197
- get supportsHandleDidShowCompletionItem() {
12198
- return isProposedApiEnabled(this._extension, 'inlineCompletionsAdditions') && typeof this._provider.handleDidShowCompletionItem === 'function';
13216
+ get supportsHandleEvents() {
13217
+ return isProposedApiEnabled(this._extension, 'inlineCompletionsAdditions')
13218
+ && (typeof this._provider.handleDidShowCompletionItem === 'function'
13219
+ || typeof this._provider.handleDidPartiallyAcceptCompletionItem === 'function');
12199
13220
  }
12200
13221
  async provideInlineCompletions(resource, position, context, token) {
12201
13222
  const doc = this._documents.getDocument(resource);
@@ -12215,14 +13236,12 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
12215
13236
  if (token.isCancellationRequested) {
12216
13237
  return undefined;
12217
13238
  }
12218
- const normalizedResult = isArray(result) ? result : result.items;
12219
- const commands = this._isAdditionsProposedApiEnabled ? isArray(result) ? [] : result.commands || [] : [];
13239
+ const normalizedResult = Array.isArray(result) ? result : result.items;
13240
+ const commands = this._isAdditionsProposedApiEnabled ? Array.isArray(result) ? [] : result.commands || [] : [];
12220
13241
  let disposableStore = undefined;
12221
13242
  const pid = this._references.createReferenceId({
12222
13243
  dispose() {
12223
- if (disposableStore) {
12224
- disposableStore.dispose();
12225
- }
13244
+ disposableStore?.dispose();
12226
13245
  },
12227
13246
  items: normalizedResult
12228
13247
  });
@@ -12266,87 +13285,11 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
12266
13285
  }
12267
13286
  }
12268
13287
  }
12269
- }
12270
- class InlineCompletionAdapterNew extends InlineCompletionAdapterBase {
12271
- constructor(extension, _documents, _provider, _commands) {
12272
- super();
12273
- this.extension = extension;
12274
- this._documents = _documents;
12275
- this._provider = _provider;
12276
- this._commands = _commands;
12277
- this._references = ( (new ReferenceMap()));
12278
- this.isAdditionProposedApiEnabled = isProposedApiEnabled(this.extension, 'inlineCompletionsAdditions');
12279
- this.languageTriggerKindToVSCodeTriggerKind = {
12280
- [InlineCompletionTriggerKind$1.Automatic]: InlineCompletionTriggerKindNew.Automatic,
12281
- [InlineCompletionTriggerKind$1.Explicit]: InlineCompletionTriggerKindNew.Invoke,
12282
- };
12283
- }
12284
- async provideInlineCompletions(resource, position, context, token) {
12285
- const doc = this._documents.getDocument(resource);
12286
- const pos = Position.to(position);
12287
- const result = await this._provider.provideInlineCompletionItems(doc, pos, {
12288
- selectedCompletionInfo: context.selectedSuggestionInfo
12289
- ? {
12290
- range: Range.to(context.selectedSuggestionInfo.range),
12291
- text: context.selectedSuggestionInfo.text
12292
- }
12293
- : undefined,
12294
- triggerKind: this.languageTriggerKindToVSCodeTriggerKind[context.triggerKind]
12295
- }, token);
12296
- if (!result) {
12297
- return undefined;
12298
- }
12299
- if (token.isCancellationRequested) {
12300
- return undefined;
12301
- }
12302
- const normalizedResult = isArray(result) ? result : result.items;
12303
- const commands = isArray(result) ? [] : result.commands || [];
12304
- let disposableStore = undefined;
12305
- const pid = this._references.createReferenceId({
12306
- dispose() {
12307
- if (disposableStore) {
12308
- disposableStore.dispose();
12309
- }
12310
- },
12311
- items: normalizedResult
12312
- });
12313
- return {
12314
- pid,
12315
- items: normalizedResult.map((item, idx) => {
12316
- let command = undefined;
12317
- if (item.command) {
12318
- if (!disposableStore) {
12319
- disposableStore = ( (new DisposableStore()));
12320
- }
12321
- command = this._commands.toInternal(item.command, disposableStore);
12322
- }
12323
- const insertText = item.insertText;
12324
- return ({
12325
- insertText: typeof insertText === 'string' ? insertText : { snippet: insertText.value },
12326
- filterText: item.filterText,
12327
- range: item.range ? Range.from(item.range) : undefined,
12328
- command,
12329
- idx: idx,
12330
- completeBracketPairs: this.isAdditionProposedApiEnabled ? item.completeBracketPairs : false
12331
- });
12332
- }),
12333
- commands: commands.map(c => {
12334
- if (!disposableStore) {
12335
- disposableStore = ( (new DisposableStore()));
12336
- }
12337
- return this._commands.toInternal(c, disposableStore);
12338
- })
12339
- };
12340
- }
12341
- disposeCompletions(pid) {
12342
- const data = this._references.disposeReferenceId(pid);
12343
- data?.dispose();
12344
- }
12345
- handleDidShowCompletionItem(pid, idx) {
13288
+ handlePartialAccept(pid, idx, acceptedCharacters) {
12346
13289
  const completionItem = this._references.get(pid)?.items[idx];
12347
13290
  if (completionItem) {
12348
- if (this._provider.handleDidShowCompletionItem && this.isAdditionProposedApiEnabled) {
12349
- this._provider.handleDidShowCompletionItem(completionItem);
13291
+ if (this._provider.handleDidPartiallyAcceptCompletionItem && this._isAdditionsProposedApiEnabled) {
13292
+ this._provider.handleDidPartiallyAcceptCompletionItem(completionItem, acceptedCharacters);
12350
13293
  }
12351
13294
  }
12352
13295
  }
@@ -12786,8 +13729,8 @@ class DocumentOnDropEditAdapter {
12786
13729
  async provideDocumentOnDropEdits(requestId, uri, position, dataTransferDto, token) {
12787
13730
  const doc = this._documents.getDocument(uri);
12788
13731
  const pos = Position.to(position);
12789
- const dataTransfer = DataTransfer.toDataTransfer(dataTransferDto, async (index) => {
12790
- return (await this._proxy.$resolveDocumentOnDropFileData(this._handle, requestId, index)).buffer;
13732
+ const dataTransfer = DataTransfer.toDataTransfer(dataTransferDto, async (id) => {
13733
+ return (await this._proxy.$resolveDocumentOnDropFileData(this._handle, requestId, id)).buffer;
12791
13734
  });
12792
13735
  const edit = await this._provider.provideDocumentDropEdits(doc, pos, dataTransfer, token);
12793
13736
  if (!edit) {
@@ -12795,7 +13738,7 @@ class DocumentOnDropEditAdapter {
12795
13738
  }
12796
13739
  return {
12797
13740
  insertText: typeof edit.insertText === 'string' ? edit.insertText : { snippet: edit.insertText.value },
12798
- additionalEdit: edit.additionalEdit ? WorkspaceEdit.from(edit.additionalEdit, undefined, true) : undefined,
13741
+ additionalEdit: edit.additionalEdit ? WorkspaceEdit.from(edit.additionalEdit, undefined) : undefined,
12799
13742
  };
12800
13743
  }
12801
13744
  }
@@ -12806,15 +13749,16 @@ class AdapterData {
12806
13749
  }
12807
13750
  }
12808
13751
  class ExtHostLanguageFeatures {
12809
- constructor(mainContext, uriTransformer, documents, commands, diagnostics, logService, apiDeprecationService) {
13752
+ constructor(mainContext, _uriTransformer, _documents, _commands, _diagnostics, _logService, _apiDeprecation, _extensionTelemetry) {
13753
+ this._uriTransformer = _uriTransformer;
13754
+ this._documents = _documents;
13755
+ this._commands = _commands;
13756
+ this._diagnostics = _diagnostics;
13757
+ this._logService = _logService;
13758
+ this._apiDeprecation = _apiDeprecation;
13759
+ this._extensionTelemetry = _extensionTelemetry;
12810
13760
  this._adapter = ( (new Map()));
12811
- this._uriTransformer = uriTransformer;
12812
13761
  this._proxy = mainContext.getProxy(MainContext.MainThreadLanguageFeatures);
12813
- this._documents = documents;
12814
- this._commands = commands;
12815
- this._diagnostics = diagnostics;
12816
- this._logService = logService;
12817
- this._apiDeprecation = apiDeprecationService;
12818
13762
  }
12819
13763
  _transformDocumentSelector(selector) {
12820
13764
  return DocumentSelector.from(selector, this._uriTransformer);
@@ -12844,6 +13788,7 @@ class ExtHostLanguageFeatures {
12844
13788
  if (!isCancellationError(err)) {
12845
13789
  this._logService.error(`[${data.extension.identifier.value}] provider FAILED`);
12846
13790
  this._logService.error(err);
13791
+ this._extensionTelemetry.onExtensionError(data.extension.identifier, err);
12847
13792
  }
12848
13793
  }).finally(() => {
12849
13794
  if (!doNotLog) {
@@ -13118,12 +14063,7 @@ class ExtHostLanguageFeatures {
13118
14063
  registerInlineCompletionsProvider(extension, selector, provider) {
13119
14064
  const adapter = ( (new InlineCompletionAdapter(extension, this._documents, provider, this._commands.converter)));
13120
14065
  const handle = this._addNewAdapter(adapter, extension);
13121
- this._proxy.$registerInlineCompletionsSupport(handle, this._transformDocumentSelector(selector), adapter.supportsHandleDidShowCompletionItem);
13122
- return this._createDisposable(handle);
13123
- }
13124
- registerInlineCompletionsProviderNew(extension, selector, provider) {
13125
- const handle = this._addNewAdapter(( (new InlineCompletionAdapterNew(extension, this._documents, provider, this._commands.converter))), extension);
13126
- this._proxy.$registerInlineCompletionsSupport(handle, this._transformDocumentSelector(selector), true);
14066
+ this._proxy.$registerInlineCompletionsSupport(handle, this._transformDocumentSelector(selector), adapter.supportsHandleEvents);
13127
14067
  return this._createDisposable(handle);
13128
14068
  }
13129
14069
  $provideInlineCompletions(handle, resource, position, context, token) {
@@ -13134,6 +14074,11 @@ class ExtHostLanguageFeatures {
13134
14074
  adapter.handleDidShowCompletionItem(pid, idx);
13135
14075
  }, undefined, undefined);
13136
14076
  }
14077
+ $handleInlineCompletionPartialAccept(handle, pid, idx, acceptedCharacters) {
14078
+ this._withAdapter(handle, InlineCompletionAdapterBase, async (adapter) => {
14079
+ adapter.handlePartialAccept(pid, idx, acceptedCharacters);
14080
+ }, undefined, undefined);
14081
+ }
13137
14082
  $freeInlineCompletionsList(handle, pid) {
13138
14083
  this._withAdapter(handle, InlineCompletionAdapterBase, async (adapter) => { adapter.disposeCompletions(pid); }, undefined, undefined);
13139
14084
  }
@@ -13209,7 +14154,7 @@ class ExtHostLanguageFeatures {
13209
14154
  (new FoldingProviderAdapter(this._documents, provider)),
13210
14155
  extension
13211
14156
  ))));
13212
- this._proxy.$registerFoldingRangeProvider(handle, this._transformDocumentSelector(selector), eventHandle);
14157
+ this._proxy.$registerFoldingRangeProvider(handle, this._transformDocumentSelector(selector), extension.identifier, eventHandle);
13213
14158
  let result = this._createDisposable(handle);
13214
14159
  if (eventHandle !== undefined) {
13215
14160
  const subscription = provider.onDidChangeFoldingRanges(() => this._proxy.$emitFoldingRangeEvent(eventHandle));
@@ -13366,14 +14311,18 @@ class DataTransferCache {
13366
14311
  }
13367
14312
  };
13368
14313
  }
13369
- async resolveDropFileData(requestId, dataItemIndex) {
14314
+ async resolveDropFileData(requestId, dataItemId) {
13370
14315
  const entry = this.dataTransfers.get(requestId);
13371
14316
  if (!entry) {
13372
14317
  throw new Error('No data transfer found');
13373
14318
  }
13374
- const file = entry[dataItemIndex]?.asFile();
14319
+ const item = entry.find(x => x.id === dataItemId);
14320
+ if (!item) {
14321
+ throw new Error('No item found in data transfer');
14322
+ }
14323
+ const file = item.asFile();
13375
14324
  if (!file) {
13376
- throw new Error('No file item found in data transfer');
14325
+ throw new Error('Found data transfer item is not a file');
13377
14326
  }
13378
14327
  return VSBuffer.wrap(await file.data());
13379
14328
  }
@@ -13411,12 +14360,13 @@ var WorkspaceSymbolProviderRegistry;
13411
14360
  const TypeHierarchyProviderRegistry = ( (new LanguageFeatureRegistry()));
13412
14361
  var MainThreadLanguageFeatures_1;
13413
14362
  let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThreadLanguageFeatures extends Disposable$1 {
13414
- constructor(extHostContext, _languageService, _languageConfigurationService, _languageFeaturesService) {
14363
+ constructor(extHostContext, _languageService, _languageConfigurationService, _languageFeaturesService, _uriIdentService) {
13415
14364
  super();
13416
14365
  this._languageService = _languageService;
13417
14366
  this._languageConfigurationService = _languageConfigurationService;
13418
14367
  this._languageFeaturesService = _languageFeaturesService;
13419
- this._registrations = ( (new Map()));
14368
+ this._uriIdentService = _uriIdentService;
14369
+ this._registrations = this._register(( (new DisposableMap())));
13420
14370
  this._pasteEditProviders = ( (new Map()));
13421
14371
  this._documentOnDropEditProviders = ( (new Map()));
13422
14372
  this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostLanguageFeatures);
@@ -13449,19 +14399,8 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13449
14399
  updateAllWordDefinitions();
13450
14400
  }
13451
14401
  }
13452
- dispose() {
13453
- for (const registration of ( (this._registrations.values()))) {
13454
- registration.dispose();
13455
- }
13456
- this._registrations.clear();
13457
- super.dispose();
13458
- }
13459
14402
  $unregister(handle) {
13460
- const registration = this._registrations.get(handle);
13461
- if (registration) {
13462
- registration.dispose();
13463
- this._registrations.delete(handle);
13464
- }
14403
+ this._registrations.deleteAndDispose(handle);
13465
14404
  }
13466
14405
  static _reviveLocationDto(data) {
13467
14406
  if (!data) {
@@ -13502,8 +14441,8 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13502
14441
  return data;
13503
14442
  }
13504
14443
  }
13505
- static _reviveCodeActionDto(data) {
13506
- data?.forEach(code => reviveWorkspaceEditDto(code.edit));
14444
+ static _reviveCodeActionDto(data, uriIdentService) {
14445
+ data?.forEach(code => reviveWorkspaceEditDto(code.edit, uriIdentService));
13507
14446
  return data;
13508
14447
  }
13509
14448
  static _reviveLinkDTO(data) {
@@ -13549,7 +14488,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13549
14488
  }
13550
14489
  };
13551
14490
  if (typeof eventHandle === 'number') {
13552
- const emitter = ( (new Emitter()));
14491
+ const emitter = ( (new Emitter$1()));
13553
14492
  this._registrations.set(eventHandle, emitter);
13554
14493
  provider.onDidChange = emitter.event;
13555
14494
  }
@@ -13557,7 +14496,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13557
14496
  }
13558
14497
  $emitCodeLensEvent(eventHandle, event) {
13559
14498
  const obj = this._registrations.get(eventHandle);
13560
- if (obj instanceof Emitter) {
14499
+ if (obj instanceof Emitter$1) {
13561
14500
  obj.fire(event);
13562
14501
  }
13563
14502
  }
@@ -13610,7 +14549,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13610
14549
  }
13611
14550
  };
13612
14551
  if (typeof eventHandle === 'number') {
13613
- const emitter = ( (new Emitter()));
14552
+ const emitter = ( (new Emitter$1()));
13614
14553
  this._registrations.set(eventHandle, emitter);
13615
14554
  provider.onDidChangeInlineValues = emitter.event;
13616
14555
  }
@@ -13618,7 +14557,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13618
14557
  }
13619
14558
  $emitInlineValuesEvent(eventHandle, event) {
13620
14559
  const obj = this._registrations.get(eventHandle);
13621
- if (obj instanceof Emitter) {
14560
+ if (obj instanceof Emitter$1) {
13622
14561
  obj.fire(event);
13623
14562
  }
13624
14563
  }
@@ -13658,7 +14597,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13658
14597
  return undefined;
13659
14598
  }
13660
14599
  return {
13661
- actions: MainThreadLanguageFeatures_1._reviveCodeActionDto(listDto.actions),
14600
+ actions: MainThreadLanguageFeatures_1._reviveCodeActionDto(listDto.actions, this._uriIdentService),
13662
14601
  dispose: () => {
13663
14602
  if (typeof listDto.cacheId === 'number') {
13664
14603
  this._proxy.$releaseCodeActions(handle, listDto.cacheId);
@@ -13673,23 +14612,23 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13673
14612
  if (supportsResolve) {
13674
14613
  provider.resolveCodeAction = async (codeAction, token) => {
13675
14614
  const data = await this._proxy.$resolveCodeAction(handle, codeAction.cacheId, token);
13676
- codeAction.edit = reviveWorkspaceEditDto(data);
14615
+ codeAction.edit = reviveWorkspaceEditDto(data, this._uriIdentService);
13677
14616
  return codeAction;
13678
14617
  };
13679
14618
  }
13680
14619
  this._registrations.set(handle, this._languageFeaturesService.codeActionProvider.register(selector, provider));
13681
14620
  }
13682
14621
  $registerPasteEditProvider(handle, selector, supportsCopy, pasteMimeTypes) {
13683
- const provider = ( (new MainThreadPasteEditProvider(handle, this._proxy, supportsCopy, pasteMimeTypes)));
14622
+ const provider = ( (new MainThreadPasteEditProvider(handle, this._proxy, supportsCopy, pasteMimeTypes, this._uriIdentService)));
13684
14623
  this._pasteEditProviders.set(handle, provider);
13685
14624
  this._registrations.set(handle, combinedDisposable(this._languageFeaturesService.documentPasteEditProvider.register(selector, provider), toDisposable(() => this._pasteEditProviders.delete(handle))));
13686
14625
  }
13687
- $resolvePasteFileData(handle, requestId, dataIndex) {
14626
+ $resolvePasteFileData(handle, requestId, dataId) {
13688
14627
  const provider = this._pasteEditProviders.get(handle);
13689
14628
  if (!provider) {
13690
14629
  throw new Error('Could not find provider');
13691
14630
  }
13692
- return provider.resolveFileData(requestId, dataIndex);
14631
+ return provider.resolveFileData(requestId, dataId);
13693
14632
  }
13694
14633
  $registerDocumentFormattingSupport(handle, selector, extensionId, displayName) {
13695
14634
  this._registrations.set(handle, this._languageFeaturesService.documentFormattingEditProvider.register(selector, {
@@ -13741,7 +14680,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13741
14680
  $registerRenameSupport(handle, selector, supportResolveLocation) {
13742
14681
  this._registrations.set(handle, this._languageFeaturesService.renameProvider.register(selector, {
13743
14682
  provideRenameEdits: (model, position, newName, token) => {
13744
- return this._proxy.$provideRenameEdits(handle, model.uri, position, newName, token).then(reviveWorkspaceEditDto);
14683
+ return this._proxy.$provideRenameEdits(handle, model.uri, position, newName, token).then(data => reviveWorkspaceEditDto(data, this._uriIdentService));
13745
14684
  },
13746
14685
  resolveRenameLocation: supportResolveLocation
13747
14686
  ? (model, position, token) => this._proxy.$resolveRenameLocation(handle, model.uri, position, token)
@@ -13751,7 +14690,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13751
14690
  $registerDocumentSemanticTokensProvider(handle, selector, legend, eventHandle) {
13752
14691
  let event = undefined;
13753
14692
  if (typeof eventHandle === 'number') {
13754
- const emitter = ( (new Emitter()));
14693
+ const emitter = ( (new Emitter$1()));
13755
14694
  this._registrations.set(eventHandle, emitter);
13756
14695
  event = emitter.event;
13757
14696
  }
@@ -13759,7 +14698,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13759
14698
  }
13760
14699
  $emitDocumentSemanticTokensEvent(eventHandle) {
13761
14700
  const obj = this._registrations.get(eventHandle);
13762
- if (obj instanceof Emitter) {
14701
+ if (obj instanceof Emitter$1) {
13763
14702
  obj.fire(undefined);
13764
14703
  }
13765
14704
  }
@@ -13768,10 +14707,13 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13768
14707
  }
13769
14708
  static _inflateSuggestDto(defaultRange, data) {
13770
14709
  const label = data["a" ];
14710
+ const commandId = data["o" ];
14711
+ const commandIdent = data["n" ];
14712
+ const commitChars = data["k" ];
13771
14713
  return {
13772
14714
  label,
13773
14715
  kind: data["b" ] ?? 9 ,
13774
- tags: data["n" ],
14716
+ tags: data["m" ],
13775
14717
  detail: data["c" ],
13776
14718
  documentation: data["d" ],
13777
14719
  sortText: data["e" ],
@@ -13780,9 +14722,14 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13780
14722
  insertText: data["h" ] ?? (typeof label === 'string' ? label : label.label),
13781
14723
  range: data["j" ] ?? defaultRange,
13782
14724
  insertTextRules: data["i" ],
13783
- commitCharacters: data["k" ],
14725
+ commitCharacters: commitChars ? Array.from(commitChars) : undefined,
13784
14726
  additionalTextEdits: data["l" ],
13785
- command: data["m" ],
14727
+ command: commandId ? {
14728
+ $ident: commandIdent,
14729
+ id: commandId,
14730
+ title: '',
14731
+ arguments: commandIdent ? [commandIdent] : data["p" ],
14732
+ } : undefined,
13786
14733
  _id: data.x,
13787
14734
  };
13788
14735
  }
@@ -13820,16 +14767,21 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13820
14767
  }
13821
14768
  this._registrations.set(handle, this._languageFeaturesService.completionProvider.register(selector, provider));
13822
14769
  }
13823
- $registerInlineCompletionsSupport(handle, selector, supportsHandleDidShowCompletionItem) {
14770
+ $registerInlineCompletionsSupport(handle, selector, supportsHandleEvents) {
13824
14771
  const provider = {
13825
14772
  provideInlineCompletions: async (model, position, context, token) => {
13826
14773
  return this._proxy.$provideInlineCompletions(handle, model.uri, position, context, token);
13827
14774
  },
13828
14775
  handleItemDidShow: async (completions, item) => {
13829
- if (supportsHandleDidShowCompletionItem) {
14776
+ if (supportsHandleEvents) {
13830
14777
  await this._proxy.$handleInlineCompletionDidShow(handle, completions.pid, item.idx);
13831
14778
  }
13832
14779
  },
14780
+ handlePartialAccept: async (completions, item, acceptedCharacters) => {
14781
+ if (supportsHandleEvents) {
14782
+ await this._proxy.$handleInlineCompletionPartialAccept(handle, completions.pid, item.idx, acceptedCharacters);
14783
+ }
14784
+ },
13833
14785
  freeInlineCompletions: (completions) => {
13834
14786
  this._proxy.$freeInlineCompletionsList(handle, completions.pid);
13835
14787
  }
@@ -13893,7 +14845,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13893
14845
  };
13894
14846
  }
13895
14847
  if (typeof eventHandle === 'number') {
13896
- const emitter = ( (new Emitter()));
14848
+ const emitter = ( (new Emitter$1()));
13897
14849
  this._registrations.set(eventHandle, emitter);
13898
14850
  provider.onDidChangeInlayHints = emitter.event;
13899
14851
  }
@@ -13901,7 +14853,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13901
14853
  }
13902
14854
  $emitInlayHintsEvent(eventHandle) {
13903
14855
  const obj = this._registrations.get(eventHandle);
13904
- if (obj instanceof Emitter) {
14856
+ if (obj instanceof Emitter$1) {
13905
14857
  obj.fire(undefined);
13906
14858
  }
13907
14859
  }
@@ -13965,14 +14917,15 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13965
14917
  }
13966
14918
  }));
13967
14919
  }
13968
- $registerFoldingRangeProvider(handle, selector, eventHandle) {
14920
+ $registerFoldingRangeProvider(handle, selector, extensionId, eventHandle) {
13969
14921
  const provider = {
14922
+ id: extensionId.value,
13970
14923
  provideFoldingRanges: (model, context, token) => {
13971
14924
  return this._proxy.$provideFoldingRanges(handle, model.uri, context, token);
13972
14925
  }
13973
14926
  };
13974
14927
  if (typeof eventHandle === 'number') {
13975
- const emitter = ( (new Emitter()));
14928
+ const emitter = ( (new Emitter$1()));
13976
14929
  this._registrations.set(eventHandle, emitter);
13977
14930
  provider.onDidChange = emitter.event;
13978
14931
  }
@@ -13980,7 +14933,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13980
14933
  }
13981
14934
  $emitFoldingRangeEvent(eventHandle, event) {
13982
14935
  const obj = this._registrations.get(eventHandle);
13983
- if (obj instanceof Emitter) {
14936
+ if (obj instanceof Emitter$1) {
13984
14937
  obj.fire(event);
13985
14938
  }
13986
14939
  }
@@ -14112,28 +15065,30 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
14112
15065
  }));
14113
15066
  }
14114
15067
  $registerDocumentOnDropEditProvider(handle, selector) {
14115
- const provider = ( (new MainThreadDocumentOnDropEditProvider(handle, this._proxy)));
15068
+ const provider = ( (new MainThreadDocumentOnDropEditProvider(handle, this._proxy, this._uriIdentService)));
14116
15069
  this._documentOnDropEditProviders.set(handle, provider);
14117
15070
  this._registrations.set(handle, combinedDisposable(this._languageFeaturesService.documentOnDropEditProvider.register(selector, provider), toDisposable(() => this._documentOnDropEditProviders.delete(handle))));
14118
15071
  }
14119
- async $resolveDocumentOnDropFileData(handle, requestId, dataIndex) {
15072
+ async $resolveDocumentOnDropFileData(handle, requestId, dataId) {
14120
15073
  const provider = this._documentOnDropEditProviders.get(handle);
14121
15074
  if (!provider) {
14122
15075
  throw new Error('Could not find provider');
14123
15076
  }
14124
- return provider.resolveDocumentOnDropFileData(requestId, dataIndex);
15077
+ return provider.resolveDocumentOnDropFileData(requestId, dataId);
14125
15078
  }
14126
15079
  };
14127
15080
  MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = ( (__decorate([
14128
15081
  extHostNamedCustomer(MainContext.MainThreadLanguageFeatures),
14129
15082
  ( (__param(1, ILanguageService))),
14130
15083
  ( (__param(2, ILanguageConfigurationService))),
14131
- ( (__param(3, ILanguageFeaturesService)))
15084
+ ( (__param(3, ILanguageFeaturesService))),
15085
+ ( (__param(4, IUriIdentityService)))
14132
15086
  ], MainThreadLanguageFeatures)));
14133
- class MainThreadPasteEditProvider {
14134
- constructor(handle, _proxy, supportsCopy, pasteMimeTypes) {
15087
+ let MainThreadPasteEditProvider = class MainThreadPasteEditProvider {
15088
+ constructor(handle, _proxy, supportsCopy, pasteMimeTypes, _uriIdentService) {
14135
15089
  this.handle = handle;
14136
15090
  this._proxy = _proxy;
15091
+ this._uriIdentService = _uriIdentService;
14137
15092
  this.dataTransfers = ( (new DataTransferCache()));
14138
15093
  this.pasteMimeTypes = pasteMimeTypes;
14139
15094
  if (supportsCopy) {
@@ -14164,21 +15119,25 @@ class MainThreadPasteEditProvider {
14164
15119
  }
14165
15120
  return {
14166
15121
  insertText: result.insertText,
14167
- additionalEdit: result.additionalEdit ? reviveWorkspaceEditDto(result.additionalEdit) : undefined,
15122
+ additionalEdit: result.additionalEdit ? reviveWorkspaceEditDto(result.additionalEdit, this._uriIdentService) : undefined,
14168
15123
  };
14169
15124
  }
14170
15125
  finally {
14171
15126
  request.dispose();
14172
15127
  }
14173
15128
  }
14174
- resolveFileData(requestId, dataIndex) {
14175
- return this.dataTransfers.resolveDropFileData(requestId, dataIndex);
15129
+ resolveFileData(requestId, dataId) {
15130
+ return this.dataTransfers.resolveDropFileData(requestId, dataId);
14176
15131
  }
14177
- }
14178
- class MainThreadDocumentOnDropEditProvider {
14179
- constructor(handle, _proxy) {
15132
+ };
15133
+ MainThreadPasteEditProvider = ( (__decorate([
15134
+ ( (__param(4, IUriIdentityService)))
15135
+ ], MainThreadPasteEditProvider)));
15136
+ let MainThreadDocumentOnDropEditProvider = class MainThreadDocumentOnDropEditProvider {
15137
+ constructor(handle, _proxy, _uriIdentService) {
14180
15138
  this.handle = handle;
14181
15139
  this._proxy = _proxy;
15140
+ this._uriIdentService = _uriIdentService;
14182
15141
  this.dataTransfers = ( (new DataTransferCache()));
14183
15142
  }
14184
15143
  async provideDocumentOnDropEdits(model, position, dataTransfer, token) {
@@ -14191,17 +15150,20 @@ class MainThreadDocumentOnDropEditProvider {
14191
15150
  }
14192
15151
  return {
14193
15152
  insertText: edit.insertText,
14194
- additionalEdit: reviveWorkspaceEditDto(edit.additionalEdit),
15153
+ additionalEdit: reviveWorkspaceEditDto(edit.additionalEdit, this._uriIdentService),
14195
15154
  };
14196
15155
  }
14197
15156
  finally {
14198
15157
  request.dispose();
14199
15158
  }
14200
15159
  }
14201
- resolveDocumentOnDropFileData(requestId, dataIndex) {
14202
- return this.dataTransfers.resolveDropFileData(requestId, dataIndex);
15160
+ resolveDocumentOnDropFileData(requestId, dataId) {
15161
+ return this.dataTransfers.resolveDropFileData(requestId, dataId);
14203
15162
  }
14204
- }
15163
+ };
15164
+ MainThreadDocumentOnDropEditProvider = ( (__decorate([
15165
+ ( (__param(2, IUriIdentityService)))
15166
+ ], MainThreadDocumentOnDropEditProvider)));
14205
15167
  class MainThreadDocumentSemanticTokensProvider {
14206
15168
  constructor(_proxy, _handle, _legend, onDidChange) {
14207
15169
  this._proxy = _proxy;
@@ -14315,7 +15277,7 @@ function scopeToOverrides(scope) {
14315
15277
  }
14316
15278
  class ExtHostConfigProvider {
14317
15279
  constructor(proxy, extHostWorkspace, data, logService) {
14318
- this._onDidChangeConfiguration = ( (new Emitter()));
15280
+ this._onDidChangeConfiguration = ( (new Emitter$1()));
14319
15281
  this._proxy = proxy;
14320
15282
  this._logService = logService;
14321
15283
  this._extHostWorkspace = extHostWorkspace;
@@ -14426,19 +15388,19 @@ class ExtHostConfigProvider {
14426
15388
  },
14427
15389
  inspect: (key) => {
14428
15390
  key = section ? `${section}.${key}` : key;
14429
- const config = deepClone(this._configuration.inspect(key, overrides, this._extHostWorkspace.workspace));
15391
+ const config = this._configuration.inspect(key, overrides, this._extHostWorkspace.workspace);
14430
15392
  if (config) {
14431
15393
  return {
14432
15394
  key,
14433
- defaultValue: config.policy?.value ?? config.default?.value,
14434
- globalValue: config.user?.value ?? config.application?.value,
14435
- workspaceValue: config.workspace?.value,
14436
- workspaceFolderValue: config.workspaceFolder?.value,
14437
- defaultLanguageValue: config.default?.override,
14438
- globalLanguageValue: config.user?.override ?? config.application?.override,
14439
- workspaceLanguageValue: config.workspace?.override,
14440
- workspaceFolderLanguageValue: config.workspaceFolder?.override,
14441
- languageIds: config.overrideIdentifiers
15395
+ defaultValue: deepClone(config.policy?.value ?? config.default?.value),
15396
+ globalValue: deepClone(config.user?.value ?? config.application?.value),
15397
+ workspaceValue: deepClone(config.workspace?.value),
15398
+ workspaceFolderValue: deepClone(config.workspaceFolder?.value),
15399
+ defaultLanguageValue: deepClone(config.default?.override),
15400
+ globalLanguageValue: deepClone(config.user?.override ?? config.application?.override),
15401
+ workspaceLanguageValue: deepClone(config.workspace?.override),
15402
+ workspaceFolderLanguageValue: deepClone(config.workspaceFolder?.override),
15403
+ languageIds: deepClone(config.overrideIdentifiers)
14442
15404
  };
14443
15405
  }
14444
15406
  return undefined;
@@ -14544,7 +15506,7 @@ let MainThreadConfiguration = class MainThreadConfiguration {
14544
15506
  : scopeToLanguage === false ? { resource: overrides.resource }
14545
15507
  : overrides.overrideIdentifier && overriddenValue !== undefined ? overrides
14546
15508
  : { resource: overrides.resource };
14547
- return this.configurationService.updateValue(key, value, overrides, configurationTarget, true);
15509
+ return this.configurationService.updateValue(key, value, overrides, configurationTarget, { donotNotifyError: true });
14548
15510
  }
14549
15511
  deriveConfigurationTarget(key, overrides) {
14550
15512
  if (overrides.resource && this._workspaceContextService.getWorkbenchState() === 3 ) {
@@ -14572,10 +15534,46 @@ const DEFAULT_EXTENSION = {
14572
15534
  publisher: 'microsoft',
14573
15535
  version: '1.0.0',
14574
15536
  engines: {
14575
- vscode: "1.69.0"
15537
+ vscode: "1.76.0"
14576
15538
  },
14577
15539
  targetPlatform: "web"
14578
15540
  };
15541
+ const environment = {
15542
+ isExtensionDevelopmentDebug: false,
15543
+ appName: 'Monaco',
15544
+ appHost: 'web',
15545
+ appLanguage: window.navigator.language ?? 'en-US',
15546
+ extensionTelemetryLogResource: ( URI.from({ scheme: 'user', path: '/extensionTelemetryLogResource.log' })),
15547
+ isExtensionTelemetryLoggingOnly: false,
15548
+ get appUriScheme() { return unsupported(); },
15549
+ get globalStorageHome() { return unsupported(); },
15550
+ get workspaceStorageHome() { return unsupported(); }
15551
+ };
15552
+ const initData = {
15553
+ _serviceBrand: undefined,
15554
+ version: '1.0.0',
15555
+ parentPid: 0,
15556
+ environment,
15557
+ get allExtensions() { return [Services.get().extension ?? DEFAULT_EXTENSION]; },
15558
+ get myExtensions() { return [(Services.get().extension ?? DEFAULT_EXTENSION).identifier]; },
15559
+ consoleForward: {
15560
+ includeStack: false,
15561
+ logNative: false
15562
+ },
15563
+ get telemetryInfo() { return unsupported(); },
15564
+ logLevel: LogLevel.Trace,
15565
+ get logsLocation() { return unsupported(); },
15566
+ get logFile() { return unsupported(); },
15567
+ autoStart: false,
15568
+ remote: {
15569
+ isRemote: false,
15570
+ authority: undefined,
15571
+ connectionData: null
15572
+ },
15573
+ uiKind: UIKind.Web,
15574
+ loggers: [],
15575
+ logName: 'browser'
15576
+ };
14579
15577
  class SimpleMessagePassingProtocol {
14580
15578
  constructor() {
14581
15579
  this._onMessage = new BufferedEmitter();
@@ -14652,7 +15650,8 @@ function createExtHostServices() {
14652
15650
  const configurationService = StandaloneServices.get(IConfigurationService);
14653
15651
  const workspaceContextService = StandaloneServices.get(IWorkspaceContextService);
14654
15652
  const extensionService = StandaloneServices.get(IExtensionService);
14655
- const instantiationService = StandaloneServices.get(IInstantiationService);
15653
+ const loggerService = StandaloneServices.get(ILoggerService);
15654
+ const logService = StandaloneServices.get(ILogService);
14656
15655
  const imessagePassingProtocol = new SimpleMessagePassingProtocol();
14657
15656
  const rpcProtocol = new RPCProtocol(imessagePassingProtocol);
14658
15657
  const extHostFileSystemInfo = new ExtHostFileSystemInfo();
@@ -14676,65 +15675,41 @@ function createExtHostServices() {
14676
15675
  rpcProtocol.dispose();
14677
15676
  }
14678
15677
  };
14679
- const initData = {
14680
- _serviceBrand: undefined,
14681
- version: '1.0.0',
14682
- parentPid: 0,
14683
- get environment() { return unsupported(); },
14684
- allExtensions: [Services.get().extension ?? DEFAULT_EXTENSION],
14685
- myExtensions: [(Services.get().extension ?? DEFAULT_EXTENSION).identifier],
14686
- consoleForward: {
14687
- includeStack: false,
14688
- logNative: false
14689
- },
14690
- get telemetryInfo() { return unsupported(); },
14691
- logLevel: LogLevel.Trace,
14692
- get logsLocation() { return unsupported(); },
14693
- get logFile() { return unsupported(); },
14694
- autoStart: false,
14695
- remote: {
14696
- isRemote: false,
14697
- authority: undefined,
14698
- connectionData: null
14699
- },
14700
- uiKind: UIKind.Web
14701
- };
14702
- const extHostLogService = new LogService(new ConsoleMainLogger());
14703
- const extHostApiDeprecationService = new ExtHostApiDeprecationService(mainContext, extHostLogService);
14704
- const extHostMessageService = new ExtHostMessageService(mainContext, extHostLogService);
15678
+ const extHostApiDeprecationService = new ExtHostApiDeprecationService(mainContext, logService);
15679
+ const extHostMessageService = new ExtHostMessageService(mainContext, logService);
14705
15680
  const uriTransformerService = new URITransformerService(null);
14706
15681
  rpcProtocol.set(MainContext.MainThreadWindow, new MainThreadWindow(mainContext, hostService, openerService));
14707
15682
  rpcProtocol.set(MainContext.MainThreadCommands, new MainThreadCommands(mainContext, commandsService, extensionService));
14708
- const extHostCommands = rpcProtocol.set(ExtHostContext.ExtHostCommands, new ExtHostCommands(mainContext, extHostLogService));
14709
- const extHostDocumentsAndEditors = rpcProtocol.set(ExtHostContext.ExtHostDocumentsAndEditors, new ExtHostDocumentsAndEditors(mainContext, extHostLogService));
15683
+ const extHostTelemetry = rpcProtocol.set(ExtHostContext.ExtHostTelemetry, new ExtHostTelemetry(initData, loggerService));
15684
+ const extHostCommands = rpcProtocol.set(ExtHostContext.ExtHostCommands, new ExtHostCommands(mainContext, logService, extHostTelemetry));
15685
+ const extHostDocumentsAndEditors = rpcProtocol.set(ExtHostContext.ExtHostDocumentsAndEditors, new ExtHostDocumentsAndEditors(mainContext, logService));
14710
15686
  const extHostDocuments = rpcProtocol.set(ExtHostContext.ExtHostDocuments, new ExtHostDocuments(mainContext, extHostDocumentsAndEditors));
14711
15687
  const extHostLanguages = rpcProtocol.set(ExtHostContext.ExtHostLanguages, new ExtHostLanguages(mainContext, extHostDocuments, extHostCommands.converter, uriTransformerService));
14712
15688
  const extHostWindow = rpcProtocol.set(ExtHostContext.ExtHostWindow, new ExtHostWindow(mainContext));
14713
15689
  const extHostQuickOpen = rpcProtocol.set(ExtHostContext.ExtHostQuickOpen, createExtHostQuickOpen(mainContext, null, extHostCommands));
14714
- const extHostDiagnostics = rpcProtocol.set(ExtHostContext.ExtHostDiagnostics, new ExtHostDiagnostics(mainContext, extHostLogService, extHostFileSystemInfo));
15690
+ const extHostDiagnostics = rpcProtocol.set(ExtHostContext.ExtHostDiagnostics, new ExtHostDiagnostics(mainContext, logService, extHostFileSystemInfo, extHostDocumentsAndEditors));
14715
15691
  const extHostProgress = rpcProtocol.set(ExtHostContext.ExtHostProgress, new ExtHostProgress(rpcProtocol.getProxy(MainContext.MainThreadProgress)));
14716
- const extHostDocumentContentProviders = rpcProtocol.set(ExtHostContext.ExtHostDocumentContentProviders, new ExtHostDocumentContentProvider(mainContext, extHostDocumentsAndEditors, extHostLogService));
15692
+ const extHostDocumentContentProviders = rpcProtocol.set(ExtHostContext.ExtHostDocumentContentProviders, new ExtHostDocumentContentProvider(mainContext, extHostDocumentsAndEditors, logService));
14717
15693
  const extHostEditors = rpcProtocol.set(ExtHostContext.ExtHostEditors, new ExtHostEditors(mainContext, extHostDocumentsAndEditors));
14718
15694
  const extHostClipboard = new ExtHostClipboard(mainContext);
14719
- const extHostLanguageFeatures = rpcProtocol.set(ExtHostContext.ExtHostLanguageFeatures, new ExtHostLanguageFeatures(rpcProtocol, uriTransformerService, extHostDocuments, extHostCommands, extHostDiagnostics, extHostLogService, extHostApiDeprecationService));
14720
- const extHostWorkspace = rpcProtocol.set(ExtHostContext.ExtHostWorkspace, new ExtHostWorkspace(mainContext, initData, extHostFileSystemInfo, extHostLogService));
14721
- const extHostConfiguration = rpcProtocol.set(ExtHostContext.ExtHostConfiguration, new SyncExtHostConfiguration(mainContext, extHostWorkspace, extHostLogService));
14722
- rpcProtocol.set(ExtHostContext.ExtHostTelemetry, new ExtHostTelemetry());
15695
+ const extHostLanguageFeatures = rpcProtocol.set(ExtHostContext.ExtHostLanguageFeatures, new ExtHostLanguageFeatures(rpcProtocol, uriTransformerService, extHostDocuments, extHostCommands, extHostDiagnostics, logService, extHostApiDeprecationService, extHostTelemetry));
15696
+ const extHostWorkspace = rpcProtocol.set(ExtHostContext.ExtHostWorkspace, new ExtHostWorkspace(mainContext, initData, extHostFileSystemInfo, logService, uriTransformerService));
15697
+ const extHostConfiguration = rpcProtocol.set(ExtHostContext.ExtHostConfiguration, new SyncExtHostConfiguration(mainContext, extHostWorkspace, logService));
14723
15698
  rpcProtocol.set(MainContext.MainThreadMessageService, new MainThreadMessageServiceWithoutSource(mainContext, notificationService, commandsService, dialogService));
14724
15699
  rpcProtocol.set(MainContext.MainThreadDiagnostics, new MainThreadDiagnostics(mainContext, markerService, uriIdentityService));
14725
15700
  rpcProtocol.set(MainContext.MainThreadQuickOpen, new MainThreadQuickOpen(mainContext, quickInputService));
14726
- rpcProtocol.set(MainContext.MainThreadTelemetry, new MainThreadTelemetry(mainContext, telemetryService, workbenchEnvironmentService, productService));
15701
+ rpcProtocol.set(MainContext.MainThreadTelemetry, new MainThreadTelemetry(mainContext, telemetryService, configurationService, workbenchEnvironmentService, productService));
14727
15702
  rpcProtocol.set(MainContext.MainThreadProgress, new MainThreadProgress(mainContext, progressService, commandsService));
14728
15703
  rpcProtocol.set(MainContext.MainThreadDocumentContentProviders, new MainThreadDocumentContentProviders(mainContext, textModelService, languageService, modelService, editorWorkerService));
14729
- rpcProtocol.set(MainContext.MainThreadBulkEdits, new MainThreadBulkEdits(mainContext, bulkEditService, extHostLogService));
15704
+ rpcProtocol.set(MainContext.MainThreadBulkEdits, new MainThreadBulkEdits(mainContext, bulkEditService, logService, uriIdentityService));
14730
15705
  rpcProtocol.set(MainContext.MainThreadLanguages, new MainThreadLanguages(mainContext, languageService, modelService, textModelService, languageStatusService));
14731
15706
  rpcProtocol.set(MainContext.MainThreadClipboard, new MainThreadClipboard(mainContext, clipboardService));
14732
- rpcProtocol.set(MainContext.MainThreadLanguageFeatures, new MainThreadLanguageFeatures(mainContext, languageService, languageConfigurationService, languageFeaturesService));
15707
+ rpcProtocol.set(MainContext.MainThreadLanguageFeatures, new MainThreadLanguageFeatures(mainContext, languageService, languageConfigurationService, languageFeaturesService, uriIdentityService));
14733
15708
  rpcProtocol.set(MainContext.MainThreadConfiguration, new MainThreadConfiguration(mainContext, workspaceContextService, configurationService, workbenchEnvironmentService));
14734
- new MainThreadDocumentsAndEditors(mainContext, modelService, textFileService, editorService, codeEditorService, fileService, textModelService, editorGroupsService, paneCompositePartService, workbenchEnvironmentService, workingCopyFileService, uriIdentityService, clipboardService, pathService, instantiationService);
15709
+ new MainThreadDocumentsAndEditors(mainContext, modelService, textFileService, editorService, codeEditorService, fileService, textModelService, editorGroupsService, paneCompositePartService, workbenchEnvironmentService, workingCopyFileService, uriIdentityService, clipboardService, pathService, configurationService);
14735
15710
  const extHostBulkEdits = new ExtHostBulkEdits(mainContext, extHostDocumentsAndEditors);
14736
15711
  return {
14737
- extHostLogService,
15712
+ extHostLogService: logService,
14738
15713
  extHostApiDeprecationService,
14739
15714
  extHostMessageService,
14740
15715
  extHostDocumentsAndEditors,
@@ -14751,7 +15726,8 @@ function createExtHostServices() {
14751
15726
  extHostClipboard,
14752
15727
  extHostLanguageFeatures,
14753
15728
  extHostWorkspace,
14754
- extHostConfiguration
15729
+ extHostConfiguration,
15730
+ extHostTelemetry
14755
15731
  };
14756
15732
  }
14757
15733
  let extHostServices;
@@ -14761,4 +15737,4 @@ function getExtHostServices() {
14761
15737
  }
14762
15738
  return extHostServices;
14763
15739
  }
14764
- export { ParameterInformation$1 as $, DiagnosticSeverity$1 as A, Breakpoint as B, CallHierarchyIncomingCall as C, DebugAdapterExecutable as D, DiagnosticTag$1 as E, Disposable as F, DocumentHighlight$1 as G, DocumentHighlightKind as H, DocumentLink$1 as I, DocumentSymbol$1 as J, EndOfLine$1 as K, EnvironmentVariableMutatorType as L, EvaluatableExpression$1 as M, InlineValueText as N, InlineValueVariableLookup as O, InlineValueEvaluatableExpression as P, ExtensionKind as Q, ExtensionMode as R, FileChangeType as S, FileDecoration as T, FileSystemError as U, FoldingRange$1 as V, FoldingRangeKind$1 as W, FunctionBreakpoint as X, Hover$1 as Y, Location as Z, MarkdownString$1 as _, CallHierarchyItem$1 as a, LanguageStatusSeverity as a$, Position$1 as a0, ProcessExecution as a1, ProgressLocation$1 as a2, QuickInputButtons as a3, Range$1 as a4, RelativePattern as a5, Selection$2 as a6, SelectionRange$1 as a7, SemanticTokens as a8, SemanticTokensBuilder as a9, TextEditorSelectionChangeKind as aA, TextDocumentChangeReason as aB, ThemeColor as aC, ThemeIcon as aD, TreeItem as aE, TreeItemCollapsibleState as aF, TypeHierarchyItem$1 as aG, UIKind as aH, ViewColumn$1 as aI, WorkspaceEdit$1 as aJ, InlayHint as aK, InlayHintLabelPart as aL, InlayHintKind$1 as aM, NotebookRange$1 as aN, NotebookCellKind$1 as aO, NotebookCellData$1 as aP, NotebookData as aQ, NotebookCellStatusBarAlignment as aR, NotebookCellOutput$1 as aS, NotebookCellOutputItem$1 as aT, NotebookCellStatusBarItem as aU, NotebookControllerAffinity as aV, LinkedEditingRanges as aW, TestRunRequest as aX, TestMessage as aY, TestTag as aZ, TestRunProfileKind as a_, SemanticTokensEdit as aa, SemanticTokensEdits as ab, SemanticTokensLegend as ac, ShellExecution as ad, ShellQuoting as ae, SignatureHelp$1 as af, SignatureHelpTriggerKind as ag, SignatureInformation$1 as ah, SnippetString as ai, SourceBreakpoint as aj, StatusBarAlignment as ak, SymbolInformation as al, SymbolKind$1 as am, SymbolTag$1 as an, Task as ao, TaskGroup as ap, TaskPanelKind as aq, TaskRevealKind as ar, TaskScope as as, TerminalLink as at, TerminalLocation as au, TerminalProfile as av, TextDocumentSaveReason as aw, TextEdit$1 as ax, TextEditorLineNumbersStyle$1 as ay, TextEditorRevealType$1 as az, CallHierarchyOutgoingCall as b, QuickPickItemKind as b0, TextDiffTabInput as b1, CustomEditorTabInput as b2, NotebookEditorTabInput as b3, NotebookDiffEditorTabInput as b4, WebviewEditorTabInput as b5, TerminalEditorTabInput as b6, InputBoxValidationSeverity as b7, InlineSuggestionList as b8, InlineCompletionTriggerKind as b9, InlineSuggestion as ba, DocumentDropEdit as bb, NotebookEditorRevealType as bc, getExtHostServices as bd, DEFAULT_EXTENSION as be, LanguageSelector as bf, Position$2 as bg, keyFromOverrideIdentifiers as bh, configurationDefaultsSchemaId as bi, ConfigurationScope as bj, Range$2 as bk, supportsTelemetry as bl, getTelemetryLevel as bm, CancellationTokenSource as c, CodeAction as d, CodeActionKind as e, CodeActionTriggerKind$1 as f, CodeLens as g, Color$1 as h, ColorInformation as i, ColorPresentation$1 as j, CommentMode as k, CommentThreadCollapsibleState as l, CompletionItem as m, CompletionItemKind$1 as n, CompletionItemTag$1 as o, CompletionList as p, CompletionTriggerKind$1 as q, ConfigurationTarget as r, CustomExecution as s, DebugAdapterInlineImplementation as t, DebugAdapterNamedPipeServer as u, DebugAdapterServer as v, DebugConsoleMode as w, DecorationRangeBehavior$1 as x, Diagnostic$1 as y, DiagnosticRelatedInformation$1 as z };
15740
+ export { ParameterInformation$1 as $, DiagnosticSeverity$1 as A, Breakpoint as B, CallHierarchyIncomingCall as C, DebugAdapterExecutable as D, DiagnosticTag$1 as E, Disposable as F, DocumentHighlight$1 as G, DocumentHighlightKind as H, DocumentLink$1 as I, DocumentSymbol$1 as J, EndOfLine$1 as K, EnvironmentVariableMutatorType as L, EvaluatableExpression$1 as M, InlineValueText as N, InlineValueVariableLookup as O, InlineValueEvaluatableExpression as P, ExtensionKind as Q, ExtensionMode as R, FileChangeType as S, FileDecoration as T, FileSystemError as U, FoldingRange$1 as V, FoldingRangeKind$1 as W, FunctionBreakpoint as X, Hover$1 as Y, Location as Z, MarkdownString$1 as _, CallHierarchyItem$1 as a, LanguageStatusSeverity as a$, Position$1 as a0, ProcessExecution as a1, ProgressLocation$1 as a2, QuickInputButtons as a3, Range$1 as a4, RelativePattern as a5, Selection$2 as a6, SelectionRange$1 as a7, SemanticTokens as a8, SemanticTokensBuilder as a9, TextEditorSelectionChangeKind as aA, TextDocumentChangeReason as aB, ThemeColor as aC, ThemeIcon as aD, TreeItem as aE, TreeItemCollapsibleState as aF, TypeHierarchyItem$1 as aG, UIKind as aH, ViewColumn$1 as aI, WorkspaceEdit$1 as aJ, InlayHint as aK, InlayHintLabelPart as aL, InlayHintKind$1 as aM, NotebookRange$1 as aN, NotebookCellKind$1 as aO, NotebookCellData$1 as aP, NotebookData as aQ, NotebookCellStatusBarAlignment as aR, NotebookCellOutput$1 as aS, NotebookCellOutputItem$1 as aT, NotebookCellStatusBarItem as aU, NotebookControllerAffinity as aV, LinkedEditingRanges as aW, TestRunRequest as aX, TestMessage as aY, TestTag as aZ, TestRunProfileKind as a_, SemanticTokensEdit as aa, SemanticTokensEdits as ab, SemanticTokensLegend as ac, ShellExecution as ad, ShellQuoting as ae, SignatureHelp$1 as af, SignatureHelpTriggerKind as ag, SignatureInformation$1 as ah, SnippetString as ai, SourceBreakpoint as aj, StatusBarAlignment as ak, SymbolInformation as al, SymbolKind$1 as am, SymbolTag$1 as an, Task as ao, TaskGroup as ap, TaskPanelKind as aq, TaskRevealKind as ar, TaskScope as as, TerminalLink as at, TerminalLocation as au, TerminalProfile as av, TextDocumentSaveReason as aw, TextEdit$1 as ax, TextEditorLineNumbersStyle$1 as ay, TextEditorRevealType$1 as az, CallHierarchyOutgoingCall as b, QuickPickItemKind as b0, TextDiffTabInput as b1, CustomEditorTabInput as b2, NotebookEditorTabInput as b3, NotebookDiffEditorTabInput as b4, WebviewEditorTabInput as b5, TerminalEditorTabInput as b6, InputBoxValidationSeverity as b7, InlineSuggestionList as b8, InlineCompletionTriggerKind as b9, InlineSuggestion as ba, DocumentDropEdit as bb, NotebookEditorRevealType as bc, SnippetTextEdit as bd, NotebookEdit as be, TerminalExitReason as bf, CommentThreadState as bg, TelemetryTrustedValue as bh, getExtHostServices as bi, DEFAULT_EXTENSION as bj, LanguageSelector as bk, initData as bl, ExtHostTelemetryLogger as bm, Position$2 as bn, keyFromOverrideIdentifiers as bo, configurationDefaultsSchemaId as bp, ConfigurationScope as bq, getRemoteAuthority as br, Range$2 as bs, getRemoteServerRootPath as bt, supportsTelemetry as bu, getTelemetryLevel as bv, CancellationTokenSource as c, CodeAction as d, CodeActionKind as e, CodeActionTriggerKind$1 as f, CodeLens as g, Color$1 as h, ColorInformation as i, ColorPresentation$1 as j, CommentMode as k, CommentThreadCollapsibleState as l, CompletionItem as m, CompletionItemKind$1 as n, CompletionItemTag$1 as o, CompletionList as p, CompletionTriggerKind$1 as q, ConfigurationTarget as r, CustomExecution as s, DebugAdapterInlineImplementation as t, DebugAdapterNamedPipeServer as u, DebugAdapterServer as v, DebugConsoleMode as w, DecorationRangeBehavior$1 as x, Diagnostic$1 as y, DiagnosticRelatedInformation$1 as z };