@codingame/monaco-vscode-view-common-service-override 5.2.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/package.json +3 -3
  2. package/viewCommon.js +1 -1
  3. package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +2 -1
  4. package/vscode/src/vs/base/browser/ui/grid/grid.js +34 -24
  5. package/vscode/src/vs/base/browser/ui/grid/gridview.js +35 -34
  6. package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +9 -60
  7. package/vscode/src/vs/workbench/browser/actions/listCommands.js +119 -79
  8. package/vscode/src/vs/workbench/browser/actions/navigationActions.js +76 -64
  9. package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
  10. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +51 -71
  11. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +1 -1
  12. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +21 -18
  13. package/vscode/src/vs/workbench/browser/parts/compositeBar.js +6 -6
  14. package/vscode/src/vs/workbench/browser/parts/compositePart.js +11 -8
  15. package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +8 -7
  16. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +112 -107
  17. package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +2 -2
  18. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +36 -30
  19. package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +75 -69
  20. package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +143 -25
  21. package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +20 -16
  22. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +13 -11
  23. package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +5 -4
  24. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +8 -5
  25. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +9 -6
  26. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +51 -37
  27. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +28 -25
  28. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +23 -13
  29. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +5 -5
  30. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +3 -2
  31. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +2 -1
  32. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +34 -23
  33. package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +3 -2
  34. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +7 -1
  35. package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +3 -2
  36. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +1 -0
  37. package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +17 -15
  38. package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +2 -1
  39. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +2 -1
  40. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +4 -3
  41. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +7 -7
  42. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +2 -2
  43. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +2 -1
  44. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +9 -8
  45. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +2 -2
  46. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +11 -6
  47. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +24 -23
  48. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +3 -2
  49. package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +5 -4
  50. package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +2 -1
  51. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +26 -23
  52. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +23 -13
  53. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +5 -5
  54. package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +2 -2
  55. package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +7 -6
  56. package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +8 -6
  57. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +10 -8
  58. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +3 -2
  59. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +4 -3
  60. package/vscode/src/vs/workbench/services/activity/browser/activityService.js +1 -0
  61. package/vscode/src/vs/workbench/services/editor/browser/editorPaneService.js +1 -0
  62. package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +21 -19
  63. package/vscode/src/vs/workbench/services/history/browser/historyService.js +73 -63
  64. package/vscode/src/vs/workbench/services/progress/browser/progressService.js +19 -15
  65. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +1 -0
  66. package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +23 -18
  67. package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +20 -14
  68. package/vscode/src/vs/base/browser/deviceAccess.js +0 -61
  69. package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +0 -13
  70. package/vscode/src/vs/workbench/browser/window.js +0 -330
  71. package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +0 -371
  72. package/vscode/src/vs/workbench/services/driver/browser/driver.js +0 -188
@@ -1,14 +1,16 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
- import { VIEWS_LOG_ID, VIEWS_LOG_NAME, Extensions, ViewVisibilityState, defaultViewIcon, ViewContainerLocationToString } from 'vscode/vscode/vs/workbench/common/views';
2
+ import { VIEWS_LOG_ID, VIEWS_LOG_NAME, Extensions, ViewContainerLocation, ViewVisibilityState, defaultViewIcon, ViewContainerLocationToString } from 'vscode/vscode/vs/workbench/common/views';
3
3
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
4
4
  import { ContextKeyExpr, RawContextKey } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
