@codingame/monaco-vscode-views-service-override 2.1.4 → 2.2.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/index.d.ts +11 -9
  2. package/index.js +8 -6
  3. package/package.json +11 -11
  4. package/tools/views.d.ts +102 -0
  5. package/tools/views.js +253 -0
  6. package/views.d.ts +4 -99
  7. package/views.js +52 -280
  8. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  9. package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +0 -180
  10. package/vscode/src/vs/base/browser/ui/grid/grid.js +0 -494
  11. package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +0 -6
  12. package/vscode/src/vs/base/browser/ui/grid/gridview.js +0 -1112
  13. package/vscode/src/vs/base/common/codicons.d.ts +0 -579
  14. package/vscode/src/vs/platform/webview/common/mimeTypes.js +0 -24
  15. package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +0 -64
  16. package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +0 -790
  17. package/vscode/src/vs/workbench/browser/actions/listCommands.js +0 -764
  18. package/vscode/src/vs/workbench/browser/layout.d.ts +0 -26
  19. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +0 -612
  20. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +0 -6
  21. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +0 -6
  22. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +0 -150
  23. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +0 -6
  24. package/vscode/src/vs/workbench/browser/parts/compositeBar.js +0 -605
  25. package/vscode/src/vs/workbench/browser/parts/compositePart.js +0 -335
  26. package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +0 -223
  27. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +0 -1407
  28. package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +0 -186
  29. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +0 -511
  30. package/vscode/src/vs/workbench/browser/parts/editor/editorPane.d.ts +0 -112
  31. package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +0 -1020
  32. package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +0 -391
  33. package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +0 -6
  34. package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +0 -6
  35. package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +0 -6
  36. package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +0 -645
  37. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +0 -379
  38. package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +0 -68
  39. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +0 -146
  40. package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +0 -6
  41. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +0 -222
  42. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +0 -299
  43. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +0 -365
  44. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +0 -135
  45. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +0 -6
  46. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +0 -17
  47. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +0 -145
  48. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +0 -214
  49. package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +0 -6
  50. package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +0 -78
  51. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +0 -63
  52. package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +0 -119
  53. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +0 -6
  54. package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +0 -79
  55. package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +0 -74
  56. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +0 -256
  57. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +0 -99
  58. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +0 -444
  59. package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +0 -432
  60. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +0 -786
  61. package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +0 -488
  62. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +0 -522
  63. package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +0 -152
  64. package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +0 -63
  65. package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +0 -409
  66. package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +0 -6
  67. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +0 -693
  68. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +0 -240
  69. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +0 -77
  70. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +0 -42
  71. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +0 -71
  72. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +0 -348
  73. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +0 -98
  74. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +0 -146
  75. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +0 -105
  76. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +0 -401
  77. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +0 -197
  78. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +0 -41
  79. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +0 -128
  80. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +0 -6
  81. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +0 -612
  82. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +0 -158
  83. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +0 -264
  84. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +0 -173
  85. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +0 -6
  86. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +0 -282
  87. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +0 -360
  88. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +0 -133
  89. package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +0 -290
  90. package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +0 -96
  91. package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +0 -88
  92. package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +0 -79
  93. package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +0 -648
  94. package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +0 -65
  95. package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +0 -59
  96. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +0 -142
  97. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +0 -121
  98. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +0 -68
  99. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +0 -235
  100. package/vscode/src/vs/workbench/services/activity/browser/activityService.js +0 -145
  101. package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +0 -670
  102. package/vscode/src/vs/workbench/services/history/browser/historyService.js +0 -1484
  103. package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +0 -6
  104. package/vscode/src/vs/workbench/services/progress/browser/progressService.js +0 -523
  105. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +0 -101
  106. package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +0 -713
  107. package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +0 -598
