@codingame/monaco-vscode-extensions-service-override 5.3.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/extensions.js +4 -4
  2. package/package.json +3 -3
  3. package/vscode/src/vs/base/common/console.js +2 -0
  4. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +6 -6
  5. package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +1 -0
  6. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +35 -21
  7. package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +2 -1
  8. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +72 -8
  9. package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +3 -0
  10. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +25 -16
  11. package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +11 -9
  12. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +22 -14
  13. package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +18 -7
  14. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +3 -2
  15. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +12 -6
  16. package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +14 -16
  17. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +38 -38
  18. package/vscode/src/vs/workbench/api/browser/mainThreadEmbeddings.js +73 -0
  19. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +9 -7
  20. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +5 -5
  21. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +18 -15
  22. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +28 -26
  23. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +8 -16
  24. package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +4 -2
  25. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +2 -1
  26. package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +3 -2
  27. package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +42 -14
  28. package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +6 -17
  29. package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +34 -0
  30. package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +4 -3
  31. package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +2 -1
  32. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +16 -16
  33. package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +2 -2
  34. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +4 -3
  35. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +5 -4
  36. package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +8 -3
  37. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +6 -1
  38. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +3 -3
  39. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +4 -4
  40. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +2 -1
  41. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +2 -1
  42. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +12 -10
  43. package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +27 -21
  44. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +15 -11
  45. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +2 -2
  46. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +19 -16
  47. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +7 -6
  48. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +12 -12
  49. package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +3 -2
  50. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +15 -2
  51. package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +2 -2
  52. package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +10 -7
  53. package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +0 -72
@@ -12,10 +12,12 @@ import { URI } from 'vscode/vscode/vs/base/common/uri';
12
12
  import { generateUuid } from 'vscode/vscode/vs/base/common/uuid';
13
13
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
14
14
  import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
15
+ import { FileOperation } from 'vscode/vscode/vs/platform/files/common/files';
15
16
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
16
17
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
17
18
  import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
18
19
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
20
+ import { UndoRedoElementType } from 'vscode/vscode/vs/platform/undoRedo/common/undoRedo';
19
21
  import { IUndoRedoService } from 'vscode/vscode/vs/platform/undoRedo/common/undoRedo.service';
20
22
  import { reviveWebviewExtension } from './mainThreadWebviews.js';