5
5
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
6
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
6
7
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
7
8
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
8
9
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
9
10
  import { Disposable, DisposableMap, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
10
11
  import { ViewPaneContainer, ViewPaneContainerAction, ViewsSubMenu } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
11
12
  import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
13
+ import 'vscode/vscode/vs/platform/instantiation/common/extensions';
12
14
  import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
13
15
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
14
16
  import { generateUuid } from 'vscode/vscode/vs/base/common/uuid';
@@ -16,6 +18,7 @@ import { getViewsStateStorageId, ViewContainerModel } from '../common/viewContai
16
18
  import { registerAction2, MenuId, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
17
19
  import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
18
20
  import { ILoggerService } from 'vscode/vscode/vs/platform/log/common/log.service';
21
+ import { Lazy } from 'vscode/vscode/vs/base/common/lazy';
19
22
 
20
23
  var ViewDescriptorService_1;
21
24
  const _moduleId = "vs/workbench/services/views/browser/viewDescriptorService";
@@ -43,7 +46,9 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
43
46
  this.canRegisterViewsVisibilityActions = false;
44
47
  this._onDidChangeViewContainers = this._register(( (new Emitter())));
45
48
  this.onDidChangeViewContainers = this._onDidChangeViewContainers.event;
46
- this.logger = loggerService.createLogger(VIEWS_LOG_ID, { name: VIEWS_LOG_NAME, hidden: true });
49
+ this.logger = ( (new Lazy(
50
+ () => loggerService.createLogger(VIEWS_LOG_ID, { name: VIEWS_LOG_NAME, hidden: true })
51
+ )));
47
52
  this.activeViewContextKeys = ( (new Map()));
48
53
  this.movableViewContextKeys = ( (new Map()));
49
54
  this.defaultViewLocationContextKeys = ( (new Map()));
@@ -66,15 +71,15 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
66
71
  this.onDidDeregisterViewContainer(viewContainer);
67
72
  this._onDidChangeViewContainers.fire({ removed: [{ container: viewContainer, location: viewContainerLocation }], added: [] });
68
73
  }));
69
- this._register(this.storageService.onDidChangeValue(0 , ViewDescriptorService_1.VIEWS_CUSTOMIZATIONS, this._register(( (new DisposableStore()))))(() => this.onDidStorageChange()));
74
+ this._register(this.storageService.onDidChangeValue(StorageScope.PROFILE, ViewDescriptorService_1.VIEWS_CUSTOMIZATIONS, this._register(( (new DisposableStore()))))(() => this.onDidStorageChange()));
70
75
  this.extensionService.whenInstalledExtensionsRegistered().then(() => this.whenExtensionsRegistered());
71
76
  }
72
77
  migrateToViewsCustomizationsStorage() {
73
- if (this.storageService.get(ViewDescriptorService_1.VIEWS_CUSTOMIZATIONS, 0 )) {
78
+ if (this.storageService.get(ViewDescriptorService_1.VIEWS_CUSTOMIZATIONS, StorageScope.PROFILE)) {
74
79
  return;
75
80
  }
76
- const viewContainerLocationsValue = this.storageService.get('views.cachedViewContainerLocations', 0 );
77
- const viewDescriptorLocationsValue = this.storageService.get('views.cachedViewPositions', 0 );
81
+ const viewContainerLocationsValue = this.storageService.get('views.cachedViewContainerLocations', StorageScope.PROFILE);
82
+ const viewDescriptorLocationsValue = this.storageService.get('views.cachedViewPositions', StorageScope.PROFILE);
78
83
  if (!viewContainerLocationsValue && !viewDescriptorLocationsValue) {
79
84
  return;
80
85
  }
@@ -85,9 +90,9 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
85
90
  viewLocations: viewDescriptorLocations.reduce((result, [id, { containerId }]) => { result[id] = containerId; return result; }, {}),
86
91
  viewContainerBadgeEnablementStates: {}
87
92
  };
88
- this.storageService.store(ViewDescriptorService_1.VIEWS_CUSTOMIZATIONS, JSON.stringify(viewsCustomizations), 0 , 0 );
89
- this.storageService.remove('views.cachedViewContainerLocations', 0 );
90
- this.storageService.remove('views.cachedViewPositions', 0 );
93
+ this.storageService.store(ViewDescriptorService_1.VIEWS_CUSTOMIZATIONS, JSON.stringify(viewsCustomizations), StorageScope.PROFILE, StorageTarget.USER);
94
+ this.storageService.remove('views.cachedViewContainerLocations', StorageScope.PROFILE);
95
+ this.storageService.remove('views.cachedViewPositions', StorageScope.PROFILE);
91
96
  }
