@codingame/monaco-vscode-api 1.85.1 → 1.85.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 (63) hide show
  1. package/README.md +14 -5
  2. package/missing-services.js +305 -63
  3. package/monaco-editor-treemending.patch +946 -946
  4. package/package.json +8 -7
  5. package/service-override/tools/editor.js +1 -1
  6. package/services.js +10 -6
  7. package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +14 -0
  8. package/vscode/src/vs/platform/extensionManagement/common/extensionEnablementService.js +140 -0
  9. package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1062 -93
  10. package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +220 -0
  11. package/vscode/src/vs/platform/quickinput/browser/quickPickPin.js +102 -0
  12. package/vscode/src/vs/platform/userDataSync/common/content.js +9 -0
  13. package/vscode/src/vs/platform/userDataSync/common/settingsMerge.js +514 -0
  14. package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +154 -2
  15. package/vscode/src/vs/platform/userDataSync/common/userDataSyncAccount.js +43 -1
  16. package/vscode/src/vs/platform/userDataSync/common/userDataSyncMachines.js +177 -0
  17. package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +1 -1
  18. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
  19. package/vscode/src/vs/workbench/api/common/extHostWebview.js +2 -2
  20. package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +105 -0
  21. package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +4 -0
  22. package/vscode/src/vs/workbench/browser/parts/views/treeView.js +1614 -0
  23. package/vscode/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js +7 -7
  24. package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +73 -2
  25. package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +6 -6
  26. package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +12 -2
  27. package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +712 -0
  28. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +130 -0
  29. package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +20 -1
  30. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +205 -0
  31. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +11 -0
  32. package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +9 -9
  33. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +1 -1
  34. package/vscode/src/vs/workbench/services/keybinding/common/keybindingEditing.js +2 -2
  35. package/vscode/src/vs/workbench/services/languageStatus/common/languageStatusService.js +24 -1
  36. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +41 -0
  37. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +588 -0
  38. package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +43 -0
  39. package/vscode/src/vs/workbench/services/search/common/search.js +3 -3
  40. package/vscode/src/vs/workbench/services/terminal/common/embedderTerminalService.js +75 -1
  41. package/vscode/src/vs/workbench/services/timer/browser/timerService.js +240 -1
  42. package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +31 -1
  43. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +25 -1
  44. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +75 -1
  45. package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +74 -4
  46. package/vscode/src/vs/base/parts/request/browser/request.js +0 -60
  47. package/vscode/src/vs/platform/request/browser/requestService.js +0 -28
  48. package/vscode/src/vs/platform/request/common/requestIpc.js +0 -17
  49. package/vscode/src/vs/platform/url/common/urlService.js +0 -17
  50. package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js +0 -120
  51. package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +0 -319
  52. package/vscode/src/vs/workbench/services/files/browser/elevatedFileService.js +0 -9
  53. package/vscode/src/vs/workbench/services/host/browser/browserHostService.js +0 -408
  54. package/vscode/src/vs/workbench/services/request/browser/requestService.js +0 -48
  55. package/vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js +0 -56
  56. package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +0 -639
  57. package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.js +0 -402
  58. package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +0 -62
  59. package/vscode/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +0 -38
  60. package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +0 -295
  61. package/vscode/src/vs/workbench/services/url/browser/urlService.js +0 -47
  62. package/vscode/src/vs/workbench/services/views/common/treeViewsService.js +0 -20
  63. package/vscode/src/vs/workbench/services/workspaces/common/canonicalUriService.js +0 -19
@@ -1,3 +1,77 @@
1
1
  import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
2
+ import { Emitter, Event } from 'monaco-editor/esm/vs/base/common/event.js';
3
+ import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
2
4
  const IEmbedderTerminalService = ( createDecorator('embedderTerminalService'));
