@codingame/monaco-vscode-api 1.69.24 → 1.76.0-next.2

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, B as mapArrayOrNot, C as delta$1, D as readonly, E as NotImplementedError, F 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
- import { marked as marked$1 } from 'monaco-editor/esm/vs/base/common/marked/marked.js';
15
14
  import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
15
+ import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
16
16
  import { MarkerSeverity, IMarkerService } from 'monaco-editor/esm/vs/platform/markers/common/markers.js';
17
+ import { marked } from 'monaco-editor/esm/vs/base/common/marked/marked.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;
992
+ }
993
+ }
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
+ }
697
1052
  }
698
- return `${match[1].toLowerCase()}/${match[2].toLowerCase()}${match[3] ?? ''}`;
699
1053
  }
700
- const marked = marked$1.marked;
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,6 @@ 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 = {}))));
3582
4189
  var Selection$1;
3583
4190
  ( ((function(Selection) {
3584
4191
  function to(selection) {
@@ -4069,7 +4676,7 @@ var TextEdit;
4069
4676
  })(TextEdit || (TextEdit = {}))));
4070
4677
  var WorkspaceEdit;
4071
4678
  ( ((function(WorkspaceEdit) {
4072
- function from(value, versionInfo, allowSnippetTextEdit) {
4679
+ function from(value, versionInfo) {
4073
4680
  const result = {
4074
4681
  edits: []
4075
4682
  };
@@ -4085,7 +4692,7 @@ var WorkspaceEdit;
4085
4692
  result.edits.push({
4086
4693
  oldResource: entry.from,
4087
4694
  newResource: entry.to,
4088
- options: entry.options,
4695
+ options: { ...entry.options, contentsBase64: entry.options?.contents && encodeBase64(VSBuffer.wrap(entry.options.contents)) },
4089
4696
  metadata: entry.metadata
4090
4697
  });
4091
4698
  }
@@ -4098,10 +4705,6 @@ var WorkspaceEdit;
4098
4705
  });
4099
4706
  }
4100
4707
  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
4708
  result.edits.push({
4106
4709
  resource: entry.uri,
4107
4710
  textEdit: {
@@ -4554,6 +5157,9 @@ var CompletionItemKind;
4554
5157
  var ParameterInformation;
4555
5158
  ( ((function(ParameterInformation) {
4556
5159
  function from(info) {
5160
+ if (typeof info.label !== 'string' && !Array.isArray(info.label)) {
5161
+ throw new TypeError('Invalid label');
5162
+ }
4557
5163
  return {
4558
5164
  label: info.label,
4559
5165
  documentation: MarkdownString.fromStrict(info.documentation)
@@ -4761,6 +5367,14 @@ var FoldingRange;
4761
5367
  return range;
4762
5368
  }
4763
5369
  FoldingRange.from = from;
5370
+ function to(r) {
5371
+ const range = { start: r.start - 1, end: r.end - 1 };
5372
+ if (r.kind) {
5373
+ range.kind = FoldingRangeKind.to(r.kind);
5374
+ }
5375
+ return range;
5376
+ }
5377
+ FoldingRange.to = to;
4764
5378
  })(FoldingRange || (FoldingRange = {}))));
4765
5379
  var FoldingRangeKind;
4766
5380
  ( ((function(FoldingRangeKind) {
@@ -4778,6 +5392,20 @@ var FoldingRangeKind;
4778
5392
  return undefined;
4779
5393
  }
4780
5394
  FoldingRangeKind.from = from;
5395
+ function to(kind) {
5396
+ if (kind) {
5397
+ switch (kind.value) {
5398
+ case FoldingRangeKind$2.Comment.value:
5399
+ return FoldingRangeKind$1.Comment;
5400
+ case FoldingRangeKind$2.Imports.value:
5401
+ return FoldingRangeKind$1.Imports;
5402
+ case FoldingRangeKind$2.Region.value:
5403
+ return FoldingRangeKind$1.Region;
5404
+ }
5405
+ }
5406
+ return undefined;
5407
+ }
5408
+ FoldingRangeKind.to = to;
4781
5409
  })(FoldingRangeKind || (FoldingRangeKind = {}))));
4782
5410
  var GlobPattern;
4783
5411
  ( ((function(GlobPattern) {
@@ -4987,7 +5615,7 @@ var TypeHierarchyItem;
4987
5615
  })(TypeHierarchyItem || (TypeHierarchyItem = {}))));
4988
5616
  var DataTransferItem;
4989
5617
  ( ((function(DataTransferItem) {
4990
- function toDataTransferItem(item, resolveFileData) {
5618
+ function to(mime, item, resolveFileData) {
4991
5619
  const file = item.fileData;
4992
5620
  if (file) {
4993
5621
  return new (class extends DataTransferItem$1 {
@@ -4998,19 +5626,58 @@ var DataTransferItem;
4998
5626
  data: once(() => resolveFileData()),
4999
5627
  };
5000
5628
  }
5001
- })('');
5629
+ })('', item.id);
5002
5630
  }
5003
- else {
5004
- return new DataTransferItem$1(item.asString);
5631
+ if (mime === Mimes.uriList && item.uriListData) {
5632
+ return new DataTransferItem$1(reviveUriList(item.uriListData));
5633
+ }
5634
+ return new DataTransferItem$1(item.asString);
5635
+ }
5636
+ DataTransferItem.to = to;
5637
+ async function from(mime, item) {
5638
+ const stringValue = await item.asString();
5639
+ if (mime === Mimes.uriList) {
5640
+ return {
5641
+ id: item.id,
5642
+ asString: stringValue,
5643
+ fileData: undefined,
5644
+ uriListData: serializeUriList(stringValue),
5645
+ };
5005
5646
  }
5647
+ const fileValue = item.asFile();
5648
+ return {
5649
+ id: item.id,
5650
+ asString: stringValue,
5651
+ fileData: fileValue ? { name: fileValue.name, uri: fileValue.uri } : undefined,
5652
+ };
5653
+ }
5654
+ DataTransferItem.from = from;
5655
+ function serializeUriList(stringValue) {
5656
+ return UriList.split(stringValue).map(part => {
5657
+ if (part.startsWith('#')) {
5658
+ return part;
5659
+ }
5660
+ try {
5661
+ return (
5662
+ (URI.parse(part))
5663
+ );
5664
+ }
5665
+ catch {
5666
+ }
5667
+ return part;
5668
+ });
5669
+ }
5670
+ function reviveUriList(parts) {
5671
+ return UriList.create(parts.map(part => {
5672
+ return typeof part === 'string' ? part : URI.revive(part);
5673
+ }));
5006
5674
  }
5007
- DataTransferItem.toDataTransferItem = toDataTransferItem;
5008
5675
  })(DataTransferItem || (DataTransferItem = {}))));
5009
5676
  var DataTransfer;
5010
5677
  ( ((function(DataTransfer) {
5011
5678
  function toDataTransfer(value, resolveFileData) {
5012
- const init = value.items.map(([type, item], index) => {
5013
- return [type, DataTransferItem.toDataTransferItem(item, () => resolveFileData(index))];
5679
+ const init = value.items.map(([type, item]) => {
5680
+ return [type, DataTransferItem.to(type, item, () => resolveFileData(item.id))];
5014
5681
  });
5015
5682
  return new DataTransfer$1(init);
5016
5683
  }
@@ -5020,12 +5687,7 @@ var DataTransfer;
5020
5687
  const promises = [];
5021
5688
  value.forEach((value, key) => {
5022
5689
  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
- }]);
5690
+ newDTO.items.push([key, await DataTransferItem.from(key, value)]);
5029
5691
  })());
5030
5692
  });
5031
5693
  await Promise.all(promises);
@@ -5062,12 +5724,6 @@ var TextEditorRevealType;
5062
5724
  TextEditorRevealType[TextEditorRevealType["InCenterIfOutsideViewport"] = 2] = "InCenterIfOutsideViewport";
5063
5725
  TextEditorRevealType[TextEditorRevealType["AtTop"] = 3] = "AtTop";
5064
5726
  })(TextEditorRevealType || (TextEditorRevealType = {}))));