92
97
  registerGroupedViews(groupedViews) {
93
98
  for (const [containerId, views] of groupedViews.entries()) {
@@ -206,7 +211,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
206
211
  return this.viewContainersRegistry.getDefaultViewContainer(location);
207
212
  }
208
213
  moveViewContainerToLocation(viewContainer, location, requestedIndex, reason) {
209
- this.logger.info(`moveViewContainerToLocation: viewContainer:${viewContainer.id} location:${location} reason:${reason}`);
214
+ this.logger.value.info(`moveViewContainerToLocation: viewContainer:${viewContainer.id} location:${location} reason:${reason}`);
210
215
  this.moveViewContainerToLocationWithoutSaving(viewContainer, location, requestedIndex);
211
216
  this.saveViewCustomizations();
212
217
  }
@@ -218,7 +223,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
218
223
  this.saveViewCustomizations();
219
224
  }
220
225
  moveViewToLocation(view, location, reason) {
221
- this.logger.info(`moveViewToLocation: view:${view.id} location:${location} reason:${reason}`);
226
+ this.logger.value.info(`moveViewToLocation: view:${view.id} location:${location} reason:${reason}`);
222
227
  const container = this.registerGeneratedViewContainer(location);
223
228
  this.moveViewsToContainer([view], container);
224
229
  }
@@ -226,7 +231,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
226
231
  if (!views.length) {
227
232
  return;
228
233
  }
229
- this.logger.info(`moveViewsToContainer: views:${( (views.map(view => view.id))).join(',')} viewContainer:${viewContainer.id} reason:${reason}`);
234
+ this.logger.value.info(`moveViewsToContainer: views:${( (views.map(view => view.id))).join(',')} viewContainer:${viewContainer.id} reason:${reason}`);
230
235
  const from = this.getViewContainerByViewId(views[0].id);
231
236
  const to = viewContainer;
232
237
  if (from && to && from !== to) {
@@ -283,8 +288,8 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
283
288
  const viewCount = views.length;
284
289
  const fromContainer = containerToString(from);
285
290
  const toContainer = containerToString(to);
286
- const fromLocation = oldLocation === 1 ? 'panel' : 'sidebar';
287
- const toLocation = newLocation === 1 ? 'panel' : 'sidebar';
291
+ const fromLocation = oldLocation === ViewContainerLocation.Panel ? 'panel' : 'sidebar';
292
+ const toLocation = newLocation === ViewContainerLocation.Panel ? 'panel' : 'sidebar';
288
293
  this.telemetryService.publicLog2('viewDescriptorService.moveViews', { viewCount, fromContainer, toContainer, fromLocation, toLocation });
289
294
  }
290
295
  moveViewsWithoutSaving(views, from, to, visibilityState = ViewVisibilityState.Expand) {
@@ -332,7 +337,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
332
337
  }
333
338
  this.viewContainersCustomLocations.delete(viewContainerId);
334
339
  this.viewContainerBadgeEnablementStates.delete(viewContainerId);
335
- this.storageService.remove(getViewsStateStorageId(viewContainer?.storageId || getViewContainerStorageId(viewContainerId)), 0 );
340
+ this.storageService.remove(getViewsStateStorageId(viewContainer?.storageId || getViewContainerStorageId(viewContainerId)), StorageScope.PROFILE);
336
341
  }
337
342
  registerGeneratedViewContainer(location, existingId) {
338
343
  const id = existingId || this.generateContainerId(location);
@@ -340,7 +345,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
340
345
  id,
341
346
  ctorDescriptor: ( (new SyncDescriptor(ViewPaneContainer, [id, { mergeViewWithContainerWhenSingleView: true }]))),
342
347
  title: { value: id, original: id },
343
- icon: location === 0 ? defaultViewIcon : undefined,
348
+ icon: location === ViewContainerLocation.Sidebar ? defaultViewIcon : undefined,
344
349
  storageId: getViewContainerStorageId(id),
345
350
  hideIfEmpty: true
346
351
  }, location, { doNotRegisterOpenCommand: true });
@@ -458,10 +463,10 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
458
463
  }
459
464
  }
460
465
  getStoredViewCustomizationsValue() {
461
- return this.storageService.get(ViewDescriptorService_1.VIEWS_CUSTOMIZATIONS, 0 , '{}');
466
+ return this.storageService.get(ViewDescriptorService_1.VIEWS_CUSTOMIZATIONS, StorageScope.PROFILE, '{}');
462
467
  }