@@ -1,6 +0,0 @@
1
- import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
2
-
3
- var css = ".monaco-workbench .progress-badge>.badge-content:before{background-color:currentColor;background-repeat:no-repeat;bottom:0;content:\"\";height:14px;left:0;margin:auto;mask:url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMiAyIDE0IDE0Ij48cGF0aCBmaWxsPSIjZmZmIiBkPSJNOSAxNmMtMy44NiAwLTctMy4xNC03LTdzMy4xNC03IDctN2MzLjg1OSAwIDcgMy4xNDEgNyA3cy0zLjE0MSA3LTcgN3pNOSAzLjRDNS45MTIgMy40IDMuNCA1LjkxMyAzLjQgOXMyLjUxMiA1LjYgNS42IDUuNiA1LjYtMi41MTIgNS42LTUuNlMxMi4wODggMy40IDkgMy40em0zLjg2IDcuMUw5LjcgOC42MDRWNC44SDguM3Y0LjU5NmwzLjg0IDIuMzA1LjcyLTEuMjAxeiIvPjwvc3ZnPg==\") no-repeat;-webkit-mask:url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMiAyIDE0IDE0Ij48cGF0aCBmaWxsPSIjZmZmIiBkPSJNOSAxNmMtMy44NiAwLTctMy4xNC03LTdzMy4xNC03IDctN2MzLjg1OSAwIDcgMy4xNDEgNyA3cy0zLjE0MSA3LTcgN3pNOSAzLjRDNS45MTIgMy40IDMuNCA1LjkxMyAzLjQgOXMyLjUxMiA1LjYgNS42IDUuNiA1LjYtMi41MTIgNS42LTUuNlMxMi4wODggMy40IDkgMy40em0zLjg2IDcuMUw5LjcgOC42MDRWNC44SDguM3Y0LjU5NmwzLjg0IDIuMzA1LjcyLTEuMjAxeiIvPjwvc3ZnPg==\") no-repeat;position:absolute;right:0;top:0;width:14px}";
4
- n(css,{});
5
-
6
- export { css, css as default };
@@ -1,523 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import './media/progressService.css.js';
3
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
4
- import { Disposable, dispose, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
5
- import { Progress } from 'vscode/vscode/vs/platform/progress/common/progress';
6
- import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
7
- import { timeout, RunOnceScheduler, DeferredPromise } from 'vscode/vscode/vs/base/common/async';
8
- import { ProgressBadge, IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
9
- import { NotificationPriority, NotificationsFilter, isNotificationSource, INotificationService, Severity } from 'vscode/vscode/vs/platform/notification/common/notification';
10
- import { Action } from 'vscode/vscode/vs/base/common/actions';
11
- import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
12
- import { ILayoutService } from 'vscode/vscode/vs/platform/layout/browser/layoutService';
13
- import { Dialog } from 'vscode/vscode/vs/base/browser/ui/dialog/dialog';
14
- import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
15
- import { EventHelper } from 'vscode/vscode/vs/base/browser/dom';
16
- import { parseLinkedText } from 'vscode/vscode/vs/base/common/linkedText';
17
- import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
18
- import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
19
- import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite';
20
- import { stripIcons } from 'vscode/vscode/vs/base/common/iconLabels';
21
- import { defaultButtonStyles, defaultCheckboxStyles, defaultInputBoxStyles, defaultDialogStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
22
-
23
- let ProgressService = class ProgressService extends Disposable {
24
- constructor(activityService, paneCompositeService, viewDescriptorService, viewsService, notificationService, statusbarService, layoutService, keybindingService) {
25
- super();
26
- this.activityService = activityService;
27
- this.paneCompositeService = paneCompositeService;
28
- this.viewDescriptorService = viewDescriptorService;
29
- this.viewsService = viewsService;
30
- this.notificationService = notificationService;
31
- this.statusbarService = statusbarService;
32
- this.layoutService = layoutService;
33
- this.keybindingService = keybindingService;
34
- this.windowProgressStack = [];
35
- this.windowProgressStatusEntry = undefined;
36
- }
37
- async withProgress(options, task, onDidCancel) {
38
- const { location } = options;
39
- const handleStringLocation = (location) => {
40
- const viewContainer = this.viewDescriptorService.getViewContainerById(location);
41
- if (viewContainer) {
42
- const viewContainerLocation = this.viewDescriptorService.getViewContainerLocation(viewContainer);
43
- if (viewContainerLocation !== null) {
44
- return this.withPaneCompositeProgress(location, viewContainerLocation, task, { ...options, location });
45
- }
46
- }
47
- if (this.viewDescriptorService.getViewDescriptorById(location) !== null) {
48
- return this.withViewProgress(location, task, { ...options, location });
49
- }
50
- throw new Error(`Bad progress location: ${location}`);
51
- };
52
- if (typeof location === 'string') {
53
- return handleStringLocation(location);
54
- }
55
- switch (location) {
56
- case 15 : {
57
- let priority = options.priority;
58
- if (priority !== NotificationPriority.URGENT) {
59
- if (this.notificationService.getFilter() === NotificationsFilter.ERROR) {
60
- priority = NotificationPriority.SILENT;
61
- }
62
- else if (isNotificationSource(options.source) && this.notificationService.getFilter(options.source) === NotificationsFilter.ERROR) {
63
- priority = NotificationPriority.SILENT;
64
- }
65
- }
66
- return this.withNotificationProgress({ ...options, location, priority }, task, onDidCancel);
67
- }
68
- case 10 : {
69
- const type = options.type;
70
- if (options.command) {
71
- return this.withWindowProgress({ ...options, location, type }, task);
72
- }
73
- return this.withNotificationProgress({ delay: 150 , ...options, priority: NotificationPriority.SILENT, location: 15 , type }, task, onDidCancel);
74
- }
75
- case 1 :
76
- return this.withPaneCompositeProgress('workbench.view.explorer', 0 , task, { ...options, location });
77
- case 3 :
78
- return handleStringLocation('workbench.scm');
79
- case 5 :
80
- return this.withPaneCompositeProgress('workbench.view.extensions', 0 , task, { ...options, location });
81
- case 20 :
82
- return this.withDialogProgress(options, task, onDidCancel);
83
- default:
84
- throw new Error(`Bad progress location: ${location}`);
85
- }
86
- }
87
- withWindowProgress(options, callback) {
88
- const task = [options, ( new Progress(() => this.updateWindowProgress()))];
89
- const promise = callback(task[1]);
90
- let delayHandle = setTimeout(() => {
91
- delayHandle = undefined;
92
- this.windowProgressStack.unshift(task);
93
- this.updateWindowProgress();
94
- Promise.all([
95
- timeout(150),
96
- promise
97
- ]).finally(() => {
98
- const idx = this.windowProgressStack.indexOf(task);
99
- this.windowProgressStack.splice(idx, 1);
100
- this.updateWindowProgress();
101
- });
102
- }, 150);
103
- return promise.finally(() => clearTimeout(delayHandle));
104
- }
105
- updateWindowProgress(idx = 0) {
106
- if (idx < this.windowProgressStack.length) {
107
- const [options, progress] = this.windowProgressStack[idx];
108
- const progressTitle = options.title;
109
- const progressMessage = progress.value && progress.value.message;
110
- const progressCommand = options.command;
111
- let text;
112
- let title;
113
- const source = options.source && typeof options.source !== 'string' ? options.source.label : options.source;
114
- if (progressTitle && progressMessage) {
115
- text = ( localizeWithPath(
116
- 'vs/workbench/services/progress/browser/progressService',
117
- 'progress.text2',
118
- "{0}: {1}",
119
- progressTitle,
120
- progressMessage
121
- ));
122
- title = source ? ( localizeWithPath(
123
- 'vs/workbench/services/progress/browser/progressService',
124
- 'progress.title3',
125
- "[{0}] {1}: {2}",
126
- source,
127
- progressTitle,
128
- progressMessage
129
- )) : text;
130
- }
131
- else if (progressTitle) {
132
- text = progressTitle;
133
- title = source ? ( localizeWithPath(
134
- 'vs/workbench/services/progress/browser/progressService',
135
- 'progress.title2',
136
- "[{0}]: {1}",
137
- source,
138
- progressTitle
139
- )) : text;
140
- }
141
- else if (progressMessage) {
142
- text = progressMessage;
143
- title = source ? ( localizeWithPath(
144
- 'vs/workbench/services/progress/browser/progressService',
145
- 'progress.title2',
146
- "[{0}]: {1}",
147
- source,
148
- progressMessage
149
- )) : text;
150
- }
151
- else {
152
- this.updateWindowProgress(idx + 1);
153
- return;
154
- }
155
- const statusEntryProperties = {
156
- name: ( localizeWithPath(
157
- 'vs/workbench/services/progress/browser/progressService',
158
- 'status.progress',
159
- "Progress Message"
160
- )),
161
- text,
162
- showProgress: options.type || true,
163
- ariaLabel: text,
164
- tooltip: title,
165
- command: progressCommand
166
- };
167
- if (this.windowProgressStatusEntry) {
168
- this.windowProgressStatusEntry.update(statusEntryProperties);
169
- }
170
- else {
171
- this.windowProgressStatusEntry = this.statusbarService.addEntry(statusEntryProperties, 'status.progress', 0 );
172
- }
173
- }
174
- else {
175
- this.windowProgressStatusEntry?.dispose();
176
- this.windowProgressStatusEntry = undefined;
177
- }
178
- }
179
- withNotificationProgress(options, callback, onDidCancel) {
180
- const progressStateModel = new (class extends Disposable {
181
- get step() { return this._step; }
182
- get done() { return this._done; }
183
- constructor() {
184
- super();
185
- this._onDidReport = this._register(( new Emitter()));
186
- this.onDidReport = this._onDidReport.event;
187
- this._onWillDispose = this._register(( new Emitter()));
188
- this.onWillDispose = this._onWillDispose.event;
189
- this._step = undefined;
190
- this._done = false;
191
- this.promise = callback(this);
192
- this.promise.finally(() => {
193
- this.dispose();
194
- });
195
- }
196
- report(step) {
197
- this._step = step;
198
- this._onDidReport.fire(step);
199
- }
200
- cancel(choice) {
201
- onDidCancel?.(choice);
202
- this.dispose();
203
- }
204
- dispose() {
205
- this._done = true;
206
- this._onWillDispose.fire();
207
- super.dispose();
208
- }
209
- });
210
- const createWindowProgress = () => {
211
- const promise = ( new DeferredPromise());
212
- this.withWindowProgress({
213
- location: 10 ,
214
- title: options.title ? ( parseLinkedText(options.title).toString()) : undefined,
215
- command: 'notifications.showList',
216
- type: options.type
217
- }, progress => {
218
- function reportProgress(step) {
219
- if (step.message) {
220
- progress.report({
221
- message: ( parseLinkedText(step.message).toString())
222
- });
223
- }
224
- }
225
- if (progressStateModel.step) {
226
- reportProgress(progressStateModel.step);
227
- }
228
- const onDidReportListener = progressStateModel.onDidReport(step => reportProgress(step));
229
- promise.p.finally(() => onDidReportListener.dispose());
230
- Event.once(progressStateModel.onWillDispose)(() => promise.complete());
231
- return promise.p;
232
- });
233
- return toDisposable(() => promise.complete());
234
- };
235
- const createNotification = (message, priority, increment) => {
236
- const notificationDisposables = ( new DisposableStore());
237
- const primaryActions = options.primaryActions ? Array.from(options.primaryActions) : [];
238
- const secondaryActions = options.secondaryActions ? Array.from(options.secondaryActions) : [];
239
- if (options.buttons) {
240
- options.buttons.forEach((button, index) => {
241
- const buttonAction = new (class extends Action {
242
- constructor() {
243
- super(`progress.button.${button}`, button, undefined, true);
244
- }
245
- async run() {
246
- progressStateModel.cancel(index);
247
- }
248
- });
249
- notificationDisposables.add(buttonAction);
250
- primaryActions.push(buttonAction);
251
- });
252
- }
253
- if (options.cancellable) {
254
- const cancelAction = new (class extends Action {
255
- constructor() {
256
- super('progress.cancel', ( localizeWithPath(
257
- 'vs/workbench/services/progress/browser/progressService',
258
- 'cancel',
259
- "Cancel"
260
- )), undefined, true);
261
- }
262
- async run() {
263
- progressStateModel.cancel();
264
- }
265
- });
266
- notificationDisposables.add(cancelAction);
267
- primaryActions.push(cancelAction);
268
- }
269
- const notification = this.notificationService.notify({
270
- severity: Severity.Info,
271
- message: stripIcons(message),
272
- source: options.source,
273
- actions: { primary: primaryActions, secondary: secondaryActions },
274
- progress: typeof increment === 'number' && increment >= 0 ? { total: 100, worked: increment } : { infinite: true },
275
- priority
276
- });
277
- let windowProgressDisposable = undefined;
278
- const onVisibilityChange = (visible) => {
279
- dispose(windowProgressDisposable);
280
- if (!visible && !progressStateModel.done) {
281
- windowProgressDisposable = createWindowProgress();
282
- }
283
- };
284
- notificationDisposables.add(notification.onDidChangeVisibility(onVisibilityChange));
285
- if (priority === NotificationPriority.SILENT) {
286
- onVisibilityChange(false);
287
- }
288
- Event.once(notification.onDidClose)(() => notificationDisposables.dispose());
289
- return notification;
290
- };
291
- const updateProgress = (notification, increment) => {
292
- if (typeof increment === 'number' && increment >= 0) {
293
- notification.progress.total(100);
294
- notification.progress.worked(increment);
295
- }
296
- else {
297
- notification.progress.infinite();
298
- }
299
- };
300
- let notificationHandle;
301
- let notificationTimeout;
302
- let titleAndMessage;
303
- const updateNotification = (step) => {
304
- if (step?.message && options.title) {
305
- titleAndMessage = `${options.title}: ${step.message}`;
306
- }
307
- else {
308
- titleAndMessage = options.title || step?.message;
309
- }
310
- if (!notificationHandle && titleAndMessage) {
311
- if (typeof options.delay === 'number' && options.delay > 0) {
312
- if (typeof notificationTimeout !== 'number') {
313
- notificationTimeout = setTimeout(() => notificationHandle = createNotification(titleAndMessage, options.priority, step?.increment), options.delay);
314
- }
315
- }
316
- else {
317
- notificationHandle = createNotification(titleAndMessage, options.priority, step?.increment);
318
- }
319
- }
320
- if (notificationHandle) {
321
- if (titleAndMessage) {
322
- notificationHandle.updateMessage(titleAndMessage);
323
- }
324
- if (typeof step?.increment === 'number') {
325
- updateProgress(notificationHandle, step.increment);
326
- }
327
- }
328
- };
329
- updateNotification(progressStateModel.step);
330
- const listener = progressStateModel.onDidReport(step => updateNotification(step));
331
- Event.once(progressStateModel.onWillDispose)(() => listener.dispose());
332
- (async () => {
333
- try {
334
- if (typeof options.delay === 'number' && options.delay > 0) {
335
- await progressStateModel.promise;
336
- }
337
- else {
338
- await Promise.all([timeout(800), progressStateModel.promise]);
339
- }
340
- }
341
- finally {
342
- clearTimeout(notificationTimeout);
343
- notificationHandle?.close();
344
- }
345
- })();
346
- return progressStateModel.promise;
347
- }
348
- withPaneCompositeProgress(paneCompositeId, viewContainerLocation, task, options) {
349
- const progressIndicator = this.paneCompositeService.getProgressIndicator(paneCompositeId, viewContainerLocation);
350
- const promise = progressIndicator ? this.withCompositeProgress(progressIndicator, task, options) : task({ report: () => { } });
351
- if (viewContainerLocation === 0 ) {
352
- this.showOnActivityBar(paneCompositeId, options, promise);
353
- }
354
- return promise;
355
- }
356
- withViewProgress(viewId, task, options) {
357
- const progressIndicator = this.viewsService.getViewProgressIndicator(viewId);
358
- const promise = progressIndicator ? this.withCompositeProgress(progressIndicator, task, options) : task({ report: () => { } });
359
- const location = this.viewDescriptorService.getViewLocationById(viewId);
360
- if (location !== 0 ) {
361
- return promise;
362
- }
363
- const viewletId = this.viewDescriptorService.getViewContainerByViewId(viewId)?.id;
364
- if (viewletId === undefined) {
365
- return promise;
366
- }
367
- this.showOnActivityBar(viewletId, options, promise);
368
- return promise;
369
- }
370
- showOnActivityBar(viewletId, options, promise) {
371
- let activityProgress;
372
- let delayHandle = setTimeout(() => {
373
- delayHandle = undefined;
374
- const handle = this.activityService.showViewContainerActivity(viewletId, { badge: ( new ProgressBadge(() => '')), priority: 100 });
375
- const startTimeVisible = Date.now();
376
- const minTimeVisible = 300;
377
- activityProgress = {
378
- dispose() {
379
- const d = Date.now() - startTimeVisible;
380
- if (d < minTimeVisible) {
381
- setTimeout(() => handle.dispose(), minTimeVisible - d);
382
- }
383
- else {
384
- handle.dispose();
385
- }
386
- }
387
- };
388
- }, options.delay || 300);
389
- promise.finally(() => {
390
- clearTimeout(delayHandle);
391
- dispose(activityProgress);
392
- });
393
- }
394
- withCompositeProgress(progressIndicator, task, options) {
395
- let discreteProgressRunner = undefined;
396
- function updateProgress(stepOrTotal) {
397
- let total = undefined;
398
- let increment = undefined;
399
- if (typeof stepOrTotal !== 'undefined') {
400
- if (typeof stepOrTotal === 'number') {
401
- total = stepOrTotal;
402
- }
403
- else if (typeof stepOrTotal.increment === 'number') {
404
- total = stepOrTotal.total ?? 100;
405
- increment = stepOrTotal.increment;
406
- }
407
- }
408
- if (typeof total === 'number') {
409
- if (!discreteProgressRunner) {
410
- discreteProgressRunner = progressIndicator.show(total, options.delay);
411
- promise.catch(() => undefined ).finally(() => discreteProgressRunner?.done());
412
- }
413
- if (typeof increment === 'number') {
414
- discreteProgressRunner.worked(increment);
415
- }
416
- }
417
- else {
418
- discreteProgressRunner?.done();
419
- progressIndicator.showWhile(promise, options.delay);
420
- }
421
- return discreteProgressRunner;
422
- }
423
- const promise = task({
424
- report: progress => {
425
- updateProgress(progress);
426
- }
427
- });
428
- updateProgress(options.total);
429
- return promise;
430
- }
431
- withDialogProgress(options, task, onDidCancel) {
432
- const disposables = ( new DisposableStore());
433
- const allowableCommands = [
434
- 'workbench.action.quit',
435
- 'workbench.action.reloadWindow',
436
- 'copy',
437
- 'cut',
438
- 'editor.action.clipboardCopyAction',
439
- 'editor.action.clipboardCutAction'
440
- ];
441
- let dialog;
442
- const createDialog = (message) => {
443
- const buttons = options.buttons || [];
444
- if (!options.sticky) {
445
- buttons.push(options.cancellable ? ( localizeWithPath(
446
- 'vs/workbench/services/progress/browser/progressService',
447
- 'cancel',
448
- "Cancel"
449
- )) : ( localizeWithPath(
450
- 'vs/workbench/services/progress/browser/progressService',
451
- 'dismiss',
452
- "Dismiss"
453
- )));
454
- }
455
- dialog = ( new Dialog(this.layoutService.activeContainer, message, buttons, {
456
- type: 'pending',
457
- detail: options.detail,
458
- cancelId: buttons.length - 1,
459
- disableCloseAction: options.sticky,
460
- disableDefaultAction: options.sticky,
461
- keyEventProcessor: (event) => {
462
- const resolved = this.keybindingService.softDispatch(event, this.layoutService.activeContainer);
463
- if (resolved.kind === 2 && resolved.commandId) {
464
- if (!allowableCommands.includes(resolved.commandId)) {
465
- EventHelper.stop(event, true);
466
- }
467
- }
468
- },
469
- buttonStyles: defaultButtonStyles,
470
- checkboxStyles: defaultCheckboxStyles,
471
- inputBoxStyles: defaultInputBoxStyles,
472
- dialogStyles: defaultDialogStyles
473
- }));
474
- disposables.add(dialog);
475
- dialog.show().then(dialogResult => {
476
- onDidCancel?.(dialogResult.button);
477
- dispose(dialog);
478
- });
479
- return dialog;
480
- };
481
- let delay = options.delay ?? 0;
482
- let latestMessage = undefined;
483
- const scheduler = disposables.add(( new RunOnceScheduler(() => {
484
- delay = 0;
485
- if (latestMessage && !dialog) {
486
- dialog = createDialog(latestMessage);
487
- }
488
- else if (latestMessage) {
489
- dialog.updateMessage(latestMessage);
490
- }
491
- }, 0)));
492
- const updateDialog = function (message) {
493
- latestMessage = message;
494
- if (!scheduler.isScheduled()) {
495
- scheduler.schedule(delay);
496
- }
497
- };
498
- const promise = task({
499
- report: progress => {
500
- updateDialog(progress.message);
501
- }
502
- });
503
- promise.finally(() => {
504
- dispose(disposables);
505
- });
506
- if (options.title) {
507
- updateDialog(options.title);
508
- }
509
- return promise;
510
- }
511
- };
512
- ProgressService = ( __decorate([
513
- ( __param(0, IActivityService)),
514
- ( __param(1, IPaneCompositePartService)),
515
- ( __param(2, IViewDescriptorService)),
516
- ( __param(3, IViewsService)),
517
- ( __param(4, INotificationService)),
518
- ( __param(5, IStatusbarService)),
519
- ( __param(6, ILayoutService)),
520
- ( __param(7, IKeybindingService))
521
- ], ProgressService));
522
-
523
- export { ProgressService };
@@ -1,101 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { Schemas } from 'vscode/vscode/vs/base/common/network';
3
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
- import { URI } from 'vscode/vscode/vs/base/common/uri';
5
- import { ITextEditorService } from 'vscode/vscode/vs/workbench/services/textfile/common/textEditorService';
6
- import { toLocalResource, isEqual } from 'vscode/vscode/vs/base/common/resources';
7
- import { PLAINTEXT_LANGUAGE_ID } from 'vscode/vscode/vs/editor/common/languages/modesRegistry';
8
- import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
9
- import { IFilesConfigurationService } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
10
- import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService';
11
- import { UntitledTextEditorInput } from 'vscode/vscode/vs/workbench/services/untitled/common/untitledTextEditorInput';
12
- import { NO_TYPE_ID } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopy';
13
- import { IWorkingCopyEditorService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService';
14
- import { IUntitledTextEditorService } from 'vscode/vscode/vs/workbench/services/untitled/common/untitledTextEditorService';
15
-
16
- let UntitledTextEditorInputSerializer = class UntitledTextEditorInputSerializer {
17
- constructor(filesConfigurationService, environmentService, pathService) {
18
- this.filesConfigurationService = filesConfigurationService;
19
- this.environmentService = environmentService;
20
- this.pathService = pathService;
21
- }
22
- canSerialize(editorInput) {
23
- return this.filesConfigurationService.isHotExitEnabled && !editorInput.isDisposed();
24
- }
25
- serialize(editorInput) {
26
- if (!this.filesConfigurationService.isHotExitEnabled || editorInput.isDisposed()) {
27
- return undefined;
28
- }
29
- const untitledTextEditorInput = editorInput;
30
- let resource = untitledTextEditorInput.resource;
31
- if (untitledTextEditorInput.hasAssociatedFilePath) {
32
- resource = toLocalResource(resource, this.environmentService.remoteAuthority, this.pathService.defaultUriScheme);
33
- }
34
- let languageId;
35
- const languageIdCandidate = untitledTextEditorInput.getLanguageId();
36
- if (languageIdCandidate !== PLAINTEXT_LANGUAGE_ID) {
37
- languageId = languageIdCandidate;
38
- }
39
- else if (untitledTextEditorInput.hasLanguageSetExplicitly) {
40
- languageId = languageIdCandidate;
41
- }
42
- const serialized = {
43
- resourceJSON: resource.toJSON(),
44
- modeId: languageId,
45
- encoding: untitledTextEditorInput.getEncoding()
46
- };
47
- return JSON.stringify(serialized);
48
- }
49
- deserialize(instantiationService, serializedEditorInput) {
50
- return instantiationService.invokeFunction(accessor => {
51
- const deserialized = JSON.parse(serializedEditorInput);
52
- const resource = URI.revive(deserialized.resourceJSON);
53
- const languageId = deserialized.modeId;
54
- const encoding = deserialized.encoding;
55
- return accessor.get(ITextEditorService).createTextEditor({ resource, languageId, encoding, forceUntitled: true });
56
- });
57
- }
58
- };
59
- UntitledTextEditorInputSerializer = ( __decorate([
60
- ( __param(0, IFilesConfigurationService)),
61
- ( __param(1, IWorkbenchEnvironmentService)),
62
- ( __param(2, IPathService))
63
- ], UntitledTextEditorInputSerializer));
64
- let UntitledTextEditorWorkingCopyEditorHandler = class UntitledTextEditorWorkingCopyEditorHandler extends Disposable {
65
- constructor(workingCopyEditorService, environmentService, pathService, textEditorService, untitledTextEditorService) {
66
- super();
67
- this.environmentService = environmentService;
68
- this.pathService = pathService;
69
- this.textEditorService = textEditorService;
70
- this.untitledTextEditorService = untitledTextEditorService;
71
- this._register(workingCopyEditorService.registerHandler(this));
72
- }
73
- handles(workingCopy) {
74
- return workingCopy.resource.scheme === Schemas.untitled && workingCopy.typeId === NO_TYPE_ID;
75
- }
76
- isOpen(workingCopy, editor) {
77
- if (!this.handles(workingCopy)) {
78
- return false;
79
- }
80
- return editor instanceof UntitledTextEditorInput && isEqual(workingCopy.resource, editor.resource);
81
- }
82
- createEditor(workingCopy) {
83
- let editorInputResource;
84
- if (this.untitledTextEditorService.isUntitledWithAssociatedResource(workingCopy.resource)) {
85
- editorInputResource = toLocalResource(workingCopy.resource, this.environmentService.remoteAuthority, this.pathService.defaultUriScheme);
86
- }
87
- else {
88
- editorInputResource = workingCopy.resource;
89
- }
90
- return this.textEditorService.createTextEditor({ resource: editorInputResource, forceUntitled: true });
91
- }
92
- };
93
- UntitledTextEditorWorkingCopyEditorHandler = ( __decorate([
94
- ( __param(0, IWorkingCopyEditorService)),
95
- ( __param(1, IWorkbenchEnvironmentService)),
96
- ( __param(2, IPathService)),
97
- ( __param(3, ITextEditorService)),
98
- ( __param(4, IUntitledTextEditorService))
99
- ], UntitledTextEditorWorkingCopyEditorHandler));
100
-
101
- export { UntitledTextEditorInputSerializer, UntitledTextEditorWorkingCopyEditorHandler };