5065
- function reviveWorkspaceEditDto(data) {
5066
- if (data && data.edits) {
5067
- revive(data);
5068
- }
5069
- return data;
5070
- }
5071
5727
  const MainContext = {
5072
5728
  MainThreadAuthentication: ( (createProxyIdentifier('MainThreadAuthentication'))),
5073
5729
  MainThreadBulkEdits: ( (createProxyIdentifier('MainThreadBulkEdits'))),
@@ -5095,6 +5751,7 @@ const MainContext = {
5095
5751
  MainThreadMessageService: ( (createProxyIdentifier('MainThreadMessageService'))),
5096
5752
  MainThreadOutputService: ( (createProxyIdentifier('MainThreadOutputService'))),
5097
5753
  MainThreadProgress: ( (createProxyIdentifier('MainThreadProgress'))),
5754
+ MainThreadQuickDiff: ( (createProxyIdentifier('MainThreadQuickDiff'))),
5098
5755
  MainThreadQuickOpen: ( (createProxyIdentifier('MainThreadQuickOpen'))),
5099
5756
  MainThreadStatusBar: ( (createProxyIdentifier('MainThreadStatusBar'))),
5100
5757
  MainThreadSecretState: ( (createProxyIdentifier('MainThreadSecretState'))),
@@ -5107,6 +5764,7 @@ const MainContext = {
5107
5764
  MainThreadCustomEditors: ( (createProxyIdentifier('MainThreadCustomEditors'))),
5108
5765
  MainThreadUrls: ( (createProxyIdentifier('MainThreadUrls'))),
5109
5766
  MainThreadUriOpeners: ( (createProxyIdentifier('MainThreadUriOpeners'))),
5767
+ MainThreadProfileContentHandlers: ( (createProxyIdentifier('MainThreadProfileContentHandlers'))),
5110
5768
  MainThreadWorkspace: ( (createProxyIdentifier('MainThreadWorkspace'))),
5111
5769
  MainThreadFileSystem: ( (createProxyIdentifier('MainThreadFileSystem'))),
5112
5770
  MainThreadExtensionService: ( (createProxyIdentifier('MainThreadExtensionService'))),
@@ -5125,6 +5783,7 @@ const MainContext = {
5125
5783
  MainThreadTunnelService: ( (createProxyIdentifier('MainThreadTunnelService'))),
5126
5784
  MainThreadTimeline: ( (createProxyIdentifier('MainThreadTimeline'))),
5127
5785
  MainThreadTesting: ( (createProxyIdentifier('MainThreadTesting'))),
5786
+ MainThreadLocalization: ( (createProxyIdentifier('MainThreadLocalizationShape')))
5128
5787
  };
5129
5788
  const ExtHostContext = {
5130
5789
  ExtHostCommands: ( (createProxyIdentifier('ExtHostCommands'))),
@@ -5144,6 +5803,7 @@ const ExtHostContext = {
5144
5803
  ExtHostLanguages: ( (createProxyIdentifier('ExtHostLanguages'))),
5145
5804
  ExtHostLanguageFeatures: ( (createProxyIdentifier('ExtHostLanguageFeatures'))),
5146
5805
  ExtHostQuickOpen: ( (createProxyIdentifier('ExtHostQuickOpen'))),
5806
+ ExtHostQuickDiff: ( (createProxyIdentifier('ExtHostQuickDiff'))),
5147
5807
  ExtHostExtensionService: ( (createProxyIdentifier('ExtHostExtensionService'))),
5148
5808
  ExtHostLogLevelServiceShape: ( (createProxyIdentifier('ExtHostLogLevelServiceShape'))),
5149
5809
  ExtHostTerminalService: ( (createProxyIdentifier('ExtHostTerminalService'))),
@@ -5164,6 +5824,7 @@ const ExtHostContext = {
5164
5824
  ExtHostStorage: ( (createProxyIdentifier('ExtHostStorage'))),
5165
5825
  ExtHostUrls: ( (createProxyIdentifier('ExtHostUrls'))),
5166
5826
  ExtHostUriOpeners: ( (createProxyIdentifier('ExtHostUriOpeners'))),
5827
+ ExtHostProfileContentHandlers: ( (createProxyIdentifier('ExtHostProfileContentHandlers'))),
5167
5828
  ExtHostOutputService: ( (createProxyIdentifier('ExtHostOutputService'))),
5168
5829
  ExtHosLabelService: ( (createProxyIdentifier('ExtHostLabelService'))),
5169
5830
  ExtHostNotebook: ( (createProxyIdentifier('ExtHostNotebook'))),
@@ -5178,17 +5839,245 @@ const ExtHostContext = {
5178
5839
  ExtHostTimeline: ( (createProxyIdentifier('ExtHostTimeline'))),
5179
5840
  ExtHostTesting: ( (createProxyIdentifier('ExtHostTesting'))),
5180
5841
  ExtHostTelemetry: ( (createProxyIdentifier('ExtHostTelemetry'))),
5842
+ ExtHostLocalization: ( (createProxyIdentifier('ExtHostLocalization'))),
5181
5843
  };
5182
5844
  const IExtHostRpcService = ( (createDecorator('IExtHostRpcService')));
5183
- var _ExtHostCommands_proxy, _ExtHostCommands_telemetry;
5845
+ const IExtHostInitDataService = ( (createDecorator('IExtHostInitDataService')));
5846
+ let ExtHostTelemetry = class ExtHostTelemetry extends Disposable$1 {
5847
+ constructor(initData, loggerService) {
5848
+ super();
5849
+ this.initData = initData;
5850
+ this.loggerService = loggerService;
5851
+ this._onDidChangeTelemetryEnabled = this._register(( (new Emitter$1())));
5852
+ this.onDidChangeTelemetryEnabled = this._onDidChangeTelemetryEnabled.event;
5853
+ this._onDidChangeTelemetryConfiguration = this._register(( (new Emitter$1())));
5854
+ this.onDidChangeTelemetryConfiguration = this._onDidChangeTelemetryConfiguration.event;
5855
+ this._productConfig = { usage: true, error: true };
5856
+ this._level = 0 ;
5857
+ this._telemetryIsSupported = false;
5858
+ this._inLoggingOnlyMode = false;
5859
+ this._telemetryLoggers = ( (new Map()));
5860
+ this.extHostTelemetryLogFile = URI.revive(this.initData.environment.extensionTelemetryLogResource);
5861
+ this._inLoggingOnlyMode = this.initData.environment.isExtensionTelemetryLoggingOnly;
5862
+ this._outputLogger = loggerService.createLogger(this.extHostTelemetryLogFile, { id: extensionTelemetryLogChannelId, name: ( (localize(
5863
+ 'extensionTelemetryLog',
5864
+ "Extension Telemetry{0}",
5865
+ this._inLoggingOnlyMode ? ' (Not Sent)' : ''
5866
+ ))), hidden: true });
5867
+ this._register(loggerService.onDidChangeLogLevel(arg => {
5868
+ if (isLogLevel(arg)) {
5869
+ this.updateLoggerVisibility();
5870
+ }
5871
+ }));
5872
+ 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.');
5873
+ this._outputLogger.info('===========================================================');
5874
+ }
5875
+ updateLoggerVisibility() {
5876
+ this.loggerService.setVisibility(this.extHostTelemetryLogFile, this._telemetryIsSupported && this.loggerService.getLogLevel() === LogLevel.Trace);
5877
+ }
5878
+ getTelemetryConfiguration() {
5879
+ return this._level === 3 ;
5880
+ }
5881
+ getTelemetryDetails() {
5882
+ return {
5883
+ isCrashEnabled: this._level >= 1 ,
5884
+ isErrorsEnabled: this._productConfig.error ? this._level >= 2 : false,
5885
+ isUsageEnabled: this._productConfig.usage ? this._level >= 3 : false
5886
+ };
5887
+ }
5888
+ instantiateLogger(extension, sender, options) {
5889
+ const telemetryDetails = this.getTelemetryDetails();
5890
+ const logger = ( (new ExtHostTelemetryLogger(
5891
+ sender,
5892
+ options,
5893
+ extension,
5894
+ this._outputLogger,
5895
+ this._inLoggingOnlyMode,
5896
+ this.getBuiltInCommonProperties(extension),
5897
+ { isUsageEnabled: telemetryDetails.isUsageEnabled, isErrorsEnabled: telemetryDetails.isErrorsEnabled }
5898
+ )));
5899
+ this._telemetryLoggers.set(extension.identifier.value, logger);
5900
+ return logger.apiTelemetryLogger;
5901
+ }
5902
+ $initializeTelemetryLevel(level, supportsTelemetry, productConfig) {
5903
+ this._level = level;
5904
+ this._telemetryIsSupported = supportsTelemetry;
5905
+ this._productConfig = productConfig ?? { usage: true, error: true };
5906
+ this.updateLoggerVisibility();
5907
+ }
5908
+ getBuiltInCommonProperties(extension) {
5909
+ const commonProperties = {};
5910
+ commonProperties['common.extname'] = `${extension.publisher}.${extension.name}`;
5911
+ commonProperties['common.extversion'] = extension.version;
5912
+ commonProperties['common.vscodemachineid'] = this.initData.telemetryInfo.machineId;
5913
+ commonProperties['common.vscodesessionid'] = this.initData.telemetryInfo.sessionId;
5914
+ commonProperties['common.vscodeversion'] = this.initData.version;
5915
+ commonProperties['common.isnewappinstall'] = isNewAppInstall(this.initData.telemetryInfo.firstSessionDate);
5916
+ commonProperties['common.product'] = this.initData.environment.appHost;
5917
+ switch (this.initData.uiKind) {
5918
+ case UIKind.Web:
5919
+ commonProperties['common.uikind'] = 'web';
5920
+ break;
5921
+ case UIKind.Desktop:
5922
+ commonProperties['common.uikind'] = 'desktop';
5923
+ break;
5924
+ default:
5925
+ commonProperties['common.uikind'] = 'unknown';
5926
+ }
5927
+ commonProperties['common.remotename'] = getRemoteName(cleanRemoteAuthority(this.initData.remote.authority));
5928
+ return commonProperties;
5929
+ }
5930
+ $onDidChangeTelemetryLevel(level) {
5931
+ this._oldTelemetryEnablement = this.getTelemetryConfiguration();
5932
+ this._level = level;
5933
+ const telemetryDetails = this.getTelemetryDetails();
5934
+ this._telemetryLoggers.forEach(logger => {
5935
+ logger.updateTelemetryEnablements(telemetryDetails.isUsageEnabled, telemetryDetails.isErrorsEnabled);
5936
+ });
5937
+ if (this._oldTelemetryEnablement !== this.getTelemetryConfiguration()) {
5938
+ this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration());
5939
+ }
5940
+ this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails());
5941
+ this.updateLoggerVisibility();
5942
+ }
5943
+ onExtensionError(extension, error) {
5944
+ const logger = this._telemetryLoggers.get(extension.value);
5945
+ if (!logger || logger.ignoreUnhandledExtHostErrors) {
5946
+ return false;
5947
+ }
5948
+ logger.logError(error);
5949
+ return true;
5950
+ }
5951
+ };
5952
+ ExtHostTelemetry = ( (__decorate([
5953
+ ( (__param(0, IExtHostInitDataService))),
5954
+ ( (__param(1, ILoggerService)))
5955
+ ], ExtHostTelemetry)));
5956
+ class ExtHostTelemetryLogger {
5957
+ static validateSender(sender) {
5958
+ if (typeof sender !== 'object') {
5959
+ throw new TypeError('TelemetrySender argument is invalid');
5960
+ }
5961
+ if (typeof sender.sendEventData !== 'function') {
5962
+ throw new TypeError('TelemetrySender.sendEventData must be a function');
5963
+ }
5964
+ if (typeof sender.sendErrorData !== 'function') {
5965
+ throw new TypeError('TelemetrySender.sendErrorData must be a function');
5966
+ }
5967
+ if (typeof sender.flush !== 'undefined' && typeof sender.flush !== 'function') {
5968
+ throw new TypeError('TelemetrySender.flush must be a function or undefined');
5969
+ }
5970
+ }
5971
+ constructor(sender, options, _extension, _logger, _inLoggingOnlyMode, _commonProperties, telemetryEnablements) {
5972
+ this._extension = _extension;
5973
+ this._logger = _logger;
5974
+ this._inLoggingOnlyMode = _inLoggingOnlyMode;
5975
+ this._commonProperties = _commonProperties;
5976
+ this._onDidChangeEnableStates = ( (new Emitter$1()));
5977
+ this.ignoreUnhandledExtHostErrors = options?.ignoreUnhandledErrors ?? false;
5978
+ this._ignoreBuiltinCommonProperties = options?.ignoreBuiltInCommonProperties ?? false;
5979
+ this._additionalCommonProperties = options?.additionalCommonProperties;
5980
+ this._sender = sender;
5981
+ this._telemetryEnablements = { isUsageEnabled: telemetryEnablements.isUsageEnabled, isErrorsEnabled: telemetryEnablements.isErrorsEnabled };
5982
+ }
5983
+ updateTelemetryEnablements(isUsageEnabled, isErrorsEnabled) {
5984
+ if (this._apiObject) {
5985
+ this._telemetryEnablements = { isUsageEnabled, isErrorsEnabled };
5986
+ this._onDidChangeEnableStates.fire(this._apiObject);
5987
+ }
5988
+ }
5989
+ mixInCommonPropsAndCleanData(data) {
5990
+ let updatedData = data.properties ?? data;
5991
+ updatedData = cleanData(updatedData, []);
5992
+ if (this._additionalCommonProperties) {
5993
+ updatedData = mixin(updatedData, this._additionalCommonProperties);
5994
+ }
5995
+ if (!this._ignoreBuiltinCommonProperties) {
5996
+ updatedData = mixin(updatedData, this._commonProperties);
5997
+ }
5998
+ if (data.properties) {
5999
+ data.properties = updatedData;
6000
+ }
6001
+ else {
6002
+ data = updatedData;
6003
+ }
6004
+ return data;
6005
+ }
6006
+ logEvent(eventName, data) {
6007
+ if (!this._sender) {
6008
+ return;
6009
+ }
6010
+ if (this._extension.publisher === 'vscode') {
6011
+ eventName = this._extension.name + '/' + eventName;
6012
+ }
6013
+ else {
6014
+ eventName = this._extension.identifier.value + '/' + eventName;
6015
+ }
6016
+ data = this.mixInCommonPropsAndCleanData(data || {});
6017
+ if (!this._inLoggingOnlyMode) {
6018
+ this._sender?.sendEventData(eventName, data);
6019
+ }
6020
+ this._logger.trace(eventName, data);
6021
+ }
6022
+ logUsage(eventName, data) {
6023
+ if (!this._telemetryEnablements.isUsageEnabled) {
6024
+ return;
6025
+ }
6026
+ this.logEvent(eventName, data);
6027
+ }
6028
+ logError(eventNameOrException, data) {
6029
+ if (!this._telemetryEnablements.isErrorsEnabled || !this._sender) {
6030
+ return;
6031
+ }
6032
+ if (typeof eventNameOrException === 'string') {
6033
+ this.logEvent(eventNameOrException, data);
6034
+ }
6035
+ else {
6036
+ this._sender.sendErrorData(eventNameOrException, data);
6037
+ }
6038
+ }
6039
+ get apiTelemetryLogger() {
6040
+ if (!this._apiObject) {
6041
+ const that = this;
6042
+ const obj = {
6043
+ logUsage: that.logUsage.bind(that),
6044
+ get isUsageEnabled() {
6045
+ return that._telemetryEnablements.isUsageEnabled;
6046
+ },
6047
+ get isErrorsEnabled() {
6048
+ return that._telemetryEnablements.isErrorsEnabled;
6049
+ },
6050
+ logError: that.logError.bind(that),
6051
+ dispose: that.dispose.bind(that),
6052
+ onDidChangeEnableStates: that._onDidChangeEnableStates.event.bind(that)
6053
+ };
6054
+ this._apiObject = ( (Object.freeze(obj)));
6055
+ }
6056
+ return this._apiObject;
6057
+ }
6058
+ dispose() {
6059
+ if (this._sender?.flush) {
6060
+ Promise.resolve(this._sender.flush()).then(this._sender = undefined);
6061
+ this._apiObject = undefined;
6062
+ }
6063
+ }
6064
+ }
6065
+ function isNewAppInstall(firstSessionDate) {
6066
+ const installAge = Date.now() - ( (new Date(firstSessionDate))).getTime();
6067
+ return isNaN(installAge) ? false : installAge < 1000 * 60 * 60 * 24;
6068
+ }
6069
+ const IExtHostTelemetry = ( (createDecorator('IExtHostTelemetry')));
6070
+ var _ExtHostCommands_proxy, _ExtHostCommands_telemetry, _ExtHostCommands_extHostTelemetry;
5184
6071
  let ExtHostCommands = class ExtHostCommands {
5185
- constructor(extHostRpc, logService) {
6072
+ constructor(extHostRpc, logService, extHostTelemetry) {
5186
6073
  _ExtHostCommands_proxy.set(this, void 0);
5187
6074
  this._commands = ( (new Map()));
5188
6075
  this._apiCommands = ( (new Map()));
5189
6076
  _ExtHostCommands_telemetry.set(this, void 0);
6077
+ _ExtHostCommands_extHostTelemetry.set(this, void 0);
5190
6078
  __classPrivateFieldSet(this, _ExtHostCommands_proxy, extHostRpc.getProxy(MainContext.MainThreadCommands), "f");
5191
6079
  this._logService = logService;
6080
+ __classPrivateFieldSet(this, _ExtHostCommands_extHostTelemetry, extHostTelemetry, "f");
5192
6081
  __classPrivateFieldSet(this, _ExtHostCommands_telemetry, extHostRpc.getProxy(MainContext.MainThreadTelemetry), "f");
5193
6082
  this.converter = ( (new CommandsConverter(this, id => {
5194
6083
  const candidate = this._apiCommands.get(id);
@@ -5327,7 +6216,6 @@ let ExtHostCommands = class ExtHostCommands {
5327
6216
  if (!command) {
5328
6217
  throw new Error('Unknown command');
5329
6218
  }
5330
- this._reportTelemetry(command, id);
5331
6219
  const { callback, thisArg, description } = command;
5332
6220
  if (description) {
5333
6221
  for (let i = 0; i < description.args.length; i++) {
@@ -5339,6 +6227,7 @@ let ExtHostCommands = class ExtHostCommands {
5339
6227
  }
5340
6228
  }
5341
6229
  }
6230
+ const stopWatch = StopWatch.create();
5342
6231
  try {
5343
6232
  return await callback.apply(thisArg, args);
5344
6233
  }
@@ -5353,6 +6242,10 @@ let ExtHostCommands = class ExtHostCommands {
5353
6242
  if (!annotateError) {
5354
6243
  throw err;
5355
6244
  }
6245
+ if (command.extension?.identifier) {
6246
+ const reported = __classPrivateFieldGet(this, _ExtHostCommands_extHostTelemetry, "f").onExtensionError(command.extension.identifier, err);
6247
+ this._logService.trace('forwarded error to extension?', reported, command.extension?.identifier);
6248
+ }
5356
6249
  throw new (class CommandError extends Error {
5357
6250
  constructor() {
5358
6251
  super(toErrorMessage(err));
@@ -5361,23 +6254,28 @@ let ExtHostCommands = class ExtHostCommands {
5361
6254
  }
5362
6255
  });
5363
6256
  }
6257
+ finally {
6258
+ this._reportTelemetry(command, id, stopWatch.elapsed());
6259
+ }
5364
6260
  }
5365
- _reportTelemetry(command, id) {
5366
- if (!command.extension || command.extension.isBuiltin) {
6261
+ _reportTelemetry(command, id, duration) {
6262
+ if (!command.extension) {
5367
6263
  return;
5368
6264
  }
5369
6265
  __classPrivateFieldGet(this, _ExtHostCommands_telemetry, "f").$publicLog2('Extension:ActionExecuted', {
5370
6266
  extensionId: command.extension.identifier.value,
5371
- id: id,
6267
+ id: ( (new TelemetryTrustedValue(id))),
6268
+ duration: duration,
5372
6269
  });
5373
6270
  }
5374
6271
  $executeContributedCommand(id, ...args) {
5375
6272
  this._logService.trace('ExtHostCommands#$executeContributedCommand', id);
5376
- if (!this._commands.has(id)) {
6273
+ const cmdHandler = this._commands.get(id);
6274
+ if (!cmdHandler) {
5377
6275
  return Promise.reject(( (new Error(`Contributed command '${id}' does not exist.`))));
5378
6276
  }
5379
6277
  else {
5380
- args = args.map(arg => this._argumentProcessors.reduce((r, p) => p.processArgument(r), arg));
6278
+ args = args.map(arg => this._argumentProcessors.reduce((r, p) => p.processArgument(r, cmdHandler.extension?.identifier), arg));
5381
6279
  return this._executeContributedCommand(id, args, true);
5382
6280
  }
5383
6281
  }
@@ -5401,17 +6299,20 @@ let ExtHostCommands = class ExtHostCommands {
5401
6299
  return Promise.resolve(result);
5402
6300
  }
5403
6301
  };
5404
- _ExtHostCommands_proxy = ( (new WeakMap())), _ExtHostCommands_telemetry = ( (new WeakMap()));
6302
+ _ExtHostCommands_proxy = ( (new WeakMap()));
6303
+ _ExtHostCommands_telemetry = ( (new WeakMap()));
6304
+ _ExtHostCommands_extHostTelemetry = ( (new WeakMap()));
5405
6305
  ExtHostCommands = ( (__decorate([
5406
6306
  ( (__param(0, IExtHostRpcService))),
5407
- ( (__param(1, ILogService)))
6307
+ ( (__param(1, ILogService))),
6308
+ ( (__param(2, IExtHostTelemetry)))
5408
6309
  ], ExtHostCommands)));
5409
6310
  class CommandsConverter {
5410
6311
  constructor(_commands, _lookupApiCommand, _logService) {
5411
6312
  this._commands = _commands;
5412
6313
  this._lookupApiCommand = _lookupApiCommand;
5413
6314
  this._logService = _logService;
5414
- this.delegatingCommandId = `_vscode_delegate_cmd_${( ( Date.now().toString(36)))}`;
6315
+ this.delegatingCommandId = `__vsc${( ( Date.now().toString(36)))}`;
5415
6316
  this._cache = ( (new Map()));
5416
6317
  this._cachIdPool = 0;
5417
6318
  this._commands.registerCommand(true, this.delegatingCommandId, this._executeConvertedCommand, this);
@@ -5435,7 +6336,7 @@ class CommandsConverter {
5435
6336
  result.arguments = apiCommand.args.map((arg, i) => arg.convert(command.arguments && command.arguments[i]));
5436
6337
  }
5437
6338
  else if (isNonEmptyArray(command.arguments)) {
5438
- const id = ++this._cachIdPool;
6339
+ const id = `${command.command}/${++this._cachIdPool}`;
5439
6340
  this._cache.set(id, command);
5440
6341
  disposables.add(toDisposable(() => {
5441
6342
  this._cache.delete(id);
@@ -5449,7 +6350,7 @@ class CommandsConverter {
5449
6350
  return result;
5450
6351
  }
5451
6352
  fromInternal(command) {
5452
- if (typeof command.$ident === 'number') {
6353
+ if (typeof command.$ident === 'string') {
5453
6354
  return this._cache.get(command.$ident);
5454
6355
  }
5455
6356
  else {
@@ -5467,7 +6368,7 @@ class CommandsConverter {
5467
6368
  const actualCmd = this.getActualCommand(...args);
5468
6369
  this._logService.trace('CommandsConverter#EXECUTE', args[0], actualCmd ? actualCmd.command : 'MISSING');
5469
6370
  if (!actualCmd) {
5470
- return Promise.reject('actual command NOT FOUND');
6371
+ return Promise.reject(`Actual command not found, wanted to execute ${args[0]}`);
5471
6372
  }
5472
6373
  return this._commands.executeCommand(actualCmd.command, ...(actualCmd.arguments || []));
5473
6374
  }
@@ -5511,7 +6412,7 @@ let MainThreadCommands = class MainThreadCommands {
5511
6412
  constructor(extHostContext, _commandService, _extensionService) {
5512
6413
  this._commandService = _commandService;
5513
6414
  this._extensionService = _extensionService;
5514
- this._commandRegistrations = ( (new Map()));
6415
+ this._commandRegistrations = ( (new DisposableMap()));
5515
6416
  this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostCommands);
5516
6417
  this._generateCommandsDocumentationRegistration = ( (CommandsRegistry.registerCommand(
5517
6418
  '_generateCommandsDocumentation',
@@ -5519,8 +6420,7 @@ let MainThreadCommands = class MainThreadCommands {
5519
6420
  )));
5520
6421
  }
5521
6422
  dispose() {
5522
- dispose(( (this._commandRegistrations.values())));
5523
- this._commandRegistrations.clear();
6423
+ this._commandRegistrations.dispose();
5524
6424
  this._generateCommandsDocumentationRegistration.dispose();
5525
6425
  }
5526
6426
  async _generateCommandsDocumentation() {
@@ -5545,11 +6445,7 @@ let MainThreadCommands = class MainThreadCommands {
5545
6445
  }))));
5546
6446
  }
5547
6447
  $unregisterCommand(id) {
5548
- const command = this._commandRegistrations.get(id);
5549
- if (command) {
5550
- command.dispose();
5551
- this._commandRegistrations.delete(id);
5552
- }
6448
+ this._commandRegistrations.deleteAndDispose(id);
5553
6449
  }
5554
6450
  $fireCommandActivationEvent(id) {
5555
6451
  const activationEvent = `onCommand:${id}`;
@@ -5659,15 +6555,16 @@ class ExtHostFileSystemInfo {
5659
6555
  const IExtHostFileSystemInfo = ( (createDecorator('IExtHostFileSystemInfo')));
5660
6556
  var _DiagnosticCollection_proxy, _DiagnosticCollection_onDidChangeDiagnostics, _DiagnosticCollection_data;
5661
6557
  class DiagnosticCollection {
5662
- constructor(_name, _owner, _maxDiagnosticsPerFile, extUri, proxy, onDidChangeDiagnostics) {
6558
+ constructor(_name, _owner, _maxDiagnosticsPerFile, _modelVersionIdProvider, extUri, proxy, onDidChangeDiagnostics) {
5663
6559
  this._name = _name;
5664
6560
  this._owner = _owner;
5665
6561
  this._maxDiagnosticsPerFile = _maxDiagnosticsPerFile;
6562
+ this._modelVersionIdProvider = _modelVersionIdProvider;
5666
6563
  _DiagnosticCollection_proxy.set(this, void 0);
5667
6564
  _DiagnosticCollection_onDidChangeDiagnostics.set(this, void 0);
5668
6565
  _DiagnosticCollection_data.set(this, void 0);
5669
6566
  this._isDisposed = false;
5670
- __classPrivateFieldSet(this, _DiagnosticCollection_data, ( (new ResourceMap(uri => extUri.getComparisonKey(uri)))), "f");
6567
+ __classPrivateFieldSet(this, _DiagnosticCollection_data, ( (new ResourceMap$1(uri => extUri.getComparisonKey(uri)))), "f");
5671
6568
  __classPrivateFieldSet(this, _DiagnosticCollection_proxy, proxy, "f");
5672
6569
  __classPrivateFieldSet(this, _DiagnosticCollection_onDidChangeDiagnostics, onDidChangeDiagnostics, "f");
5673
6570
  }
@@ -5739,7 +6636,7 @@ class DiagnosticCollection {
5739
6636
  orderLoop: for (let i = 0; i < 4; i++) {
5740
6637
  for (const diagnostic of diagnostics) {
5741
6638
  if (diagnostic.severity === order[i]) {
5742
- const len = marker.push(Diagnostic.from(diagnostic));
6639
+ const len = marker.push({ ...Diagnostic.from(diagnostic), modelVersionId: this._modelVersionIdProvider(uri) });
5743
6640
  if (len === this._maxDiagnosticsPerFile) {
5744
6641
  break orderLoop;
5745
6642
  }
@@ -5760,7 +6657,7 @@ class DiagnosticCollection {
5760
6657
  });
5761
6658
  }
5762
6659
  else {
5763
- marker = diagnostics.map(diag => Diagnostic.from(diag));
6660
+ marker = diagnostics.map(diag => ({ ...Diagnostic.from(diag), modelVersionId: this._modelVersionIdProvider(uri) }));
5764
6661
  }
5765
6662
  }
5766
6663
  entries.push([uri, marker]);
@@ -5823,23 +6720,24 @@ class DiagnosticCollection {
5823
6720
  }
5824
6721
  }
5825
6722
  let ExtHostDiagnostics = class ExtHostDiagnostics {
5826
- constructor(mainContext, _logService, _fileSystemInfoService) {
6723
+ static _mapper(last) {
6724
+ const map = ( (new ResourceMap$1()));
6725
+ for (const uri of last) {
6726
+ map.set(uri, uri);
6727
+ }
6728
+ return { uris: ( (Object.freeze(Array.from(( (map.values())))))) };
6729
+ }
6730
+ constructor(mainContext, _logService, _fileSystemInfoService, _extHostDocumentsAndEditors) {
5827
6731
  this._logService = _logService;
5828
6732
  this._fileSystemInfoService = _fileSystemInfoService;
6733
+ this._extHostDocumentsAndEditors = _extHostDocumentsAndEditors;
5829
6734
  this._collections = ( (new Map()));
5830
6735
  this._onDidChangeDiagnostics = ( (new DebounceEmitter({ merge: all => all.flat(), delay: 50 })));
5831
6736
  this.onDidChangeDiagnostics = Event.map(this._onDidChangeDiagnostics.event, ExtHostDiagnostics._mapper);
5832
6737
  this._proxy = mainContext.getProxy(MainContext.MainThreadDiagnostics);
5833
6738
  }
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
6739
  createDiagnosticCollection(extensionId, name) {
5842
- const { _collections, _proxy, _onDidChangeDiagnostics, _logService, _fileSystemInfoService } = this;
6740
+ const { _collections, _proxy, _onDidChangeDiagnostics, _logService, _fileSystemInfoService, _extHostDocumentsAndEditors } = this;
5843
6741
  const loggingProxy = new (class {
5844
6742
  $changeMany(owner, entries) {
5845
6743
  _proxy.$changeMany(owner, entries);
@@ -5869,7 +6767,7 @@ let ExtHostDiagnostics = class ExtHostDiagnostics {
5869
6767
  }
5870
6768
  const result = new (class extends DiagnosticCollection {
5871
6769
  constructor() {
5872
- super(name, owner, ExtHostDiagnostics._maxDiagnosticsPerFile, _fileSystemInfoService.extUri, loggingProxy, _onDidChangeDiagnostics);
6770
+ super(name, owner, ExtHostDiagnostics._maxDiagnosticsPerFile, uri => _extHostDocumentsAndEditors.getDocument(uri)?.version, _fileSystemInfoService.extUri, loggingProxy, _onDidChangeDiagnostics);
5873
6771
  _collections.set(owner, this);
5874
6772
  }
5875
6773
  dispose() {
@@ -5916,6 +6814,7 @@ let ExtHostDiagnostics = class ExtHostDiagnostics {
5916
6814
  name,
5917
6815
  name,
5918
6816
  ExtHostDiagnostics._maxDiagnosticsPerFile,
6817
+ _uri => undefined,
5919
6818
  this._fileSystemInfoService.extUri,
5920
6819
  undefined,
5921
6820
  this._onDidChangeDiagnostics
@@ -5942,6 +6841,9 @@ function _transformIncomingURIs(obj, transformer, revive, depth) {
5942
6841
  if (obj.$mid === 1 ) {
5943
6842
  return revive ? URI.revive(transformer.transformIncoming(obj)) : transformer.transformIncoming(obj);
5944
6843
  }
6844
+ if (obj instanceof VSBuffer) {
6845
+ return null;
6846
+ }
5945
6847
  for (const key in obj) {
5946
6848
  if (Object.hasOwnProperty.call(obj, key)) {
5947
6849
  const r = _transformIncomingURIs(obj[key], transformer, revive, depth + 1);
@@ -6098,7 +7000,7 @@ class RPCProtocol extends Disposable$1 {
6098
7000
  constructor(protocol, logger = null, transformer = null) {
6099
7001
  super();
6100
7002
  this[_a] = true;
6101
- this._onDidChangeResponsiveState = this._register(( (new Emitter())));
7003
+ this._onDidChangeResponsiveState = this._register(( (new Emitter$1())));
6102
7004
  this.onDidChangeResponsiveState = this._onDidChangeResponsiveState.event;
6103
7005
  this._protocol = protocol;
6104
7006
  this._logger = logger;
@@ -6411,10 +7313,6 @@ class RPCProtocol extends Disposable$1 {
6411
7313
  _a = _RPCProtocolSymbol;
6412
7314
  RPCProtocol.UNRESPONSIVE_TIME = 3 * 1000;
6413
7315
  class MessageBuffer {
6414
- constructor(buff, offset) {
6415
- this._buff = buff;
6416
- this._offset = offset;
6417
- }
6418
7316
  static alloc(type, req, messageSize) {
6419
7317
  const result = ( (new MessageBuffer(VSBuffer.alloc(messageSize + 1 + 4 ), 0)));
6420
7318
  result.writeUInt8(type);
@@ -6429,6 +7327,10 @@ class MessageBuffer {
6429
7327
  get buffer() {
6430
7328
  return this._buff;
6431
7329
  }
7330
+ constructor(buff, offset) {
7331
+ this._buff = buff;
7332
+ this._offset = offset;
7333
+ }
6432
7334
  static sizeUInt8() {
6433
7335
  return 1;
6434
7336
  }
@@ -6795,12 +7697,12 @@ class BufferedEmitter {
6795
7697
  this._hasListeners = false;
6796
7698
  this._isDeliveringMessages = false;
6797
7699
  this._bufferedMessages = [];
6798
- this._emitter = ( (new Emitter({
6799
- onFirstListenerAdd: () => {
7700
+ this._emitter = ( (new Emitter$1({
7701
+ onWillAddFirstListener: () => {
6800
7702
  this._hasListeners = true;
6801
7703
  queueMicrotask(() => this._deliverMessages());
6802
7704
  },
6803
- onLastListenerRemove: () => {
7705
+ onDidRemoveLastListener: () => {
6804
7706
  this._hasListeners = false;
6805
7707
  }
6806
7708
  })));
@@ -7055,10 +7957,10 @@ class ExtHostDocumentLine {
7055
7957
  }
7056
7958
  class ExtHostDocuments {
7057
7959
  constructor(mainContext, documentsAndEditors) {
7058
- this._onDidAddDocument = ( (new Emitter()));
7059
- this._onDidRemoveDocument = ( (new Emitter()));
7060
- this._onDidChangeDocument = ( (new Emitter()));
7061
- this._onDidSaveDocument = ( (new Emitter()));
7960
+ this._onDidAddDocument = ( (new Emitter$1()));
7961
+ this._onDidRemoveDocument = ( (new Emitter$1()));
7962
+ this._onDidChangeDocument = ( (new Emitter$1()));
7963
+ this._onDidSaveDocument = ( (new Emitter$1()));
7062
7964
  this.onDidAddDocument = this._onDidAddDocument.event;
7063
7965
  this.onDidRemoveDocument = this._onDidRemoveDocument.event;
7064
7966
  this.onDidChangeDocument = this._onDidChangeDocument.event;
@@ -7196,7 +8098,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7196
8098
  this._workspace = workspace;
7197
8099
  this._commands = commands;
7198
8100
  }
7199
- showQuickPick(itemsOrItemsPromise, options, token = CancellationToken.None) {
8101
+ showQuickPick(extension, itemsOrItemsPromise, options, token = CancellationToken.None) {
7200
8102
  this._onDidSelectItem = undefined;
7201
8103
  const itemsPromise = Promise.resolve(itemsOrItemsPromise);
7202
8104
  const instance = ++this._instances;
@@ -7214,6 +8116,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7214
8116
  if (result === widgetClosedMarker) {
7215
8117
  return undefined;
7216
8118
  }
8119
+ const allowedTooltips = isProposedApiEnabled(extension, 'quickPickItemTooltip');
7217
8120
  return itemsPromise.then(items => {
7218
8121
  const pickItems = [];
7219
8122
  for (let handle = 0; handle < items.length; handle++) {
@@ -7225,12 +8128,16 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7225
8128
  pickItems.push({ type: 'separator', label: item.label });
7226
8129
  }
7227
8130
  else {
8131
+ if (item.tooltip && !allowedTooltips) {
8132
+ 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}`);
8133
+ }
7228
8134
  pickItems.push({
7229
8135
  label: item.label,
7230
8136
  description: item.description,
7231
8137
  detail: item.detail,
7232
8138
  picked: item.picked,
7233
8139
  alwaysShow: item.alwaysShow,
8140
+ tooltip: allowedTooltips ? MarkdownString.fromStrict(item.tooltip) : undefined,
7234
8141
  handle
7235
8142
  });
7236
8143
  }
@@ -7327,9 +8234,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7327
8234
  }
7328
8235
  $onDidAccept(sessionId) {
7329
8236
  const session = this._sessions.get(sessionId);
7330
- if (session) {
7331
- session._fireDidAccept();
7332
- }
8237
+ session?._fireDidAccept();
7333
8238
  }
7334
8239
  $onDidChangeActive(sessionId, handles) {
7335
8240
  const session = this._sessions.get(sessionId);
@@ -7355,9 +8260,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7355
8260
  }
7356
8261
  $onDidHide(sessionId) {
7357
8262
  const session = this._sessions.get(sessionId);
7358
- if (session) {
7359
- session._fireDidHide();
7360
- }
8263
+ session?._fireDidHide();
7361
8264
  }
7362
8265
  }
7363
8266
  class ExtHostQuickInput {
@@ -7373,10 +8276,10 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7373
8276
  this._value = '';
7374
8277
  this._buttons = [];
7375
8278
  this._handlesToButtons = ( (new Map()));
7376
- this._onDidAcceptEmitter = ( (new Emitter()));
7377
- this._onDidChangeValueEmitter = ( (new Emitter()));
7378
- this._onDidTriggerButtonEmitter = ( (new Emitter()));
7379
- this._onDidHideEmitter = ( (new Emitter()));
8279
+ this._onDidAcceptEmitter = ( (new Emitter$1()));
8280
+ this._onDidChangeValueEmitter = ( (new Emitter$1()));
8281
+ this._onDidTriggerButtonEmitter = ( (new Emitter$1()));
8282
+ this._onDidHideEmitter = ( (new Emitter$1()));
7380
8283
  this._pendingUpdate = { id: this._id };
7381
8284
  this._disposed = false;
7382
8285
  this._disposables = [
@@ -7571,6 +8474,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7571
8474
  class ExtHostQuickPick extends ExtHostQuickInput {
7572
8475
  constructor(extension, onDispose) {
7573
8476
  super(extension.identifier, onDispose);
8477
+ this.extension = extension;
7574
8478
  this._items = [];
7575
8479
  this._handlesToItems = ( (new Map()));
7576
8480
  this._itemsToHandles = ( (new Map()));
@@ -7580,10 +8484,10 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7580
8484
  this._sortByLabel = true;
7581
8485
  this._keepScrollPosition = false;
7582
8486
  this._activeItems = [];
7583
- this._onDidChangeActiveEmitter = ( (new Emitter()));
8487
+ this._onDidChangeActiveEmitter = ( (new Emitter$1()));
7584
8488
  this._selectedItems = [];
7585
- this._onDidChangeSelectionEmitter = ( (new Emitter()));
7586
- this._onDidTriggerItemButtonEmitter = ( (new Emitter()));
8489
+ this._onDidChangeSelectionEmitter = ( (new Emitter$1()));
8490
+ this._onDidTriggerItemButtonEmitter = ( (new Emitter$1()));
7587
8491
  this.onDidChangeActive = this._onDidChangeActiveEmitter.event;
7588
8492
  this.onDidChangeSelection = this._onDidChangeSelectionEmitter.event;
7589
8493
  this.onDidTriggerItemButton = this._onDidTriggerItemButtonEmitter.event;
@@ -7601,6 +8505,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7601
8505
  this._handlesToItems.set(i, item);
7602
8506
  this._itemsToHandles.set(item, i);
7603
8507
  });
8508
+ const allowedTooltips = isProposedApiEnabled(this.extension, 'quickPickItemTooltip');
7604
8509
  const pickItems = [];
7605
8510
  for (let handle = 0; handle < items.length; handle++) {
7606
8511
  const item = items[handle];
@@ -7608,6 +8513,9 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7608
8513
  pickItems.push({ type: 'separator', label: item.label });
7609
8514
  }
7610
8515
  else {
8516
+ if (item.tooltip && !allowedTooltips) {
8517
+ 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}`);
8518
+ }
7611
8519
  pickItems.push({
7612
8520
  handle,
7613
8521
  label: item.label,
@@ -7615,6 +8523,7 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7615
8523
  detail: item.detail,
7616
8524
  picked: item.picked,
7617
8525
  alwaysShow: item.alwaysShow,
8526
+ tooltip: allowedTooltips ? MarkdownString.fromStrict(item.tooltip) : undefined,
7618
8527
  buttons: item.buttons?.map((button, i) => {
7619
8528
  return {
7620
8529
  ...getIconPathOrClass(button),
@@ -7722,6 +8631,13 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7722
8631
  this._prompt = prompt;
7723
8632
  this.update({ prompt });
7724
8633
  }
8634
+ get valueSelection() {
8635
+ return this._valueSelection;
8636
+ }
8637
+ set valueSelection(valueSelection) {
8638
+ this._valueSelection = valueSelection;
8639
+ this.update({ valueSelection });
8640
+ }
7725
8641
  get validationMessage() {
7726
8642
  return this._validationMessage;
7727
8643
  }
@@ -7742,7 +8658,23 @@ function createExtHostQuickOpen(mainContext, workspace, commands) {
7742
8658
  (new ExtHostQuickOpenImpl(workspace, commands))
7743
8659
  );
7744
8660
  }
7745
- const IExtHostInitDataService = ( (createDecorator('IExtHostInitDataService')));
8661
+ const IURITransformerService = ( (createDecorator('IURITransformerService')));
8662
+ class URITransformerService {
8663
+ constructor(delegate) {
8664
+ if (!delegate) {
8665
+ this.transformIncoming = arg => arg;
8666
+ this.transformOutgoing = arg => arg;
8667
+ this.transformOutgoingURI = arg => arg;
8668
+ this.transformOutgoingScheme = arg => arg;
8669
+ }
8670
+ else {
8671
+ this.transformIncoming = delegate.transformIncoming.bind(delegate);
8672
+ this.transformOutgoing = delegate.transformOutgoing.bind(delegate);
8673
+ this.transformOutgoingURI = delegate.transformOutgoingURI.bind(delegate);
8674
+ this.transformOutgoingScheme = delegate.transformOutgoingScheme.bind(delegate);
8675
+ }
8676
+ }
8677
+ }
7746
8678
  function resultIsMatch(result) {
7747
8679
  return !!result.preview;
7748
8680
  }
@@ -7768,17 +8700,6 @@ function ignorePathCasing(uri, extHostFileSystemInfo) {
7768
8700
  return !(capabilities && ((capabilities & 1024) ));
7769
8701
  }
7770
8702
  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
8703
  static toExtHostWorkspace(data, previousConfirmedWorkspace, previousUnconfirmedWorkspace, extHostFileSystemInfo) {
7783
8704
  if (!data) {
7784
8705
  return { workspace: null, added: [], removed: [] };
@@ -7825,6 +8746,17 @@ class ExtHostWorkspaceImpl extends Workspace {
7825
8746
  }
7826
8747
  return undefined;
7827
8748
  }
8749
+ constructor(id, _name, folders, transient, configuration, _isUntitled, ignorePathCasing) {
8750
+ super(id, folders.map(f => ( (new WorkspaceFolder(f)))), transient, configuration, ignorePathCasing);
8751
+ this._name = _name;
8752
+ this._isUntitled = _isUntitled;
8753
+ this._workspaceFolders = [];
8754
+ this._structure = TernarySearchTree.forUris(ignorePathCasing);
8755
+ folders.forEach(folder => {
8756
+ this._workspaceFolders.push(folder);
8757
+ this._structure.set(folder.uri, folder);
8758
+ });
8759
+ }
7828
8760
  get name() {
7829
8761
  return this._name;
7830
8762
  }
@@ -7845,15 +8777,19 @@ class ExtHostWorkspaceImpl extends Workspace {
7845
8777
  }
7846
8778
  }
7847
8779
  let ExtHostWorkspace = class ExtHostWorkspace {
7848
- constructor(extHostRpc, initData, extHostFileSystemInfo, logService) {
7849
- this._onDidChangeWorkspace = ( (new Emitter()));
8780
+ constructor(extHostRpc, initData, extHostFileSystemInfo, logService, uriTransformerService) {
8781
+ this._onDidChangeWorkspace = ( (new Emitter$1()));
7850
8782
  this.onDidChangeWorkspace = this._onDidChangeWorkspace.event;
7851
- this._onDidGrantWorkspaceTrust = ( (new Emitter()));
8783
+ this._onDidGrantWorkspaceTrust = ( (new Emitter$1()));
7852
8784
  this.onDidGrantWorkspaceTrust = this._onDidGrantWorkspaceTrust.event;
7853
8785
  this._activeSearchCallbacks = [];
7854
8786
  this._trusted = false;
8787
+ this._editSessionIdentityProviders = ( (new Map()));
8788
+ this._providerHandlePool = 0;
8789
+ this._onWillCreateEditSessionIdentityEvent = ( (new AsyncEmitter()));
7855
8790
  this._logService = logService;
7856
8791
  this._extHostFileSystemInfo = extHostFileSystemInfo;
8792
+ this._uriTransformerService = uriTransformerService;
7857
8793
  this._requestIdProvider = ( (new Counter()));
7858
8794
  this._barrier = ( (new Barrier()));
7859
8795
  this._proxy = extHostRpc.getProxy(MainContext.MainThreadWorkspace);
@@ -8145,12 +9081,89 @@ let ExtHostWorkspace = class ExtHostWorkspace {
8145
9081
  this._onDidGrantWorkspaceTrust.fire();
8146
9082
  }
8147
9083
  }
9084
+ registerEditSessionIdentityProvider(scheme, provider) {
9085
+ if (this._editSessionIdentityProviders.has(scheme)) {
9086
+ throw new Error(`A provider has already been registered for scheme ${scheme}`);
9087
+ }
9088
+ this._editSessionIdentityProviders.set(scheme, provider);
9089
+ const outgoingScheme = this._uriTransformerService.transformOutgoingScheme(scheme);
9090
+ const handle = this._providerHandlePool++;
9091
+ this._proxy.$registerEditSessionIdentityProvider(handle, outgoingScheme);
9092
+ return toDisposable(() => {
9093
+ this._editSessionIdentityProviders.delete(scheme);
9094
+ this._proxy.$unregisterEditSessionIdentityProvider(handle);
9095
+ });
9096
+ }
9097
+ async $getEditSessionIdentifier(workspaceFolder, cancellationToken) {
9098
+ this._logService.info('Getting edit session identifier for workspaceFolder', workspaceFolder);
9099
+ const folder = await this.resolveWorkspaceFolder(URI.revive(workspaceFolder));
9100
+ if (!folder) {
9101
+ this._logService.warn('Unable to resolve workspace folder');
9102
+ return undefined;
9103
+ }
9104
+ this._logService.info('Invoking #provideEditSessionIdentity for workspaceFolder', folder);
9105
+ const provider = this._editSessionIdentityProviders.get(folder.uri.scheme);
9106
+ this._logService.info(`Provider for scheme ${folder.uri.scheme} is defined: `, !!provider);
9107
+ if (!provider) {
9108
+ return undefined;
9109
+ }
9110
+ const result = await provider.provideEditSessionIdentity(folder, cancellationToken);
9111
+ this._logService.info('Provider returned edit session identifier: ', result);
9112
+ if (!result) {
9113
+ return undefined;
9114
+ }
9115
+ return result;
9116
+ }
9117
+ async $provideEditSessionIdentityMatch(workspaceFolder, identity1, identity2, cancellationToken) {
9118
+ this._logService.info('Getting edit session identifier for workspaceFolder', workspaceFolder);
9119
+ const folder = await this.resolveWorkspaceFolder(URI.revive(workspaceFolder));
9120
+ if (!folder) {
9121
+ this._logService.warn('Unable to resolve workspace folder');
9122
+ return undefined;
9123
+ }
9124
+ this._logService.info('Invoking #provideEditSessionIdentity for workspaceFolder', folder);
9125
+ const provider = this._editSessionIdentityProviders.get(folder.uri.scheme);
9126
+ this._logService.info(`Provider for scheme ${folder.uri.scheme} is defined: `, !!provider);
9127
+ if (!provider) {
9128
+ return undefined;
9129
+ }
9130
+ const result = await provider.provideEditSessionIdentityMatch?.(identity1, identity2, cancellationToken);
9131
+ this._logService.info('Provider returned edit session identifier match result: ', result);
9132
+ if (!result) {
9133
+ return undefined;
9134
+ }
9135
+ return result;
9136
+ }
9137
+ getOnWillCreateEditSessionIdentityEvent(extension) {
9138
+ return (listener, thisArg, disposables) => {
9139
+ const wrappedListener = function wrapped(e) { listener.call(thisArg, e); };
9140
+ wrappedListener.extension = extension;
9141
+ return this._onWillCreateEditSessionIdentityEvent.event(wrappedListener, undefined, disposables);
9142
+ };
9143
+ }
9144
+ async $onWillCreateEditSessionIdentity(workspaceFolder, token, timeout) {
9145
+ const folder = await this.resolveWorkspaceFolder(URI.revive(workspaceFolder));
9146
+ if (folder === undefined) {
9147
+ throw new Error('Unable to resolve workspace folder');
9148
+ }
9149
+ await this._onWillCreateEditSessionIdentityEvent.fireAsync({ workspaceFolder: folder }, token, async (thenable, listener) => {
9150
+ const now = Date.now();
9151
+ await Promise.resolve(thenable);
9152
+ if (Date.now() - now > timeout) {
9153
+ this._logService.warn('SLOW edit session create-participant', listener.extension.identifier);
9154
+ }
9155
+ });
9156
+ if (token.isCancellationRequested) {
9157
+ return undefined;
9158
+ }
9159
+ }
8148
9160
  };
8149
9161
  ExtHostWorkspace = ( (__decorate([
8150
9162
  ( (__param(0, IExtHostRpcService))),
8151
9163
  ( (__param(1, IExtHostInitDataService))),
8152
9164
  ( (__param(2, IExtHostFileSystemInfo))),
8153
- ( (__param(3, ILogService)))
9165
+ ( (__param(3, ILogService))),
9166
+ ( (__param(4, IURITransformerService)))
8154
9167
  ], ExtHostWorkspace)));
8155
9168
  const IExtHostWorkspace = ( (createDecorator('IExtHostWorkspace')));
8156
9169
  function parseSearchInclude(include) {
@@ -8416,29 +9429,15 @@ let MainThreadMessageService = class MainThreadMessageService {
8416
9429
  _showMessage(severity, message, commands, options) {
8417
9430
  return (
8418
9431
  (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
- });
9432
+ const primaryActions = commands.map(command => toAction({
9433
+ id: `_extension_message_handle_${command.handle}`,
9434
+ label: command.title,
9435
+ enabled: true,
9436
+ run: () => {
9437
+ resolve(command.handle);
9438
+ return Promise.resolve();
8433
9439
  }
8434
- }
8435
- commands.forEach(command => {
8436
- primaryActions.push(( (new MessageItemAction(
8437
- '_extension_message_handle_' + command.handle,
8438
- command.title,
8439
- command.handle
8440
- ))));
8441
- });
9440
+ }));
8442
9441
  let source;
8443
9442
  if (options.source) {
8444
9443
  source = {
@@ -8451,11 +9450,13 @@ let MainThreadMessageService = class MainThreadMessageService {
8451
9450
  }
8452
9451
  const secondaryActions = [];
8453
9452
  if (options.source) {
8454
- secondaryActions.push(( (new ManageExtensionAction(
8455
- options.source.identifier,
8456
- (localize('manageExtension', "Manage Extension")),
8457
- this._commandService
8458
- ))));
9453
+ secondaryActions.push(toAction({
9454
+ id: options.source.identifier.value,
9455
+ label: ( (localize('manageExtension', "Manage Extension"))),
9456
+ run: () => {
9457
+ return this._commandService.executeCommand('_extensions.manage', options.source.identifier.value);
9458
+ }
9459
+ }));
8459
9460
  }
8460
9461
  const messageHandle = this._notificationService.notify({
8461
9462
  severity,
@@ -8464,32 +9465,49 @@ let MainThreadMessageService = class MainThreadMessageService {
8464
9465
  source
8465
9466
  });
8466
9467
  Event.once(messageHandle.onDidClose)(() => {
8467
- dispose(primaryActions);
8468
- dispose(secondaryActions);
8469
9468
  resolve(undefined);
8470
9469
  });
8471
9470
  }))
8472
9471
  );
8473
9472
  }
8474
9473
  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;
9474
+ const buttons = [];
9475
+ let cancelButton = undefined;
9476
+ for (const command of commands) {
9477
+ const button = {
9478
+ label: command.title,
9479
+ run: () => command.handle
9480
+ };
9481
+ if (command.isCloseAffordance) {
9482
+ cancelButton = button;
8479
9483
  }
8480
- return command.title;
8481
- });
8482
- if (cancelId === undefined) {
9484
+ else {
9485
+ buttons.push(button);
9486
+ }
9487
+ }
9488
+ if (!cancelButton) {
8483
9489
  if (buttons.length > 0) {
8484
- buttons.push(( (localize('cancel', "Cancel"))));
9490
+ cancelButton = {
9491
+ label: ( (localize('cancel', "Cancel"))),
9492
+ run: () => undefined
9493
+ };
8485
9494
  }
8486
9495
  else {
8487
- buttons.push(( (localize('ok', "OK"))));
9496
+ cancelButton = {
9497
+ label: ( (localize({ key: 'ok', comment: ['&& denotes a mnemonic'] }, "&&OK"))),
9498
+ run: () => undefined
9499
+ };
8488
9500
  }
8489
- cancelId = buttons.length - 1;
8490
9501
  }
8491
- const { choice } = await this._dialogService.show(severity, message, buttons, { cancelId, custom: useCustom, detail });
8492
- return choice === commands.length ? undefined : commands[choice].handle;
9502
+ const { result } = await this._dialogService.prompt({
9503
+ type: severity,
9504
+ message,
9505
+ detail,
9506
+ buttons,
9507
+ cancelButton,
9508
+ custom: useCustom
9509
+ });
9510
+ return result;
8493
9511
  }
8494
9512
  };
8495
9513
  MainThreadMessageService = ( (__decorate([
@@ -8524,9 +9542,7 @@ class ExtHostProgress {
8524
9542
  const progressEnd = (handle) => {
8525
9543
  this._proxy.$progressEnd(handle);
8526
9544
  this._mapHandleToCancellationSource.delete(handle);
8527
- if (source) {
8528
- source.dispose();
8529
- }
9545
+ source?.dispose();
8530
9546
  };
8531
9547
  let p;
8532
9548
  try {
@@ -8623,12 +9639,12 @@ let MainThreadDocumentContentProviders = class MainThreadDocumentContentProvider
8623
9639
  this._languageService = _languageService;
8624
9640
  this._modelService = _modelService;
8625
9641
  this._editorWorkerService = _editorWorkerService;
8626
- this._resourceContentProvider = ( (new Map()));
9642
+ this._resourceContentProvider = ( (new DisposableMap()));
8627
9643
  this._pendingUpdate = ( (new Map()));
8628
9644
  this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostDocumentContentProviders);
8629
9645
  }
8630
9646
  dispose() {
8631
- dispose(( (this._resourceContentProvider.values())));
9647
+ this._resourceContentProvider.dispose();
8632
9648
  dispose(( (this._pendingUpdate.values())));
8633
9649
  }
8634
9650
  $registerTextContentProvider(handle, scheme) {
@@ -8647,11 +9663,7 @@ let MainThreadDocumentContentProviders = class MainThreadDocumentContentProvider
8647
9663
  this._resourceContentProvider.set(handle, registration);
8648
9664
  }
8649
9665
  $unregisterTextContentProvider(handle) {
8650
- const registration = this._resourceContentProvider.get(handle);
8651
- if (registration) {
8652
- registration.dispose();
8653
- this._resourceContentProvider.delete(handle);
8654
- }
9666
+ this._resourceContentProvider.deleteAndDispose(handle);
8655
9667
  }
8656
9668
  $onVirtualDocumentChange(uri, value) {
8657
9669
  const model = this._modelService.getModel(URI.revive(uri));
@@ -8659,9 +9671,7 @@ let MainThreadDocumentContentProviders = class MainThreadDocumentContentProvider
8659
9671
  return;
8660
9672
  }
8661
9673
  const pending = this._pendingUpdate.get(model.id);
8662
- if (pending) {
8663
- pending.cancel();
8664
- }
9674
+ pending?.cancel();
8665
9675
  const myToken = ( (new CancellationTokenSource()));
8666
9676
  this._pendingUpdate.set(model.id, myToken);
8667
9677
  this._editorWorkerService.computeMoreMinimalEdits(model.uri, [{ text: value, range: model.getFullModelRange() }]).then(edits => {
@@ -8838,6 +9848,12 @@ class ExtHostTextEditorOptions {
8838
9848
  set tabSize(value) {
8839
9849
  that._setTabSize(value);
8840
9850
  },
9851
+ get indentSize() {
9852
+ return that._indentSize;
9853
+ },
9854
+ set indentSize(value) {
9855
+ that._setIndentSize(value);
9856
+ },
8841
9857
  get insertSpaces() {
8842
9858
  return that._insertSpaces;
8843
9859
  },
@@ -8860,6 +9876,7 @@ class ExtHostTextEditorOptions {
8860
9876
  }
8861
9877
  _accept(source) {
8862
9878
  this._tabSize = source.tabSize;
9879
+ this._indentSize = source.indentSize;
8863
9880
  this._insertSpaces = source.insertSpaces;
8864
9881
  this._cursorStyle = source.cursorStyle;
8865
9882
  this._lineNumbers = TextEditorLineNumbersStyle.to(source.lineNumbers);
@@ -8896,6 +9913,38 @@ class ExtHostTextEditorOptions {
8896
9913
  tabSize: tabSize
8897
9914
  }));
8898
9915
  }
9916
+ _validateIndentSize(value) {
9917
+ if (value === 'tabSize') {
9918
+ return 'tabSize';
9919
+ }
9920
+ if (typeof value === 'number') {
9921
+ const r = Math.floor(value);
9922
+ return (r > 0 ? r : null);
9923
+ }
9924
+ if (typeof value === 'string') {
9925
+ const r = parseInt(value, 10);
9926
+ if (isNaN(r)) {
9927
+ return null;
9928
+ }
9929
+ return (r > 0 ? r : null);
9930
+ }
9931
+ return null;
9932
+ }
9933
+ _setIndentSize(value) {
9934
+ const indentSize = this._validateIndentSize(value);
9935
+ if (indentSize === null) {
9936
+ return;
9937
+ }
9938
+ if (typeof indentSize === 'number') {
9939
+ if (this._indentSize === indentSize) {
9940
+ return;
9941
+ }
9942
+ this._indentSize = indentSize;
9943
+ }
9944
+ this._warnOnError('setIndentSize', this._proxy.$trySetOptions(this._id, {
9945
+ indentSize: indentSize
9946
+ }));
9947
+ }
8899
9948
  _validateInsertSpaces(value) {
8900
9949
  if (value === 'auto') {
8901
9950
  return 'auto';
@@ -8947,6 +9996,18 @@ class ExtHostTextEditorOptions {
8947
9996
  bulkConfigurationUpdate.tabSize = tabSize;
8948
9997
  }
8949
9998
  }
9999
+ if (typeof newOptions.indentSize !== 'undefined') {
10000
+ const indentSize = this._validateIndentSize(newOptions.indentSize);
10001
+ if (indentSize === 'tabSize') {
10002
+ hasUpdate = true;
10003
+ bulkConfigurationUpdate.indentSize = indentSize;
10004
+ }
10005
+ else if (typeof indentSize === 'number' && this._indentSize !== indentSize) {
10006
+ this._indentSize = indentSize;
10007
+ hasUpdate = true;
10008
+ bulkConfigurationUpdate.indentSize = indentSize;
10009
+ }
10010
+ }
8950
10011
  if (typeof newOptions.insertSpaces !== 'undefined') {
8951
10012
  const insertSpaces = this._validateInsertSpaces(newOptions.insertSpaces);
8952
10013
  if (insertSpaces === 'auto') {
@@ -8998,7 +10059,7 @@ class ExtHostTextEditor {
8998
10059
  const that = this;
8999
10060
  this.value = ( (Object.freeze({
9000
10061
  get document() {
9001
- return document.getValue();
10062
+ return document.value;
9002
10063
  },
9003
10064
  set document(_value) {
9004
10065
  throw readonly('document');
@@ -9047,7 +10108,7 @@ class ExtHostTextEditor {
9047
10108
  if (that._disposed) {
9048
10109
  return Promise.reject(( (new Error('TextEditor#edit not possible on closed editors'))));
9049
10110
  }
9050
- const edit = ( (new TextEditorEdit(document.getValue(), options)));
10111
+ const edit = ( (new TextEditorEdit(document.value, options)));
9051
10112
  callback(edit);
9052
10113
  return that._applyEdit(edit);
9053
10114
  },
@@ -9078,7 +10139,7 @@ class ExtHostTextEditor {
9078
10139
  }
9079
10140
  }
9080
10141
  }
9081
- return _proxy.$tryInsertSnippet(id, document.getValue().version, snippet.value, ranges, options);
10142
+ return _proxy.$tryInsertSnippet(id, document.value.version, snippet.value, ranges, options);
9082
10143
  },
9083
10144
  setDecorations(decorationType, ranges) {
9084
10145
  const willBeEmpty = (ranges.length === 0);
@@ -9213,11 +10274,11 @@ let ExtHostDocumentsAndEditors = class ExtHostDocumentsAndEditors {
9213
10274
  this._logService = _logService;
9214
10275
  this._activeEditorId = null;
9215
10276
  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()));
10277
+ this._documents = ( (new ResourceMap$1()));
10278
+ this._onDidAddDocuments = ( (new Emitter$1()));
10279
+ this._onDidRemoveDocuments = ( (new Emitter$1()));
10280
+ this._onDidChangeVisibleTextEditors = ( (new Emitter$1()));
10281
+ this._onDidChangeActiveTextEditor = ( (new Emitter$1()));
9221
10282
  this.onDidAddDocuments = this._onDidAddDocuments.event;
9222
10283
  this.onDidRemoveDocuments = this._onDidRemoveDocuments.event;
9223
10284
  this.onDidChangeVisibleTextEditors = this._onDidChangeVisibleTextEditors.event;
@@ -9345,12 +10406,12 @@ ExtHostDocumentsAndEditors = ( (__decorate([
9345
10406
  class ExtHostEditors {
9346
10407
  constructor(mainContext, _extHostDocumentsAndEditors) {
9347
10408
  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()));
10409
+ this._onDidChangeTextEditorSelection = ( (new Emitter$1()));
10410
+ this._onDidChangeTextEditorOptions = ( (new Emitter$1()));
10411
+ this._onDidChangeTextEditorVisibleRanges = ( (new Emitter$1()));
10412
+ this._onDidChangeTextEditorViewColumn = ( (new Emitter$1()));
10413
+ this._onDidChangeActiveTextEditor = ( (new Emitter$1()));
10414
+ this._onDidChangeVisibleTextEditors = ( (new Emitter$1()));
9354
10415
  this.onDidChangeTextEditorSelection = this._onDidChangeTextEditorSelection.event;
9355
10416
  this.onDidChangeTextEditorOptions = this._onDidChangeTextEditorOptions.event;
9356
10417
  this.onDidChangeTextEditorVisibleRanges = this._onDidChangeTextEditorVisibleRanges.event;
@@ -9540,9 +10601,9 @@ let MainThreadDocuments = class MainThreadDocuments extends Disposable$1 {
9540
10601
  this._environmentService = _environmentService;
9541
10602
  this._uriIdentityService = _uriIdentityService;
9542
10603
  this._pathService = _pathService;
9543
- this._onIsCaughtUpWithContentChanges = this._store.add(( (new Emitter())));
10604
+ this._onIsCaughtUpWithContentChanges = this._store.add(( (new Emitter$1())));
9544
10605
  this.onIsCaughtUpWithContentChanges = this._onIsCaughtUpWithContentChanges.event;
9545
- this._modelTrackers = ( (new ResourceMap()));
10606
+ this._modelTrackers = ( (new ResourceMap$1()));
9546
10607
  this._modelReferenceCollection = this._store.add(( (new BoundModelReferenceCollection(_uriIdentityService.extUri))));
9547
10608
  this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostDocuments);
9548
10609
  this._store.add(_modelService.onModelLanguageChanged(this._onModelModeChanged, this));
@@ -9689,13 +10750,8 @@ MainThreadDocuments = ( (__decorate([
9689
10750
  ( (__param(7, IWorkingCopyFileService))),
9690
10751
  ( (__param(8, IPathService)))
9691
10752
  ], 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
- }
10753
+ const Selection = monaco.Selection;
10754
+ class MainThreadTextEditorProperties {
9699
10755
  static readFromEditor(previousProperties, model, codeEditor) {
9700
10756
  const selections = MainThreadTextEditorProperties._readSelectionsFromCodeEditor(previousProperties, codeEditor);
9701
10757
  const options = MainThreadTextEditorProperties._readOptionsFromCodeEditor(previousProperties, model, codeEditor);
@@ -9730,8 +10786,8 @@ class MainThreadTextEditorProperties {
9730
10786
  let lineNumbers;
9731
10787
  if (codeEditor) {
9732
10788
  const options = codeEditor.getOptions();
9733
- const lineNumbersOpts = options.get(62 );
9734
- cursorStyle = options.get(24 );
10789
+ const lineNumbersOpts = options.get(64 );
10790
+ cursorStyle = options.get(25 );
9735
10791
  lineNumbers = lineNumbersOpts.renderType;
9736
10792
  }
9737
10793
  else if (previousProperties) {
@@ -9746,6 +10802,7 @@ class MainThreadTextEditorProperties {
9746
10802
  return {
9747
10803
  insertSpaces: modelOptions.insertSpaces,
9748
10804
  tabSize: modelOptions.tabSize,
10805
+ indentSize: modelOptions.indentSize,
9749
10806
  cursorStyle: cursorStyle,
9750
10807
  lineNumbers: lineNumbers
9751
10808
  };
@@ -9756,6 +10813,11 @@ class MainThreadTextEditorProperties {
9756
10813
  }
9757
10814
  return [];
9758
10815
  }
10816
+ constructor(selections, options, visibleRanges) {
10817
+ this.selections = selections;
10818
+ this.options = options;
10819
+ this.visibleRanges = visibleRanges;
10820
+ }
9759
10821
  generateDelta(oldProps, selectionChangeSource) {
9760
10822
  const delta = {
9761
10823
  options: null,
@@ -9793,6 +10855,7 @@ class MainThreadTextEditorProperties {
9793
10855
  return true;
9794
10856
  }
9795
10857
  return (a.tabSize === b.tabSize
10858
+ && a.indentSize === b.indentSize
9796
10859
  && a.insertSpaces === b.insertSpaces
9797
10860
  && a.cursorStyle === b.cursorStyle
9798
10861
  && a.lineNumbers === b.lineNumbers);
@@ -9810,7 +10873,7 @@ class MainThreadTextEditor {
9810
10873
  this._mainThreadDocuments = mainThreadDocuments;
9811
10874
  this._modelService = modelService;
9812
10875
  this._clipboardService = clipboardService;
9813
- this._onPropertiesChanged = ( (new Emitter()));
10876
+ this._onPropertiesChanged = ( (new Emitter$1()));
9814
10877
  this._modelListeners.add(this._model.onDidChangeOptions((e) => {
9815
10878
  this._updatePropertiesNow(null);
9816
10879
  }));
@@ -9945,6 +11008,9 @@ class MainThreadTextEditor {
9945
11008
  if (typeof newConfiguration.tabSize !== 'undefined') {
9946
11009
  newOpts.tabSize = newConfiguration.tabSize;
9947
11010
  }
11011
+ if (typeof newConfiguration.indentSize !== 'undefined') {
11012
+ newOpts.indentSize = newConfiguration.indentSize;
11013
+ }
9948
11014
  this._model.updateOptions(newOpts);
9949
11015
  }
9950
11016
  setConfiguration(newConfiguration) {
@@ -10067,7 +11133,9 @@ class MainThreadTextEditor {
10067
11133
  return false;
10068
11134
  }
10069
11135
  }
10070
- if (this._codeEditor.getModel().getVersionId() !== modelVersionId) ;
11136
+ if (this._codeEditor.getModel().getVersionId() !== modelVersionId) {
11137
+ return false;
11138
+ }
10071
11139
  const snippetController = SnippetController2.get(this._codeEditor);
10072
11140
  if (!snippetController) {
10073
11141
  return false;
@@ -10083,31 +11151,44 @@ class MainThreadTextEditor {
10083
11151
  return true;
10084
11152
  }
10085
11153
  }
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;
11154
+ var EditorActivation;
11155
+ ( ((function(EditorActivation) {
11156
+ EditorActivation[EditorActivation["ACTIVATE"] = 1] = "ACTIVATE";
11157
+ EditorActivation[EditorActivation["RESTORE"] = 2] = "RESTORE";
11158
+ EditorActivation[EditorActivation["PRESERVE"] = 3] = "PRESERVE";
11159
+ })(EditorActivation || (EditorActivation = {}))));
11160
+ var EditorResolution;
11161
+ ( ((function(EditorResolution) {
11162
+ EditorResolution[EditorResolution["PICK"] = 0] = "PICK";
11163
+ EditorResolution[EditorResolution["EXCLUSIVE_ONLY"] = 1] = "EXCLUSIVE_ONLY";
11164
+ })(EditorResolution || (EditorResolution = {}))));
11165
+ function columnToEditorGroup(editorGroupService, configurationService, column = ACTIVE_GROUP) {
11166
+ if (column === ACTIVE_GROUP || column === SIDE_GROUP) {
11167
+ return column;
10094
11168
  }
10095
- const groupInColumn = editorGroupService.getGroups(2 )[column];
10096
- if (groupInColumn) {
10097
- return groupInColumn.id;
11169
+ let groupInColumn = editorGroupService.getGroups(2 )[column];
11170
+ if (!groupInColumn && column < 9) {
11171
+ for (let i = 0; i <= column; i++) {
11172
+ const editorGroups = editorGroupService.getGroups(2 );
11173
+ if (!editorGroups[i]) {
11174
+ editorGroupService.addGroup(editorGroups[i - 1], preferredSideBySideGroupDirection(configurationService));
11175
+ }
11176
+ }
11177
+ groupInColumn = editorGroupService.getGroups(2 )[column];
10098
11178
  }
10099
- return SIDE_GROUP;
11179
+ return groupInColumn?.id ?? SIDE_GROUP;
10100
11180
  }
10101
11181
  function editorGroupToColumn(editorGroupService, editorGroup) {
10102
11182
  const group = (typeof editorGroup === 'number') ? editorGroupService.getGroup(editorGroup) : editorGroup;
10103
11183
  return editorGroupService.getGroups(2 ).indexOf(group ?? editorGroupService.activeGroup);
10104
11184
  }
10105
11185
  let MainThreadTextEditors = class MainThreadTextEditors {
10106
- constructor(_editorLocator, extHostContext, _codeEditorService, _editorService, _editorGroupService) {
11186
+ constructor(_editorLocator, extHostContext, _codeEditorService, _editorService, _editorGroupService, _configurationService) {
10107
11187
  this._editorLocator = _editorLocator;
10108
11188
  this._codeEditorService = _codeEditorService;
10109
11189
  this._editorService = _editorService;
10110
11190
  this._editorGroupService = _editorGroupService;
11191
+ this._configurationService = _configurationService;
10111
11192
  this._toDispose = ( (new DisposableStore()));
10112
11193
  this._instanceId = String(++MainThreadTextEditors.INSTANCE_COUNT);
10113
11194
  this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostEditors);
@@ -10165,17 +11246,19 @@ let MainThreadTextEditors = class MainThreadTextEditors {
10165
11246
  pinned: options.pinned,
10166
11247
  selection: options.selection,
10167
11248
  activation: options.preserveFocus ? EditorActivation.RESTORE : undefined,
10168
- override: EditorResolution.DISABLED
11249
+ override: EditorResolution.EXCLUSIVE_ONLY
10169
11250
  };
10170
11251
  const input = {
10171
11252
  resource: uri,
10172
11253
  options: editorOptions
10173
11254
  };
10174
- const editor = await this._editorService.openEditor(input, columnToEditorGroup(this._editorGroupService, options.position));
11255
+ const editor = await this._editorService.openEditor(input, columnToEditorGroup(this._editorGroupService, this._configurationService, options.position));
10175
11256
  if (!editor) {
10176
11257
  return undefined;
10177
11258
  }
10178
- return this._editorLocator.findTextEditorIdFor(editor);
11259
+ const editorControl = editor.getControl();
11260
+ const codeEditor = getCodeEditor(editorControl);
11261
+ return codeEditor ? this._editorLocator.getIdOfCodeEditor(codeEditor) : undefined;
10179
11262
  }
10180
11263
  async $tryShowEditor(id, position) {
10181
11264
  const mainThreadEditor = this._editorLocator.getEditor(id);
@@ -10184,7 +11267,7 @@ let MainThreadTextEditors = class MainThreadTextEditors {
10184
11267
  await this._editorService.openEditor({
10185
11268
  resource: model.uri,
10186
11269
  options: { preserveFocus: false }
10187
- }, columnToEditorGroup(this._editorGroupService, position));
11270
+ }, columnToEditorGroup(this._editorGroupService, this._configurationService, position));
10188
11271
  return;
10189
11272
  }
10190
11273
  }
@@ -10292,7 +11375,8 @@ MainThreadTextEditors.INSTANCE_COUNT = 0;
10292
11375
  MainThreadTextEditors = ( (__decorate([
10293
11376
  ( (__param(2, ICodeEditorService))),
10294
11377
  ( (__param(3, IEditorService))),
10295
- ( (__param(4, IEditorGroupsService)))
11378
+ ( (__param(4, IEditorGroupsService))),
11379
+ ( (__param(5, IConfigurationService)))
10296
11380
  ], MainThreadTextEditors)));
10297
11381
  class AbstractTextEditor {}
10298
11382
  class TextEditorSnapshot {
@@ -10326,11 +11410,6 @@ class DocumentAndEditorStateDelta {
10326
11410
  }
10327
11411
  }
10328
11412
  class DocumentAndEditorState {
10329
- constructor(documents, textEditors, activeEditor) {
10330
- this.documents = documents;
10331
- this.textEditors = textEditors;
10332
- this.activeEditor = activeEditor;
10333
- }
10334
11413
  static compute(before, after) {
10335
11414
  if (!before) {
10336
11415
  return (
@@ -10359,6 +11438,11 @@ class DocumentAndEditorState {
10359
11438
  ))
10360
11439
  );
10361
11440
  }
11441
+ constructor(documents, textEditors, activeEditor) {
11442
+ this.documents = documents;
11443
+ this.textEditors = textEditors;
11444
+ this.activeEditor = activeEditor;
11445
+ }
10362
11446
  }
10363
11447
  let MainThreadDocumentAndEditorStateComputer = class MainThreadDocumentAndEditorStateComputer {
10364
11448
  constructor(_onDidChangeState, _modelService, _codeEditorService, _editorService, _paneCompositeService) {
@@ -10368,7 +11452,7 @@ let MainThreadDocumentAndEditorStateComputer = class MainThreadDocumentAndEditor
10368
11452
  this._editorService = _editorService;
10369
11453
  this._paneCompositeService = _paneCompositeService;
10370
11454
  this._toDispose = ( (new DisposableStore()));
10371
- this._toDisposeOnEditorRemove = ( (new Map()));
11455
+ this._toDisposeOnEditorRemove = ( (new DisposableMap()));
10372
11456
  this._activeEditorOrder = 0 ;
10373
11457
  this._modelService.onModelAdded(this._updateStateOnModelAdd, this, this._toDispose);
10374
11458
  this._modelService.onModelRemoved(_ => this._updateState(), this, this._toDispose);
@@ -10383,16 +11467,16 @@ let MainThreadDocumentAndEditorStateComputer = class MainThreadDocumentAndEditor
10383
11467
  }
10384
11468
  dispose() {
10385
11469
  this._toDispose.dispose();
11470
+ this._toDisposeOnEditorRemove.dispose();
10386
11471
  }
10387
11472
  _onDidAddEditor(e) {
10388
11473
  this._toDisposeOnEditorRemove.set(e.getId(), combinedDisposable(e.onDidChangeModel(() => this._updateState()), e.onDidFocusEditorText(() => this._updateState()), e.onDidFocusEditorWidget(() => this._updateState(e))));
10389
11474
  this._updateState();
10390
11475
  }
10391
11476
  _onDidRemoveEditor(e) {
10392
- const sub = this._toDisposeOnEditorRemove.get(e.getId());
10393
- if (sub) {
10394
- this._toDisposeOnEditorRemove.delete(e.getId());
10395
- sub.dispose();
11477
+ const id = e.getId();
11478
+ if (this._toDisposeOnEditorRemove.has(id)) {
11479
+ this._toDisposeOnEditorRemove.deleteAndDispose(id);
10396
11480
  this._updateState();
10397
11481
  }
10398
11482
  }
@@ -10484,7 +11568,7 @@ MainThreadDocumentAndEditorStateComputer = ( (__decorate([
10484
11568
  ( (__param(4, IPaneCompositePartService)))
10485
11569
  ], MainThreadDocumentAndEditorStateComputer)));
10486
11570
  let MainThreadDocumentsAndEditors = class MainThreadDocumentsAndEditors {
10487
- constructor(extHostContext, _modelService, _textFileService, _editorService, codeEditorService, fileService, textModelResolverService, _editorGroupService, paneCompositeService, environmentService, workingCopyFileService, uriIdentityService, _clipboardService, pathService, instantiationService) {
11571
+ constructor(extHostContext, _modelService, _textFileService, _editorService, codeEditorService, fileService, textModelResolverService, _editorGroupService, paneCompositeService, environmentService, workingCopyFileService, uriIdentityService, _clipboardService, pathService, configurationService) {
10488
11572
  this._modelService = _modelService;
10489
11573
  this._textFileService = _textFileService;
10490
11574
  this._editorService = _editorService;
@@ -10510,7 +11594,8 @@ let MainThreadDocumentsAndEditors = class MainThreadDocumentsAndEditors {
10510
11594
  extHostContext,
10511
11595
  codeEditorService,
10512
11596
  this._editorService,
10513
- this._editorGroupService
11597
+ this._editorGroupService,
11598
+ configurationService
10514
11599
  ))));
10515
11600
  extHostContext.set(MainContext.MainThreadTextEditors, this._mainThreadEditors);
10516
11601
  this._toDispose.add(( (new MainThreadDocumentAndEditorStateComputer(
@@ -10643,7 +11728,7 @@ MainThreadDocumentsAndEditors = ( (__decorate([
10643
11728
  ( (__param(11, IUriIdentityService))),
10644
11729
  ( (__param(12, IClipboardService))),
10645
11730
  ( (__param(13, IPathService))),
10646
- ( (__param(14, IInstantiationService)))
11731
+ ( (__param(14, IConfigurationService)))
10647
11732
  ], MainThreadDocumentsAndEditors)));
10648
11733
  let MainThreadDiagnostics = class MainThreadDiagnostics {
10649
11734
  constructor(extHostContext, _markerService, _uriIdentService) {
@@ -10705,47 +11790,29 @@ MainThreadDiagnostics = ( (__decorate([
10705
11790
  ( (__param(1, IMarkerService))),
10706
11791
  ( (__param(2, IUriIdentityService)))
10707
11792
  ], 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
11793
  var MainThreadTelemetry_1;
10730
11794
  let MainThreadTelemetry = MainThreadTelemetry_1 = class MainThreadTelemetry extends Disposable$1 {
10731
- constructor(extHostContext, _telemetryService, _environmentService, _productService) {
11795
+ constructor(extHostContext, _telemetryService, _configurationService, _environmentService, _productService) {
10732
11796
  super();
10733
11797
  this._telemetryService = _telemetryService;
11798
+ this._configurationService = _configurationService;
10734
11799
  this._environmentService = _environmentService;
10735
11800
  this._productService = _productService;
10736
11801
  this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostTelemetry);
10737
11802
  if (supportsTelemetry(this._productService, this._environmentService)) {
10738
- this._register(_telemetryService.telemetryLevel.onDidChange(level => {
10739
- this._proxy.$onDidChangeTelemetryLevel(level);
11803
+ this._register(this._configurationService.onDidChangeConfiguration(e => {
11804
+ if (e.affectsConfiguration(TELEMETRY_SETTING_ID) || e.affectsConfiguration(TELEMETRY_OLD_SETTING_ID)) {
11805
+ this._proxy.$onDidChangeTelemetryLevel(this.telemetryLevel);
11806
+ }
10740
11807
  }));
10741
11808
  }
10742
- this._proxy.$initializeTelemetryLevel(this.telemetryLevel, this._productService.enabledTelemetryLevels);
11809
+ this._proxy.$initializeTelemetryLevel(this.telemetryLevel, supportsTelemetry(this._productService, this._environmentService), this._productService.enabledTelemetryLevels);
10743
11810
  }
10744
11811
  get telemetryLevel() {
10745
11812
  if (!supportsTelemetry(this._productService, this._environmentService)) {
10746
11813
  return 0 ;
10747
11814
  }
10748
- return this._telemetryService.telemetryLevel.value;
11815
+ return this._telemetryService.telemetryLevel;
10749
11816
  }
10750
11817
  $publicLog(eventName, data = Object.create(null)) {
10751
11818
  data[MainThreadTelemetry_1._name] = true;
@@ -10759,8 +11826,9 @@ MainThreadTelemetry._name = 'pluginHostTelemetry';
10759
11826
  MainThreadTelemetry = MainThreadTelemetry_1 = ( (__decorate([
10760
11827
  extHostNamedCustomer(MainContext.MainThreadTelemetry),
10761
11828
  ( (__param(1, ITelemetryService))),
10762
- ( (__param(2, IEnvironmentService))),
10763
- ( (__param(3, IProductService)))
11829
+ ( (__param(2, IConfigurationService))),
11830
+ ( (__param(3, IEnvironmentService))),
11831
+ ( (__param(4, IProductService)))
10764
11832
  ], MainThreadTelemetry)));
10765
11833
  let ExtHostBulkEdits = class ExtHostBulkEdits {
10766
11834
  constructor(extHostRpc, extHostDocumentsAndEditors) {
@@ -10770,22 +11838,15 @@ let ExtHostBulkEdits = class ExtHostBulkEdits {
10770
11838
  getNotebookDocumentVersion: () => undefined
10771
11839
  };
10772
11840
  }
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);
11841
+ applyWorkspaceEdit(edit, extension, metadata) {
11842
+ const dto = WorkspaceEdit.from(edit, this._versionInformationProvider);
11843
+ return this._proxy.$tryApplyWorkspaceEdit(dto, undefined, metadata?.isRefactoring ?? false);
10777
11844
  }
10778
11845
  };
10779
11846
  ExtHostBulkEdits = ( (__decorate([
10780
11847
  ( (__param(0, IExtHostRpcService)))
10781
11848
  ], ExtHostBulkEdits)));
10782
11849
  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
11850
  static is(candidate) {
10790
11851
  if (candidate instanceof ResourceNotebookCellEdit) {
10791
11852
  return true;
@@ -10801,35 +11862,24 @@ class ResourceNotebookCellEdit extends ResourceEdit {
10801
11862
  (new ResourceNotebookCellEdit(edit.resource, edit.cellEdit, edit.notebookVersionId, edit.metadata))
10802
11863
  );
10803
11864
  }
10804
- }
10805
- function reviveWorkspaceEditDto2(data) {
10806
- const edits = reviveWorkspaceEditDto(data)?.edits;
10807
- if (!edits) {
10808
- return [];
11865
+ constructor(resource, cellEdit, notebookVersionId = undefined, metadata) {
11866
+ super(metadata);
11867
+ this.resource = resource;
11868
+ this.cellEdit = cellEdit;
11869
+ this.notebookVersionId = notebookVersionId;
10809
11870
  }
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
11871
  }
10823
11872
  let MainThreadBulkEdits = class MainThreadBulkEdits {
10824
- constructor(_extHostContext, _bulkEditService, _logService) {
11873
+ constructor(_extHostContext, _bulkEditService, _logService, _uriIdentService) {
10825
11874
  this._bulkEditService = _bulkEditService;
10826
11875
  this._logService = _logService;
11876
+ this._uriIdentService = _uriIdentService;
10827
11877
  }
10828
11878
  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);
11879
+ $tryApplyWorkspaceEdit(dto, undoRedoGroupId, isRefactoring) {
11880
+ const edits = reviveWorkspaceEditDto(dto, this._uriIdentService);
11881
+ return this._bulkEditService.apply(edits, { undoRedoGroupId, respectAutoSaveConfig: isRefactoring }).then((res) => res.isApplied, err => {
11882
+ this._logService.warn(`IGNORING workspace edit: ${err}`);
10833
11883
  return false;
10834
11884
  });
10835
11885
  }
@@ -10837,8 +11887,28 @@ let MainThreadBulkEdits = class MainThreadBulkEdits {
10837
11887
  MainThreadBulkEdits = ( (__decorate([
10838
11888
  extHostNamedCustomer(MainContext.MainThreadBulkEdits),
10839
11889
  ( (__param(1, IBulkEditService))),
10840
- ( (__param(2, ILogService)))
11890
+ ( (__param(2, ILogService))),
11891
+ ( (__param(3, IUriIdentityService)))
10841
11892
  ], MainThreadBulkEdits)));
11893
+ function reviveWorkspaceEditDto(data, uriIdentityService) {
11894
+ if (!data || !data.edits) {
11895
+ return data;
11896
+ }
11897
+ const result = revive(data);
11898
+ for (const edit of result.edits) {
11899
+ if (ResourceTextEdit.is(edit)) {
11900
+ edit.resource = uriIdentityService.asCanonicalUri(edit.resource);
11901
+ }
11902
+ if (ResourceFileEdit.is(edit)) {
11903
+ edit.newResource = edit.newResource && uriIdentityService.asCanonicalUri(edit.newResource);
11904
+ edit.oldResource = edit.oldResource && uriIdentityService.asCanonicalUri(edit.oldResource);
11905
+ }
11906
+ if (ResourceNotebookCellEdit.is(edit)) {
11907
+ edit.resource = uriIdentityService.asCanonicalUri(edit.resource);
11908
+ }
11909
+ }
11910
+ return data;
11911
+ }
10842
11912
  class ExtHostLanguages {
10843
11913
  constructor(mainContext, _documents, _commands, _uriTransformer) {
10844
11914
  this._documents = _documents;
@@ -11003,7 +12073,7 @@ let MainThreadLanguages = class MainThreadLanguages {
11003
12073
  this._resolverService = _resolverService;
11004
12074
  this._languageStatusService = _languageStatusService;
11005
12075
  this._disposables = ( (new DisposableStore()));
11006
- this._status = ( (new Map()));
12076
+ this._status = ( (new DisposableMap()));
11007
12077
  this._proxy = _extHostContext.getProxy(ExtHostContext.ExtHostLanguages);
11008
12078
  this._proxy.$acceptLanguageIds(_languageService.getRegisteredLanguageIds());
11009
12079
  this._disposables.add(_languageService.onDidChange(_ => {
@@ -11012,10 +12082,7 @@ let MainThreadLanguages = class MainThreadLanguages {
11012
12082
  }
11013
12083
  dispose() {
11014
12084
  this._disposables.dispose();
11015
- for (const status of ( (this._status.values()))) {
11016
- status.dispose();
11017
- }
11018
- this._status.clear();
12085
+ this._status.dispose();
11019
12086
  }
11020
12087
  async $changeLanguage(resource, languageId) {
11021
12088
  if (!this._languageService.isRegisteredLanguageId(languageId)) {
@@ -11064,31 +12131,15 @@ MainThreadLanguages = ( (__decorate([
11064
12131
  ( (__param(3, ITextModelService))),
11065
12132
  ( (__param(4, ILanguageStatusService)))
11066
12133
  ], 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
12134
  let ExtHostWindow = class ExtHostWindow {
12135
+ get state() { return this._state; }
11084
12136
  constructor(extHostRpc) {
11085
- this._onDidChangeWindowState = ( (new Emitter()));
12137
+ this._onDidChangeWindowState = ( (new Emitter$1()));
11086
12138
  this.onDidChangeWindowState = this._onDidChangeWindowState.event;
11087
12139
  this._state = ExtHostWindow.InitialState;
11088
12140
  this._proxy = extHostRpc.getProxy(MainContext.MainThreadWindow);
11089
12141
  this._proxy.$getWindowVisibility().then(isFocused => this.$onDidChangeWindowFocus(isFocused));
11090
12142
  }
11091
- get state() { return this._state; }
11092
12143
  $onDidChangeWindowFocus(focused) {
11093
12144
  if (focused === this._state.focused) {
11094
12145
  return;
@@ -11136,16 +12187,11 @@ let MainThreadWindow = class MainThreadWindow {
11136
12187
  this.hostService = hostService;
11137
12188
  this.openerService = openerService;
11138
12189
  this.disposables = ( (new DisposableStore()));
11139
- this.resolved = ( (new Map()));
11140
12190
  this.proxy = extHostContext.getProxy(ExtHostContext.ExtHostWindow);
11141
12191
  Event.latch(hostService.onDidChangeFocus)(this.proxy.$onDidChangeWindowFocus, this.proxy, this.disposables);
11142
12192
  }
11143
12193
  dispose() {
11144
12194
  this.disposables.dispose();
11145
- for (const value of ( (this.resolved.values()))) {
11146
- value.dispose();
11147
- }
11148
- this.resolved.clear();
11149
12195
  }
11150
12196
  $getWindowVisibility() {
11151
12197
  return Promise.resolve(this.hostService.hasFocus);
@@ -11205,38 +12251,6 @@ class ExtHostClipboard {
11205
12251
  })));
11206
12252
  }
11207
12253
  }
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
12254
  function reverseEndianness(arr) {
11241
12255
  for (let i = 0, len = arr.length; i < len; i += 4) {
11242
12256
  const b0 = arr[i + 0];
@@ -11668,7 +12682,7 @@ class CodeActionAdapter {
11668
12682
  title: candidate.title,
11669
12683
  command: candidate.command && this._commands.toInternal(candidate.command, disposables),
11670
12684
  diagnostics: candidate.diagnostics && candidate.diagnostics.map(Diagnostic.from),
11671
- edit: candidate.edit && WorkspaceEdit.from(candidate.edit, undefined, isProposedApiEnabled(this._extension, 'snippetWorkspaceEdit')),
12685
+ edit: candidate.edit && WorkspaceEdit.from(candidate.edit, undefined),
11672
12686
  kind: candidate.kind && candidate.kind.value,
11673
12687
  isPreferred: candidate.isPreferred,
11674
12688
  disabled: candidate.disabled?.reason
@@ -11688,7 +12702,7 @@ class CodeActionAdapter {
11688
12702
  }
11689
12703
  const resolvedItem = (await this._provider.resolveCodeAction(item, token)) ?? item;
11690
12704
  return resolvedItem?.edit
11691
- ? WorkspaceEdit.from(resolvedItem.edit, undefined, isProposedApiEnabled(this._extension, 'snippetWorkspaceEdit'))
12705
+ ? WorkspaceEdit.from(resolvedItem.edit, undefined)
11692
12706
  : undefined;
11693
12707
  }
11694
12708
  releaseCodeActions(cachedId) {
@@ -11723,8 +12737,8 @@ class DocumentPasteEditProvider {
11723
12737
  async providePasteEdits(requestId, resource, ranges, dataTransferDto, token) {
11724
12738
  const doc = this._documents.getDocument(resource);
11725
12739
  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;
12740
+ const dataTransfer = DataTransfer.toDataTransfer(dataTransferDto, async (id) => {
12741
+ return (await this._proxy.$resolvePasteFileData(this._handle, requestId, id)).buffer;
11728
12742
  });
11729
12743
  const edit = await this._provider.provideDocumentPasteEdits(doc, vscodeRanges, dataTransfer, token);
11730
12744
  if (!edit) {
@@ -11732,7 +12746,7 @@ class DocumentPasteEditProvider {
11732
12746
  }
11733
12747
  return {
11734
12748
  insertText: typeof edit.insertText === 'string' ? edit.insertText : { snippet: edit.insertText.value },
11735
- additionalEdit: edit.additionalEdit ? WorkspaceEdit.from(edit.additionalEdit, undefined, true) : undefined,
12749
+ additionalEdit: edit.additionalEdit ? WorkspaceEdit.from(edit.additionalEdit, undefined) : undefined,
11736
12750
  };
11737
12751
  }
11738
12752
  }
@@ -11829,14 +12843,14 @@ class NavigateTypeAdapter {
11829
12843
  }
11830
12844
  }
11831
12845
  class RenameAdapter {
12846
+ static supportsResolving(provider) {
12847
+ return typeof provider.prepareRename === 'function';
12848
+ }
11832
12849
  constructor(_documents, _provider, _logService) {
11833
12850
  this._documents = _documents;
11834
12851
  this._provider = _provider;
11835
12852
  this._logService = _logService;
11836
12853
  }
11837
- static supportsResolving(provider) {
11838
- return typeof provider.prepareRename === 'function';
11839
- }
11840
12854
  async provideRenameEdits(resource, position, newName, token) {
11841
12855
  const doc = this._documents.getDocument(resource);
11842
12856
  const pos = Position.to(position);
@@ -12060,6 +13074,9 @@ class DocumentRangeSemanticTokensAdapter {
12060
13074
  }
12061
13075
  }
12062
13076
  class CompletionsAdapter {
13077
+ static supportsResolving(provider) {
13078
+ return typeof provider.resolveCompletionItem === 'function';
13079
+ }
12063
13080
  constructor(_documents, _commands, _provider, _apiDeprecation, _extension) {
12064
13081
  this._documents = _documents;
12065
13082
  this._commands = _commands;
@@ -12069,9 +13086,6 @@ class CompletionsAdapter {
12069
13086
  this._cache = ( (new Cache('CompletionItem')));
12070
13087
  this._disposables = ( (new Map()));
12071
13088
  }
12072
- static supportsResolving(provider) {
12073
- return typeof provider.resolveCompletionItem === 'function';
12074
- }
12075
13089
  async provideCompletionItems(resource, position, context, token) {
12076
13090
  const doc = this._documents.getDocument(resource);
12077
13091
  const pos = Position.to(position);
@@ -12128,20 +13142,23 @@ class CompletionsAdapter {
12128
13142
  if (!disposables) {
12129
13143
  throw Error('DisposableStore is missing...');
12130
13144
  }
13145
+ const command = this._commands.toInternal(item.command, disposables);
12131
13146
  const result = {
12132
13147
  x: id,
12133
13148
  ["a" ]: item.label,
12134
13149
  ["b" ]: item.kind !== undefined ? CompletionItemKind.from(item.kind) : undefined,
12135
- ["n" ]: item.tags && item.tags.map(CompletionItemTag.from),
13150
+ ["m" ]: item.tags && item.tags.map(CompletionItemTag.from),
12136
13151
  ["c" ]: item.detail,
12137
13152
  ["d" ]: typeof item.documentation === 'undefined' ? undefined : MarkdownString.fromStrict(item.documentation),
12138
13153
  ["e" ]: item.sortText !== item.label ? item.sortText : undefined,
12139
13154
  ["f" ]: item.filterText !== item.label ? item.filterText : undefined,
12140
13155
  ["g" ]: item.preselect || undefined,
12141
- ["i" ]: item.keepWhitespace ? 1 : 0,
12142
- ["k" ]: item.commitCharacters,
13156
+ ["i" ]: item.keepWhitespace ? 1 : 0 ,
13157
+ ["k" ]: item.commitCharacters?.join(''),
12143
13158
  ["l" ]: item.additionalTextEdits && item.additionalTextEdits.map(TextEdit.from),
12144
- ["m" ]: this._commands.toInternal(item.command, disposables),
13159
+ ["n" ]: command?.$ident,
13160
+ ["o" ]: command?.id,
13161
+ ["p" ]: command?.$ident ? undefined : command?.arguments,
12145
13162
  };
12146
13163
  if (item.textEdit) {
12147
13164
  this._apiDeprecation.report('CompletionItem.textEdit', this._extension, `Use 'CompletionItem.insertText' and 'CompletionItem.range' instead.`);
@@ -12179,6 +13196,7 @@ class InlineCompletionAdapterBase {
12179
13196
  }
12180
13197
  disposeCompletions(pid) { }
12181
13198
  handleDidShowCompletionItem(pid, idx) { }
13199
+ handlePartialAccept(pid, idx, acceptedCharacters) { }
12182
13200
  }
12183
13201
  class InlineCompletionAdapter extends InlineCompletionAdapterBase {
12184
13202
  constructor(_extension, _documents, _provider, _commands) {
@@ -12194,8 +13212,10 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
12194
13212
  [InlineCompletionTriggerKind$1.Explicit]: InlineCompletionTriggerKind.Invoke,
12195
13213
  };
12196
13214
  }
12197
- get supportsHandleDidShowCompletionItem() {
12198
- return isProposedApiEnabled(this._extension, 'inlineCompletionsAdditions') && typeof this._provider.handleDidShowCompletionItem === 'function';
13215
+ get supportsHandleEvents() {
13216
+ return isProposedApiEnabled(this._extension, 'inlineCompletionsAdditions')
13217
+ && (typeof this._provider.handleDidShowCompletionItem === 'function'
13218
+ || typeof this._provider.handleDidPartiallyAcceptCompletionItem === 'function');
12199
13219
  }
12200
13220
  async provideInlineCompletions(resource, position, context, token) {
12201
13221
  const doc = this._documents.getDocument(resource);
@@ -12215,14 +13235,12 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
12215
13235
  if (token.isCancellationRequested) {
12216
13236
  return undefined;
12217
13237
  }
12218
- const normalizedResult = isArray(result) ? result : result.items;
12219
- const commands = this._isAdditionsProposedApiEnabled ? isArray(result) ? [] : result.commands || [] : [];
13238
+ const normalizedResult = Array.isArray(result) ? result : result.items;
13239
+ const commands = this._isAdditionsProposedApiEnabled ? Array.isArray(result) ? [] : result.commands || [] : [];
12220
13240
  let disposableStore = undefined;
12221
13241
  const pid = this._references.createReferenceId({
12222
13242
  dispose() {
12223
- if (disposableStore) {
12224
- disposableStore.dispose();
12225
- }
13243
+ disposableStore?.dispose();
12226
13244
  },
12227
13245
  items: normalizedResult
12228
13246
  });
@@ -12266,87 +13284,11 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
12266
13284
  }
12267
13285
  }
12268
13286
  }
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) {
13287
+ handlePartialAccept(pid, idx, acceptedCharacters) {
12346
13288
  const completionItem = this._references.get(pid)?.items[idx];
12347
13289
  if (completionItem) {
12348
- if (this._provider.handleDidShowCompletionItem && this.isAdditionProposedApiEnabled) {
12349
- this._provider.handleDidShowCompletionItem(completionItem);
13290
+ if (this._provider.handleDidPartiallyAcceptCompletionItem && this._isAdditionsProposedApiEnabled) {
13291
+ this._provider.handleDidPartiallyAcceptCompletionItem(completionItem, acceptedCharacters);
12350
13292
  }
12351
13293
  }
12352
13294
  }
@@ -12786,8 +13728,8 @@ class DocumentOnDropEditAdapter {
12786
13728
  async provideDocumentOnDropEdits(requestId, uri, position, dataTransferDto, token) {
12787
13729
  const doc = this._documents.getDocument(uri);
12788
13730
  const pos = Position.to(position);
12789
- const dataTransfer = DataTransfer.toDataTransfer(dataTransferDto, async (index) => {
12790
- return (await this._proxy.$resolveDocumentOnDropFileData(this._handle, requestId, index)).buffer;
13731
+ const dataTransfer = DataTransfer.toDataTransfer(dataTransferDto, async (id) => {
13732
+ return (await this._proxy.$resolveDocumentOnDropFileData(this._handle, requestId, id)).buffer;
12791
13733
  });
12792
13734
  const edit = await this._provider.provideDocumentDropEdits(doc, pos, dataTransfer, token);
12793
13735
  if (!edit) {
@@ -12795,7 +13737,7 @@ class DocumentOnDropEditAdapter {
12795
13737
  }
12796
13738
  return {
12797
13739
  insertText: typeof edit.insertText === 'string' ? edit.insertText : { snippet: edit.insertText.value },
12798
- additionalEdit: edit.additionalEdit ? WorkspaceEdit.from(edit.additionalEdit, undefined, true) : undefined,
13740
+ additionalEdit: edit.additionalEdit ? WorkspaceEdit.from(edit.additionalEdit, undefined) : undefined,
12799
13741
  };
12800
13742
  }
12801
13743
  }
@@ -12806,15 +13748,16 @@ class AdapterData {
12806
13748
  }
12807
13749
  }
12808
13750
  class ExtHostLanguageFeatures {
12809
- constructor(mainContext, uriTransformer, documents, commands, diagnostics, logService, apiDeprecationService) {
13751
+ constructor(mainContext, _uriTransformer, _documents, _commands, _diagnostics, _logService, _apiDeprecation, _extensionTelemetry) {
13752
+ this._uriTransformer = _uriTransformer;
13753
+ this._documents = _documents;
13754
+ this._commands = _commands;
13755
+ this._diagnostics = _diagnostics;
13756
+ this._logService = _logService;
13757
+ this._apiDeprecation = _apiDeprecation;
13758
+ this._extensionTelemetry = _extensionTelemetry;
12810
13759
  this._adapter = ( (new Map()));
12811
- this._uriTransformer = uriTransformer;
12812
13760
  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
13761
  }
12819
13762
  _transformDocumentSelector(selector) {
12820
13763
  return DocumentSelector.from(selector, this._uriTransformer);
@@ -12844,6 +13787,7 @@ class ExtHostLanguageFeatures {
12844
13787
  if (!isCancellationError(err)) {
12845
13788
  this._logService.error(`[${data.extension.identifier.value}] provider FAILED`);
12846
13789
  this._logService.error(err);
13790
+ this._extensionTelemetry.onExtensionError(data.extension.identifier, err);
12847
13791
  }
12848
13792
  }).finally(() => {
12849
13793
  if (!doNotLog) {
@@ -13118,12 +14062,7 @@ class ExtHostLanguageFeatures {
13118
14062
  registerInlineCompletionsProvider(extension, selector, provider) {
13119
14063
  const adapter = ( (new InlineCompletionAdapter(extension, this._documents, provider, this._commands.converter)));
13120
14064
  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);
14065
+ this._proxy.$registerInlineCompletionsSupport(handle, this._transformDocumentSelector(selector), adapter.supportsHandleEvents);
13127
14066
  return this._createDisposable(handle);
13128
14067
  }
13129
14068
  $provideInlineCompletions(handle, resource, position, context, token) {
@@ -13134,6 +14073,11 @@ class ExtHostLanguageFeatures {
13134
14073
  adapter.handleDidShowCompletionItem(pid, idx);
13135
14074
  }, undefined, undefined);
13136
14075
  }
14076
+ $handleInlineCompletionPartialAccept(handle, pid, idx, acceptedCharacters) {
14077
+ this._withAdapter(handle, InlineCompletionAdapterBase, async (adapter) => {
14078
+ adapter.handlePartialAccept(pid, idx, acceptedCharacters);
14079
+ }, undefined, undefined);
14080
+ }
13137
14081
  $freeInlineCompletionsList(handle, pid) {
13138
14082
  this._withAdapter(handle, InlineCompletionAdapterBase, async (adapter) => { adapter.disposeCompletions(pid); }, undefined, undefined);
13139
14083
  }
@@ -13209,7 +14153,7 @@ class ExtHostLanguageFeatures {
13209
14153
  (new FoldingProviderAdapter(this._documents, provider)),
13210
14154
  extension
13211
14155
  ))));
13212
- this._proxy.$registerFoldingRangeProvider(handle, this._transformDocumentSelector(selector), eventHandle);
14156
+ this._proxy.$registerFoldingRangeProvider(handle, this._transformDocumentSelector(selector), extension.identifier, eventHandle);
13213
14157
  let result = this._createDisposable(handle);
13214
14158
  if (eventHandle !== undefined) {
13215
14159
  const subscription = provider.onDidChangeFoldingRanges(() => this._proxy.$emitFoldingRangeEvent(eventHandle));
@@ -13366,14 +14310,18 @@ class DataTransferCache {
13366
14310
  }
13367
14311
  };
13368
14312
  }
13369
- async resolveDropFileData(requestId, dataItemIndex) {
14313
+ async resolveDropFileData(requestId, dataItemId) {
13370
14314
  const entry = this.dataTransfers.get(requestId);
13371
14315
  if (!entry) {
13372
14316
  throw new Error('No data transfer found');
13373
14317
  }
13374
- const file = entry[dataItemIndex]?.asFile();
14318
+ const item = entry.find(x => x.id === dataItemId);
14319
+ if (!item) {
14320
+ throw new Error('No item found in data transfer');
14321
+ }
14322
+ const file = item.asFile();
13375
14323
  if (!file) {
13376
- throw new Error('No file item found in data transfer');
14324
+ throw new Error('Found data transfer item is not a file');
13377
14325
  }
13378
14326
  return VSBuffer.wrap(await file.data());
13379
14327
  }
@@ -13411,12 +14359,13 @@ var WorkspaceSymbolProviderRegistry;
13411
14359
  const TypeHierarchyProviderRegistry = ( (new LanguageFeatureRegistry()));
13412
14360
  var MainThreadLanguageFeatures_1;
13413
14361
  let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThreadLanguageFeatures extends Disposable$1 {
13414
- constructor(extHostContext, _languageService, _languageConfigurationService, _languageFeaturesService) {
14362
+ constructor(extHostContext, _languageService, _languageConfigurationService, _languageFeaturesService, _uriIdentService) {
13415
14363
  super();
13416
14364
  this._languageService = _languageService;
13417
14365
  this._languageConfigurationService = _languageConfigurationService;
13418
14366
  this._languageFeaturesService = _languageFeaturesService;
13419
- this._registrations = ( (new Map()));
14367
+ this._uriIdentService = _uriIdentService;
14368
+ this._registrations = this._register(( (new DisposableMap())));
13420
14369
  this._pasteEditProviders = ( (new Map()));
13421
14370
  this._documentOnDropEditProviders = ( (new Map()));
13422
14371
  this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostLanguageFeatures);
@@ -13449,19 +14398,8 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13449
14398
  updateAllWordDefinitions();
13450
14399
  }
13451
14400
  }
13452
- dispose() {
13453
- for (const registration of ( (this._registrations.values()))) {
13454
- registration.dispose();
13455
- }
13456
- this._registrations.clear();
13457
- super.dispose();
13458
- }
13459
14401
  $unregister(handle) {
13460
- const registration = this._registrations.get(handle);
13461
- if (registration) {
13462
- registration.dispose();
13463
- this._registrations.delete(handle);
13464
- }
14402
+ this._registrations.deleteAndDispose(handle);
13465
14403
  }
13466
14404
  static _reviveLocationDto(data) {
13467
14405
  if (!data) {
@@ -13502,8 +14440,8 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13502
14440
  return data;
13503
14441
  }
13504
14442
  }
13505
- static _reviveCodeActionDto(data) {
13506
- data?.forEach(code => reviveWorkspaceEditDto(code.edit));
14443
+ static _reviveCodeActionDto(data, uriIdentService) {
14444
+ data?.forEach(code => reviveWorkspaceEditDto(code.edit, uriIdentService));
13507
14445
  return data;
13508
14446
  }
13509
14447
  static _reviveLinkDTO(data) {
@@ -13549,7 +14487,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13549
14487
  }
13550
14488
  };
13551
14489
  if (typeof eventHandle === 'number') {
13552
- const emitter = ( (new Emitter()));
14490
+ const emitter = ( (new Emitter$1()));
13553
14491
  this._registrations.set(eventHandle, emitter);
13554
14492
  provider.onDidChange = emitter.event;
13555
14493
  }
@@ -13557,7 +14495,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13557
14495
  }
13558
14496
  $emitCodeLensEvent(eventHandle, event) {
13559
14497
  const obj = this._registrations.get(eventHandle);
13560
- if (obj instanceof Emitter) {
14498
+ if (obj instanceof Emitter$1) {
13561
14499
  obj.fire(event);
13562
14500
  }
13563
14501
  }
@@ -13610,7 +14548,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13610
14548
  }
13611
14549
  };
13612
14550
  if (typeof eventHandle === 'number') {
13613
- const emitter = ( (new Emitter()));
14551
+ const emitter = ( (new Emitter$1()));
13614
14552
  this._registrations.set(eventHandle, emitter);
13615
14553
  provider.onDidChangeInlineValues = emitter.event;
13616
14554
  }
@@ -13618,7 +14556,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13618
14556
  }
13619
14557
  $emitInlineValuesEvent(eventHandle, event) {
13620
14558
  const obj = this._registrations.get(eventHandle);
13621
- if (obj instanceof Emitter) {
14559
+ if (obj instanceof Emitter$1) {
13622
14560
  obj.fire(event);
13623
14561
  }
13624
14562
  }
@@ -13658,7 +14596,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13658
14596
  return undefined;
13659
14597
  }
13660
14598
  return {
13661
- actions: MainThreadLanguageFeatures_1._reviveCodeActionDto(listDto.actions),
14599
+ actions: MainThreadLanguageFeatures_1._reviveCodeActionDto(listDto.actions, this._uriIdentService),
13662
14600
  dispose: () => {
13663
14601
  if (typeof listDto.cacheId === 'number') {
13664
14602
  this._proxy.$releaseCodeActions(handle, listDto.cacheId);
@@ -13673,23 +14611,23 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13673
14611
  if (supportsResolve) {
13674
14612
  provider.resolveCodeAction = async (codeAction, token) => {
13675
14613
  const data = await this._proxy.$resolveCodeAction(handle, codeAction.cacheId, token);
13676
- codeAction.edit = reviveWorkspaceEditDto(data);
14614
+ codeAction.edit = reviveWorkspaceEditDto(data, this._uriIdentService);
13677
14615
  return codeAction;
13678
14616
  };
13679
14617
  }
13680
14618
  this._registrations.set(handle, this._languageFeaturesService.codeActionProvider.register(selector, provider));
13681
14619
  }
13682
14620
  $registerPasteEditProvider(handle, selector, supportsCopy, pasteMimeTypes) {
13683
- const provider = ( (new MainThreadPasteEditProvider(handle, this._proxy, supportsCopy, pasteMimeTypes)));
14621
+ const provider = ( (new MainThreadPasteEditProvider(handle, this._proxy, supportsCopy, pasteMimeTypes, this._uriIdentService)));
13684
14622
  this._pasteEditProviders.set(handle, provider);
13685
14623
  this._registrations.set(handle, combinedDisposable(this._languageFeaturesService.documentPasteEditProvider.register(selector, provider), toDisposable(() => this._pasteEditProviders.delete(handle))));
13686
14624
  }
13687
- $resolvePasteFileData(handle, requestId, dataIndex) {
14625
+ $resolvePasteFileData(handle, requestId, dataId) {
13688
14626
  const provider = this._pasteEditProviders.get(handle);
13689
14627
  if (!provider) {
13690
14628
  throw new Error('Could not find provider');
13691
14629
  }
13692
- return provider.resolveFileData(requestId, dataIndex);
14630
+ return provider.resolveFileData(requestId, dataId);
13693
14631
  }
13694
14632
  $registerDocumentFormattingSupport(handle, selector, extensionId, displayName) {
13695
14633
  this._registrations.set(handle, this._languageFeaturesService.documentFormattingEditProvider.register(selector, {
@@ -13741,7 +14679,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13741
14679
  $registerRenameSupport(handle, selector, supportResolveLocation) {
13742
14680
  this._registrations.set(handle, this._languageFeaturesService.renameProvider.register(selector, {
13743
14681
  provideRenameEdits: (model, position, newName, token) => {
13744
- return this._proxy.$provideRenameEdits(handle, model.uri, position, newName, token).then(reviveWorkspaceEditDto);
14682
+ return this._proxy.$provideRenameEdits(handle, model.uri, position, newName, token).then(data => reviveWorkspaceEditDto(data, this._uriIdentService));
13745
14683
  },
13746
14684
  resolveRenameLocation: supportResolveLocation
13747
14685
  ? (model, position, token) => this._proxy.$resolveRenameLocation(handle, model.uri, position, token)
@@ -13751,7 +14689,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13751
14689
  $registerDocumentSemanticTokensProvider(handle, selector, legend, eventHandle) {
13752
14690
  let event = undefined;
13753
14691
  if (typeof eventHandle === 'number') {
13754
- const emitter = ( (new Emitter()));
14692
+ const emitter = ( (new Emitter$1()));
13755
14693
  this._registrations.set(eventHandle, emitter);
13756
14694
  event = emitter.event;
13757
14695
  }
@@ -13759,7 +14697,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13759
14697
  }
13760
14698
  $emitDocumentSemanticTokensEvent(eventHandle) {
13761
14699
  const obj = this._registrations.get(eventHandle);
13762
- if (obj instanceof Emitter) {
14700
+ if (obj instanceof Emitter$1) {
13763
14701
  obj.fire(undefined);
13764
14702
  }
13765
14703
  }
@@ -13768,10 +14706,13 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13768
14706
  }
13769
14707
  static _inflateSuggestDto(defaultRange, data) {
13770
14708
  const label = data["a" ];
14709
+ const commandId = data["o" ];
14710
+ const commandIdent = data["n" ];
14711
+ const commitChars = data["k" ];
13771
14712
  return {
13772
14713
  label,
13773
14714
  kind: data["b" ] ?? 9 ,
13774
- tags: data["n" ],
14715
+ tags: data["m" ],
13775
14716
  detail: data["c" ],
13776
14717
  documentation: data["d" ],
13777
14718
  sortText: data["e" ],
@@ -13780,9 +14721,14 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13780
14721
  insertText: data["h" ] ?? (typeof label === 'string' ? label : label.label),
13781
14722
  range: data["j" ] ?? defaultRange,
13782
14723
  insertTextRules: data["i" ],
13783
- commitCharacters: data["k" ],
14724
+ commitCharacters: commitChars ? Array.from(commitChars) : undefined,
13784
14725
  additionalTextEdits: data["l" ],
13785
- command: data["m" ],
14726
+ command: commandId ? {
14727
+ $ident: commandIdent,
14728
+ id: commandId,
14729
+ title: '',
14730
+ arguments: commandIdent ? [commandIdent] : data["p" ],
14731
+ } : undefined,
13786
14732
  _id: data.x,
13787
14733
  };
13788
14734
  }
@@ -13820,16 +14766,21 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13820
14766
  }
13821
14767
  this._registrations.set(handle, this._languageFeaturesService.completionProvider.register(selector, provider));
13822
14768
  }
13823
- $registerInlineCompletionsSupport(handle, selector, supportsHandleDidShowCompletionItem) {
14769
+ $registerInlineCompletionsSupport(handle, selector, supportsHandleEvents) {
13824
14770
  const provider = {
13825
14771
  provideInlineCompletions: async (model, position, context, token) => {
13826
14772
  return this._proxy.$provideInlineCompletions(handle, model.uri, position, context, token);
13827
14773
  },
13828
14774
  handleItemDidShow: async (completions, item) => {
13829
- if (supportsHandleDidShowCompletionItem) {
14775
+ if (supportsHandleEvents) {
13830
14776
  await this._proxy.$handleInlineCompletionDidShow(handle, completions.pid, item.idx);
13831
14777
  }
13832
14778
  },
14779
+ handlePartialAccept: async (completions, item, acceptedCharacters) => {
14780
+ if (supportsHandleEvents) {
14781
+ await this._proxy.$handleInlineCompletionPartialAccept(handle, completions.pid, item.idx, acceptedCharacters);
14782
+ }
14783
+ },
13833
14784
  freeInlineCompletions: (completions) => {
13834
14785
  this._proxy.$freeInlineCompletionsList(handle, completions.pid);
13835
14786
  }
@@ -13893,7 +14844,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13893
14844
  };
13894
14845
  }
13895
14846
  if (typeof eventHandle === 'number') {
13896
- const emitter = ( (new Emitter()));
14847
+ const emitter = ( (new Emitter$1()));
13897
14848
  this._registrations.set(eventHandle, emitter);
13898
14849
  provider.onDidChangeInlayHints = emitter.event;
13899
14850
  }
@@ -13901,7 +14852,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13901
14852
  }
13902
14853
  $emitInlayHintsEvent(eventHandle) {
13903
14854
  const obj = this._registrations.get(eventHandle);
13904
- if (obj instanceof Emitter) {
14855
+ if (obj instanceof Emitter$1) {
13905
14856
  obj.fire(undefined);
13906
14857
  }
13907
14858
  }
@@ -13965,14 +14916,15 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13965
14916
  }
13966
14917
  }));
13967
14918
  }
13968
- $registerFoldingRangeProvider(handle, selector, eventHandle) {
14919
+ $registerFoldingRangeProvider(handle, selector, extensionId, eventHandle) {
13969
14920
  const provider = {
14921
+ id: extensionId.value,
13970
14922
  provideFoldingRanges: (model, context, token) => {
13971
14923
  return this._proxy.$provideFoldingRanges(handle, model.uri, context, token);
13972
14924
  }
13973
14925
  };
13974
14926
  if (typeof eventHandle === 'number') {
13975
- const emitter = ( (new Emitter()));
14927
+ const emitter = ( (new Emitter$1()));
13976
14928
  this._registrations.set(eventHandle, emitter);
13977
14929
  provider.onDidChange = emitter.event;
13978
14930
  }
@@ -13980,7 +14932,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
13980
14932
  }
13981
14933
  $emitFoldingRangeEvent(eventHandle, event) {
13982
14934
  const obj = this._registrations.get(eventHandle);
13983
- if (obj instanceof Emitter) {
14935
+ if (obj instanceof Emitter$1) {
13984
14936
  obj.fire(event);
13985
14937
  }
13986
14938
  }
@@ -14112,28 +15064,30 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
14112
15064
  }));
14113
15065
  }
14114
15066
  $registerDocumentOnDropEditProvider(handle, selector) {
14115
- const provider = ( (new MainThreadDocumentOnDropEditProvider(handle, this._proxy)));
15067
+ const provider = ( (new MainThreadDocumentOnDropEditProvider(handle, this._proxy, this._uriIdentService)));
14116
15068
  this._documentOnDropEditProviders.set(handle, provider);
14117
15069
  this._registrations.set(handle, combinedDisposable(this._languageFeaturesService.documentOnDropEditProvider.register(selector, provider), toDisposable(() => this._documentOnDropEditProviders.delete(handle))));
14118
15070
  }
14119
- async $resolveDocumentOnDropFileData(handle, requestId, dataIndex) {
15071
+ async $resolveDocumentOnDropFileData(handle, requestId, dataId) {
14120
15072
  const provider = this._documentOnDropEditProviders.get(handle);
14121
15073
  if (!provider) {
14122
15074
  throw new Error('Could not find provider');
14123
15075
  }
14124
- return provider.resolveDocumentOnDropFileData(requestId, dataIndex);
15076
+ return provider.resolveDocumentOnDropFileData(requestId, dataId);
14125
15077
  }
14126
15078
  };
14127
15079
  MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = ( (__decorate([
14128
15080
  extHostNamedCustomer(MainContext.MainThreadLanguageFeatures),
14129
15081
  ( (__param(1, ILanguageService))),
14130
15082
  ( (__param(2, ILanguageConfigurationService))),
14131
- ( (__param(3, ILanguageFeaturesService)))
15083
+ ( (__param(3, ILanguageFeaturesService))),
15084
+ ( (__param(4, IUriIdentityService)))
14132
15085
  ], MainThreadLanguageFeatures)));
14133
- class MainThreadPasteEditProvider {
14134
- constructor(handle, _proxy, supportsCopy, pasteMimeTypes) {
15086
+ let MainThreadPasteEditProvider = class MainThreadPasteEditProvider {
15087
+ constructor(handle, _proxy, supportsCopy, pasteMimeTypes, _uriIdentService) {
14135
15088
  this.handle = handle;
14136
15089
  this._proxy = _proxy;
15090
+ this._uriIdentService = _uriIdentService;
14137
15091
  this.dataTransfers = ( (new DataTransferCache()));
14138
15092
  this.pasteMimeTypes = pasteMimeTypes;
14139
15093
  if (supportsCopy) {
@@ -14164,21 +15118,25 @@ class MainThreadPasteEditProvider {
14164
15118
  }
14165
15119
  return {
14166
15120
  insertText: result.insertText,
14167
- additionalEdit: result.additionalEdit ? reviveWorkspaceEditDto(result.additionalEdit) : undefined,
15121
+ additionalEdit: result.additionalEdit ? reviveWorkspaceEditDto(result.additionalEdit, this._uriIdentService) : undefined,
14168
15122
  };
14169
15123
  }
14170
15124
  finally {
14171
15125
  request.dispose();
14172
15126
  }
14173
15127
  }
14174
- resolveFileData(requestId, dataIndex) {
14175
- return this.dataTransfers.resolveDropFileData(requestId, dataIndex);
15128
+ resolveFileData(requestId, dataId) {
15129
+ return this.dataTransfers.resolveDropFileData(requestId, dataId);
14176
15130
  }
14177
- }
14178
- class MainThreadDocumentOnDropEditProvider {
14179
- constructor(handle, _proxy) {
15131
+ };
15132
+ MainThreadPasteEditProvider = ( (__decorate([
15133
+ ( (__param(4, IUriIdentityService)))
15134
+ ], MainThreadPasteEditProvider)));
15135
+ let MainThreadDocumentOnDropEditProvider = class MainThreadDocumentOnDropEditProvider {
15136
+ constructor(handle, _proxy, _uriIdentService) {
14180
15137
  this.handle = handle;
14181
15138
  this._proxy = _proxy;
15139
+ this._uriIdentService = _uriIdentService;
14182
15140
  this.dataTransfers = ( (new DataTransferCache()));
14183
15141
  }
14184
15142
  async provideDocumentOnDropEdits(model, position, dataTransfer, token) {
@@ -14191,17 +15149,20 @@ class MainThreadDocumentOnDropEditProvider {
14191
15149
  }
14192
15150
  return {
14193
15151
  insertText: edit.insertText,
14194
- additionalEdit: reviveWorkspaceEditDto(edit.additionalEdit),
15152
+ additionalEdit: reviveWorkspaceEditDto(edit.additionalEdit, this._uriIdentService),
14195
15153
  };
14196
15154
  }
14197
15155
  finally {
14198
15156
  request.dispose();
14199
15157
  }
14200
15158
  }
14201
- resolveDocumentOnDropFileData(requestId, dataIndex) {
14202
- return this.dataTransfers.resolveDropFileData(requestId, dataIndex);
15159
+ resolveDocumentOnDropFileData(requestId, dataId) {
15160
+ return this.dataTransfers.resolveDropFileData(requestId, dataId);
14203
15161
  }
14204
- }
15162
+ };
15163
+ MainThreadDocumentOnDropEditProvider = ( (__decorate([
15164
+ ( (__param(2, IUriIdentityService)))
15165
+ ], MainThreadDocumentOnDropEditProvider)));
14205
15166
  class MainThreadDocumentSemanticTokensProvider {
14206
15167
  constructor(_proxy, _handle, _legend, onDidChange) {
14207
15168
  this._proxy = _proxy;
@@ -14315,7 +15276,7 @@ function scopeToOverrides(scope) {
14315
15276
  }
14316
15277
  class ExtHostConfigProvider {
14317
15278
  constructor(proxy, extHostWorkspace, data, logService) {
14318
- this._onDidChangeConfiguration = ( (new Emitter()));
15279
+ this._onDidChangeConfiguration = ( (new Emitter$1()));
14319
15280
  this._proxy = proxy;
14320
15281
  this._logService = logService;
14321
15282
  this._extHostWorkspace = extHostWorkspace;
@@ -14426,19 +15387,19 @@ class ExtHostConfigProvider {
14426
15387
  },
14427
15388
  inspect: (key) => {
14428
15389
  key = section ? `${section}.${key}` : key;
14429
- const config = deepClone(this._configuration.inspect(key, overrides, this._extHostWorkspace.workspace));
15390
+ const config = this._configuration.inspect(key, overrides, this._extHostWorkspace.workspace);
14430
15391
  if (config) {
14431
15392
  return {
14432
15393
  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
15394
+ defaultValue: deepClone(config.policy?.value ?? config.default?.value),
15395
+ globalValue: deepClone(config.user?.value ?? config.application?.value),
15396
+ workspaceValue: deepClone(config.workspace?.value),
15397
+ workspaceFolderValue: deepClone(config.workspaceFolder?.value),
15398
+ defaultLanguageValue: deepClone(config.default?.override),
15399
+ globalLanguageValue: deepClone(config.user?.override ?? config.application?.override),
15400
+ workspaceLanguageValue: deepClone(config.workspace?.override),
15401
+ workspaceFolderLanguageValue: deepClone(config.workspaceFolder?.override),
15402
+ languageIds: deepClone(config.overrideIdentifiers)
14442
15403
  };
14443
15404
  }
14444
15405
  return undefined;
@@ -14544,7 +15505,7 @@ let MainThreadConfiguration = class MainThreadConfiguration {
14544
15505
  : scopeToLanguage === false ? { resource: overrides.resource }
14545
15506
  : overrides.overrideIdentifier && overriddenValue !== undefined ? overrides
14546
15507
  : { resource: overrides.resource };
14547
- return this.configurationService.updateValue(key, value, overrides, configurationTarget, true);
15508
+ return this.configurationService.updateValue(key, value, overrides, configurationTarget, { donotNotifyError: true });
14548
15509
  }
14549
15510
  deriveConfigurationTarget(key, overrides) {
14550
15511
  if (overrides.resource && this._workspaceContextService.getWorkbenchState() === 3 ) {
@@ -14572,10 +15533,46 @@ const DEFAULT_EXTENSION = {
14572
15533
  publisher: 'microsoft',
14573
15534
  version: '1.0.0',
14574
15535
  engines: {
14575
- vscode: "1.69.0"
15536
+ vscode: "1.76.0"
14576
15537
  },
14577
15538
  targetPlatform: "web"
14578
15539
  };
15540
+ const environment = {
15541
+ isExtensionDevelopmentDebug: false,
15542
+ appName: 'Monaco',
15543
+ appHost: 'web',
15544
+ appLanguage: window.navigator.language ?? 'en-US',
15545
+ extensionTelemetryLogResource: ( URI.from({ scheme: 'user', path: '/extensionTelemetryLogResource.log' })),
15546
+ isExtensionTelemetryLoggingOnly: false,
15547
+ get appUriScheme() { return unsupported(); },
15548
+ get globalStorageHome() { return unsupported(); },
15549
+ get workspaceStorageHome() { return unsupported(); }
15550
+ };
15551
+ const initData = {
15552
+ _serviceBrand: undefined,
15553
+ version: '1.0.0',
15554
+ parentPid: 0,
15555
+ environment,
15556
+ get allExtensions() { return [Services.get().extension ?? DEFAULT_EXTENSION]; },
15557
+ get myExtensions() { return [(Services.get().extension ?? DEFAULT_EXTENSION).identifier]; },
15558
+ consoleForward: {
15559
+ includeStack: false,
15560
+ logNative: false
15561
+ },
15562
+ get telemetryInfo() { return unsupported(); },
15563
+ logLevel: LogLevel.Trace,
15564
+ get logsLocation() { return unsupported(); },
15565
+ get logFile() { return unsupported(); },
15566
+ autoStart: false,
15567
+ remote: {
15568
+ isRemote: false,
15569
+ authority: undefined,
15570
+ connectionData: null
15571
+ },
15572
+ uiKind: UIKind.Web,
15573
+ loggers: [],
15574
+ logName: 'browser'
15575
+ };
14579
15576
  class SimpleMessagePassingProtocol {
14580
15577
  constructor() {
14581
15578
  this._onMessage = new BufferedEmitter();
@@ -14652,7 +15649,8 @@ function createExtHostServices() {
14652
15649
  const configurationService = StandaloneServices.get(IConfigurationService);
14653
15650
  const workspaceContextService = StandaloneServices.get(IWorkspaceContextService);
14654
15651
  const extensionService = StandaloneServices.get(IExtensionService);
14655
- const instantiationService = StandaloneServices.get(IInstantiationService);
15652
+ const loggerService = StandaloneServices.get(ILoggerService);
15653
+ const logService = StandaloneServices.get(ILogService);
14656
15654
  const imessagePassingProtocol = new SimpleMessagePassingProtocol();
14657
15655
  const rpcProtocol = new RPCProtocol(imessagePassingProtocol);
14658
15656
  const extHostFileSystemInfo = new ExtHostFileSystemInfo();
@@ -14676,65 +15674,41 @@ function createExtHostServices() {
14676
15674
  rpcProtocol.dispose();
14677
15675
  }
14678
15676
  };
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);
15677
+ const extHostApiDeprecationService = new ExtHostApiDeprecationService(mainContext, logService);
15678
+ const extHostMessageService = new ExtHostMessageService(mainContext, logService);
14705
15679
  const uriTransformerService = new URITransformerService(null);
14706
15680
  rpcProtocol.set(MainContext.MainThreadWindow, new MainThreadWindow(mainContext, hostService, openerService));
14707
15681
  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));
15682
+ const extHostTelemetry = rpcProtocol.set(ExtHostContext.ExtHostTelemetry, new ExtHostTelemetry(initData, loggerService));
15683
+ const extHostCommands = rpcProtocol.set(ExtHostContext.ExtHostCommands, new ExtHostCommands(mainContext, logService, extHostTelemetry));
15684
+ const extHostDocumentsAndEditors = rpcProtocol.set(ExtHostContext.ExtHostDocumentsAndEditors, new ExtHostDocumentsAndEditors(mainContext, logService));
14710
15685
  const extHostDocuments = rpcProtocol.set(ExtHostContext.ExtHostDocuments, new ExtHostDocuments(mainContext, extHostDocumentsAndEditors));
14711
15686
  const extHostLanguages = rpcProtocol.set(ExtHostContext.ExtHostLanguages, new ExtHostLanguages(mainContext, extHostDocuments, extHostCommands.converter, uriTransformerService));
14712
15687
  const extHostWindow = rpcProtocol.set(ExtHostContext.ExtHostWindow, new ExtHostWindow(mainContext));
14713
15688
  const extHostQuickOpen = rpcProtocol.set(ExtHostContext.ExtHostQuickOpen, createExtHostQuickOpen(mainContext, null, extHostCommands));
14714
- const extHostDiagnostics = rpcProtocol.set(ExtHostContext.ExtHostDiagnostics, new ExtHostDiagnostics(mainContext, extHostLogService, extHostFileSystemInfo));
15689
+ const extHostDiagnostics = rpcProtocol.set(ExtHostContext.ExtHostDiagnostics, new ExtHostDiagnostics(mainContext, logService, extHostFileSystemInfo, extHostDocumentsAndEditors));
14715
15690
  const extHostProgress = rpcProtocol.set(ExtHostContext.ExtHostProgress, new ExtHostProgress(rpcProtocol.getProxy(MainContext.MainThreadProgress)));
14716
- const extHostDocumentContentProviders = rpcProtocol.set(ExtHostContext.ExtHostDocumentContentProviders, new ExtHostDocumentContentProvider(mainContext, extHostDocumentsAndEditors, extHostLogService));
15691
+ const extHostDocumentContentProviders = rpcProtocol.set(ExtHostContext.ExtHostDocumentContentProviders, new ExtHostDocumentContentProvider(mainContext, extHostDocumentsAndEditors, logService));
14717
15692
  const extHostEditors = rpcProtocol.set(ExtHostContext.ExtHostEditors, new ExtHostEditors(mainContext, extHostDocumentsAndEditors));
14718
15693
  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());
15694
+ const extHostLanguageFeatures = rpcProtocol.set(ExtHostContext.ExtHostLanguageFeatures, new ExtHostLanguageFeatures(rpcProtocol, uriTransformerService, extHostDocuments, extHostCommands, extHostDiagnostics, logService, extHostApiDeprecationService, extHostTelemetry));
15695
+ const extHostWorkspace = rpcProtocol.set(ExtHostContext.ExtHostWorkspace, new ExtHostWorkspace(mainContext, initData, extHostFileSystemInfo, logService, uriTransformerService));
15696
+ const extHostConfiguration = rpcProtocol.set(ExtHostContext.ExtHostConfiguration, new SyncExtHostConfiguration(mainContext, extHostWorkspace, logService));
14723
15697
  rpcProtocol.set(MainContext.MainThreadMessageService, new MainThreadMessageServiceWithoutSource(mainContext, notificationService, commandsService, dialogService));
14724
15698
  rpcProtocol.set(MainContext.MainThreadDiagnostics, new MainThreadDiagnostics(mainContext, markerService, uriIdentityService));
14725
15699
  rpcProtocol.set(MainContext.MainThreadQuickOpen, new MainThreadQuickOpen(mainContext, quickInputService));
14726
- rpcProtocol.set(MainContext.MainThreadTelemetry, new MainThreadTelemetry(mainContext, telemetryService, workbenchEnvironmentService, productService));
15700
+ rpcProtocol.set(MainContext.MainThreadTelemetry, new MainThreadTelemetry(mainContext, telemetryService, configurationService, workbenchEnvironmentService, productService));
14727
15701
  rpcProtocol.set(MainContext.MainThreadProgress, new MainThreadProgress(mainContext, progressService, commandsService));
14728
15702
  rpcProtocol.set(MainContext.MainThreadDocumentContentProviders, new MainThreadDocumentContentProviders(mainContext, textModelService, languageService, modelService, editorWorkerService));
14729
- rpcProtocol.set(MainContext.MainThreadBulkEdits, new MainThreadBulkEdits(mainContext, bulkEditService, extHostLogService));
15703
+ rpcProtocol.set(MainContext.MainThreadBulkEdits, new MainThreadBulkEdits(mainContext, bulkEditService, logService, uriIdentityService));
14730
15704
  rpcProtocol.set(MainContext.MainThreadLanguages, new MainThreadLanguages(mainContext, languageService, modelService, textModelService, languageStatusService));
14731
15705
  rpcProtocol.set(MainContext.MainThreadClipboard, new MainThreadClipboard(mainContext, clipboardService));
14732
- rpcProtocol.set(MainContext.MainThreadLanguageFeatures, new MainThreadLanguageFeatures(mainContext, languageService, languageConfigurationService, languageFeaturesService));
15706
+ rpcProtocol.set(MainContext.MainThreadLanguageFeatures, new MainThreadLanguageFeatures(mainContext, languageService, languageConfigurationService, languageFeaturesService, uriIdentityService));
14733
15707
  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);
15708
+ new MainThreadDocumentsAndEditors(mainContext, modelService, textFileService, editorService, codeEditorService, fileService, textModelService, editorGroupsService, paneCompositePartService, workbenchEnvironmentService, workingCopyFileService, uriIdentityService, clipboardService, pathService, configurationService);
14735
15709
  const extHostBulkEdits = new ExtHostBulkEdits(mainContext, extHostDocumentsAndEditors);
14736
15710
  return {
14737
- extHostLogService,
15711
+ extHostLogService: logService,
14738
15712
  extHostApiDeprecationService,
14739
15713
  extHostMessageService,
14740
15714
  extHostDocumentsAndEditors,
@@ -14751,7 +15725,8 @@ function createExtHostServices() {
14751
15725
  extHostClipboard,
14752
15726
  extHostLanguageFeatures,
14753
15727
  extHostWorkspace,
14754
- extHostConfiguration
15728
+ extHostConfiguration,
15729
+ extHostTelemetry
14755
15730
  };
14756
15731
  }
14757
15732
  let extHostServices;
@@ -14761,4 +15736,4 @@ function getExtHostServices() {
14761
15736
  }
14762
15737
  return extHostServices;
14763
15738
  }
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 };
15739
+ 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 };