463
468
  setStoredViewCustomizationsValue(value) {
464
- this.storageService.store(ViewDescriptorService_1.VIEWS_CUSTOMIZATIONS, value, 0 , 0 );
469
+ this.storageService.store(ViewDescriptorService_1.VIEWS_CUSTOMIZATIONS, value, StorageScope.PROFILE, StorageTarget.USER);
465
470
  }
466
471
  getViewsByContainer(viewContainer) {
467
472
  const result = this.viewsRegistry.getViews(viewContainer).filter(viewDescriptor => {
@@ -1,6 +1,7 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { VIEWS_LOG_ID, VIEWS_LOG_NAME, Extensions, defaultViewIcon } from 'vscode/vscode/vs/workbench/common/views';
3
3
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
4
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
4
5
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
5
6
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
6
7
  import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
@@ -17,6 +18,7 @@ import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommon
17
18
  import { IOutputService } from 'vscode/vscode/vs/workbench/services/output/common/output.service';
18
19
  import { CounterSet } from 'vscode/vscode/vs/base/common/map';
19
20
  import { localize2WithPath } from 'vscode/vscode/vs/nls';
21
+ import { Lazy } from 'vscode/vscode/vs/base/common/lazy';
20
22
 
21
23
  const _moduleId = "vs/workbench/services/views/common/viewContainerModel";
22
24
  registerAction2(class extends Action2 {
@@ -43,10 +45,12 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
43
45
  this.storageService = storageService;
44
46
  this._onDidChangeStoredState = this._register(( (new Emitter())));
45
47
  this.onDidChangeStoredState = this._onDidChangeStoredState.event;
46
- this.logger = loggerService.createLogger(VIEWS_LOG_ID, { name: VIEWS_LOG_NAME, hidden: true });
48
+ this.logger = ( (new Lazy(
49
+ () => loggerService.createLogger(VIEWS_LOG_ID, { name: VIEWS_LOG_NAME, hidden: true })
50
+ )));
47
51
  this.globalViewsStateStorageId = getViewsStateStorageId(viewContainerStorageId);
48
52
  this.workspaceViewsStateStorageId = viewContainerStorageId;
49
- this._register(this.storageService.onDidChangeValue(0 , this.globalViewsStateStorageId, this._register(( (new DisposableStore()))))(() => this.onDidStorageChange()));
53
+ this._register(this.storageService.onDidChangeValue(StorageScope.PROFILE, this.globalViewsStateStorageId, this._register(( (new DisposableStore()))))(() => this.onDidStorageChange()));
50
54
  this.state = this.initialize();
51
55
  }
52
56
  set(id, state) {
@@ -73,10 +77,10 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
73
77
  }
74
78
  }
75
79
  if (( (Object.keys(storedViewsStates))).length > 0) {
76
- this.storageService.store(this.workspaceViewsStateStorageId, JSON.stringify(storedViewsStates), 1 , 1 );
80
+ this.storageService.store(this.workspaceViewsStateStorageId, JSON.stringify(storedViewsStates), StorageScope.WORKSPACE, StorageTarget.MACHINE);
77
81
  }
78
82
  else {
79
- this.storageService.remove(this.workspaceViewsStateStorageId, 1 );
83
+ this.storageService.remove(this.workspaceViewsStateStorageId, StorageScope.WORKSPACE);
80
84
  }
81
85
  }
82
86
  updateGlobalState(viewDescriptors) {
@@ -102,7 +106,7 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
102
106
  if (state) {
103
107
  if (state.visibleGlobal !== !storedState.isHidden) {
104
108
  if (!storedState.isHidden) {
105
- this.logger.info(`View visibility state changed: ${id} is now visible`, this.viewContainerName);
109
+ this.logger.value.info(`View visibility state changed: ${id} is now visible`, this.viewContainerName);
106
110
  }
107
111
  changedStates.push({ id, visible: !storedState.isHidden });
108
112
  }
@@ -144,7 +148,7 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
144
148
  size: workspaceViewState.size,
145
149
  });
146
150
  }
147
- const value = this.storageService.get(this.globalViewsStateStorageId, 1 , '[]');
151
+ const value = this.storageService.get(this.globalViewsStateStorageId, StorageScope.WORKSPACE, '[]');
148
152
  const { state: workspaceVisibilityStates } = this.parseStoredGlobalState(value);
149
153
  if (workspaceVisibilityStates.size > 0) {
150
154
  for (const { id, isHidden } of ( (workspaceVisibilityStates.values()))) {
@@ -163,7 +167,7 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
163
167
  });
164
168
  }
