@codingame/monaco-vscode-api 1.78.4-next.2 → 1.78.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/monaco.d.ts CHANGED
@@ -1,17 +1,6 @@
1
1
  import * as monaco from 'monaco-editor';
2
2
  import * as vscode from 'vscode';
3
3
 
4
- interface ServicesAccessor {
5
- get<T>(id: ServiceIdentifier<T>): T;
6
- }
7
- /**
8
- * Identifies a service of type `T`.
9
- */
10
- interface ServiceIdentifier<T> {
11
- (...args: any[]): void;
12
- type: T;
13
- }
14
-
15
4
  /**
16
5
  * An object that performs a cleanup operation when `.dispose()` is called.
17
6
  *
@@ -548,6 +537,17 @@ declare namespace Event {
548
537
  function fromObservable<T>(obs: IObservable<T, any>, store?: DisposableStore): Event<T>;
549
538
  }
550
539
 
540
+ interface ServicesAccessor {
541
+ get<T>(id: ServiceIdentifier<T>): T;
542
+ }
543
+ /**
544
+ * Identifies a service of type `T`.
545
+ */
546
+ interface ServiceIdentifier<T> {
547
+ (...args: any[]): void;
548
+ type: T;
549
+ }
550
+
551
551
  declare const enum ContextKeyExprType {
552
552
  False = 0,
553
553
  True = 1,
package/dist/polyfill.js CHANGED
@@ -55049,6 +55049,42 @@ MainThreadOutputService = MainThreadOutputService_1 = __decorate([
55049
55049
  ( (__param(1, IOutputService))),
55050
55050
  ( (__param(2, IViewsService)))
55051
55051
  ], MainThreadOutputService);
55052
+ class ExtHostSaveParticipant {
55053
+ constructor(extHostContext) {
55054
+ this._proxy = ( (extHostContext.getProxy(ExtHostContext.ExtHostDocumentSaveParticipant)));
55055
+ }
55056
+ async participate(editorModel, env, _progress, token) {
55057
+ if (!editorModel.textEditorModel || !shouldSynchronizeModel(editorModel.textEditorModel)) {
55058
+ return undefined;
55059
+ }
55060
+ const p = ( (new Promise((resolve, reject) => {
55061
+ setTimeout(() => reject(( (new Error(
55062
+ (localize('timeout.onWillSave', "Aborted onWillSaveTextDocument-event after 1750ms"))
55063
+ )))), 1750);
55064
+ this._proxy.$participateInSave(editorModel.resource, env.reason).then(values => {
55065
+ if (!values.every(success => success)) {
55066
+ return Promise.reject(( (new Error('listener failed'))));
55067
+ }
55068
+ return undefined;
55069
+ }).then(resolve, reject);
55070
+ })));
55071
+ return raceCancellationError(p, token);
55072
+ }
55073
+ }
55074
+ let SaveParticipant = class SaveParticipant {
55075
+ constructor(extHostContext, instantiationService, _textFileService) {
55076
+ this._textFileService = _textFileService;
55077
+ this._saveParticipantDisposable = this._textFileService.files.addSaveParticipant(instantiationService.createInstance(ExtHostSaveParticipant, extHostContext));
55078
+ }
55079
+ dispose() {
55080
+ this._saveParticipantDisposable.dispose();
55081
+ }
55082
+ };
55083
+ SaveParticipant = __decorate([
55084
+ extHostCustomer,
55085
+ ( (__param(1, IInstantiationService))),
55086
+ ( (__param(2, ITextFileService)))
55087
+ ], SaveParticipant);
55052
55088
  const original = MainThreadMessageService.prototype.$showMessage;
55053
55089
  MainThreadMessageService.prototype.$showMessage = function (severity, message, options, commands) {
55054
55090
  const _options = {
@@ -17566,4 +17566,4 @@ declare function registerServiceInitializeParticipant(participant: ServiceInitia
17566
17566
  declare const onRenderWorkbench: Event$1<ServicesAccessor>;
17567
17567
  declare function initialize(overrides: IEditorOverrideServices): Promise<void>;
17568
17568
 
17569
- export { DialogType, IAction, IAudioCueService, IBaseDialogOptions, IBulkEditService, ICheckbox, ICheckboxResult, IClipboardService, ICodeEditorService, IColorTheme, ICommandService, IConfigurationChangeEvent, IConfigurationService, IConfirmDialogArgs, IConfirmation, IConfirmationResult, ICustomDialogMarkdown, ICustomDialogOptions, IDebugService, IDialogArgs, IDialogHandler, IDialogResult, IDialogService, IEditorGroupsService, IEditorService, IEditorWorkerService, IFileService, IHostService, IInput, IInputDialogArgs, IInputElement, IInputResult, IInstantiationService, ILanguageConfigurationService, ILanguageFeaturesService, ILanguageService, ILanguageStatusService, IMarkdownString, IMarkerService, IModelService, INeverShowAgainOptions, INotification, INotificationActions, INotificationHandle, INotificationProgress, INotificationProgressProperties, INotificationProperties, INotificationService, IOpenerService, IPaneCompositePartService, IPathService, IProductService, IPrompt, IPromptBaseButton, IPromptButton, IPromptCancelButton, IPromptChoice, IPromptChoiceWithMenu, IPromptDialogArgs, IPromptOptions, IPromptResult, IPromptResultWithCancel, IPromptWithCustomCancel, IPromptWithDefaultCancel, IQuickInputService, ISnippetsService, IStatusMessageOptions, IStorageService, ITelemetryService, ITextFileService, ITextModelContentProvider, ITextModelService, IThemeService, IUriIdentityService, IWorkbenchEnvironmentService, IWorkingCopyFileService, IWorkspaceContextService, MarkdownStringTrustedOptions, NeverShowAgainScope, NoOpNotification, NoOpProgress, NotificationMessage, NotificationPriority, NotificationsFilter, Severity$1 as Severity, StandaloneServices, StorageScope, StorageTarget, initialize, onRenderWorkbench, registerServiceInitializeParticipant };
17569
+ export { ContextKeyExprType, DialogType, IAction, IAudioCueService, IBaseDialogOptions, IBulkEditService, ICheckbox, ICheckboxResult, IClipboardService, ICodeEditorService, IColorTheme, ICommandService, IConfigurationChangeEvent, IConfigurationService, IConfirmDialogArgs, IConfirmation, IConfirmationResult, ICustomDialogMarkdown, ICustomDialogOptions, IDebugService, IDialogArgs, IDialogHandler, IDialogResult, IDialogService, IEditorGroupsService, IEditorService, IEditorWorkerService, IFileService, IHostService, IInput, IInputDialogArgs, IInputElement, IInputResult, IInstantiationService, ILanguageConfigurationService, ILanguageFeaturesService, ILanguageService, ILanguageStatusService, IMarkdownString, IMarkerService, IModelService, INeverShowAgainOptions, INotification, INotificationActions, INotificationHandle, INotificationProgress, INotificationProgressProperties, INotificationProperties, INotificationService, IOpenerService, IPaneCompositePartService, IPathService, IProductService, IPrompt, IPromptBaseButton, IPromptButton, IPromptCancelButton, IPromptChoice, IPromptChoiceWithMenu, IPromptDialogArgs, IPromptOptions, IPromptResult, IPromptResultWithCancel, IPromptWithCustomCancel, IPromptWithDefaultCancel, IQuickInputService, ISnippetsService, IStatusMessageOptions, IStorageService, ITelemetryService, ITextFileService, ITextModelContentProvider, ITextModelService, IThemeService, IUriIdentityService, IWorkbenchEnvironmentService, IWorkingCopyFileService, IWorkspaceContextService, MarkdownStringTrustedOptions, NeverShowAgainScope, NoOpNotification, NoOpProgress, NotificationMessage, NotificationPriority, NotificationsFilter, Severity$1 as Severity, StandaloneServices, StorageScope, StorageTarget, initialize, onRenderWorkbench, registerServiceInitializeParticipant };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-api",
3
- "version": "1.78.4-next.2",
3
+ "version": "1.78.4",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor",
6
6
  "keywords": [],
@@ -1,110 +0,0 @@
1
- import { ILifecycleService, mark } from './missing-services.js';
2
- import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
3
- import { DeferredPromise, runWhenIdle } from 'monaco-editor/esm/vs/base/common/async.js';
4
- import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
5
- import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
6
- import { IEnvironmentService } from 'monaco-editor/esm/vs/platform/environment/common/environment.js';
7
- var Extensions;
8
- ( (function(Extensions) {
9
- Extensions.Workbench = 'workbench.contributions.kind';
10
- })(Extensions || (Extensions = {})));
11
- class WorkbenchContributionsRegistry {
12
- constructor() {
13
- this.contributions = ( new Map());
14
- this.pendingRestoredContributions = ( new DeferredPromise());
15
- }
16
- registerWorkbenchContribution(contribution, phase = 1 ) {
17
- if (this.instantiationService && this.lifecycleService && this.logService && this.environmentService && this.lifecycleService.phase >= phase) {
18
- this.safeCreateContribution(this.instantiationService, this.logService, this.environmentService, contribution, phase);
19
- }
20
- else {
21
- let contributions = this.contributions.get(phase);
22
- if (!contributions) {
23
- contributions = [];
24
- this.contributions.set(phase, contributions);
25
- }
26
- contributions.push(contribution);
27
- }
28
- }
29
- start(accessor) {
30
- const instantiationService = this.instantiationService = accessor.get(IInstantiationService);
31
- const lifecycleService = this.lifecycleService = accessor.get(ILifecycleService);
32
- const logService = this.logService = accessor.get(ILogService);
33
- const environmentService = this.environmentService = accessor.get(IEnvironmentService);
34
- for (const phase of [1 , 2 , 3 , 4 ]) {
35
- this.instantiateByPhase(instantiationService, lifecycleService, logService, environmentService, phase);
36
- }
37
- }
38
- instantiateByPhase(instantiationService, lifecycleService, logService, environmentService, phase) {
39
- if (lifecycleService.phase >= phase) {
40
- this.doInstantiateByPhase(instantiationService, logService, environmentService, phase);
41
- }
42
- else {
43
- lifecycleService.when(phase).then(() => this.doInstantiateByPhase(instantiationService, logService, environmentService, phase));
44
- }
45
- }
46
- async doInstantiateByPhase(instantiationService, logService, environmentService, phase) {
47
- const contributions = this.contributions.get(phase);
48
- if (contributions) {
49
- this.contributions.delete(phase);
50
- switch (phase) {
51
- case 1 :
52
- case 2 : {
53
- mark(`code/willCreateWorkbenchContributions/${phase}`);
54
- for (const contribution of contributions) {
55
- this.safeCreateContribution(instantiationService, logService, environmentService, contribution, phase);
56
- }
57
- mark(`code/didCreateWorkbenchContributions/${phase}`);
58
- break;
59
- }
60
- case 3 :
61
- case 4 : {
62
- if (phase === 4 ) {
63
- await this.pendingRestoredContributions.p;
64
- }
65
- this.doInstantiateWhenIdle(contributions, instantiationService, logService, environmentService, phase);
66
- break;
67
- }
68
- }
69
- }
70
- }
71
- doInstantiateWhenIdle(contributions, instantiationService, logService, environmentService, phase) {
72
- mark(`code/willCreateWorkbenchContributions/${phase}`);
73
- let i = 0;
74
- const forcedTimeout = phase === 4 ? 3000 : 500;
75
- const instantiateSome = (idle) => {
76
- while (i < contributions.length) {
77
- const contribution = contributions[i++];
78
- this.safeCreateContribution(instantiationService, logService, environmentService, contribution, phase);
79
- if (idle.timeRemaining() < 1) {
80
- runWhenIdle(instantiateSome, forcedTimeout);
81
- break;
82
- }
83
- }
84
- if (i === contributions.length) {
85
- mark(`code/didCreateWorkbenchContributions/${phase}`);
86
- if (phase === 3 ) {
87
- this.pendingRestoredContributions.complete();
88
- }
89
- }
90
- };
91
- runWhenIdle(instantiateSome, forcedTimeout);
92
- }
93
- safeCreateContribution(instantiationService, logService, environmentService, contribution, phase) {
94
- const now = phase < 3 ? Date.now() : undefined;
95
- try {
96
- instantiationService.createInstance(contribution);
97
- }
98
- catch (error) {
99
- logService.error(`Unable to create workbench contribution ${contribution.name}.`, error);
100
- }
101
- if (typeof now === 'number' && !environmentService.isBuilt ) {
102
- const time = Date.now() - now;
103
- if (time > 20) {
104
- logService.warn(`Workbench contribution ${contribution.name} blocked restore phase by ${time}ms.`);
105
- }
106
- }
107
- }
108
- }
109
- Registry.add(Extensions.Workbench, ( new WorkbenchContributionsRegistry()));
110
- export { Extensions };