@codingame/monaco-vscode-view-common-service-override 25.1.2 → 26.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 (68) hide show
  1. package/package.json +3 -3
  2. package/vscode/src/vs/platform/webview/common/mimeTypes.js +13 -13
  3. package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +5 -3
  4. package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +290 -233
  5. package/vscode/src/vs/workbench/browser/actions/helpActions.js +100 -57
  6. package/vscode/src/vs/workbench/browser/actions/listCommands.js +140 -136
  7. package/vscode/src/vs/workbench/browser/actions/navigationActions.js +79 -68
  8. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +843 -258
  9. package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +61 -57
  10. package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +13 -13
  11. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +80 -49
  12. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +104 -64
  13. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +39 -18
  14. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +10 -7
  15. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +33 -32
  16. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +100 -40
  17. package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +17 -14
  18. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +15 -11
  19. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +7 -3
  20. package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +64 -73
  21. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +1 -2
  22. package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.js +154 -99
  23. package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +20 -19
  24. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +256 -204
  25. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +70 -41
  26. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +16 -19
  27. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorAccessibilityHelp.js +17 -27
  28. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +2 -3
  29. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +45 -13
  30. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.d.ts +30 -0
  31. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +302 -0
  32. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +33 -18
  33. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +31 -24
  34. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +39 -26
  35. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +131 -105
  36. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +43 -33
  37. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.d.ts +11 -0
  38. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +43 -0
  39. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +31 -16
  40. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +229 -124
  41. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +27 -30
  42. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +89 -66
  43. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +32 -22
  44. package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +53 -44
  45. package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +13 -10
  46. package/vscode/src/vs/workbench/contrib/sash/browser/sash.js +19 -13
  47. package/vscode/src/vs/workbench/contrib/scrollLocking/browser/scrollLocking.js +34 -33
  48. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +79 -48
  49. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +112 -64
  50. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +30 -15
  51. package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +106 -47
  52. package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +29 -14
  53. package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +35 -23
  54. package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +255 -149
  55. package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +13 -13
  56. package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +4 -4
  57. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +33 -13
  58. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +24 -21
  59. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +13 -7
  60. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +70 -40
  61. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewService.js +12 -4
  62. package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +237 -127
  63. package/vscode/src/vs/workbench/services/history/browser/historyService.js +343 -244
  64. package/vscode/src/vs/workbench/services/progress/browser/progressService.js +150 -102
  65. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +34 -22
  66. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +28 -17
  67. package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +320 -118
  68. package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +288 -109