165
169
  }
166
- this.storageService.remove(this.globalViewsStateStorageId, 1 );
170
+ this.storageService.remove(this.globalViewsStateStorageId, StorageScope.WORKSPACE);
167
171
  }
168
172
  const { state, hasDuplicates } = this.parseStoredGlobalState(this.globalViewsStatesValue);
169
173
  if (hasDuplicates) {
@@ -190,7 +194,7 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
190
194
  return viewStates;
191
195
  }
192
196
  getStoredWorkspaceState() {
193
- return JSON.parse(this.storageService.get(this.workspaceViewsStateStorageId, 1 , '{}'));
197
+ return JSON.parse(this.storageService.get(this.workspaceViewsStateStorageId, StorageScope.WORKSPACE, '{}'));
194
198
  }
195
199
  getStoredGlobalState() {
196
200
  return this.parseStoredGlobalState(this.globalViewsStatesValue).state;
@@ -227,10 +231,10 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
227
231
  }
228
232
  }
229
233
  getStoredGlobalViewsStatesValue() {
230
- return this.storageService.get(this.globalViewsStateStorageId, 0 , '[]');
234
+ return this.storageService.get(this.globalViewsStateStorageId, StorageScope.PROFILE, '[]');
231
235
  }
232
236
  setStoredGlobalViewsStatesValue(value) {
233
- this.storageService.store(this.globalViewsStateStorageId, value, 0 , 0 );
237
+ this.storageService.store(this.globalViewsStateStorageId, value, StorageScope.PROFILE, StorageTarget.USER);
234
238
  }
235
239
  };
