@codingame/monaco-vscode-api 1.78.4-next.3 → 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,
@@ -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.3",
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 };