@codingame/monaco-vscode-views-service-override 1.83.1 → 1.83.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +44 -52
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +3 -3
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +57 -57
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +1 -1
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +229 -244
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +47 -47
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +75 -77
- package/vscode/src/vs/workbench/services/hover/browser/hoverService.js +14 -14
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +41 -49
|
@@ -19,7 +19,7 @@ import { IOutputService } from 'vscode/vscode/vs/workbench/services/output/commo
|
|
|
19
19
|
import { CounterSet } from 'monaco-editor/esm/vs/base/common/map.js';
|
|
20
20
|
|
|
21
21
|
const VIEWS_LOG_ID = 'views';
|
|
22
|
-
const VIEWS_LOG_NAME = (
|
|
22
|
+
const VIEWS_LOG_NAME = ( localize('views log', "Views"));
|
|
23
23
|
registerAction2(class extends Action2 {
|
|
24
24
|
constructor() {
|
|
25
25
|
super({
|
|
@@ -42,12 +42,12 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
42
42
|
super();
|
|
43
43
|
this.viewContainerName = viewContainerName;
|
|
44
44
|
this.storageService = storageService;
|
|
45
|
-
this._onDidChangeStoredState = this._register((
|
|
45
|
+
this._onDidChangeStoredState = this._register(( new Emitter()));
|
|
46
46
|
this.onDidChangeStoredState = this._onDidChangeStoredState.event;
|
|
47
47
|
this.logger = loggerService.createLogger(VIEWS_LOG_ID, { name: VIEWS_LOG_NAME, hidden: true });
|
|
48
48
|
this.globalViewsStateStorageId = getViewsStateStorageId(viewContainerStorageId);
|
|
49
49
|
this.workspaceViewsStateStorageId = viewContainerStorageId;
|
|
50
|
-
this._register(this.storageService.onDidChangeValue(0 , this.globalViewsStateStorageId, this._register((
|
|
50
|
+
this._register(this.storageService.onDidChangeValue(0 , this.globalViewsStateStorageId, this._register(( new DisposableStore())))(() => this.onDidStorageChange()));
|
|
51
51
|
this.state = this.initialize();
|
|
52
52
|
}
|
|
53
53
|
set(id, state) {
|
|
@@ -73,7 +73,7 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
if ((
|
|
76
|
+
if (( Object.keys(storedViewsStates)).length > 0) {
|
|
77
77
|
this.storageService.store(this.workspaceViewsStateStorageId, JSON.stringify(storedViewsStates), 1 , 1 );
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
@@ -132,9 +132,9 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
initialize() {
|
|
135
|
-
const viewStates = (
|
|
135
|
+
const viewStates = ( new Map());
|
|
136
136
|
const workspaceViewsStates = this.getStoredWorkspaceState();
|
|
137
|
-
for (const id of (
|
|
137
|
+
for (const id of ( Object.keys(workspaceViewsStates))) {
|
|
138
138
|
const workspaceViewState = workspaceViewsStates[id];
|
|
139
139
|
viewStates.set(id, {
|
|
140
140
|
active: false,
|
|
@@ -148,7 +148,7 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
148
148
|
const value = this.storageService.get(this.globalViewsStateStorageId, 1 , '[]');
|
|
149
149
|
const { state: workspaceVisibilityStates } = this.parseStoredGlobalState(value);
|
|
150
150
|
if (workspaceVisibilityStates.size > 0) {
|
|
151
|
-
for (const { id, isHidden } of (
|
|
151
|
+
for (const { id, isHidden } of ( workspaceVisibilityStates.values())) {
|
|
152
152
|
const viewState = viewStates.get(id);
|
|
153
153
|
if (viewState) {
|
|
154
154
|
if (isUndefined(viewState.visibleWorkspace)) {
|
|
@@ -170,7 +170,7 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
170
170
|
if (hasDuplicates) {
|
|
171
171
|
this.setStoredGlobalState(state);
|
|
172
172
|
}
|
|
173
|
-
for (const { id, isHidden, order } of (
|
|
173
|
+
for (const { id, isHidden, order } of ( state.values())) {
|
|
174
174
|
const viewState = viewStates.get(id);
|
|
175
175
|
if (viewState) {
|
|
176
176
|
viewState.visibleGlobal = !isHidden;
|
|
@@ -197,22 +197,22 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
197
197
|
return this.parseStoredGlobalState(this.globalViewsStatesValue).state;
|
|
198
198
|
}
|
|
199
199
|
setStoredGlobalState(storedGlobalState) {
|
|
200
|
-
this.globalViewsStatesValue = JSON.stringify([...(
|
|
200
|
+
this.globalViewsStatesValue = JSON.stringify([...( storedGlobalState.values())]);
|
|
201
201
|
}
|
|
202
202
|
parseStoredGlobalState(value) {
|
|
203
203
|
const storedValue = JSON.parse(value);
|
|
204
204
|
let hasDuplicates = false;
|
|
205
205
|
const state = storedValue.reduce((result, storedState) => {
|
|
206
206
|
if (typeof storedState === 'string' ) {
|
|
207
|
-
hasDuplicates = hasDuplicates || (
|
|
207
|
+
hasDuplicates = hasDuplicates || ( result.has(storedState));
|
|
208
208
|
result.set(storedState, { id: storedState, isHidden: true });
|
|
209
209
|
}
|
|
210
210
|
else {
|
|
211
|
-
hasDuplicates = hasDuplicates || (
|
|
211
|
+
hasDuplicates = hasDuplicates || ( result.has(storedState.id));
|
|
212
212
|
result.set(storedState.id, storedState);
|
|
213
213
|
}
|
|
214
214
|
return result;
|
|
215
|
-
}, (
|
|
215
|
+
}, ( new Map()));
|
|
216
216
|
return { state, hasDuplicates };
|
|
217
217
|
}
|
|
218
218
|
get globalViewsStatesValue() {
|
|
@@ -234,40 +234,34 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
234
234
|
this.storageService.store(this.globalViewsStateStorageId, value, 0 , 0 );
|
|
235
235
|
}
|
|
236
236
|
};
|
|
237
|
-
ViewDescriptorsState = (
|
|
238
|
-
(
|
|
239
|
-
(
|
|
240
|
-
], ViewDescriptorsState))
|
|
237
|
+
ViewDescriptorsState = ( __decorate([
|
|
238
|
+
( __param(2, IStorageService)),
|
|
239
|
+
( __param(3, ILoggerService))
|
|
240
|
+
], ViewDescriptorsState));
|
|
241
241
|
let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
242
242
|
get title() { return this._title; }
|
|
243
243
|
get icon() { return this._icon; }
|
|
244
244
|
get keybindingId() { return this._keybindingId; }
|
|
245
|
-
get allViewDescriptors() { return (
|
|
246
|
-
|
|
247
|
-
); }
|
|
248
|
-
get activeViewDescriptors() { return (
|
|
249
|
-
(this.viewDescriptorItems.filter(item => item.state.active).map(item => item.viewDescriptor))
|
|
250
|
-
); }
|
|
251
|
-
get visibleViewDescriptors() { return (
|
|
252
|
-
(this.viewDescriptorItems.filter(item => this.isViewDescriptorVisible(item)).map(item => item.viewDescriptor))
|
|
253
|
-
); }
|
|
245
|
+
get allViewDescriptors() { return ( this.viewDescriptorItems.map(item => item.viewDescriptor)); }
|
|
246
|
+
get activeViewDescriptors() { return ( this.viewDescriptorItems.filter(item => item.state.active).map(item => item.viewDescriptor)); }
|
|
247
|
+
get visibleViewDescriptors() { return ( this.viewDescriptorItems.filter(item => this.isViewDescriptorVisible(item)).map(item => item.viewDescriptor)); }
|
|
254
248
|
constructor(viewContainer, instantiationService, contextKeyService, loggerService) {
|
|
255
249
|
super();
|
|
256
250
|
this.viewContainer = viewContainer;
|
|
257
251
|
this.contextKeyService = contextKeyService;
|
|
258
|
-
this.contextKeys = (
|
|
252
|
+
this.contextKeys = ( new CounterSet());
|
|
259
253
|
this.viewDescriptorItems = [];
|
|
260
|
-
this._onDidChangeContainerInfo = this._register((
|
|
254
|
+
this._onDidChangeContainerInfo = this._register(( new Emitter()));
|
|
261
255
|
this.onDidChangeContainerInfo = this._onDidChangeContainerInfo.event;
|
|
262
|
-
this._onDidChangeAllViewDescriptors = this._register((
|
|
256
|
+
this._onDidChangeAllViewDescriptors = this._register(( new Emitter()));
|
|
263
257
|
this.onDidChangeAllViewDescriptors = this._onDidChangeAllViewDescriptors.event;
|
|
264
|
-
this._onDidChangeActiveViewDescriptors = this._register((
|
|
258
|
+
this._onDidChangeActiveViewDescriptors = this._register(( new Emitter()));
|
|
265
259
|
this.onDidChangeActiveViewDescriptors = this._onDidChangeActiveViewDescriptors.event;
|
|
266
|
-
this._onDidAddVisibleViewDescriptors = this._register((
|
|
260
|
+
this._onDidAddVisibleViewDescriptors = this._register(( new Emitter()));
|
|
267
261
|
this.onDidAddVisibleViewDescriptors = this._onDidAddVisibleViewDescriptors.event;
|
|
268
|
-
this._onDidRemoveVisibleViewDescriptors = this._register((
|
|
262
|
+
this._onDidRemoveVisibleViewDescriptors = this._register(( new Emitter()));
|
|
269
263
|
this.onDidRemoveVisibleViewDescriptors = this._onDidRemoveVisibleViewDescriptors.event;
|
|
270
|
-
this._onDidMoveVisibleViewDescriptors = this._register((
|
|
264
|
+
this._onDidMoveVisibleViewDescriptors = this._register(( new Emitter()));
|
|
271
265
|
this.onDidMoveVisibleViewDescriptors = this._onDidMoveVisibleViewDescriptors.event;
|
|
272
266
|
this.logger = loggerService.createLogger(VIEWS_LOG_ID, { name: VIEWS_LOG_NAME, hidden: true });
|
|
273
267
|
this._register(Event.filter(contextKeyService.onDidChangeContext, e => e.affectsSome(this.contextKeys))(() => this.onDidChangeContext()));
|
|
@@ -276,9 +270,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
276
270
|
this.updateContainerInfo();
|
|
277
271
|
}
|
|
278
272
|
updateContainerInfo() {
|
|
279
|
-
const useDefaultContainerInfo = this.viewContainer.alwaysUseContainerInfo || this.visibleViewDescriptors.length === 0 || (
|
|
280
|
-
v => ( (Registry.as(Extensions.ViewsRegistry))).getViewContainer(v.id) === this.viewContainer
|
|
281
|
-
)));
|
|
273
|
+
const useDefaultContainerInfo = this.viewContainer.alwaysUseContainerInfo || this.visibleViewDescriptors.length === 0 || ( this.visibleViewDescriptors.some(v => ( Registry.as(Extensions.ViewsRegistry)).getViewContainer(v.id) === this.viewContainer));
|
|
282
274
|
const title = useDefaultContainerInfo ? (typeof this.viewContainer.title === 'string' ? this.viewContainer.title : this.viewContainer.title.value) : this.visibleViewDescriptors[0]?.containerTitle || this.visibleViewDescriptors[0]?.name || '';
|
|
283
275
|
let titleChanged = false;
|
|
284
276
|
if (this._title !== title) {
|
|
@@ -321,8 +313,8 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
321
313
|
this.updateVisibility([{ id, visible }]);
|
|
322
314
|
}
|
|
323
315
|
updateVisibility(viewDescriptors) {
|
|
324
|
-
const viewDescriptorItemsToHide = coalesce((
|
|
325
|
-
.map(({ id }) => this.findAndIgnoreIfNotFound(id))))
|
|
316
|
+
const viewDescriptorItemsToHide = coalesce(( viewDescriptors.filter(({ visible }) => !visible)
|
|
317
|
+
.map(({ id }) => this.findAndIgnoreIfNotFound(id))));
|
|
326
318
|
const removed = [];
|
|
327
319
|
for (const { viewDescriptorItem, visibleIndex } of viewDescriptorItemsToHide) {
|
|
328
320
|
if (this.updateViewDescriptorItemVisibility(viewDescriptorItem, false)) {
|
|
@@ -406,7 +398,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
406
398
|
for (const addedViewDescriptorState of addedViewDescriptorStates) {
|
|
407
399
|
const viewDescriptor = addedViewDescriptorState.viewDescriptor;
|
|
408
400
|
if (viewDescriptor.when) {
|
|
409
|
-
for (const key of (
|
|
401
|
+
for (const key of ( viewDescriptor.when.keys())) {
|
|
410
402
|
this.contextKeys.add(key);
|
|
411
403
|
}
|
|
412
404
|
}
|
|
@@ -438,7 +430,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
438
430
|
}
|
|
439
431
|
this.viewDescriptorItems.push(...addedItems);
|
|
440
432
|
this.viewDescriptorItems.sort(this.compareViewDescriptors.bind(this));
|
|
441
|
-
this._onDidChangeAllViewDescriptors.fire({ added: (
|
|
433
|
+
this._onDidChangeAllViewDescriptors.fire({ added: ( addedItems.map(({ viewDescriptor }) => viewDescriptor)), removed: [] });
|
|
442
434
|
const addedActiveItems = [];
|
|
443
435
|
for (const viewDescriptorItem of addedItems) {
|
|
444
436
|
if (viewDescriptorItem.state.active) {
|
|
@@ -446,7 +438,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
446
438
|
}
|
|
447
439
|
}
|
|
448
440
|
if (addedActiveItems.length) {
|
|
449
|
-
this._onDidChangeActiveViewDescriptors.fire(({ added: (
|
|
441
|
+
this._onDidChangeActiveViewDescriptors.fire(({ added: ( addedActiveItems.map(({ viewDescriptorItem }) => viewDescriptorItem.viewDescriptor)), removed: [] }));
|
|
450
442
|
}
|
|
451
443
|
const addedVisibleDescriptors = [];
|
|
452
444
|
for (const { viewDescriptorItem, visible } of addedActiveItems) {
|
|
@@ -464,7 +456,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
464
456
|
const removedVisibleDescriptors = [];
|
|
465
457
|
for (const viewDescriptor of viewDescriptors) {
|
|
466
458
|
if (viewDescriptor.when) {
|
|
467
|
-
for (const key of (
|
|
459
|
+
for (const key of ( viewDescriptor.when.keys())) {
|
|
468
460
|
this.contextKeys.delete(key);
|
|
469
461
|
}
|
|
470
462
|
}
|
|
@@ -517,7 +509,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
517
509
|
addedActiveItems.forEach(({ item }) => item.state.active = true);
|
|
518
510
|
this.broadCastRemovedVisibleViewDescriptors(removedVisibleDescriptors);
|
|
519
511
|
if (addedActiveItems.length || removedActiveItems.length) {
|
|
520
|
-
this._onDidChangeActiveViewDescriptors.fire(({ added: (
|
|
512
|
+
this._onDidChangeActiveViewDescriptors.fire(({ added: ( addedActiveItems.map(({ item }) => item.viewDescriptor)), removed: ( removedActiveItems.map(item => item.viewDescriptor)) }));
|
|
521
513
|
}
|
|
522
514
|
const addedVisibleDescriptors = [];
|
|
523
515
|
for (const { item, visibleWhenActive } of addedActiveItems) {
|
|
@@ -531,13 +523,13 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
531
523
|
broadCastAddedVisibleViewDescriptors(added) {
|
|
532
524
|
if (added.length) {
|
|
533
525
|
this._onDidAddVisibleViewDescriptors.fire(added.sort((a, b) => a.index - b.index));
|
|
534
|
-
this.updateState(`Added views:${(
|
|
526
|
+
this.updateState(`Added views:${( added.map(v => v.viewDescriptor.id)).join(',')} in ${this.viewContainer.id}`);
|
|
535
527
|
}
|
|
536
528
|
}
|
|
537
529
|
broadCastRemovedVisibleViewDescriptors(removed) {
|
|
538
530
|
if (removed.length) {
|
|
539
531
|
this._onDidRemoveVisibleViewDescriptors.fire(removed.sort((a, b) => b.index - a.index));
|
|
540
|
-
this.updateState(`Removed views:${(
|
|
532
|
+
this.updateState(`Removed views:${( removed.map(v => v.viewDescriptor.id)).join(',')} from ${this.viewContainer.id}`);
|
|
541
533
|
}
|
|
542
534
|
}
|
|
543
535
|
broadCastMovedViewDescriptors(from, to) {
|
|
@@ -600,10 +592,10 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
600
592
|
return a.group < b.group ? -1 : 1;
|
|
601
593
|
}
|
|
602
594
|
};
|
|
603
|
-
ViewContainerModel = (
|
|
604
|
-
(
|
|
605
|
-
(
|
|
606
|
-
(
|
|
607
|
-
], ViewContainerModel))
|
|
595
|
+
ViewContainerModel = ( __decorate([
|
|
596
|
+
( __param(1, IInstantiationService)),
|
|
597
|
+
( __param(2, IContextKeyService)),
|
|
598
|
+
( __param(3, ILoggerService))
|
|
599
|
+
], ViewContainerModel));
|
|
608
600
|
|
|
609
601
|
export { ViewContainerModel, getViewsStateStorageId };
|