236
240
  ViewDescriptorsState = ( (__decorate([
@@ -268,7 +272,9 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
268
272
  this.onDidRemoveVisibleViewDescriptors = this._onDidRemoveVisibleViewDescriptors.event;
269
273
  this._onDidMoveVisibleViewDescriptors = this._register(( (new Emitter())));
270
274
  this.onDidMoveVisibleViewDescriptors = this._onDidMoveVisibleViewDescriptors.event;
271
- this.logger = loggerService.createLogger(VIEWS_LOG_ID, { name: VIEWS_LOG_NAME, hidden: true });
275
+ this.logger = ( (new Lazy(
276
+ () => loggerService.createLogger(VIEWS_LOG_ID, { name: VIEWS_LOG_NAME, hidden: true })
277
+ )));
272
278
  this._register(Event.filter(contextKeyService.onDidChangeContext, e => e.affectsSome(this.contextKeys))(() => this.onDidChangeContext()));
273
279
  this.viewDescriptorsState = this._register(instantiationService.createInstance(ViewDescriptorsState, viewContainer.storageId || `${viewContainer.id}.state`, typeof viewContainer.title === 'string' ? viewContainer.title : viewContainer.title.original));
274
280
  this._register(this.viewDescriptorsState.onDidChangeStoredState(items => this.updateVisibility(items)));
@@ -362,7 +368,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
362
368
  else {
363
369
  viewDescriptorItem.state.visibleGlobal = visible;
364
370
  if (visible) {
365
- this.logger.info(`Showing view ${viewDescriptorItem.viewDescriptor.id} in the container ${this.viewContainer.id}`);
371
+ this.logger.value.info(`Showing view ${viewDescriptorItem.viewDescriptor.id} in the container ${this.viewContainer.id}`);
366
372
  }
367
373
  }
368
374
  return this.isViewDescriptorVisible(viewDescriptorItem) === visible;
@@ -418,7 +424,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
418
424
  const isVisible = state.visibleGlobal;
419
425
  state.visibleGlobal = isUndefinedOrNull(addedViewDescriptorState.visible) ? (isUndefinedOrNull(state.visibleGlobal) ? !viewDescriptor.hideByDefault : state.visibleGlobal) : addedViewDescriptorState.visible;
420
426
  if (state.visibleGlobal && !isVisible) {
421
- this.logger.info(`Added view ${viewDescriptor.id} in the container ${this.viewContainer.id} and showing it.`, `${isVisible}`, `${viewDescriptor.hideByDefault}`, `${addedViewDescriptorState.visible}`);
427
+ this.logger.value.info(`Added view ${viewDescriptor.id} in the container ${this.viewContainer.id} and showing it.`, `${isVisible}`, `${viewDescriptor.hideByDefault}`, `${addedViewDescriptorState.visible}`);
422
428
  }
423
429
  }
424
430
  state.collapsed = isUndefinedOrNull(addedViewDescriptorState.collapsed) ? (isUndefinedOrNull(state.collapsed) ? !!viewDescriptor.collapsed : state.collapsed) : addedViewDescriptorState.collapsed;
@@ -544,7 +550,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
544
550
  this.updateState(`Moved view ${from.viewDescriptor.id} to ${to.viewDescriptor.id} in ${this.viewContainer.id}`);
545
551
  }
546
552
  updateState(reason) {
547
- this.logger.info(reason);
553
+ this.logger.value.info(reason);
548
554
  this.viewDescriptorsState.updateState(this.allViewDescriptors);
549
555
  this.updateContainerInfo();
550
556
  }
@@ -1,61 +0,0 @@
1
- async function requestUsbDevice(options) {
2
- const usb = navigator.usb;
3
- if (!usb) {
4
- return undefined;
5
- }
6
- const device = await usb.requestDevice({ filters: options?.filters ?? [] });
7
- if (!device) {
8
- return undefined;
9
- }
10
- return {
11
- deviceClass: device.deviceClass,
12
- deviceProtocol: device.deviceProtocol,
13
- deviceSubclass: device.deviceSubclass,
14
- deviceVersionMajor: device.deviceVersionMajor,
15
- deviceVersionMinor: device.deviceVersionMinor,
16
- deviceVersionSubminor: device.deviceVersionSubminor,
17
- manufacturerName: device.manufacturerName,
18
- productId: device.productId,
19
- productName: device.productName,
20
- serialNumber: device.serialNumber,
21
- usbVersionMajor: device.usbVersionMajor,
22
- usbVersionMinor: device.usbVersionMinor,
23
- usbVersionSubminor: device.usbVersionSubminor,
24
- vendorId: device.vendorId,
25
- };
26
- }
27
- async function requestSerialPort(options) {
28
- const serial = navigator.serial;
29
- if (!serial) {
30
- return undefined;
31
- }
32
- const port = await serial.requestPort({ filters: options?.filters ?? [] });
33
- if (!port) {
34
- return undefined;
35
- }
36
- const info = port.getInfo();
37
- return {
38
- usbVendorId: info.usbVendorId,
39
- usbProductId: info.usbProductId
40
- };
41
- }
42
- async function requestHidDevice(options) {
43
- const hid = navigator.hid;
44
- if (!hid) {
45
- return undefined;
46
- }
47
- const devices = await hid.requestDevice({ filters: options?.filters ?? [] });
48
- if (!devices.length) {
49
- return undefined;
50
- }
51
- const device = devices[0];
52
- return {
53
- opened: device.opened,
54
- vendorId: device.vendorId,
55
- productId: device.productId,
56
- productName: device.productName,
57
- collections: device.collections
58
- };
59
- }
60
-
61
- export { requestHidDevice, requestSerialPort, requestUsbDevice };
@@ -1,13 +0,0 @@
1
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
2
-
3
- const _moduleId = "vs/platform/languagePacks/common/localizedStrings";
4
- const open = ( localizeWithPath(_moduleId, 0, 'open'));
5
- const close = ( localizeWithPath(_moduleId, 1, 'close'));
6
- const find = ( localizeWithPath(_moduleId, 2, 'find'));
7
- var localizedStrings = {
8
- open: open,
9
- close: close,
10
- find: find
11
- };
12
-
13
- export { localizedStrings as default };