21
23
  import { ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
@@ -31,12 +33,17 @@ import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/service
31
33
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
32
34
  import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService.service';
33
35
  import { ResourceWorkingCopy } from 'vscode/vscode/vs/workbench/services/workingCopy/common/resourceWorkingCopy';
34
- import { NO_TYPE_ID } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopy';
36
+ import { NO_TYPE_ID, WorkingCopyCapabilities } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopy';
35
37
  import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service';
36
38
  import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
37
39
 
38
40
  var MainThreadCustomEditorModel_1;
39
41
  const _moduleId = "vs/workbench/api/browser/mainThreadCustomEditors";
42
+ var CustomEditorModelType;
43
+ ( ((function(CustomEditorModelType) {
44
+ CustomEditorModelType[CustomEditorModelType["Custom"] = 0] = "Custom";
45
+ CustomEditorModelType[CustomEditorModelType["Text"] = 1] = "Text";
46
+ })(CustomEditorModelType || (CustomEditorModelType = {}))));
40
47
  let MainThreadCustomEditors = class MainThreadCustomEditors extends Disposable {
41
48
  constructor(context, mainThreadWebview, mainThreadWebviewPanels, extensionService, storageService, workingCopyService, workingCopyFileService, _customEditorService, _editorGroupService, _editorService, _instantiationService, _webviewWorkbenchService) {
42
49
  super();
@@ -74,10 +81,10 @@ let MainThreadCustomEditors = class MainThreadCustomEditors extends Disposable {
74
81
  this._register(workingCopyFileService.onWillRunWorkingCopyFileOperation(async (e) => this.onWillRunWorkingCopyFileOperation(e)));
75
82
  }
76
83
  $registerTextEditorProvider(extensionData, viewType, options, capabilities, serializeBuffersForPostMessage) {
77
- this.registerEditorProvider(1 , reviveWebviewExtension(extensionData), viewType, options, capabilities, true, serializeBuffersForPostMessage);
84
+ this.registerEditorProvider(CustomEditorModelType.Text, reviveWebviewExtension(extensionData), viewType, options, capabilities, true, serializeBuffersForPostMessage);
78
85
  }
79
86
  $registerCustomEditorProvider(extensionData, viewType, options, supportsMultipleEditorsPerDocument, serializeBuffersForPostMessage) {
80
- this.registerEditorProvider(0 , reviveWebviewExtension(extensionData), viewType, options, {}, supportsMultipleEditorsPerDocument, serializeBuffersForPostMessage);
87
+ this.registerEditorProvider(CustomEditorModelType.Custom, reviveWebviewExtension(extensionData), viewType, options, {}, supportsMultipleEditorsPerDocument, serializeBuffersForPostMessage);
81
88
  }
82
89
  registerEditorProvider(modelType, extension, viewType, options, capabilities, supportsMultipleEditorsPerDocument, serializeBuffersForPostMessage) {
83
90
  if (( (this._editorProviders.has(viewType)))) {
@@ -168,12 +175,12 @@ let MainThreadCustomEditors = class MainThreadCustomEditors extends Disposable {
168
175
  return existingModel;
169
176
  }
170
177
  switch (modelType) {
171
- case 1 :
178
+ case CustomEditorModelType.Text:
172
179
  {
173
180
  const model = CustomTextEditorModel.create(this._instantiationService, viewType, resource);
174
181
  return this._customEditorService.models.add(resource, viewType, model);
175
182
  }
176
- case 0 :
183
+ case CustomEditorModelType.Custom:
177
184
  {
178
185
  const model = MainThreadCustomEditorModel.create(this._instantiationService, this._proxyCustomEditors, viewType, resource, options, () => {
179
186
  return Array.from(this.mainThreadWebviewPanels.webviewInputs)
@@ -200,7 +207,7 @@ let MainThreadCustomEditors = class MainThreadCustomEditors extends Disposable {
200
207
  return model;
201
208
  }
202
209
  async onWillRunWorkingCopyFileOperation(e) {
203
- if (e.operation !== 2 ) {
210
+ if (e.operation !== FileOperation.MOVE) {
204
211
  return;
205
212
  }
206
213
  e.waitUntil((async () => {
@@ -234,17 +241,18 @@ MainThreadCustomEditors = ( (__decorate([
234
241
  ], MainThreadCustomEditors)));
235
242
  var HotExitState;
236
243
  ( ((function(HotExitState) {
244
+ let Type;
237
245
  ( ((function(Type) {
238
246
  Type[Type["Allowed"] = 0] = "Allowed";
239
247
  Type[Type["NotAllowed"] = 1] = "NotAllowed";
240
248
  Type[Type["Pending"] = 2] = "Pending";
241
- })(HotExitState.Type || (HotExitState.Type = {}))));
242
- HotExitState.Allowed = ( (Object.freeze({ type: 0 })));
243
- HotExitState.NotAllowed = ( (Object.freeze({ type: 1 })));
249
+ })(Type = HotExitState.Type || (HotExitState.Type = {}))));
250
+ HotExitState.Allowed = ( (Object.freeze({ type: Type.Allowed })));
251
+ HotExitState.NotAllowed = ( (Object.freeze({ type: Type.NotAllowed })));
244
252
  class Pending {
245
253
  constructor(operation) {
246
254
  this.operation = operation;
247
- this.type = 2 ;
255
+ this.type = Type.Pending;
248
256
  }
249
257
  }
250
258
  HotExitState.Pending = Pending;
@@ -331,7 +339,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
331
339
  return basename(this._labelService.getUriLabel(this._editorResource));
332
340
  }
333
341
  get capabilities() {
334
- return this.isUntitled() ? 2 : 0 ;
342
+ return this.isUntitled() ? WorkingCopyCapabilities.Untitled : WorkingCopyCapabilities.None;
335
343
  }
336
344
  isDirty() {
337
345
  if (this._isDirtyFromContentChange) {
@@ -363,7 +371,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
363
371
  this._currentEditIndex = this._edits.length - 1;
364
372
  });
365
373
  this._undoService.pushElement({
366
- type: 0 ,
374
+ type: UndoRedoElementType.Resource,
367
375
  resource: this._editorResource,
368
376
  label: label ?? ( localizeWithPath(_moduleId, 1, "Edit")),
369
377
  code: 'undoredo.customEditorEdit',
@@ -497,7 +505,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
497
505
  return true;
498
506
  }
499
507
  }
500
- get canHotExit() { return typeof this._backupId === 'string' && this._hotExitState.type === 0 ; }
508
+ get canHotExit() { return typeof this._backupId === 'string' && this._hotExitState.type === HotExitState.Type.Allowed; }
501
509
  async backup(token) {
502
510
  const editors = this._getEditors();
503
511
  if (!editors.length) {
@@ -524,7 +532,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
524
532
  if (!this._editable) {
525
533
  return backupData;
526
534
  }
527
- if (this._hotExitState.type === 2 ) {
535
+ if (this._hotExitState.type === HotExitState.Type.Pending) {
528
536
  this._hotExitState.operation.cancel();
529
537
  }
530
538
  const pendingState = new HotExitState.Pending(createCancelablePromise(token => this._proxy.$backup(this._editorResource.toJSON(), this.viewType, token)));
@@ -1,7 +1,7 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { DisposableStore, DisposableMap, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
3
  import { URI } from 'vscode/vscode/vs/base/common/uri';
4
- import { IDebugVisualization } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
4
+ import { IDebugVisualization, DataBreakpointSetType } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
5
5
  import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug.service';
6
6
  import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
7
7
  import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
@@ -12,6 +12,7 @@ import { ErrorNoTelemetry } from 'vscode/vscode/vs/base/common/errors';
12
12
  import { IDebugVisualizerService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugVisualizers.service';
13
13
  import { ExtensionIdentifier } from 'vscode/vscode/vs/platform/extensions/common/extensions';
14
14
  import { Event } from 'vscode/vscode/vs/base/common/event';
15
+ import { isDefined } from 'vscode/vscode/vs/base/common/types';
15
16
 
16
17
  let MainThreadDebugService = class MainThreadDebugService {
17
18
  constructor(extHostContext, debugService, visualizerService) {
@@ -164,7 +165,7 @@ let MainThreadDebugService = class MainThreadDebugService {
164
165
  $registerBreakpoints(DTOs) {
165
166
  for (const dto of DTOs) {
166
167
  if (dto.type === 'sourceMulti') {
167
- const rawbps = ( dto.lines.map(l => ({
168
+ const rawbps = ( dto.lines.map((l) => ({
168
169
  id: l.id,
169
170
  enabled: l.enabled,
170
171
  lineNumber: l.line + 1,
@@ -177,12 +178,19 @@ let MainThreadDebugService = class MainThreadDebugService {
177
178
  this.debugService.addBreakpoints(URI.revive(dto.uri), rawbps);
178
179
  }
179
180
  else if (dto.type === 'function') {
180
- this.debugService.addFunctionBreakpoint(dto.functionName, dto.id, dto.mode);
181
+ this.debugService.addFunctionBreakpoint({
182
+ name: dto.functionName,
183
+ mode: dto.mode,
184
+ condition: dto.condition,
185
+ hitCondition: dto.hitCondition,
186
+ enabled: dto.enabled,
187
+ logMessage: dto.logMessage
188
+ }, dto.id);
181
189
  }
182
190
  else if (dto.type === 'data') {
183
191
  this.debugService.addDataBreakpoint({
184
192
  description: dto.label,
185
- src: { type: 0 , dataId: dto.dataId },
193
+ src: { type: DataBreakpointSetType.Variable, dataId: dto.dataId },
186
194
  canPersist: dto.canPersist,
187
195
  accessTypes: dto.accessTypes,
188
196
  accessType: dto.accessType,
@@ -375,7 +383,7 @@ let MainThreadDebugService = class MainThreadDebugService {
375
383
  return {
376
384
  type: 'data',
377
385
  id: dbp.getId(),
378
- dataId: dbp.src.type === 0 ? dbp.src.dataId : dbp.src.address,
386
+ dataId: dbp.src.type === DataBreakpointSetType.Variable ? dbp.src.dataId : dbp.src.address,
379
387
  enabled: dbp.enabled,
380
388
  condition: dbp.condition,
381
389
  hitCondition: dbp.hitCondition,
@@ -385,7 +393,7 @@ let MainThreadDebugService = class MainThreadDebugService {
385
393
  canPersist: dbp.canPersist
386
394
  };
387
395
  }
388
- else {
396
+ else if ('uri' in bp) {
389
397
  const sbp = bp;
390
398
  return {
391
399
  type: 'source',
@@ -399,7 +407,10 @@ let MainThreadDebugService = class MainThreadDebugService {
399
407
  character: (typeof sbp.column === 'number' && sbp.column > 0) ? sbp.column - 1 : 0,
400
408
  };
401
409
  }
402
- }));
410
+ else {
411
+ return undefined;
412
+ }
413
+ })).filter(isDefined);
403
414
  }
404
415
  };
405
416
  MainThreadDebugService = __decorate([
@@ -6,6 +6,7 @@ import { URI } from 'vscode/vscode/vs/base/common/uri';
6
6
  import { shouldSynchronizeModel } from 'vscode/vscode/vs/editor/common/model';
7
7
  import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
8
8
  import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
9
+ import { FileOperation } from 'vscode/vscode/vs/platform/files/common/files';
9
10
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
10
11
  import { ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
11
12
  import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles.service';
@@ -113,8 +114,8 @@ let MainThreadDocuments = class MainThreadDocuments extends Disposable {
113
114
  }
114
115
  }));
115
116
  this._store.add(workingCopyFileService.onDidRunWorkingCopyFileOperation(e => {
116
- const isMove = e.operation === 2 ;
117
- if (isMove || e.operation === 1 ) {
117
+ const isMove = e.operation === FileOperation.MOVE;
118
+ if (isMove || e.operation === FileOperation.DELETE) {
118
119
  for (const pair of e.files) {
119
120
  const removed = isMove ? pair.source : pair.target;
120
121
  if (removed) {
@@ -24,6 +24,7 @@ import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/cl
24
24
  import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService.service';
25
25
  import { diffSets, diffMaps } from 'vscode/vscode/vs/base/common/collections';
26
26
  import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
27
+ import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
27
28
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
28
29
 
29
30
  class TextEditorSnapshot {
@@ -80,6 +81,11 @@ class DocumentAndEditorState {
80
81
  this.activeEditor = activeEditor;
81
82
  }
82
83
  }
84
+ var ActiveEditorOrder;
85
+ ( (function(ActiveEditorOrder) {
86
+ ActiveEditorOrder[ActiveEditorOrder["Editor"] = 0] = "Editor";
87
+ ActiveEditorOrder[ActiveEditorOrder["Panel"] = 1] = "Panel";
88
+ })(ActiveEditorOrder || (ActiveEditorOrder = {})));
83
89
  let MainThreadDocumentAndEditorStateComputer = class MainThreadDocumentAndEditorStateComputer {
84
90
  constructor(_onDidChangeState, _modelService, _codeEditorService, _editorService, _paneCompositeService) {
85
91
  this._onDidChangeState = _onDidChangeState;
@@ -89,16 +95,16 @@ let MainThreadDocumentAndEditorStateComputer = class MainThreadDocumentAndEditor
89
95
  this._paneCompositeService = _paneCompositeService;
90
96
  this._toDispose = ( new DisposableStore());
91
97
  this._toDisposeOnEditorRemove = ( new DisposableMap());
92
- this._activeEditorOrder = 0 ;
98
+ this._activeEditorOrder = ActiveEditorOrder.Editor;
93
99
  this._modelService.onModelAdded(this._updateStateOnModelAdd, this, this._toDispose);
94
100
  this._modelService.onModelRemoved(_ => this._updateState(), this, this._toDispose);
95
101
  this._editorService.onDidActiveEditorChange(_ => this._updateState(), this, this._toDispose);
96
102
  this._codeEditorService.onCodeEditorAdd(this._onDidAddEditor, this, this._toDispose);
97
103
  this._codeEditorService.onCodeEditorRemove(this._onDidRemoveEditor, this, this._toDispose);
98
104
  this._codeEditorService.listCodeEditors().forEach(this._onDidAddEditor, this);
99
- Event.filter(this._paneCompositeService.onDidPaneCompositeOpen, event => event.viewContainerLocation === 1 )(_ => this._activeEditorOrder = 1 , undefined, this._toDispose);
100
- Event.filter(this._paneCompositeService.onDidPaneCompositeClose, event => event.viewContainerLocation === 1 )(_ => this._activeEditorOrder = 0 , undefined, this._toDispose);
101
- this._editorService.onDidVisibleEditorsChange(_ => this._activeEditorOrder = 0 , undefined, this._toDispose);
105
+ Event.filter(this._paneCompositeService.onDidPaneCompositeOpen, event => event.viewContainerLocation === ViewContainerLocation.Panel)(_ => this._activeEditorOrder = ActiveEditorOrder.Panel, undefined, this._toDispose);
106
+ Event.filter(this._paneCompositeService.onDidPaneCompositeClose, event => event.viewContainerLocation === ViewContainerLocation.Panel)(_ => this._activeEditorOrder = ActiveEditorOrder.Editor, undefined, this._toDispose);
107
+ this._editorService.onDidVisibleEditorsChange(_ => this._activeEditorOrder = ActiveEditorOrder.Editor, undefined, this._toDispose);
102
108
  this._updateState();
103
109
  }
104
110
  dispose() {
@@ -158,7 +164,7 @@ let MainThreadDocumentAndEditorStateComputer = class MainThreadDocumentAndEditor
158
164
  }
159
165
  if (!activeEditor) {
160
166
  let candidate;
161
- if (this._activeEditorOrder === 0 ) {
167
+ if (this._activeEditorOrder === ActiveEditorOrder.Editor) {
162
168
  candidate = this._getActiveEditorFromEditorPart() || this._getActiveEditorFromPanel();
163
169
  }
164
170
  else {
@@ -180,7 +186,7 @@ let MainThreadDocumentAndEditorStateComputer = class MainThreadDocumentAndEditor
180
186
  }
181
187
  }
182
188
  _getActiveEditorFromPanel() {
183
- const panel = this._paneCompositeService.getActivePaneComposite(1 );
189
+ const panel = this._paneCompositeService.getActivePaneComposite(ViewContainerLocation.Panel);
184
190
  if (panel instanceof FakeAbstractTextEditor) {
185
191
  const control = panel.getControl();
186
192
  if (isCodeEditor(control)) {
@@ -1,12 +1,13 @@
1
1
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
2
2
  import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
3
- import { TextEditorCursorStyle, cursorStyleToString } from 'vscode/vscode/vs/editor/common/config/editorOptions';
3
+ import { EditorOption, TextEditorCursorStyle, RenderLineNumbersType, cursorStyleToString } from 'vscode/vscode/vs/editor/common/config/editorOptions';
4
4
  import { Range } from 'vscode/vscode/vs/editor/common/core/range';
5
5
  import { Selection } from 'vscode/vscode/vs/editor/common/core/selection';
6
+ import { ScrollType } from 'vscode/vscode/vs/editor/common/editorCommon';
6
7
  import { SnippetController2 } from 'vscode/vscode/vs/editor/contrib/snippet/browser/snippetController2';
7
8
  import { TextEditorRevealType } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
8
9
  import { equals } from 'vscode/vscode/vs/base/common/arrays';
9
- import { EditorState } from 'vscode/vscode/vs/editor/contrib/editorState/browser/editorState';
10
+ import { EditorState, CodeEditorStateFlag } from 'vscode/vscode/vs/editor/contrib/editorState/browser/editorState';
10
11
  import { SnippetParser } from 'vscode/vscode/vs/editor/contrib/snippet/browser/snippetParser';
11
12
 
12
13
  class MainThreadTextEditorProperties {
@@ -42,8 +43,8 @@ class MainThreadTextEditorProperties {
42
43
  let lineNumbers;
43
44
  if (codeEditor) {
44
45
  const options = codeEditor.getOptions();
45
- const lineNumbersOpts = options.get(68 );
46
- cursorStyle = options.get(28 );
46
+ const lineNumbersOpts = options.get(EditorOption.lineNumbers);
47
+ cursorStyle = options.get(EditorOption.cursorStyle);
47
48
  lineNumbers = lineNumbersOpts.renderType;
48
49
  }
49
50
  else if (previousProperties) {
@@ -52,7 +53,7 @@ class MainThreadTextEditorProperties {
52
53
  }
53
54
  else {
54
55
  cursorStyle = TextEditorCursorStyle.Line;
55
- lineNumbers = 1 ;
56
+ lineNumbers = RenderLineNumbersType.On;
56
57
  }
57
58
  const modelOptions = model.getOptions();
58
59
  return {
@@ -284,13 +285,13 @@ class MainThreadTextEditor {
284
285
  if (typeof newConfiguration.lineNumbers !== 'undefined') {
285
286
  let lineNumbers;
286
287
  switch (newConfiguration.lineNumbers) {
287
- case 1 :
288
+ case RenderLineNumbersType.On:
288
289
  lineNumbers = 'on';
289
290
  break;
290
- case 2 :
291
+ case RenderLineNumbersType.Relative:
291
292
  lineNumbers = 'relative';
292
293
  break;
293
- case 3 :
294
+ case RenderLineNumbersType.Interval:
294
295
  lineNumbers = 'interval';
295
296
  break;
296
297
  default:
@@ -323,16 +324,16 @@ class MainThreadTextEditor {
323
324
  }
324
325
  switch (revealType) {
325
326
  case TextEditorRevealType.Default:
326
- this._codeEditor.revealRange(range, 0 );
327
+ this._codeEditor.revealRange(range, ScrollType.Smooth);
327
328
  break;
328
329
  case TextEditorRevealType.InCenter:
329
- this._codeEditor.revealRangeInCenter(range, 0 );
330
+ this._codeEditor.revealRangeInCenter(range, ScrollType.Smooth);
330
331
  break;
331
332
  case TextEditorRevealType.InCenterIfOutsideViewport:
332
- this._codeEditor.revealRangeInCenterIfOutsideViewport(range, 0 );
333
+ this._codeEditor.revealRangeInCenterIfOutsideViewport(range, ScrollType.Smooth);
333
334
  break;
334
335
  case TextEditorRevealType.AtTop:
335
- this._codeEditor.revealRangeAtTop(range, 0 );
336
+ this._codeEditor.revealRangeAtTop(range, ScrollType.Smooth);
336
337
  break;
337
338
  default:
338
339
  console.warn(`Unknown revealType: ${revealType}`);
@@ -384,10 +385,7 @@ class MainThreadTextEditor {
384
385
  let clipboardText;
385
386
  const needsTemplate = SnippetParser.guessNeedsClipboard(template);
386
387
  if (needsTemplate) {
387
- const state = ( new EditorState(
388
- this._codeEditor,
389
- 1 | 4
390
- ));
388
+ const state = ( new EditorState(this._codeEditor, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position));
391
389
  clipboardText = await this._clipboardService.readText();
392
390
  if (!state.validate(this._codeEditor)) {
393
391
  return false;
@@ -5,8 +5,8 @@ import { isEqual } from 'vscode/vscode/vs/base/common/resources';
5
5
  import { URI } from 'vscode/vscode/vs/base/common/uri';
6
6
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
7
7
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
8
- import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
9
- import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
8
+ import { ExtHostContext, TabInputKind, TabModelOperationKind, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
9
+ import { EditorResourceAccessor, SideBySideEditor, GroupModelChangeKind } from 'vscode/vscode/vs/workbench/common/editor';
10
10
  import { DiffEditorInput } from 'vscode/vscode/vs/workbench/common/editor/diffEditorInput';
11
11
  import { isGroupEditorMoveEvent } from 'vscode/vscode/vs/workbench/common/editor/editorGroupModel';
12
12
  import { SideBySideEditorInput } from 'vscode/vscode/vs/workbench/common/editor/sideBySideEditorInput';
@@ -20,7 +20,7 @@ import { NotebookEditorInput } from 'vscode/vscode/vs/workbench/contrib/notebook
20
20
  import { TerminalEditorInput } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/terminalEditorInput';
21
21
  import { WebviewInput } from 'vscode/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
22
22
  import { editorGroupToColumn, columnToEditorGroup } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupColumn';
23
- import { preferredSideBySideGroupDirection } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
23
+ import { GroupDirection, preferredSideBySideGroupDirection } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
24
24
  import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
25
25
  import { SIDE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
26
26
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
@@ -73,7 +73,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
73
73
  _editorInputToDto(editor) {
74
74
  if (editor instanceof MergeEditorInput) {
75
75
  return {
76
- kind: 3 ,
76
+ kind: TabInputKind.TextMergeInput,
77
77
  base: editor.base,
78
78
  input1: editor.input1.uri,
79
79
  input2: editor.input2.uri,
@@ -82,7 +82,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
82
82
  }
83
83
  if (editor instanceof AbstractTextResourceEditorInput) {
84
84
  return {
85
- kind: 1 ,
85
+ kind: TabInputKind.TextInput,
86
86
  uri: editor.resource
87
87
  };
88
88
  }
@@ -95,48 +95,48 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
95
95
  && primaryResource
96
96
  && secondaryResource) {
97
97
  return {
98
- kind: 1 ,
98
+ kind: TabInputKind.TextInput,
99
99
  uri: primaryResource
100
100
  };
101
101
  }
102
- return { kind: 0 };
102
+ return { kind: TabInputKind.UnknownInput };
103
103
  }
104
104
  if (editor instanceof NotebookEditorInput) {
105
105
  return {
106
- kind: 4 ,
106
+ kind: TabInputKind.NotebookInput,
107
107
  notebookType: editor.viewType,
108
108
  uri: editor.resource
109
109
  };
110
110
  }
111
111
  if (editor instanceof CustomEditorInput) {
112
112
  return {
113
- kind: 6 ,
113
+ kind: TabInputKind.CustomEditorInput,
114
114
  viewType: editor.viewType,
115
115
  uri: editor.resource,
116
116
  };
117
117
  }
118
118
  if (editor instanceof WebviewInput) {
119
119
  return {
120
- kind: 7 ,
120
+ kind: TabInputKind.WebviewEditorInput,
121
121
  viewType: editor.viewType
122
122
  };
123
123
  }
124
124
  if (editor instanceof TerminalEditorInput) {
125
125
  return {
126
- kind: 8
126
+ kind: TabInputKind.TerminalEditorInput
127
127
  };
128
128
  }
129
129
  if (editor instanceof DiffEditorInput) {
130
130
  if (editor.modified instanceof AbstractTextResourceEditorInput && editor.original instanceof AbstractTextResourceEditorInput) {
131
131
  return {
132
- kind: 2 ,
132
+ kind: TabInputKind.TextDiffInput,
133
133
  modified: editor.modified.resource,
134
134
  original: editor.original.resource
135
135
  };
136
136
  }
137
137
  if (editor.modified instanceof NotebookEditorInput && editor.original instanceof NotebookEditorInput) {
138
138
  return {
139
- kind: 5 ,
139
+ kind: TabInputKind.NotebookDiffInput,
140
140
  notebookType: editor.original.viewType,
141
141
  modified: editor.modified.resource,
142
142
  original: editor.original.resource
@@ -145,14 +145,14 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
145
145
  }
146
146
  if (editor instanceof InteractiveEditorInput) {
147
147
  return {
148
- kind: 9 ,
148
+ kind: TabInputKind.InteractiveEditorInput,
149
149
  uri: editor.resource,
150
150
  inputBoxUri: editor.inputResource
151
151
  };
152
152
  }
153
153
  if (editor instanceof ChatEditorInput) {
154
154
  return {
155
- kind: 10 ,
155
+ kind: TabInputKind.ChatEditorInput,
156
156
  };
157
157
  }
158
158
  if (editor instanceof MultiDiffEditorInput) {
@@ -160,18 +160,18 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
160
160
  for (const resource of (editor?.resources.get() ?? [])) {
161
161
  if (resource.original && resource.modified) {
162
162
  diffEditors.push({
163
- kind: 2 ,
163
+ kind: TabInputKind.TextDiffInput,
164
164
  original: resource.original,
165
165
  modified: resource.modified
166
166
  });
167
167
  }
168
168
  }
169
169
  return {
170
- kind: 11 ,
170
+ kind: TabInputKind.MultiDiffEditorInput,
171
171
  diffEditors
172
172
  };
173
173
  }
174
- return { kind: 0 };
174
+ return { kind: TabInputKind.UnknownInput };
175
175
  }
176
176
  _generateTabId(editor, groupId) {
177
177
  let resourceString;
@@ -201,7 +201,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
201
201
  groupId,
202
202
  index: editorIndex,
203
203
  tabDto: tabInfo.tab,
204
- kind: 2
204
+ kind: TabModelOperationKind.TAB_UPDATE
205
205
  });
206
206
  }
207
207
  else {
@@ -235,7 +235,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
235
235
  groupId,
236
236
  index: editorIndex,
237
237
  tabDto: tabInfo.tab,
238
- kind: 2
238
+ kind: TabModelOperationKind.TAB_UPDATE
239
239
  });
240
240
  }));
241
241
  }
@@ -243,7 +243,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
243
243
  groupId,
244
244
  index: editorIndex,
245
245
  tabDto: tabObject,
246
- kind: 0
246
+ kind: TabModelOperationKind.TAB_OPEN
247
247
  });
248
248
  }
249
249
  _onDidTabClose(groupId, editorIndex) {
@@ -265,7 +265,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
265
265
  groupId,
266
266
  index: editorIndex,
267
267
  tabDto: removedTab[0],
268
- kind: 1
268
+ kind: TabModelOperationKind.TAB_CLOSE
269
269
  });
270
270
  }
271
271
  _onDidTabActiveChange(groupId, editorIndex) {
@@ -279,7 +279,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
279
279
  groupId,
280
280
  index: editorIndex,
281
281
  tabDto: activeTab,
282
- kind: 2
282
+ kind: TabModelOperationKind.TAB_UPDATE
283
283
  });
284
284
  }
285
285
  _onDidTabDirty(groupId, editorIndex, editor) {
@@ -295,7 +295,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
295
295
  groupId,
296
296
  index: editorIndex,
297
297
  tabDto: tabInfo.tab,
298
- kind: 2
298
+ kind: TabModelOperationKind.TAB_UPDATE
299
299
  });
300
300
  }
301
301
  _onDidTabPinChange(groupId, editorIndex, editor) {
@@ -313,7 +313,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
313
313
  groupId,
314
314
  index: editorIndex,
315
315
  tabDto: tab,
316
- kind: 2
316
+ kind: TabModelOperationKind.TAB_UPDATE
317
317
  });
318
318
  }
319
319
  _onDidTabPreviewChange(groupId, editorIndex, editor) {
@@ -328,7 +328,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
328
328
  }
329
329
  tab.isPreview = !group.isPinned(editorIndex);
330
330
  this._proxy.$acceptTabOperation({
331
- kind: 2 ,
331
+ kind: TabModelOperationKind.TAB_UPDATE,
332
332
  groupId,
333
333
  tabDto: tab,
334
334
  index: editorIndex
@@ -347,7 +347,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
347
347
  }
348
348
  tabs.splice(editorIndex, 0, removedTab[0]);
349
349
  this._proxy.$acceptTabOperation({
350
- kind: 3 ,
350
+ kind: TabModelOperationKind.TAB_MOVE,
351
351
  groupId,
352
352
  tabDto: removedTab[0],
353
353
  index: editorIndex,
@@ -389,7 +389,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
389
389
  const event = changeEvent.event;
390
390
  const groupId = changeEvent.groupId;
391
391
  switch (event.kind) {
392
- case 0 :
392
+ case GroupModelChangeKind.GROUP_ACTIVE:
393
393
  if (groupId === this._editorGroupsService.activeGroup.id) {
394
394
  this._onDidGroupActivate();
395
395
  break;
@@ -397,44 +397,44 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
397
397
  else {
398
398
  return;
399
399
  }
400
- case 8 :
400
+ case GroupModelChangeKind.EDITOR_LABEL:
401
401
  if (event.editor !== undefined && event.editorIndex !== undefined) {
402
402
  this._onDidTabLabelChange(groupId, event.editor, event.editorIndex);
403
403
  break;
404
404
  }
405
- case 4 :
405
+ case GroupModelChangeKind.EDITOR_OPEN:
406
406
  if (event.editor !== undefined && event.editorIndex !== undefined) {
407
407
  this._onDidTabOpen(groupId, event.editor, event.editorIndex);
408
408
  break;
409
409
  }
410
- case 5 :
410
+ case GroupModelChangeKind.EDITOR_CLOSE:
411
411
  if (event.editorIndex !== undefined) {
412
412
  this._onDidTabClose(groupId, event.editorIndex);
413
413
  break;
414
414
  }
415
- case 7 :
415
+ case GroupModelChangeKind.EDITOR_ACTIVE:
416
416
  if (event.editorIndex !== undefined) {
417
417
  this._onDidTabActiveChange(groupId, event.editorIndex);
418
418
  break;
419
419
  }
420
- case 13 :
420
+ case GroupModelChangeKind.EDITOR_DIRTY:
421
421
  if (event.editorIndex !== undefined && event.editor !== undefined) {
422
422
  this._onDidTabDirty(groupId, event.editorIndex, event.editor);
423
423
  break;
424
424
  }
425
- case 12 :
425
+ case GroupModelChangeKind.EDITOR_STICKY:
426
426
  if (event.editorIndex !== undefined && event.editor !== undefined) {
427
427
  this._onDidTabPinChange(groupId, event.editorIndex, event.editor);
428
428
  break;
429
429
  }
430
- case 10 :
430
+ case GroupModelChangeKind.EDITOR_PIN:
431
431
  if (event.editorIndex !== undefined && event.editor !== undefined) {
432
432
  this._onDidTabPreviewChange(groupId, event.editorIndex, event.editor);
433
433
  break;
434
434
  }
435
- case 11 :
435
+ case GroupModelChangeKind.EDITOR_TRANSIENT:
436
436
  break;
437
- case 6 :
437
+ case GroupModelChangeKind.EDITOR_MOVE:
438
438
  if (isGroupEditorMoveEvent(event) && event.editor && event.editorIndex !== undefined && event.oldEditorIndex !== undefined) {
439
439
  this._onDidTabMove(groupId, event.editorIndex, event.oldEditorIndex, event.editor);
440
440
  break;
@@ -456,7 +456,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
456
456
  return;
457
457
  }
458
458
  if (this._groupLookup.get(groupId) === undefined) {
459
- let direction = 3 ;
459
+ let direction = GroupDirection.RIGHT;
460
460
  if (viewColumn === SIDE_GROUP) {
461
461
  direction = preferredSideBySideGroupDirection(this._configurationService);
462
462
  }