3
- export { IEmbedderTerminalService };
5
+ class EmbedderTerminalService {
6
+ constructor() {
7
+ this._onDidCreateTerminal = ( new Emitter());
8
+ this.onDidCreateTerminal = Event.buffer(this._onDidCreateTerminal.event);
9
+ }
10
+ createTerminal(options) {
11
+ const slc = {
12
+ name: options.name,
13
+ isFeatureTerminal: true,
14
+ customPtyImplementation(terminalId, cols, rows) {
15
+ return ( new EmbedderTerminalProcess(terminalId, options.pty));
16
+ },
17
+ };
18
+ this._onDidCreateTerminal.fire(slc);
19
+ }
20
+ }
21
+ class EmbedderTerminalProcess extends Disposable {
22
+ constructor(id, pty) {
23
+ super();
24
+ this.id = id;
25
+ this.shouldPersist = false;
26
+ this._onProcessReady = this._register(( new Emitter()));
27
+ this.onProcessReady = this._onProcessReady.event;
28
+ this._onDidChangeProperty = this._register(( new Emitter()));
29
+ this.onDidChangeProperty = this._onDidChangeProperty.event;
30
+ this._onProcessExit = this._register(( new Emitter()));
31
+ this.onProcessExit = this._onProcessExit.event;
32
+ this._pty = pty;
33
+ this.onProcessData = this._pty.onDidWrite;
34
+ if (this._pty.onDidClose) {
35
+ this._register(this._pty.onDidClose(e => this._onProcessExit.fire(e || undefined)));
36
+ }
37
+ if (this._pty.onDidChangeName) {
38
+ this._register(this._pty.onDidChangeName(e => this._onDidChangeProperty.fire({
39
+ type: "title" ,
40
+ value: e
41
+ })));
42
+ }
43
+ }
44
+ async start() {
45
+ this._onProcessReady.fire({ pid: -1, cwd: '', windowsPty: undefined });
46
+ this._pty.open();
47
+ return undefined;
48
+ }
49
+ shutdown() {
50
+ this._pty.close();
51
+ }
52
+ input() {
53
+ }
54
+ async processBinary() {
55
+ }
56
+ resize() {
57
+ }
58
+ clearBuffer() {
59
+ }
60
+ acknowledgeDataEvent() {
61
+ }
62
+ async setUnicodeVersion() {
63
+ }
64
+ async getInitialCwd() {
65
+ return '';
66
+ }
67
+ async getCwd() {
68
+ return '';
69
+ }
70
+ refreshProperty(property) {
71
+ throw new Error(`refreshProperty is not suppported in EmbedderTerminalProcess. property: ${property}`);
72
+ }
73
+ updateProperty(property, value) {
74
+ throw new Error(`updateProperty is not suppported in EmbedderTerminalProcess. property: ${property}, value: ${value}`);
75
+ }
76
+ }
77
+ export { EmbedderTerminalService, IEmbedderTerminalService };
@@ -1,3 +1,242 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import * as performance$1 from 'monaco-editor/esm/vs/base/common/performance.js';
1
3
  import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
