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