@@ -27,241 +27,233 @@ import { isProposedApiEnabled } from '@codingame/monaco-vscode-api/vscode/vs/wor
27
27
  import { ExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
28
28
 
29
29
  const viewsContainerSchema = {
30
- type: 'object',
30
+ type: "object",
31
31
  properties: {
32
32
  id: {
33
33
  description: ( localize(
34
- 2576,
34
+ 2579,
35
35
  "Unique id used to identify the container in which views can be contributed using 'views' contribution point"
36
36
  )),
37
- type: 'string',
38
- pattern: '^[a-zA-Z0-9_-]+$'
37
+ type: "string",
38
+ pattern: "^[a-zA-Z0-9_-]+$"
39
39
  },
40
40
  title: {
41
- description: ( localize(2577, 'Human readable string used to render the container')),
42
- type: 'string'
41
+ description: ( localize(2580, "Human readable string used to render the container")),
42
+ type: "string"
43
43
  },
44
44
  icon: {
45
45
  description: ( localize(
46
- 2578,
46
+ 2581,
47
47
  "Path to the container icon. Icons are 24x24 centered on a 50x40 block and have a fill color of 'rgb(215, 218, 224)' or '#d7dae0'. It is recommended that icons be in SVG, though any image file type is accepted."
48
48
  )),
49
- type: 'string'
49
+ type: "string"
50
50
  }
51
51
  },
52
- required: ['id', 'title', 'icon']
52
+ required: ["id", "title", "icon"]
53
53
  };
54
54
  const viewsContainersContribution = {
55
- description: ( localize(2579, 'Contributes views containers to the editor')),
56
- type: 'object',
55
+ description: ( localize(2582, "Contributes views containers to the editor")),
56
+ type: "object",
57
57
  properties: {
58
- 'activitybar': {
59
- description: ( localize(2580, "Contribute views containers to Activity Bar")),
60
- type: 'array',
58
+ "activitybar": {
59
+ description: ( localize(2583, "Contribute views containers to Activity Bar")),
60
+ type: "array",
61
61
  items: viewsContainerSchema
62
62
  },
63
- 'panel': {
64
- description: ( localize(2581, "Contribute views containers to Panel")),
65
- type: 'array',
63
+ "panel": {
64
+ description: ( localize(2584, "Contribute views containers to Panel")),
65
+ type: "array",
66
66
  items: viewsContainerSchema
67
67
  },
68
- 'secondarySidebar': {
69
- description: ( localize(2582, "Contribute views containers to Secondary Side Bar")),
70
- type: 'array',
68
+ "secondarySidebar": {
69
+ description: ( localize(2585, "Contribute views containers to Secondary Side Bar")),
70
+ type: "array",
71
71
  items: viewsContainerSchema
72
72
  }
73
73
  },
74
74
  additionalProperties: false
75
75
  };
76
76
  var ViewType;
77
- (function (ViewType) {
77
+ (function(ViewType) {
78
78
  ViewType["Tree"] = "tree";
79
79
  ViewType["Webview"] = "webview";
80
80
  })(ViewType || (ViewType = {}));
81
81
  var InitialVisibility;
82
- (function (InitialVisibility) {
82
+ (function(InitialVisibility) {
83
83
  InitialVisibility["Visible"] = "visible";
84
84
  InitialVisibility["Hidden"] = "hidden";
85
85
  InitialVisibility["Collapsed"] = "collapsed";
86
86
  })(InitialVisibility || (InitialVisibility = {}));
87
87
  const viewDescriptor = {
88
- type: 'object',
89
- required: ['id', 'name', 'icon'],
90
- defaultSnippets: [{ body: { id: '${1:id}', name: '${2:name}', icon: '${3:icon}' } }],
88
+ type: "object",
89
+ required: ["id", "name", "icon"],
90
+ defaultSnippets: [{
91
+ body: {
92
+ id: "${1:id}",
93
+ name: "${2:name}",
94
+ icon: "${3:icon}"
95
+ }
96
+ }],
91
97
  properties: {
92
98
  type: {
93
99
  markdownDescription: ( localize(
94
- 2583,
100
+ 2586,
95
101
  "Type of the view. This can either be `tree` for a tree view based view or `webview` for a webview based view. The default is `tree`."
96
102
  )),
97
- type: 'string',
98
- enum: [
99
- 'tree',
100
- 'webview',
101
- ],
102
- markdownEnumDescriptions: [
103
- ( localize(2584, "The view is backed by a `TreeView` created by `createTreeView`.")),
104
- ( localize(
105
- 2585,
103
+ type: "string",
104
+ enum: ["tree", "webview"],
105
+ markdownEnumDescriptions: [( localize(2587, "The view is backed by a `TreeView` created by `createTreeView`.")), ( localize(
106
+ 2588,
106
107
  "The view is backed by a `WebviewView` registered by `registerWebviewViewProvider`."
107
- )),
108
- ]
108
+ ))]
109
109
  },
110
110
  id: {
111
111
  markdownDescription: ( localize(
112
- 2586,
113
- 'Identifier of the view. This should be unique across all views. It is recommended to include your extension id as part of the view id. Use this to register a data provider through `vscode.window.registerTreeDataProviderForView` API. Also to trigger activating your extension by registering `onView:${id}` event to `activationEvents`.'
112
+ 2589,
113
+ "Identifier of the view. This should be unique across all views. It is recommended to include your extension id as part of the view id. Use this to register a data provider through `vscode.window.registerTreeDataProviderForView` API. Also to trigger activating your extension by registering `onView:${id}` event to `activationEvents`."
114
114
  )),
115
- type: 'string'
115
+ type: "string"
116
116
  },
117
117
  name: {
118
- description: ( localize(2587, 'The human-readable name of the view. Will be shown')),
119
- type: 'string'
118
+ description: ( localize(2590, "The human-readable name of the view. Will be shown")),
119
+ type: "string"
120
120
  },
121
121
  when: {
122
- description: ( localize(2588, 'Condition which must be true to show this view')),
123
- type: 'string'
122
+ description: ( localize(2591, "Condition which must be true to show this view")),
123
+ type: "string"
124
124
  },
125
125
  icon: {
126
126
  description: ( localize(
127
- 2589,
127
+ 2592,
128
128
  "Path to the view icon. View icons are displayed when the name of the view cannot be shown. It is recommended that icons be in SVG, though any image file type is accepted."
129
129
  )),
130
- type: 'string'
130
+ type: "string"
131
131
  },
132
132
  contextualTitle: {
133
133
  description: ( localize(
134
- 2590,
134
+ 2593,
135
135
  "Human-readable context for when the view is moved out of its original location. By default, the view's container name will be used."
136
136
  )),
137
- type: 'string'
137
+ type: "string"
138
138
  },
139
139
  visibility: {
140
140
  description: ( localize(
141
- 2591,
141
+ 2594,
142
142
  "Initial state of the view when the extension is first installed. Once the user has changed the view state by collapsing, moving, or hiding the view, the initial state will not be used again."
143
143
  )),
144
- type: 'string',
145
- enum: [
146
- 'visible',
147
- 'hidden',
148
- 'collapsed'
149
- ],
150
- default: 'visible',
151
- enumDescriptions: [
152
- ( localize(
153
- 2592,
144
+ type: "string",
145
+ enum: ["visible", "hidden", "collapsed"],
146
+ default: "visible",
147
+ enumDescriptions: [( localize(
148
+ 2595,
154
149
  "The default initial state for the view. In most containers the view will be expanded, however; some built-in containers (explorer, scm, and debug) show all contributed views collapsed regardless of the `visibility`."
155
- )),
156
- ( localize(
157
- 2593,
150
+ )), ( localize(
151
+ 2596,
158
152
  "The view will not be shown in the view container, but will be discoverable through the views menu and other view entry points and can be un-hidden by the user."
159
- )),
160
- ( localize(2594, "The view will show in the view container, but will be collapsed."))
161
- ]
153
+ )), ( localize(2597, "The view will show in the view container, but will be collapsed."))]
162
154
  },
163
155
  initialSize: {
164
- type: 'number',
156
+ type: "number",
165
157
  description: ( localize(
166
- 2595,
158
+ 2598,
167
159
  "The initial size of the view. The size will behave like the css 'flex' property, and will set the initial size when the view is first shown. In the side bar, this is the height of the view. This value is only respected when the same extension owns both the view and the view container."
168
- )),
160
+ ))
169
161
  },
170
162
  accessibilityHelpContent: {
171
- type: 'string',
163
+ type: "string",
172
164
  markdownDescription: ( localize(
173
- 2596,
165
+ 2599,
174
166
  "When the accessibility help dialog is invoked in this view, this content will be presented to the user as a markdown string. Keybindings will be resolved when provided in the format of <keybinding:commandId>. If there is no keybinding, that will be indicated and this command will be included in a quickpick for easy configuration."
175
167
  ))
176
168
  }
177
169
  }
178
170
  };
179
171
  const remoteViewDescriptor = {
180
- type: 'object',
181
- required: ['id', 'name'],
172
+ type: "object",
173
+ required: ["id", "name"],
182
174
  properties: {
183
175
  id: {
184
176
  description: ( localize(
185
- 2586,
186
- 'Identifier of the view. This should be unique across all views. It is recommended to include your extension id as part of the view id. Use this to register a data provider through `vscode.window.registerTreeDataProviderForView` API. Also to trigger activating your extension by registering `onView:${id}` event to `activationEvents`.'
177
+ 2589,
178
+ "Identifier of the view. This should be unique across all views. It is recommended to include your extension id as part of the view id. Use this to register a data provider through `vscode.window.registerTreeDataProviderForView` API. Also to trigger activating your extension by registering `onView:${id}` event to `activationEvents`."
187
179
  )),
188
- type: 'string'
180
+ type: "string"
189
181
  },
190
182
  name: {
191
- description: ( localize(2587, 'The human-readable name of the view. Will be shown')),
192
- type: 'string'
183
+ description: ( localize(2590, "The human-readable name of the view. Will be shown")),
184
+ type: "string"
193
185
  },
194
186
  when: {
195
- description: ( localize(2588, 'Condition which must be true to show this view')),
196
- type: 'string'
187
+ description: ( localize(2591, "Condition which must be true to show this view")),
188
+ type: "string"
197
189
  },
198
190
  group: {
199
- description: ( localize(2597, 'Nested group in the viewlet')),
200
- type: 'string'
191
+ description: ( localize(2600, "Nested group in the viewlet")),
192
+ type: "string"
201
193
  },
202
194
  remoteName: {
203
- description: ( localize(2598, 'The name of the remote type associated with this view')),
204
- type: ['string', 'array'],
195
+ description: ( localize(2601, "The name of the remote type associated with this view")),
196
+ type: ["string", "array"],
205
197
  items: {
206
- type: 'string'
198
+ type: "string"
207
199
  }
208
200
  }
209
201
  }
210
202
  };
211
203
  const viewsContribution = {
212
- description: ( localize(2599, "Contributes views to the editor")),
213
- type: 'object',
204
+ description: ( localize(2602, "Contributes views to the editor")),
205
+ type: "object",
214
206
  properties: {
215
- 'explorer': {
216
- description: ( localize(2600, "Contributes views to Explorer container in the Activity bar")),
217
- type: 'array',
207
+ "explorer": {
208
+ description: ( localize(2603, "Contributes views to Explorer container in the Activity bar")),
209
+ type: "array",
218
210
  items: viewDescriptor,
219
211
  default: []
220
212
  },
221
- 'debug': {
222
- description: ( localize(2601, "Contributes views to Debug container in the Activity bar")),
223
- type: 'array',
213
+ "debug": {
214
+ description: ( localize(2604, "Contributes views to Debug container in the Activity bar")),
215
+ type: "array",
224
216
  items: viewDescriptor,
225
217
  default: []
226
218
  },
227
- 'scm': {
228
- description: ( localize(2602, "Contributes views to SCM container in the Activity bar")),
229
- type: 'array',
219
+ "scm": {
220
+ description: ( localize(2605, "Contributes views to SCM container in the Activity bar")),
221
+ type: "array",
230
222
  items: viewDescriptor,
231
223
  default: []
232
224
  },
233
- 'test': {
234
- description: ( localize(2603, "Contributes views to Test container in the Activity bar")),
235
- type: 'array',
225
+ "test": {
226
+ description: ( localize(2606, "Contributes views to Test container in the Activity bar")),
227
+ type: "array",
236
228
  items: viewDescriptor,
237
229
  default: []
238
230
  },
239
- 'remote': {
231
+ "remote": {
240
232
  description: ( localize(
241
- 2604,
233
+ 2607,
242
234
  "Contributes views to Remote container in the Activity bar. To contribute to this container, the 'contribViewsRemote' API proposal must be enabled."
243
235
  )),
244
- type: 'array',
236
+ type: "array",
245
237
  items: remoteViewDescriptor,
246
238
  default: []
247
- },
239
+ }
248
240
  },
249
241
  additionalProperties: {
250
- description: ( localize(2605, "Contributes views to contributed views container")),
251
- type: 'array',
242
+ description: ( localize(2608, "Contributes views to contributed views container")),
243
+ type: "array",
252
244
  items: viewDescriptor,
253
245
  default: []
254
246
  }
255
247
  };
256
248
  const viewsContainersExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
257
- extensionPoint: 'viewsContainers',
249
+ extensionPoint: "viewsContainers",
258
250
  jsonSchema: viewsContainersContribution
259
251
  });
260
252
  const viewsExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
261
- extensionPoint: 'views',
253
+ extensionPoint: "views",
262
254
  deps: [viewsContainersExtensionPoint],
263
255
  jsonSchema: viewsContribution,
264
- activationEventsGenerator: function* (viewExtensionPointTypeArray) {
256
+ activationEventsGenerator: function*(viewExtensionPointTypeArray) {
265
257
  for (const viewExtensionPointType of viewExtensionPointTypeArray) {
266
258
  for (const viewDescriptors of ( Object.values(viewExtensionPointType))) {
267
259
  for (const viewDescriptor of viewDescriptors) {
@@ -275,7 +267,9 @@ const viewsExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
275
267
  });
276
268
  const CUSTOM_VIEWS_START_ORDER = 7;
277
269
  let ViewsExtensionHandler = class ViewsExtensionHandler {
278
- static { this.ID = 'workbench.contrib.viewsExtensionHandler'; }
270
+ static {
271
+ this.ID = "workbench.contrib.viewsExtensionHandler";
272
+ }
279
273
  constructor(instantiationService, logService) {
280
274
  this.instantiationService = instantiationService;
281
275
  this.logService = logService;
@@ -285,7 +279,13 @@ let ViewsExtensionHandler = class ViewsExtensionHandler {
285
279
  this.handleAndRegisterCustomViews();
286
280
  }
287
281
  handleAndRegisterCustomViewContainers() {
288
- viewsContainersExtensionPoint.setHandler((extensions, { added, removed }) => {
282
+ viewsContainersExtensionPoint.setHandler((
283
+ extensions,
284
+ {
285
+ added,
286
+ removed
287
+ }
288
+ ) => {
289
289
  if (removed.length) {
290
290
  this.removeCustomViewContainers(removed);
291
291
  }
@@ -296,31 +296,62 @@ let ViewsExtensionHandler = class ViewsExtensionHandler {
296
296
  }
297
297
  addCustomViewContainers(extensionPoints, existingViewContainers) {
298
298
  const viewContainersRegistry = ( Registry.as(Extensions.ViewContainersRegistry));
299
- let activityBarOrder = CUSTOM_VIEWS_START_ORDER + viewContainersRegistry.all.filter(v => !!v.extensionId && viewContainersRegistry.getViewContainerLocation(v) === ViewContainerLocation.Sidebar).length;
300
- let panelOrder = 5 + viewContainersRegistry.all.filter(v => !!v.extensionId && viewContainersRegistry.getViewContainerLocation(v) === ViewContainerLocation.Panel).length + 1;
301
- let auxiliaryBarOrder = 100 + viewContainersRegistry.all.filter(v => !!v.extensionId && viewContainersRegistry.getViewContainerLocation(v) === ViewContainerLocation.AuxiliaryBar).length + 1;
302
- for (const { value, collector, description } of extensionPoints) {
299
+ let activityBarOrder = CUSTOM_VIEWS_START_ORDER + viewContainersRegistry.all.filter(
300
+ v => !!v.extensionId && viewContainersRegistry.getViewContainerLocation(v) === ViewContainerLocation.Sidebar
301
+ ).length;
302
+ let panelOrder = 5 + viewContainersRegistry.all.filter(
303
+ v => !!v.extensionId && viewContainersRegistry.getViewContainerLocation(v) === ViewContainerLocation.Panel
304
+ ).length + 1;
305
+ let auxiliaryBarOrder = 100 + viewContainersRegistry.all.filter(
306
+ v => !!v.extensionId && viewContainersRegistry.getViewContainerLocation(v) === ViewContainerLocation.AuxiliaryBar
307
+ ).length + 1;
308
+ for (const {
309
+ value,
310
+ collector,
311
+ description
312
+ } of extensionPoints) {
303
313
  Object.entries(value).forEach(([key, value]) => {
304
314
  if (!this.isValidViewsContainer(value, collector)) {
305
315
  return;
306
316
  }
307
317
  switch (key) {
308
- case 'activitybar':
309
- activityBarOrder = this.registerCustomViewContainers(value, description, activityBarOrder, existingViewContainers, ViewContainerLocation.Sidebar);
310
- break;
311
- case 'panel':
312
- panelOrder = this.registerCustomViewContainers(value, description, panelOrder, existingViewContainers, ViewContainerLocation.Panel);
313
- break;
314
- case 'secondarySidebar':
315
- auxiliaryBarOrder = this.registerCustomViewContainers(value, description, auxiliaryBarOrder, existingViewContainers, ViewContainerLocation.AuxiliaryBar);
316
- break;
318
+ case "activitybar":
319
+ activityBarOrder = this.registerCustomViewContainers(
320
+ value,
321
+ description,
322
+ activityBarOrder,
323
+ existingViewContainers,
324
+ ViewContainerLocation.Sidebar
325
+ );
326
+ break;
327
+ case "panel":
328
+ panelOrder = this.registerCustomViewContainers(
329
+ value,
330
+ description,
331
+ panelOrder,
332
+ existingViewContainers,
333
+ ViewContainerLocation.Panel
334
+ );
335
+ break;
336
+ case "secondarySidebar":
337
+ auxiliaryBarOrder = this.registerCustomViewContainers(
338
+ value,
339
+ description,
340
+ auxiliaryBarOrder,
341
+ existingViewContainers,
342
+ ViewContainerLocation.AuxiliaryBar
343
+ );
344
+ break;
317
345
  }
318
346
  });
319
347
  }
320
348
  }
321
349
  removeCustomViewContainers(extensionPoints) {
322
350
  const viewContainersRegistry = ( Registry.as(Extensions.ViewContainersRegistry));
323
- const removedExtensions = extensionPoints.reduce((result, e) => { result.add(e.description.identifier); return result; }, ( new ExtensionIdentifierSet()));
351
+ const removedExtensions = extensionPoints.reduce((result, e) => {
352
+ result.add(e.description.identifier);
353
+ return result;
354
+ }, ( new ExtensionIdentifierSet()));
324
355
  for (const viewContainer of viewContainersRegistry.all) {
325
356
  if (viewContainer.extensionId && ( removedExtensions.has(viewContainer.extensionId))) {
326
357
  const views = this.viewsRegistry.getViews(viewContainer);
@@ -333,39 +364,39 @@ let ViewsExtensionHandler = class ViewsExtensionHandler {
333
364
  }
334
365
  isValidViewsContainer(viewsContainersDescriptors, collector) {
335
366
  if (!Array.isArray(viewsContainersDescriptors)) {
336
- collector.error(( localize(2606, "views containers must be an array")));
367
+ collector.error(( localize(2609, "views containers must be an array")));
337
368
  return false;
338
369
  }
339
370
  for (const descriptor of viewsContainersDescriptors) {
340
- if (typeof descriptor.id !== 'string' && isFalsyOrWhitespace(descriptor.id)) {
371
+ if (typeof descriptor.id !== "string" && isFalsyOrWhitespace(descriptor.id)) {
341
372
  collector.error(( localize(
342
- 2607,
373
+ 2610,
343
374
  "property `{0}` is mandatory and must be of type `string` with non-empty value. Only alphanumeric characters, '_', and '-' are allowed.",
344
- 'id'
375
+ "id"
345
376
  )));
346
377
  return false;
347
378
  }
348
379
  if (!(/^[a-z0-9_-]+$/i.test(descriptor.id))) {
349
380
  collector.error(( localize(
350
- 2607,
381
+ 2610,
351
382
  "property `{0}` is mandatory and must be of type `string` with non-empty value. Only alphanumeric characters, '_', and '-' are allowed.",
352
- 'id'
383
+ "id"
353
384
  )));
354
385
  return false;
355
386
  }
356
- if (typeof descriptor.title !== 'string') {
357
- collector.error(( localize(2608, "property `{0}` is mandatory and must be of type `string`", 'title')));
387
+ if (typeof descriptor.title !== "string") {
388
+ collector.error(( localize(2611, "property `{0}` is mandatory and must be of type `string`", "title")));
358
389
  return false;
359
390
  }
360
- if (typeof descriptor.icon !== 'string') {
361
- collector.error(( localize(2608, "property `{0}` is mandatory and must be of type `string`", 'icon')));
391
+ if (typeof descriptor.icon !== "string") {
392
+ collector.error(( localize(2611, "property `{0}` is mandatory and must be of type `string`", "icon")));
362
393
  return false;
363
394
  }
364
395
  if (isFalsyOrWhitespace(descriptor.title)) {
365
396
  collector.warn(( localize(
366
- 2609,
397
+ 2612,
367
398
  "property `{0}` is mandatory and must be of type `string` with non-empty value",
368
- 'title'
399
+ "title"
369
400
  )));
370
401
  return true;
371
402
  }
@@ -383,7 +414,9 @@ let ViewsExtensionHandler = class ViewsExtensionHandler {
383
414
  const viewsToMove = [];
384
415
  for (const existingViewContainer of existingViewContainers) {
385
416
  if (viewContainer !== existingViewContainer) {
386
- viewsToMove.push(...this.viewsRegistry.getViews(existingViewContainer).filter(view => view.originalContainerId === descriptor.id));
417
+ viewsToMove.push(
418
+ ...this.viewsRegistry.getViews(existingViewContainer).filter(view => view.originalContainerId === descriptor.id)
419
+ );
387
420
  }
388
421
  }
389
422
  if (viewsToMove.length) {
@@ -398,12 +431,17 @@ let ViewsExtensionHandler = class ViewsExtensionHandler {
398
431
  if (!viewContainer) {
399
432
  viewContainer = this.viewContainersRegistry.registerViewContainer({
400
433
  id,
401
- title: { value: title, original: title },
434
+ title: {
435
+ value: title,
436
+ original: title
437
+ },
402
438
  extensionId,
403
- ctorDescriptor: ( new SyncDescriptor(ViewPaneContainer, [id, { mergeViewWithContainerWhenSingleView: true }])),
439
+ ctorDescriptor: ( new SyncDescriptor(ViewPaneContainer, [id, {
440
+ mergeViewWithContainerWhenSingleView: true
441
+ }])),
404
442
  hideIfEmpty: true,
405
443
  order,
406
- icon,
444
+ icon
407
445
  }, location);
408
446
  }
409
447
  return viewContainer;
@@ -413,7 +451,13 @@ let ViewsExtensionHandler = class ViewsExtensionHandler {
413
451
  ( Registry.as(Extensions$1.Viewlets)).deregisterPaneComposite(viewContainer.id);
414
452
  }
415
453
  handleAndRegisterCustomViews() {
416
- viewsExtensionPoint.setHandler((extensions, { added, removed }) => {
454
+ viewsExtensionPoint.setHandler((
455
+ extensions,
456
+ {
457
+ added,
458
+ removed
459
+ }
460
+ ) => {
417
461
  if (removed.length) {
418
462
  this.removeViews(removed);
419
463
  }
@@ -426,22 +470,25 @@ let ViewsExtensionHandler = class ViewsExtensionHandler {
426
470
  const viewIds = ( new Set());
427
471
  const allViewDescriptors = [];
428
472
  for (const extension of extensions) {
429
- const { value, collector } = extension;
473
+ const {
474
+ value,
475
+ collector
476
+ } = extension;
430
477
  Object.entries(value).forEach(([key, value]) => {
431
478
  if (!this.isValidViewDescriptors(value, collector)) {
432
479
  return;
433
480
  }
434
- if (key === 'remote' && !isProposedApiEnabled(extension.description, 'contribViewsRemote')) {
481
+ if (key === "remote" && !isProposedApiEnabled(extension.description, "contribViewsRemote")) {
435
482
  collector.warn(( localize(
436
- 2610,
483
+ 2613,
437
484
  "View container '{0}' requires 'enabledApiProposals: [\"contribViewsRemote\"]' to be added to 'Remote'.",
438
485
  key
439
486
  )));
440
487
  return;
441
488
  }
442
- if (key === 'agentSessions' && !isProposedApiEnabled(extension.description, 'chatSessionsProvider')) {
489
+ if (key === "agentSessions" && !isProposedApiEnabled(extension.description, "chatSessionsProvider")) {
443
490
  collector.warn(( localize(
444
- 2611,
491
+ 2614,
445
492
  "View container '{0}' requires 'enabledApiProposals: [\"chatSessionsProvider\"]'.",
446
493
  key
447
494
  )));
@@ -450,7 +497,7 @@ let ViewsExtensionHandler = class ViewsExtensionHandler {
450
497
  const viewContainer = this.getViewContainer(key);
451
498
  if (!viewContainer) {
452
499
  collector.warn(( localize(
453
- 2612,
500
+ 2615,
454
501
  "View container '{0}' does not exist and all views registered to it will be added to 'Explorer'.",
455
502
  key
456
503
  )));
@@ -460,49 +507,49 @@ let ViewsExtensionHandler = class ViewsExtensionHandler {
460
507
  for (let index = 0; index < value.length; index++) {
461
508
  const item = value[index];
462
509
  if (( viewIds.has(item.id))) {
463
- collector.error(( localize(2613, "Cannot register multiple views with same id `{0}`", item.id)));
510
+ collector.error(( localize(2616, "Cannot register multiple views with same id `{0}`", item.id)));
464
511
  continue;
465
512
  }
466
513
  if (this.viewsRegistry.getView(item.id) !== null) {
467
- collector.error(( localize(2614, "A view with id `{0}` is already registered.", item.id)));
514
+ collector.error(( localize(2617, "A view with id `{0}` is already registered.", item.id)));
468
515
  continue;
469
516
  }
470
- const order = ExtensionIdentifier.equals(extension.description.identifier, container.extensionId)
471
- ? index + 1
472
- : container.viewOrderDelegate
473
- ? container.viewOrderDelegate.getOrder(item.group)
474
- : undefined;
517
+ const order = ExtensionIdentifier.equals(extension.description.identifier, container.extensionId) ? index + 1 : container.viewOrderDelegate ? container.viewOrderDelegate.getOrder(item.group) : undefined;
475
518
  let icon;
476
- if (typeof item.icon === 'string') {
519
+ if (typeof item.icon === "string") {
477
520
  icon = ThemeIcon.fromString(item.icon) || joinPath(extension.description.extensionLocation, item.icon);
478
521
  }
479
522
  const initialVisibility = this.convertInitialVisibility(item.visibility);
480
523
  const type = this.getViewType(item.type);
481
524
  if (!type) {
482
- collector.error(( localize(2615, "Unknown view type `{0}`.", item.type)));
525
+ collector.error(( localize(2618, "Unknown view type `{0}`.", item.type)));
483
526
  continue;
484
527
  }
485
528
  let weight = undefined;
486
- if (typeof item.initialSize === 'number') {
529
+ if (typeof item.initialSize === "number") {
487
530
  if (container.extensionId?.value === extension.description.identifier.value) {
488
531
  weight = item.initialSize;
489
- }
490
- else {
491
- this.logService.warn(`${extension.description.identifier.value} tried to set the view size of ${item.id} but it was ignored because the view container does not belong to it.`);
532
+ } else {
533
+ this.logService.warn(
534
+ `${extension.description.identifier.value} tried to set the view size of ${item.id} but it was ignored because the view container does not belong to it.`
535
+ );
492
536
  }
493
537
  }
494
538
  let accessibilityHelpContent;
495
- if (isProposedApiEnabled(extension.description, 'contribAccessibilityHelpContent') && item.accessibilityHelpContent) {
539
+ if (isProposedApiEnabled(extension.description, "contribAccessibilityHelpContent") && item.accessibilityHelpContent) {
496
540
  accessibilityHelpContent = ( new MarkdownString(item.accessibilityHelpContent));
497
541
  }
498
542
  const viewDescriptor = {
499
543
  type: type,
500
544
  ctorDescriptor: type === ViewType.Tree ? ( new SyncDescriptor(TreeViewPane)) : ( new SyncDescriptor(WebviewViewPane)),
501
545
  id: item.id,
502
- name: { value: item.name, original: item.name },
546
+ name: {
547
+ value: item.name,
548
+ original: item.name
549
+ },
503
550
  when: ContextKeyExpr.deserialize(item.when),
504
551
  containerIcon: icon || viewContainer?.icon,
505
- containerTitle: item.contextualTitle || (viewContainer && (typeof viewContainer.title === 'string' ? viewContainer.title : viewContainer.title.value)),
552
+ containerTitle: item.contextualTitle || (viewContainer && (typeof viewContainer.title === "string" ? viewContainer.title : viewContainer.title.value)),
506
553
  canToggleVisibility: true,
507
554
  canMoveView: viewContainer?.id !== VIEWLET_ID,
508
555
  treeView: type === ViewType.Tree ? this.instantiationService.createInstance(CustomTreeView, item.id, item.name, extension.description.identifier.value) : undefined,
@@ -521,7 +568,10 @@ let ViewsExtensionHandler = class ViewsExtensionHandler {
521
568
  viewIds.add(viewDescriptor.id);
522
569
  viewDescriptors.push(viewDescriptor);
523
570
  }
524
- allViewDescriptors.push({ viewContainer: container, views: viewDescriptors });
571
+ allViewDescriptors.push({
572
+ viewContainer: container,
573
+ views: viewDescriptors
574
+ });
525
575
  });
526
576
  }
527
577
  this.viewsRegistry.registerViews2(allViewDescriptors);
@@ -539,7 +589,10 @@ let ViewsExtensionHandler = class ViewsExtensionHandler {
539
589
  return this.viewContainersRegistry.get(VIEWLET_ID$1);
540
590
  }
541
591
  removeViews(extensions) {
542
- const removedExtensions = extensions.reduce((result, e) => { result.add(e.description.identifier); return result; }, ( new ExtensionIdentifierSet()));
592
+ const removedExtensions = extensions.reduce((result, e) => {
593
+ result.add(e.description.identifier);
594
+ return result;
595
+ }, ( new ExtensionIdentifierSet()));
543
596
  for (const viewContainer of this.viewContainersRegistry.all) {
544
597
  const removedViews = this.viewsRegistry.getViews(viewContainer).filter(v => v.extensionId && ( removedExtensions.has(v.extensionId)));
545
598
  if (removedViews.length) {
@@ -561,40 +614,40 @@ let ViewsExtensionHandler = class ViewsExtensionHandler {
561
614
  }
562
615
  isValidViewDescriptors(viewDescriptors, collector) {
563
616
  if (!Array.isArray(viewDescriptors)) {
564
- collector.error(( localize(2616, "views must be an array")));
617
+ collector.error(( localize(2619, "views must be an array")));
565
618
  return false;
566
619
  }
567
620
  for (const descriptor of viewDescriptors) {
568
- if (typeof descriptor.id !== 'string') {
569
- collector.error(( localize(2608, "property `{0}` is mandatory and must be of type `string`", 'id')));
621
+ if (typeof descriptor.id !== "string") {
622
+ collector.error(( localize(2611, "property `{0}` is mandatory and must be of type `string`", "id")));
570
623
  return false;
571
624
  }
572
- if (typeof descriptor.name !== 'string') {
573
- collector.error(( localize(2608, "property `{0}` is mandatory and must be of type `string`", 'name')));
625
+ if (typeof descriptor.name !== "string") {
626
+ collector.error(( localize(2611, "property `{0}` is mandatory and must be of type `string`", "name")));
574
627
  return false;
575
628
  }
576
- if (descriptor.when && typeof descriptor.when !== 'string') {
577
- collector.error(( localize(2617, "property `{0}` can be omitted or must be of type `string`", 'when')));
629
+ if (descriptor.when && typeof descriptor.when !== "string") {
630
+ collector.error(( localize(2620, "property `{0}` can be omitted or must be of type `string`", "when")));
578
631
  return false;
579
632
  }
580
- if (descriptor.icon && typeof descriptor.icon !== 'string') {
581
- collector.error(( localize(2617, "property `{0}` can be omitted or must be of type `string`", 'icon')));
633
+ if (descriptor.icon && typeof descriptor.icon !== "string") {
634
+ collector.error(( localize(2620, "property `{0}` can be omitted or must be of type `string`", "icon")));
582
635
  return false;
583
636
  }
584
- if (descriptor.contextualTitle && typeof descriptor.contextualTitle !== 'string') {
637
+ if (descriptor.contextualTitle && typeof descriptor.contextualTitle !== "string") {
585
638
  collector.error(( localize(
586
- 2617,
639
+ 2620,
587
640
  "property `{0}` can be omitted or must be of type `string`",
588
- 'contextualTitle'
641
+ "contextualTitle"
589
642
  )));
590
643
  return false;
591
644
  }
592
645
  if (descriptor.visibility && !this.convertInitialVisibility(descriptor.visibility)) {
593
646
  collector.error(( localize(
594
- 2618,
647
+ 2621,
595
648
  "property `{0}` can be omitted or must be one of {1}",
596
- 'visibility',
597
- ( Object.values(InitialVisibility)).join(', ')
649
+ "visibility",
650
+ ( Object.values(InitialVisibility)).join(", ")
598
651
  )));
599
652
  return false;
600
653
  }
@@ -603,31 +656,33 @@ let ViewsExtensionHandler = class ViewsExtensionHandler {
603
656
  }
604
657
  getViewContainer(value) {
605
658
  switch (value) {
606
- case 'explorer': return this.viewContainersRegistry.get(VIEWLET_ID$1);
607
- case 'debug': return this.viewContainersRegistry.get(VIEWLET_ID$3);
608
- case 'scm': return this.viewContainersRegistry.get(VIEWLET_ID$2);
609
- case 'remote': return this.viewContainersRegistry.get(VIEWLET_ID);
610
- default: return this.viewContainersRegistry.get(`workbench.view.extension.${value}`);
659
+ case "explorer":
660
+ return this.viewContainersRegistry.get(VIEWLET_ID$1);
661
+ case "debug":
662
+ return this.viewContainersRegistry.get(VIEWLET_ID$3);
663
+ case "scm":
664
+ return this.viewContainersRegistry.get(VIEWLET_ID$2);
665
+ case "remote":
666
+ return this.viewContainersRegistry.get(VIEWLET_ID);
667
+ default:
668
+ return this.viewContainersRegistry.get(`workbench.view.extension.${value}`);
611
669
  }
612
670
  }
613
671
  showCollapsed(container) {
614
672
  switch (container.id) {
615
- case VIEWLET_ID$1:
616
- case VIEWLET_ID$2:
617
- case VIEWLET_ID$3:
618
- return true;
673
+ case VIEWLET_ID$1:
674
+ case VIEWLET_ID$2:
675
+ case VIEWLET_ID$3:
676
+ return true;
619
677
  }
620
678
  return false;
621
679
  }
622
680
  };
623
- ViewsExtensionHandler = ( __decorate([
624
- ( __param(0, IInstantiationService)),
625
- ( __param(1, ILogService))
626
- ], ViewsExtensionHandler));
681
+ ViewsExtensionHandler = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, ILogService))], ViewsExtensionHandler));
627
682
  class ViewContainersDataRenderer extends Disposable {
628
683
  constructor() {
629
684
  super(...arguments);
630
- this.type = 'table';
685
+ this.type = "table";
631
686
  }
632
687
  shouldRender(manifest) {
633
688
  return !!manifest.contributes?.viewsContainers;
@@ -636,39 +691,38 @@ class ViewContainersDataRenderer extends Disposable {
636
691
  const contrib = manifest.contributes?.viewsContainers || {};
637
692
  const viewContainers = ( Object.keys(contrib)).reduce((result, location) => {
638
693
  const viewContainersForLocation = contrib[location];
639
- result.push(...( viewContainersForLocation.map(viewContainer => ({ ...viewContainer, location }))));
694
+ result.push(...( viewContainersForLocation.map(viewContainer => ({
695
+ ...viewContainer,
696
+ location
697
+ }))));
640
698
  return result;
641
699
  }, []);
642
700
  if (!viewContainers.length) {
643
- return { data: { headers: [], rows: [] }, dispose: () => { } };
701
+ return {
702
+ data: {
703
+ headers: [],
704
+ rows: []
705
+ },
706
+ dispose: () => {}
707
+ };
644
708
  }
645
- const headers = [
646
- ( localize(2619, "ID")),
647
- ( localize(2620, "Title")),
648
- ( localize(2621, "Where")),
649
- ];
650
- const rows = ( viewContainers
651
- .sort((a, b) => a.id.localeCompare(b.id))
652
- .map(viewContainer => {
653
- return [
654
- viewContainer.id,
655
- viewContainer.title,
656
- viewContainer.location
657
- ];
709
+ const headers = [( localize(2622, "ID")), ( localize(2623, "Title")), ( localize(2624, "Where"))];
710
+ const rows = ( viewContainers.sort((a, b) => a.id.localeCompare(b.id)).map(viewContainer => {
711
+ return [viewContainer.id, viewContainer.title, viewContainer.location];
658
712
  }));
659
713
  return {
660
714
  data: {
661
715
  headers,
662
716
  rows
663
717
  },
664
- dispose: () => { }
718
+ dispose: () => {}
665
719
  };
666
720
  }
667
721
  }
668
722
  class ViewsDataRenderer extends Disposable {
669
723
  constructor() {
670
724
  super(...arguments);
671
- this.type = 'table';
725
+ this.type = "table";
672
726
  }
673
727
  shouldRender(manifest) {
674
728
  return !!manifest.contributes?.views;
@@ -677,51 +731,54 @@ class ViewsDataRenderer extends Disposable {
677
731
  const contrib = manifest.contributes?.views || {};
678
732
  const views = ( Object.keys(contrib)).reduce((result, location) => {
679
733
  const viewsForLocation = contrib[location];
680
- result.push(...( viewsForLocation.map(view => ({ ...view, location }))));
734
+ result.push(...( viewsForLocation.map(view => ({
735
+ ...view,
736
+ location
737
+ }))));
681
738
  return result;
682
739
  }, []);
683
740
  if (!views.length) {
684
- return { data: { headers: [], rows: [] }, dispose: () => { } };
741
+ return {
742
+ data: {
743
+ headers: [],
744
+ rows: []
745
+ },
746
+ dispose: () => {}
747
+ };
685
748
  }
686
- const headers = [
687
- ( localize(2622, "ID")),
688
- ( localize(2623, "Name")),
689
- ( localize(2621, "Where")),
690
- ];
691
- const rows = ( views
692
- .sort((a, b) => a.id.localeCompare(b.id))
693
- .map(view => {
694
- return [
695
- view.id,
696
- view.name,
697
- view.location
698
- ];
749
+ const headers = [( localize(2625, "ID")), ( localize(2626, "Name")), ( localize(2624, "Where"))];
750
+ const rows = ( views.sort((a, b) => a.id.localeCompare(b.id)).map(view => {
751
+ return [view.id, view.name, view.location];
699
752
  }));
700
753
  return {
701
754
  data: {
702
755
  headers,
703
756
  rows
704
757
  },
705
- dispose: () => { }
758
+ dispose: () => {}
706
759
  };
707
760
  }
708
761
  }
709
762
  ( Registry.as(Extensions$2.ExtensionFeaturesRegistry)).registerExtensionFeature({
710
- id: 'viewsContainers',
711
- label: ( localize(2624, "View Containers")),
763
+ id: "viewsContainers",
764
+ label: ( localize(2627, "View Containers")),
712
765
  access: {
713
766
  canToggle: false
714
767
  },
715
- renderer: ( new SyncDescriptor(ViewContainersDataRenderer)),
768
+ renderer: ( new SyncDescriptor(ViewContainersDataRenderer))
716
769
  });
717
770
  ( Registry.as(Extensions$2.ExtensionFeaturesRegistry)).registerExtensionFeature({
718
- id: 'views',
719
- label: ( localize(2625, "Views")),
771
+ id: "views",
772
+ label: ( localize(2628, "Views")),
720
773
  access: {
721
774
  canToggle: false
722
775
  },
723
- renderer: ( new SyncDescriptor(ViewsDataRenderer)),
776
+ renderer: ( new SyncDescriptor(ViewsDataRenderer))
724
777
  });
725
- registerWorkbenchContribution2(ViewsExtensionHandler.ID, ViewsExtensionHandler, WorkbenchPhase.BlockStartup);
778
+ registerWorkbenchContribution2(
779
+ ViewsExtensionHandler.ID,
780
+ ViewsExtensionHandler,
781
+ WorkbenchPhase.BlockStartup
782
+ );
726
783
 
727
784
  export { viewsContainersContribution };