4
+ import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
5
+ import { IExtensionService } from '../../extensions/common/extensions.js';
6
+ import { IUpdateService } from '../../../../platform/update/common/update.js';
7
+ import { ILifecycleService } from '../../lifecycle/common/lifecycle.js';
8
+ import { IEditorService } from '../../editor/common/editorService.js';
9
+ import { IAccessibilityService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
10
+ import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
11
+ import { Barrier, timeout } from 'monaco-editor/esm/vs/base/common/async.js';
12
+ import { IWorkbenchLayoutService } from '../../layout/browser/layoutService.js';
13
+ import { IPaneCompositePartService } from '../../panecomposite/browser/panecomposite.js';
14
+ import { TelemetryTrustedValue } from '../../../../platform/telemetry/common/telemetryUtils.js';
15
+ import { isWeb } from 'monaco-editor/esm/vs/base/common/platform.js';
16
+ import { createBlobWorker } from 'monaco-editor/esm/vs/base/browser/defaultWorkerFactory.js';
17
+ import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
18
+ import { TerminalExtensions } from '../../../../platform/terminal/common/terminal.js';
2
19
  const ITimerService = ( createDecorator('timerService'));
3
- export { ITimerService };
20
+ class PerfMarks {
21
+ constructor() {
22
+ this._entries = [];
23
+ }
24
+ setMarks(source, entries) {
25
+ this._entries.push([source, entries]);
26
+ }
27
+ getDuration(from, to) {
28
+ const fromEntry = this._findEntry(from);
29
+ if (!fromEntry) {
30
+ return 0;
31
+ }
32
+ const toEntry = this._findEntry(to);
33
+ if (!toEntry) {
34
+ return 0;
35
+ }
36
+ return toEntry.startTime - fromEntry.startTime;
37
+ }
38
+ _findEntry(name) {
39
+ for (const [, marks] of this._entries) {
40
+ for (let i = marks.length - 1; i >= 0; i--) {
41
+ if (marks[i].name === name) {
42
+ return marks[i];
43
+ }
44
+ }
45
+ }
46
+ }
47
+ getEntries() {
48
+ return this._entries.slice(0);
49
+ }
50
+ }
51
+ let AbstractTimerService = class AbstractTimerService {
52
+ constructor(_lifecycleService, _contextService, _extensionService, _updateService, _paneCompositeService, _editorService, _accessibilityService, _telemetryService, layoutService) {
53
+ this._lifecycleService = _lifecycleService;
54
+ this._contextService = _contextService;
55
+ this._extensionService = _extensionService;
56
+ this._updateService = _updateService;
57
+ this._paneCompositeService = _paneCompositeService;
58
+ this._editorService = _editorService;
59
+ this._accessibilityService = _accessibilityService;
60
+ this._telemetryService = _telemetryService;
61
+ this._barrier = ( new Barrier());
62
+ this._marks = ( new PerfMarks());
63
+ this._rndValueShouldSendTelemetry = Math.random() < .05;
64
+ Promise.all([
65
+ this._extensionService.whenInstalledExtensionsRegistered(),
66
+ _lifecycleService.when(3 ),
67
+ layoutService.whenRestored,
68
+ Promise.all(( Array.from(( ( Registry.as(TerminalExtensions.Backend)).backends.values())).map(e => e.whenReady)))
69
+ ]).then(() => {
70
+ this.setPerformanceMarks('renderer', performance$1.getMarks());
71
+ return this._computeStartupMetrics();
72
+ }).then(metrics => {
73
+ this._startupMetrics = metrics;
74
+ this._reportStartupTimes(metrics);
75
+ this._barrier.open();
76
+ });
77
+ this.perfBaseline = this._barrier.wait()
78
+ .then(() => this._lifecycleService.when(4 ))
79
+ .then(() => timeout(this._startupMetrics.timers.ellapsedRequire))
80
+ .then(() => {
81
+ const jsSrc = ( (function () {
82
+ let tooSlow = false;
83
+ function fib(n) {
84
+ if (tooSlow) {
85
+ return 0;
86
+ }
87
+ if (performance.now() - t1 >= 1000) {
88
+ tooSlow = true;
89
+ }
90
+ if (n <= 2) {
91
+ return n;
92
+ }
93
+ return fib(n - 1) + fib(n - 2);
94
+ }
95
+ const t1 = performance.now();
96
+ fib(24);
97
+ const value = Math.round(performance.now() - t1);
98
+ postMessage({ value: tooSlow ? -1 : value });
99
+ }).toString());
100
+ const blob = ( new Blob([`(${jsSrc})();`], { type: 'application/javascript' }));
101
+ const blobUrl = URL.createObjectURL(blob);
102
+ const worker = createBlobWorker(blobUrl, { name: 'perfBaseline' });
103
+ return ( new Promise(resolve => {
104
+ worker.onmessage = e => resolve(e.data.value);
105
+ })).finally(() => {
106
+ worker.terminate();
107
+ URL.revokeObjectURL(blobUrl);
108
+ });
109
+ });
110
+ }
111
+ whenReady() {
112
+ return this._barrier.wait();
113
+ }
114
+ get startupMetrics() {
115
+ if (!this._startupMetrics) {
116
+ throw new Error('illegal state, MUST NOT access startupMetrics before whenReady has resolved');
117
+ }
118
+ return this._startupMetrics;
119
+ }
120
+ setPerformanceMarks(source, marks) {
121
+ const codeMarks = marks.filter(mark => mark.name.startsWith('code/'));
122
+ this._marks.setMarks(source, codeMarks);
123
+ this._reportPerformanceMarks(source, codeMarks);
124
+ }
125
+ getPerformanceMarks() {
126
+ return this._marks.getEntries();
127
+ }
128
+ getDuration(from, to) {
129
+ return this._marks.getDuration(from, to);
130
+ }
131
+ _reportStartupTimes(metrics) {
132
+ this._telemetryService.publicLog('startupTimeVaried', metrics);
133
+ }
134
+ _shouldReportPerfMarks() {
135
+ return this._rndValueShouldSendTelemetry;
136
+ }
137
+ _reportPerformanceMarks(source, marks) {
138
+ if (!this._shouldReportPerfMarks()) {
139
+ return;
140
+ }
141
+ for (const mark of marks) {
142
+ this._telemetryService.publicLog2('startup.timer.mark', {
143
+ source,
144
+ name: ( new TelemetryTrustedValue(mark.name)),
145
+ startTime: mark.startTime
146
+ });
147
+ }
148
+ }
149
+ async _computeStartupMetrics() {
150
+ const initialStartup = this._isInitialStartup();
151
+ let startMark;
152
+ if (isWeb) {
153
+ startMark = 'code/timeOrigin';
154
+ }
155
+ else {
156
+ startMark = initialStartup ? 'code/didStartMain' : 'code/willOpenNewWindow';
157
+ }
158
+ const activeViewlet = this._paneCompositeService.getActivePaneComposite(0 );
159
+ const activePanel = this._paneCompositeService.getActivePaneComposite(1 );
160
+ const info = {
161
+ version: 2,
162
+ ellapsed: this._marks.getDuration(startMark, 'code/didStartWorkbench'),
163
+ isLatestVersion: Boolean(await this._updateService.isLatestVersion()),
164
+ didUseCachedData: this._didUseCachedData(),
165
+ windowKind: this._lifecycleService.startupKind,
166
+ windowCount: await this._getWindowCount(),
167
+ viewletId: activeViewlet?.getId(),
168
+ editorIds: ( this._editorService.visibleEditors.map(input => input.typeId)),
169
+ panelId: activePanel ? activePanel.getId() : undefined,
170
+ timers: {
171
+ ellapsedAppReady: initialStartup ? this._marks.getDuration('code/didStartMain', 'code/mainAppReady') : undefined,
172
+ ellapsedNlsGeneration: initialStartup ? this._marks.getDuration('code/willGenerateNls', 'code/didGenerateNls') : undefined,
173
+ ellapsedLoadMainBundle: initialStartup ? this._marks.getDuration('code/willLoadMainBundle', 'code/didLoadMainBundle') : undefined,
174
+ ellapsedCrashReporter: initialStartup ? this._marks.getDuration('code/willStartCrashReporter', 'code/didStartCrashReporter') : undefined,
175
+ ellapsedMainServer: initialStartup ? this._marks.getDuration('code/willStartMainServer', 'code/didStartMainServer') : undefined,
176
+ ellapsedWindowCreate: initialStartup ? this._marks.getDuration('code/willCreateCodeWindow', 'code/didCreateCodeWindow') : undefined,
177
+ ellapsedWindowRestoreState: initialStartup ? this._marks.getDuration('code/willRestoreCodeWindowState', 'code/didRestoreCodeWindowState') : undefined,
178
+ ellapsedBrowserWindowCreate: initialStartup ? this._marks.getDuration('code/willCreateCodeBrowserWindow', 'code/didCreateCodeBrowserWindow') : undefined,
179
+ ellapsedWindowMaximize: initialStartup ? this._marks.getDuration('code/willMaximizeCodeWindow', 'code/didMaximizeCodeWindow') : undefined,
180
+ ellapsedWindowLoad: initialStartup ? this._marks.getDuration('code/mainAppReady', 'code/willOpenNewWindow') : undefined,
181
+ ellapsedWindowLoadToRequire: this._marks.getDuration('code/willOpenNewWindow', 'code/willLoadWorkbenchMain'),
182
+ ellapsedRequire: this._marks.getDuration('code/willLoadWorkbenchMain', 'code/didLoadWorkbenchMain'),
183
+ ellapsedWaitForWindowConfig: this._marks.getDuration('code/willWaitForWindowConfig', 'code/didWaitForWindowConfig'),
184
+ ellapsedStorageInit: this._marks.getDuration('code/willInitStorage', 'code/didInitStorage'),
185
+ ellapsedSharedProcesConnected: this._marks.getDuration('code/willConnectSharedProcess', 'code/didConnectSharedProcess'),
186
+ ellapsedWorkspaceServiceInit: this._marks.getDuration('code/willInitWorkspaceService', 'code/didInitWorkspaceService'),
187
+ ellapsedRequiredUserDataInit: this._marks.getDuration('code/willInitRequiredUserData', 'code/didInitRequiredUserData'),
188
+ ellapsedOtherUserDataInit: this._marks.getDuration('code/willInitOtherUserData', 'code/didInitOtherUserData'),
189
+ ellapsedExtensions: this._marks.getDuration('code/willLoadExtensions', 'code/didLoadExtensions'),
190
+ ellapsedEditorRestore: this._marks.getDuration('code/willRestoreEditors', 'code/didRestoreEditors'),
191
+ ellapsedViewletRestore: this._marks.getDuration('code/willRestoreViewlet', 'code/didRestoreViewlet'),
192
+ ellapsedPanelRestore: this._marks.getDuration('code/willRestorePanel', 'code/didRestorePanel'),
193
+ ellapsedWorkbench: this._marks.getDuration('code/willStartWorkbench', 'code/didStartWorkbench'),
194
+ ellapsedExtensionsReady: this._marks.getDuration(startMark, 'code/didLoadExtensions'),
195
+ ellapsedRenderer: this._marks.getDuration('code/didStartRenderer', 'code/didStartWorkbench')
196
+ },
197
+ platform: undefined,
198
+ release: undefined,
199
+ arch: undefined,
200
+ totalmem: undefined,
201
+ freemem: undefined,
202
+ meminfo: undefined,
203
+ cpus: undefined,
204
+ loadavg: undefined,
205
+ isVMLikelyhood: undefined,
206
+ initialStartup,
207
+ hasAccessibilitySupport: this._accessibilityService.isScreenReaderOptimized(),
208
+ emptyWorkbench: this._contextService.getWorkbenchState() === 1
209
+ };
210
+ await this._extendStartupInfo(info);
211
+ return info;
212
+ }
213
+ };
214
+ AbstractTimerService = ( __decorate([
215
+ ( __param(0, ILifecycleService)),
216
+ ( __param(1, IWorkspaceContextService)),
217
+ ( __param(2, IExtensionService)),
218
+ ( __param(3, IUpdateService)),
219
+ ( __param(4, IPaneCompositePartService)),
220
+ ( __param(5, IEditorService)),
221
+ ( __param(6, IAccessibilityService)),
222
+ ( __param(7, ITelemetryService)),
223
+ ( __param(8, IWorkbenchLayoutService))
224
+ ], AbstractTimerService));
225
+ class TimerService extends AbstractTimerService {
226
+ _isInitialStartup() {
227
+ return false;
228
+ }
229
+ _didUseCachedData() {
230
+ return false;
231
+ }
232
+ async _getWindowCount() {
233
+ return 1;
234
+ }
235
+ async _extendStartupInfo(info) {
236
+ info.isVMLikelyhood = 0;
237
+ info.isARM64Emulated = false;
238
+ info.platform = navigator.userAgent;
239
+ info.release = navigator.appVersion;
240
+ }
241
+ }
242
+ export { AbstractTimerService, ITimerService, TimerService };
@@ -6,6 +6,36 @@ import { isWeb } from 'monaco-editor/esm/vs/base/common/platform.js';
6
6
  import { IExtensionService } from '../../extensions/common/extensions.js';
7
7
  import { mark } from 'monaco-editor/esm/vs/base/common/performance.js';
8
8
  const IUserDataInitializationService = ( createDecorator('IUserDataInitializationService'));
9
+ class UserDataInitializationService {
10
+ constructor(initializers = []) {
11
+ this.initializers = initializers;
12
+ }
13
+ async whenInitializationFinished() {
14
+ if (await this.requiresInitialization()) {
15
+ await Promise.all(( this.initializers.map(initializer => initializer.whenInitializationFinished())));
16
+ }
17
+ }
18
+ async requiresInitialization() {
19
+ return ( (await Promise.all(( this.initializers.map(initializer => initializer.requiresInitialization())))).some(result => result));
20
+ }
21
+ async initializeRequiredResources() {
22
+ if (await this.requiresInitialization()) {
23
+ await Promise.all(( this.initializers.map(initializer => initializer.initializeRequiredResources())));
24
+ }
25
+ }
26
+ async initializeOtherResources(instantiationService) {
27
+ if (await this.requiresInitialization()) {
28
+ await Promise.all(( this.initializers.map(initializer => initializer.initializeOtherResources(instantiationService))));
29
+ }
30
+ }
31
+ async initializeInstalledExtensions(instantiationService) {
32
+ if (await this.requiresInitialization()) {
33
+ await Promise.all(( this.initializers.map(
34
+ initializer => initializer.initializeInstalledExtensions(instantiationService)
35
+ )));
36
+ }
37
+ }
38
+ }
9
39
  let InitializeOtherResourcesContribution = class InitializeOtherResourcesContribution {
10
40
  constructor(userDataInitializeService, instantiationService, extensionService) {
11
41
  extensionService.whenInstalledExtensionsRegistered().then(() => this.initializeOtherResource(userDataInitializeService, instantiationService));
@@ -27,4 +57,4 @@ if (isWeb) {
27
57
  const workbenchRegistry = ( Registry.as(Extensions.Workbench));
28
58
  workbenchRegistry.registerWorkbenchContribution(InitializeOtherResourcesContribution, 3 );
29
59
  }
30
- export { IUserDataInitializationService };
60
+ export { IUserDataInitializationService, UserDataInitializationService };
@@ -1,14 +1,38 @@
1
1
  import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
2
2
  import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
3
3
  import { RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
4
+ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
4
5
  import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
5
6
  import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
6
7
  const IUserDataProfileService = ( createDecorator('IUserDataProfileService'));
8
+ const IUserDataProfileManagementService = ( createDecorator('IUserDataProfileManagementService'));
9
+ const PROFILE_URL_AUTHORITY = 'profile';
10
+ function toUserDataProfileUri(path, productService) {
11
+ return ( URI.from({
12
+ scheme: productService.urlProtocol,
13
+ authority: PROFILE_URL_AUTHORITY,
14
+ path: path.startsWith('/') ? path : `/${path}`
15
+ }));
16
+ }
7
17
  const IUserDataProfileImportExportService = ( createDecorator('IUserDataProfileImportExportService'));
8
18
  const defaultUserDataProfileIcon = registerIcon('defaultProfile-icon', Codicon.settings, ( localizeWithPath(
9
19
  'vs/workbench/services/userDataProfile/common/userDataProfile',
10
20
  'defaultProfileIcon',
11
21
  'Icon for Default Profile.'
12
22
  )));
23
+ const PROFILES_TITLE = { value: ( localizeWithPath(
24
+ 'vs/workbench/services/userDataProfile/common/userDataProfile',
25
+ 'profiles',
26
+ "Profiles"
27
+ )), original: 'Profiles' };
28
+ const PROFILES_CATEGORY = { ...PROFILES_TITLE };
29
+ const PROFILE_EXTENSION = 'code-profile';
30
+ const PROFILE_FILTER = [{ name: ( localizeWithPath(
31
+ 'vs/workbench/services/userDataProfile/common/userDataProfile',
32
+ 'profile',
33
+ "Profile"
34
+ )), extensions: [PROFILE_EXTENSION] }];
13
35
  const CURRENT_PROFILE_CONTEXT = ( new RawContextKey('currentProfile', ''));
14
- export { CURRENT_PROFILE_CONTEXT, IUserDataProfileImportExportService, IUserDataProfileService, defaultUserDataProfileIcon };
36
+ const IS_PROFILE_EXPORT_IN_PROGRESS_CONTEXT = ( new RawContextKey('isProfileExportInProgress', false));
37
+ const IS_PROFILE_IMPORT_IN_PROGRESS_CONTEXT = ( new RawContextKey('isProfileImportInProgress', false));
38
+ export { CURRENT_PROFILE_CONTEXT, IS_PROFILE_EXPORT_IN_PROGRESS_CONTEXT, IS_PROFILE_IMPORT_IN_PROGRESS_CONTEXT, IUserDataProfileImportExportService, IUserDataProfileManagementService, IUserDataProfileService, PROFILES_CATEGORY, PROFILES_TITLE, PROFILE_EXTENSION, PROFILE_FILTER, PROFILE_URL_AUTHORITY, defaultUserDataProfileIcon, toUserDataProfileUri };
@@ -6,4 +6,78 @@ const DEFAULT_ICON = registerIcon('settings-view-bar-icon', Codicon.settingsGear
6
6
  'settingsViewBarIcon',
7
7
  "Settings icon in the view bar."
8
8
  )));
9
- export { DEFAULT_ICON };
9
+ const ICONS = [
10
+ DEFAULT_ICON,
11
+ Codicon.vm,
12
+ Codicon.server,
13
+ Codicon.recordKeys,
14
+ Codicon.deviceMobile,
15
+ Codicon.watch,
16
+ Codicon.vr,
17
+ Codicon.piano,
18
+ Codicon.ruby,
19
+ Codicon.code,
20
+ Codicon.coffee,
21
+ Codicon.snake,
22
+ Codicon.window,
23
+ Codicon.library,
24
+ Codicon.extensions,
25
+ Codicon.terminal,
26
+ Codicon.beaker,
27
+ Codicon.package,
28
+ Codicon.cloud,
29
+ Codicon.book,
30
+ Codicon.globe,
31
+ Codicon.database,
32
+ Codicon.notebook,
33
+ Codicon.robot,
34
+ Codicon.game,
35
+ Codicon.chip,
36
+ Codicon.music,
37
+ Codicon.gift,
38
+ Codicon.send,
39
+ Codicon.briefcase,
40
+ Codicon.megaphone,
41
+ Codicon.comment,
42
+ Codicon.telescope,
43
+ Codicon.creditCard,
44
+ Codicon.map,
45
+ Codicon.deviceCameraVideo,
46
+ Codicon.unmute,
47
+ Codicon.law,
48
+ Codicon.graphLine,
49
+ Codicon.heart,
50
+ Codicon.home,
51
+ Codicon.inbox,
52
+ Codicon.mortarBoard,
53
+ Codicon.rocket,
54
+ Codicon.magnet,
55
+ Codicon.lock,
56
+ Codicon.milestone,
57
+ Codicon.tag,
58
+ Codicon.pulse,
59
+ Codicon.radioTower,
60
+ Codicon.smiley,
61
+ Codicon.symbolEvent,
62
+ Codicon.squirrel,
63
+ Codicon.symbolColor,
64
+ Codicon.mail,
65
+ Codicon.key,
66
+ Codicon.pieChart,
67
+ Codicon.organization,
68
+ Codicon.preview,
69
+ Codicon.wand,
70
+ Codicon.starEmpty,
71
+ Codicon.lightbulb,
72
+ Codicon.symbolRuler,
73
+ Codicon.dashboard,
74
+ Codicon.calendar,
75
+ Codicon.shield,
76
+ Codicon.flame,
77
+ Codicon.compass,
78
+ Codicon.paintcan,
79
+ Codicon.archive,
80
+ Codicon.mic,
81
+ Codicon.jersey,
82
+ ];
83
+ export { DEFAULT_ICON, ICONS };
@@ -1,13 +1,83 @@
1
1
  import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
2
- import { RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
3
- import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
2
+ import { RawContextKey, ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
3
+ import { localizeWithPath, localize2WithPath } from 'monaco-editor/esm/vs/nls.js';
4
4
  import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
5
5
  import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
6
+ import { Categories } from 'monaco-editor/esm/vs/platform/action/common/actionCommonCategories.js';
6
7
  const IUserDataSyncWorkbenchService = ( createDecorator('IUserDataSyncWorkbenchService'));
7
- registerIcon('settings-sync-view-icon', Codicon.sync, ( localizeWithPath(
8
+ function getSyncAreaLabel(source) {
9
+ switch (source) {
10
+ case "settings" : return ( localizeWithPath(
11
+ 'vs/workbench/services/userDataSync/common/userDataSync',
12
+ 'settings',
13
+ "Settings"
14
+ ));
15
+ case "keybindings" : return ( localizeWithPath(
16
+ 'vs/workbench/services/userDataSync/common/userDataSync',
17
+ 'keybindings',
18
+ "Keyboard Shortcuts"
19
+ ));
20
+ case "snippets" : return ( localizeWithPath(
21
+ 'vs/workbench/services/userDataSync/common/userDataSync',
22
+ 'snippets',
23
+ "User Snippets"
24
+ ));
25
+ case "tasks" : return ( localizeWithPath(
26
+ 'vs/workbench/services/userDataSync/common/userDataSync',
27
+ 'tasks',
28
+ "User Tasks"
29
+ ));
30
+ case "extensions" : return ( localizeWithPath(
31
+ 'vs/workbench/services/userDataSync/common/userDataSync',
32
+ 'extensions',
33
+ "Extensions"
34
+ ));
35
+ case "globalState" : return ( localizeWithPath(
36
+ 'vs/workbench/services/userDataSync/common/userDataSync',
37
+ 'ui state label',
38
+ "UI State"
39
+ ));
40
+ case "profiles" : return ( localizeWithPath(
41
+ 'vs/workbench/services/userDataSync/common/userDataSync',
42
+ 'profiles',
43
+ "Profiles"
44
+ ));
45
+ case "workspaceState" : return ( localizeWithPath(
46
+ 'vs/workbench/services/userDataSync/common/userDataSync',
47
+ 'workspace state label',
48
+ "Workspace State"
49
+ ));
50
+ }
51
+ }
52
+ const SYNC_TITLE = ( localize2WithPath(
53
+ 'vs/workbench/services/userDataSync/common/userDataSync',
54
+ 'sync category',
55
+ "Settings Sync"
56
+ ));
57
+ const SYNC_VIEW_ICON = registerIcon('settings-sync-view-icon', Codicon.sync, ( localizeWithPath(
8
58
  'vs/workbench/services/userDataSync/common/userDataSync',
9
59
  'syncViewIcon',
10
60
  'View icon of the Settings Sync view.'
11
61
  )));
62
+ const CONTEXT_SYNC_STATE = ( new RawContextKey('syncStatus', "uninitialized" ));
12
63
  const CONTEXT_SYNC_ENABLEMENT = ( new RawContextKey('syncEnabled', false));
13
- export { CONTEXT_SYNC_ENABLEMENT, IUserDataSyncWorkbenchService };
64
+ const CONTEXT_ACCOUNT_STATE = ( new RawContextKey('userDataSyncAccountStatus', "unavailable" ));
65
+ const CONTEXT_ENABLE_ACTIVITY_VIEWS = ( new RawContextKey(`enableSyncActivityViews`, false));
66
+ const CONTEXT_ENABLE_SYNC_CONFLICTS_VIEW = ( new RawContextKey(`enableSyncConflictsView`, false));
67
+ const CONTEXT_HAS_CONFLICTS = ( new RawContextKey('hasConflicts', false));
68
+ const CONFIGURE_SYNC_COMMAND_ID = 'workbench.userDataSync.actions.configure';
69
+ const SHOW_SYNC_LOG_COMMAND_ID = 'workbench.userDataSync.actions.showLog';
70
+ const SYNC_VIEW_CONTAINER_ID = 'workbench.view.sync';
71
+ const SYNC_CONFLICTS_VIEW_ID = 'workbench.views.sync.conflicts';
72
+ const DOWNLOAD_ACTIVITY_ACTION_DESCRIPTOR = {
73
+ id: 'workbench.userDataSync.actions.downloadSyncActivity',
74
+ title: { original: 'Download Settings Sync Activity', value: ( localizeWithPath(
75
+ 'vs/workbench/services/userDataSync/common/userDataSync',
76
+ 'download sync activity title',
77
+ "Download Settings Sync Activity"
78
+ )) },
79
+ category: Categories.Developer,
80
+ f1: true,
81
+ precondition: ( ContextKeyExpr.and(( CONTEXT_ACCOUNT_STATE.isEqualTo("available" )), ( CONTEXT_SYNC_STATE.notEqualsTo("uninitialized" ))))
82
+ };
83
+ export { CONFIGURE_SYNC_COMMAND_ID, CONTEXT_ACCOUNT_STATE, CONTEXT_ENABLE_ACTIVITY_VIEWS, CONTEXT_ENABLE_SYNC_CONFLICTS_VIEW, CONTEXT_HAS_CONFLICTS, CONTEXT_SYNC_ENABLEMENT, CONTEXT_SYNC_STATE, DOWNLOAD_ACTIVITY_ACTION_DESCRIPTOR, IUserDataSyncWorkbenchService, SHOW_SYNC_LOG_COMMAND_ID, SYNC_CONFLICTS_VIEW_ID, SYNC_TITLE, SYNC_VIEW_CONTAINER_ID, SYNC_VIEW_ICON, getSyncAreaLabel };
@@ -1,60 +0,0 @@
1
- import { bufferToStream, VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
2
- import { canceled } from 'monaco-editor/esm/vs/base/common/errors.js';
3
- import { OfflineError } from '../common/request.js';
4
- function request(options, token) {
5
- if (options.proxyAuthorization) {
6
- options.headers = {
7
- ...(options.headers || {}),
8
- 'Proxy-Authorization': options.proxyAuthorization
9
- };
10
- }
11
- const xhr = ( new XMLHttpRequest());
12
- return ( new Promise((resolve, reject) => {
13
- xhr.open(options.type || 'GET', options.url || '', true, options.user, options.password);
14
- setRequestHeaders(xhr, options);
15
- xhr.responseType = 'arraybuffer';
16
- xhr.onerror = e => reject(navigator.onLine ? ( new Error(xhr.statusText && ('XHR failed: ' + xhr.statusText) || 'XHR failed')) : ( new OfflineError()));
17
- xhr.onload = (e) => {
18
- resolve({
19
- res: {
20
- statusCode: xhr.status,
21
- headers: getResponseHeaders(xhr)
22
- },
23
- stream: bufferToStream(VSBuffer.wrap(( new Uint8Array(xhr.response))))
24
- });
25
- };
26
- xhr.ontimeout = e => reject(( new Error(`XHR timeout: ${options.timeout}ms`)));
27
- if (options.timeout) {
28
- xhr.timeout = options.timeout;
29
- }
30
- xhr.send(options.data);
31
- token.onCancellationRequested(() => {
32
- xhr.abort();
33
- reject(canceled());
34
- });
35
- }));
36
- }
37
- function setRequestHeaders(xhr, options) {
38
- if (options.headers) {
39
- outer: for (const k in options.headers) {
40
- switch (k) {
41
- case 'User-Agent':
42
- case 'Accept-Encoding':
43
- case 'Content-Length':
44
- continue outer;
45
- }
46
- xhr.setRequestHeader(k, options.headers[k]);
47
- }
48
- }
49
- }
50
- function getResponseHeaders(xhr) {
51
- const headers = Object.create(null);
52
- for (const line of xhr.getAllResponseHeaders().split(/\r\n|\n|\r/g)) {
53
- if (line) {
54
- const idx = line.indexOf(':');
55
- headers[line.substr(0, idx).trim().toLowerCase()] = line.substr(idx + 1).trim();
56
- }
57
- }
58
- return headers;
59
- }
60
- export { request };
@@ -1,28 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { request } from '../../../base/parts/request/browser/request.js';
3
- import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
4
- import { ILoggerService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
5
- import { AbstractRequestService } from '../common/request.js';
6
- let RequestService = class RequestService extends AbstractRequestService {
7
- constructor(configurationService, loggerService) {
8
- super(loggerService);
9
- this.configurationService = configurationService;
10
- }
11
- async request(options, token) {
12
- if (!options.proxyAuthorization) {
13
- options.proxyAuthorization = this.configurationService.getValue('http.proxyAuthorization');
14
- }
15
- return this.logAndRequest('browser', options, () => request(options, token));
16
- }
17
- async resolveProxy(url) {
18
- return undefined;
19
- }
20
- async loadCertificates() {
21
- return [];
22
- }
23
- };
24
- RequestService = ( __decorate([
25
- ( __param(0, IConfigurationService)),
26
- ( __param(1, ILoggerService))
27
- ], RequestService));
28
- export { RequestService };