@codingame/monaco-vscode-api 1.81.1 → 1.81.3-next.0

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 (28) hide show
  1. package/dist/default-extensions/npm/npmBrowserMain.js.map +1 -1
  2. package/dist/default-extensions/typescript-language-features/tsserver.web.js.map +1 -1
  3. package/dist/lifecycle.js +47 -0
  4. package/dist/service-override/configuration.js +1 -1
  5. package/dist/service-override/editor.d.ts +2 -2
  6. package/dist/service-override/layout.d.ts +35 -5
  7. package/dist/service-override/layout.js +117 -14
  8. package/dist/service-override/notifications.js +1 -1
  9. package/dist/service-override/snippets.js +1 -1
  10. package/dist/service-override/storage.d.ts +25 -3
  11. package/dist/service-override/storage.js +29 -6
  12. package/dist/service-override/textmate.js +1 -1
  13. package/dist/service-override/views.d.ts +8 -1
  14. package/dist/service-override/views.js +23 -10
  15. package/dist/services.d.ts +3 -11
  16. package/dist/services.js +4 -50
  17. package/dist/vscode/vs/base/browser/broadcast.js +52 -0
  18. package/dist/vscode/vs/base/parts/storage/common/storage.d.ts +38 -1
  19. package/dist/vscode/vs/editor/common/editorCommon.d.ts +5 -290
  20. package/dist/vscode/vs/editor/common/model.d.ts +1 -22
  21. package/dist/vscode/vs/editor/common/textModelEvents.d.ts +1 -9
  22. package/dist/vscode/vs/platform/storage/common/storage.d.ts +61 -2
  23. package/dist/vscode/vs/workbench/services/layout/browser/layoutService.js +12 -1
  24. package/dist/vscode/vs/workbench/services/storage/browser/storageService.d.ts +40 -0
  25. package/dist/vscode/vs/workbench/services/storage/browser/storageService.js +278 -0
  26. package/dist/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.d.ts +19 -0
  27. package/monaco-editor-treemending.patch +919 -919
  28. package/package.json +1 -1
package/dist/services.js CHANGED
@@ -1,17 +1,13 @@
1
1
  export { default as Severity } from 'monaco-editor/esm/vs/base/common/severity.js';
2
2
  export { StorageScope, StorageTarget } from './vscode/vs/platform/storage/common/storage.js';
3
- import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
4
- import { Extensions } from './vscode/vs/workbench/common/contributions.js';
5
3
  import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
6
4
  export { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
7
- import { ILifecycleService } from './vscode/vs/workbench/services/lifecycle/common/lifecycle.js';
8
- import { Barrier, RunOnceScheduler, runWhenIdle } from 'monaco-editor/esm/vs/base/common/async.js';
9
- import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
10
5
  import getServiceOverride from './service-override/layout.js';
11
6
  import getServiceOverride$1 from './service-override/environment.js';
12
7
  import getServiceOverride$2 from './service-override/extensions.js';
13
8
  import getServiceOverride$3 from './service-override/files.js';
14
9
  import getServiceOverride$4 from './service-override/quickaccess.js';
10
+ import { startup, serviceInitializedBarrier } from './lifecycle.js';
15
11
  export { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
16
12
  export { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
17
13
  export { INotificationService, NeverShowAgainScope, NoOpNotification, NoOpProgress, NotificationPriority, NotificationsFilter } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
@@ -68,19 +64,7 @@ export { IHoverService } from './vscode/vs/workbench/services/hover/browser/hove
68
64
  export { IExplorerService } from './vscode/vs/workbench/contrib/files/browser/files.js';
69
65
  export { IStatusbarService } from './vscode/vs/workbench/services/statusbar/browser/statusbar.js';
70
66
  export { IDialogService } from './vscode/vs/platform/dialogs/common/dialogs.js';
71
- const serviceInitializePreParticipants = [];
72
- const serviceInitializeParticipants = [];
73
- const serviceInitializePostParticipants = [];
74
- function registerServiceInitializePreParticipant(participant) {
75
- serviceInitializePreParticipants.push(participant);
76
- }
77
- function registerServiceInitializeParticipant(participant) {
78
- serviceInitializeParticipants.push(participant);
79
- }
80
- function registerServiceInitializePostParticipant(participant) {
81
- serviceInitializePostParticipants.push(participant);
82
- }
83
- async function initServices(overrides) {
67
+ async function initialize(overrides) {
84
68
  const instantiationService = StandaloneServices.initialize({
85
69
  ...getServiceOverride(),
86
70
  ...getServiceOverride$1(),
@@ -89,40 +73,10 @@ async function initServices(overrides) {
89
73
  ...getServiceOverride$4(),
90
74
  ...overrides
91
75
  });
92
- await instantiationService.invokeFunction(async (accessor) => {
93
- await Promise.all(( serviceInitializePreParticipants.map(participant => participant(accessor))));
94
- });
95
- await instantiationService.invokeFunction(async (accessor) => {
96
- const lifecycleService = accessor.get(ILifecycleService);
97
- await Promise.all(( serviceInitializeParticipants.map(participant => participant(accessor))));
98
- lifecycleService.phase = 2 ;
99
- });
100
- await instantiationService.invokeFunction(async (accessor) => {
101
- await Promise.all(( serviceInitializePostParticipants.map(participant => participant(accessor))));
102
- });
103
- return instantiationService;
76
+ await startup(instantiationService);
104
77
  }
105
- const renderWorkbenchEmitter = new Emitter();
106
- const onRenderWorkbench = renderWorkbenchEmitter.event;
107
- const serviceInitializedBarrier = new Barrier();
108
78
  async function getService(identifier) {
109
79
  await serviceInitializedBarrier.wait();
110
80
  return StandaloneServices.get(identifier);
111
81
  }
112
- async function initialize(overrides) {
113
- const instantiationService = await initServices(overrides);
114
- serviceInitializedBarrier.open();
115
- instantiationService.invokeFunction(accessor => {
116
- const lifecycleService = accessor.get(ILifecycleService);
117
- ( Registry.as(Extensions.Workbench)).start(accessor);
118
- renderWorkbenchEmitter.fire(accessor);
119
- lifecycleService.phase = 3 ;
120
- const eventuallyPhaseScheduler = new RunOnceScheduler(() => {
121
- runWhenIdle(() => {
122
- lifecycleService.phase = 4 ;
123
- }, 2500);
124
- }, 2500);
125
- eventuallyPhaseScheduler.schedule();
126
- });
127
- }
128
- export { getService, initialize, onRenderWorkbench, registerServiceInitializeParticipant, registerServiceInitializePostParticipant, registerServiceInitializePreParticipant };
82
+ export { getService, initialize };
@@ -0,0 +1,52 @@
1
+ import { getErrorMessage } from 'monaco-editor/esm/vs/base/common/errors.js';
2
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
3
+ import { Disposable, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
4
+ class BroadcastDataChannel extends Disposable {
5
+ constructor(channelName) {
6
+ super();
7
+ this.channelName = channelName;
8
+ this._onDidReceiveData = this._register(( new Emitter()));
9
+ this.onDidReceiveData = this._onDidReceiveData.event;
10
+ if ('BroadcastChannel' in window) {
11
+ try {
12
+ this.broadcastChannel = ( new BroadcastChannel(channelName));
13
+ const listener = (event) => {
14
+ this._onDidReceiveData.fire(event.data);
15
+ };
16
+ this.broadcastChannel.addEventListener('message', listener);
17
+ this._register(toDisposable(() => {
18
+ if (this.broadcastChannel) {
19
+ this.broadcastChannel.removeEventListener('message', listener);
20
+ this.broadcastChannel.close();
21
+ }
22
+ }));
23
+ }
24
+ catch (error) {
25
+ console.warn('Error while creating broadcast channel. Falling back to localStorage.', getErrorMessage(error));
26
+ }
27
+ }
28
+ if (!this.broadcastChannel) {
29
+ this.channelName = `BroadcastDataChannel.${channelName}`;
30
+ this.createBroadcastChannel();
31
+ }
32
+ }
33
+ createBroadcastChannel() {
34
+ const listener = (event) => {
35
+ if (event.key === this.channelName && event.newValue) {
36
+ this._onDidReceiveData.fire(JSON.parse(event.newValue));
37
+ }
38
+ };
39
+ window.addEventListener('storage', listener);
40
+ this._register(toDisposable(() => window.removeEventListener('storage', listener)));
41
+ }
42
+ postData(data) {
43
+ if (this.broadcastChannel) {
44
+ this.broadcastChannel.postMessage(data);
45
+ }
46
+ else {
47
+ window.localStorage.removeItem(this.channelName);
48
+ window.localStorage.setItem(this.channelName, JSON.stringify(data));
49
+ }
50
+ }
51
+ }
52
+ export { BroadcastDataChannel };
@@ -1,7 +1,44 @@
1
+ import { Event } from '../../../common/event.js';
2
+ import { IDisposable } from '../../../common/lifecycle.js';
3
+
1
4
  interface IStorageItemsChangeEvent {
2
5
  readonly changed?: Map<string, string>;
3
6
  readonly deleted?: Set<string>;
4
7
  }
8
+ interface IStorageChangeEvent {
9
+ /**
10
+ * The `key` of the storage entry that was changed
11
+ * or was removed.
12
+ */
13
+ readonly key: string;
14
+ /**
15
+ * A hint how the storage change event was triggered. If
16
+ * `true`, the storage change was triggered by an external
17
+ * source, such as:
18
+ * - another process (for example another window)
19
+ * - operations such as settings sync or profiles change
20
+ */
21
+ readonly external?: boolean;
22
+ }
5
23
  type StorageValue = string | boolean | number | undefined | null | object;
24
+ interface IStorage extends IDisposable {
25
+ readonly onDidChangeStorage: Event<IStorageChangeEvent>;
26
+ readonly items: Map<string, string>;
27
+ readonly size: number;
28
+ init(): Promise<void>;
29
+ get(key: string, fallbackValue: string): string;
30
+ get(key: string, fallbackValue?: string): string | undefined;
31
+ getBoolean(key: string, fallbackValue: boolean): boolean;
32
+ getBoolean(key: string, fallbackValue?: boolean): boolean | undefined;
33
+ getNumber(key: string, fallbackValue: number): number;
34
+ getNumber(key: string, fallbackValue?: number): number | undefined;
35
+ getObject<T extends object>(key: string, fallbackValue: T): T;
36
+ getObject<T extends object>(key: string, fallbackValue?: T): T | undefined;
37
+ set(key: string, value: StorageValue, external?: boolean): Promise<void>;
38
+ delete(key: string, external?: boolean): Promise<void>;
39
+ flush(delay?: number): Promise<void>;
40
+ whenFlushed(): Promise<void>;
41
+ close(): Promise<void>;
42
+ }
6
43
 
7
- export { IStorageItemsChangeEvent, StorageValue };
44
+ export { IStorage, IStorageChangeEvent, IStorageItemsChangeEvent, StorageValue };
@@ -1,14 +1,8 @@
1
- import { Event } from '../../base/common/event.js';
1
+ import * as monaco from 'monaco-editor';
2
2
  import { UriComponents } from '../../base/common/uri.js';
3
- import { IDisposable } from '../../base/common/lifecycle.js';
4
3
  import { ThemeColor } from '../../base/common/themables.js';
5
- import { IEditorOptions } from './config/editorOptions.js';
6
- import { IDimension } from './core/dimension.js';
7
- import { IPosition, Position } from './core/position.js';
8
- import { IRange, Range } from './core/range.js';
9
- import { Selection, ISelection } from './core/selection.js';
10
- import { IModelDeltaDecoration, IModelDecorationsChangeAccessor, IModelDecoration, TrackedRangeStickiness, OverviewRulerLane, ITextModel } from './model.js';
11
- import { IModelDecorationsChangedEvent } from './textModelEvents.js';
4
+ import { IPosition } from './core/position.js';
5
+ import { TrackedRangeStickiness, OverviewRulerLane, ITextModel } from './model.js';
12
6
 
13
7
  /**
14
8
  * A model for the diff editor.
@@ -27,14 +21,6 @@ interface IDiffEditorViewModel {
27
21
  readonly model: IDiffEditorModel;
28
22
  waitForDiff(): Promise<void>;
29
23
  }
30
- interface IEditorAction {
31
- readonly id: string;
32
- readonly label: string;
33
- readonly alias: string;
34
- isSupported(): boolean;
35
- run(args?: unknown): Promise<void>;
36
- }
37
- type IEditorModel = ITextModel | IDiffEditorModel | IDiffEditorViewModel;
38
24
  /**
39
25
  * A (serializable) state of the cursors.
40
26
  */
@@ -73,247 +59,10 @@ interface IDiffEditorViewState {
73
59
  modified: ICodeEditorViewState | null;
74
60
  modelState?: unknown;
75
61
  }
76
- /**
77
- * An editor view state.
78
- */
79
- type IEditorViewState = ICodeEditorViewState | IDiffEditorViewState;
80
- declare const enum ScrollType {
81
- Smooth = 0,
82
- Immediate = 1
83
- }
84
62
  /**
85
63
  * An editor.
86
64
  */
87
- interface IEditor {
88
- /**
89
- * An event emitted when the editor has been disposed.
90
- * @event
91
- */
92
- onDidDispose(listener: () => void): IDisposable;
93
- /**
94
- * Dispose the editor.
95
- */
96
- dispose(): void;
97
- /**
98
- * Get a unique id for this editor instance.
99
- */
100
- getId(): string;
101
- /**
102
- * Get the editor type. Please see `EditorType`.
103
- * This is to avoid an instanceof check
104
- */
105
- getEditorType(): string;
106
- /**
107
- * Update the editor's options after the editor has been created.
108
- */
109
- updateOptions(newOptions: IEditorOptions): void;
110
- /**
111
- * Indicates that the editor becomes visible.
112
- * @internal
113
- */
114
- onVisible(): void;
115
- /**
116
- * Indicates that the editor becomes hidden.
117
- * @internal
118
- */
119
- onHide(): void;
120
- /**
121
- * Instructs the editor to remeasure its container. This method should
122
- * be called when the container of the editor gets resized.
123
- *
124
- * If a dimension is passed in, the passed in value will be used.
125
- */
126
- layout(dimension?: IDimension): void;
127
- /**
128
- * Brings browser focus to the editor text
129
- */
130
- focus(): void;
131
- /**
132
- * Returns true if the text inside this editor is focused (i.e. cursor is blinking).
133
- */
134
- hasTextFocus(): boolean;
135
- /**
136
- * Returns all actions associated with this editor.
137
- */
138
- getSupportedActions(): IEditorAction[];
139
- /**
140
- * Saves current view state of the editor in a serializable object.
141
- */
142
- saveViewState(): IEditorViewState | null;
143
- /**
144
- * Restores the view state of the editor from a serializable object generated by `saveViewState`.
145
- */
146
- restoreViewState(state: IEditorViewState | null): void;
147
- /**
148
- * Given a position, returns a column number that takes tab-widths into account.
149
- */
150
- getVisibleColumnFromPosition(position: IPosition): number;
151
- /**
152
- * Given a position, returns a column number that takes tab-widths into account.
153
- * @internal
154
- */
155
- getStatusbarColumn(position: IPosition): number;
156
- /**
157
- * Returns the primary position of the cursor.
158
- */
159
- getPosition(): Position | null;
160
- /**
161
- * Set the primary position of the cursor. This will remove any secondary cursors.
162
- * @param position New primary cursor's position
163
- * @param source Source of the call that caused the position
164
- */
165
- setPosition(position: IPosition, source?: string): void;
166
- /**
167
- * Scroll vertically as necessary and reveal a line.
168
- */
169
- revealLine(lineNumber: number, scrollType?: ScrollType): void;
170
- /**
171
- * Scroll vertically as necessary and reveal a line centered vertically.
172
- */
173
- revealLineInCenter(lineNumber: number, scrollType?: ScrollType): void;
174
- /**
175
- * Scroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport.
176
- */
177
- revealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void;
178
- /**
179
- * Scroll vertically as necessary and reveal a line close to the top of the viewport,
180
- * optimized for viewing a code definition.
181
- */
182
- revealLineNearTop(lineNumber: number, scrollType?: ScrollType): void;
183
- /**
184
- * Scroll vertically or horizontally as necessary and reveal a position.
185
- */
186
- revealPosition(position: IPosition, scrollType?: ScrollType): void;
187
- /**
188
- * Scroll vertically or horizontally as necessary and reveal a position centered vertically.
189
- */
190
- revealPositionInCenter(position: IPosition, scrollType?: ScrollType): void;
191
- /**
192
- * Scroll vertically or horizontally as necessary and reveal a position centered vertically only if it lies outside the viewport.
193
- */
194
- revealPositionInCenterIfOutsideViewport(position: IPosition, scrollType?: ScrollType): void;
195
- /**
196
- * Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport,
197
- * optimized for viewing a code definition.
198
- */
199
- revealPositionNearTop(position: IPosition, scrollType?: ScrollType): void;
200
- /**
201
- * Returns the primary selection of the editor.
202
- */
203
- getSelection(): Selection | null;
204
- /**
205
- * Returns all the selections of the editor.
206
- */
207
- getSelections(): Selection[] | null;
208
- /**
209
- * Set the primary selection of the editor. This will remove any secondary cursors.
210
- * @param selection The new selection
211
- * @param source Source of the call that caused the selection
212
- */
213
- setSelection(selection: IRange, source?: string): void;
214
- /**
215
- * Set the primary selection of the editor. This will remove any secondary cursors.
216
- * @param selection The new selection
217
- * @param source Source of the call that caused the selection
218
- */
219
- setSelection(selection: Range, source?: string): void;
220
- /**
221
- * Set the primary selection of the editor. This will remove any secondary cursors.
222
- * @param selection The new selection
223
- * @param source Source of the call that caused the selection
224
- */
225
- setSelection(selection: ISelection, source?: string): void;
226
- /**
227
- * Set the primary selection of the editor. This will remove any secondary cursors.
228
- * @param selection The new selection
229
- * @param source Source of the call that caused the selection
230
- */
231
- setSelection(selection: Selection, source?: string): void;
232
- /**
233
- * Set the selections for all the cursors of the editor.
234
- * Cursors will be removed or added, as necessary.
235
- * @param selections The new selection
236
- * @param source Source of the call that caused the selection
237
- */
238
- setSelections(selections: readonly ISelection[], source?: string): void;
239
- /**
240
- * Scroll vertically as necessary and reveal lines.
241
- */
242
- revealLines(startLineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;
243
- /**
244
- * Scroll vertically as necessary and reveal lines centered vertically.
245
- */
246
- revealLinesInCenter(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;
247
- /**
248
- * Scroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport.
249
- */
250
- revealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;
251
- /**
252
- * Scroll vertically as necessary and reveal lines close to the top of the viewport,
253
- * optimized for viewing a code definition.
254
- */
255
- revealLinesNearTop(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;
256
- /**
257
- * Scroll vertically or horizontally as necessary and reveal a range.
258
- */
259
- revealRange(range: IRange, scrollType?: ScrollType): void;
260
- /**
261
- * Scroll vertically or horizontally as necessary and reveal a range centered vertically.
262
- */
263
- revealRangeInCenter(range: IRange, scrollType?: ScrollType): void;
264
- /**
265
- * Scroll vertically or horizontally as necessary and reveal a range at the top of the viewport.
266
- */
267
- revealRangeAtTop(range: IRange, scrollType?: ScrollType): void;
268
- /**
269
- * Scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport.
270
- */
271
- revealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void;
272
- /**
273
- * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport,
274
- * optimized for viewing a code definition.
275
- */
276
- revealRangeNearTop(range: IRange, scrollType?: ScrollType): void;
277
- /**
278
- * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport,
279
- * optimized for viewing a code definition. Only if it lies outside the viewport.
280
- */
281
- revealRangeNearTopIfOutsideViewport(range: IRange, scrollType?: ScrollType): void;
282
- /**
283
- * Directly trigger a handler or an editor action.
284
- * @param source The source of the call.
285
- * @param handlerId The id of the handler or the id of a contribution.
286
- * @param payload Extra data to be sent to the handler.
287
- */
288
- trigger(source: string | null | undefined, handlerId: string, payload: any): void;
289
- /**
290
- * Gets the current model attached to this editor.
291
- */
292
- getModel(): IEditorModel | null;
293
- /**
294
- * Sets the current model attached to this editor.
295
- * If the previous model was created by the editor via the value key in the options
296
- * literal object, it will be destroyed. Otherwise, if the previous model was set
297
- * via setModel, or the model key in the options literal object, the previous model
298
- * will not be destroyed.
299
- * It is safe to call setModel(null) to simply detach the current model from the editor.
300
- */
301
- setModel(model: IEditorModel | null): void;
302
- /**
303
- * Create a collection of decorations. All decorations added through this collection
304
- * will get the ownerId of the editor (meaning they will not show up in other editors).
305
- * These decorations will be automatically cleared when the editor's model changes.
306
- */
307
- createDecorationsCollection(decorations?: IModelDeltaDecoration[]): IEditorDecorationsCollection;
308
- /**
309
- * Change the decorations. All decorations added through this changeAccessor
310
- * will get the ownerId of the editor (meaning they will not show up in other
311
- * editors).
312
- * @see {@link ITextModel.changeDecorations}
313
- * @internal
314
- */
315
- changeDecorations(callback: (changeAccessor: IModelDecorationsChangeAccessor) => any): any;
316
- }
65
+ type IEditor = monaco.editor.IEditor
317
66
  /**
318
67
  * A diff editor.
319
68
  *
@@ -333,40 +82,6 @@ interface IDiffEditor extends IEditor {
333
82
  */
334
83
  getModifiedEditor(): IEditor;
335
84
  }
336
- /**
337
- * A collection of decorations
338
- */
339
- interface IEditorDecorationsCollection {
340
- /**
341
- * An event emitted when decorations change in the editor,
342
- * but the change is not caused by us setting or clearing the collection.
343
- */
344
- onDidChange: Event<IModelDecorationsChangedEvent>;
345
- /**
346
- * Get the decorations count.
347
- */
348
- length: number;
349
- /**
350
- * Get the range for a decoration.
351
- */
352
- getRange(index: number): Range | null;
353
- /**
354
- * Get all ranges for decorations.
355
- */
356
- getRanges(): Range[];
357
- /**
358
- * Determine if a decoration is in this collection.
359
- */
360
- has(decoration: IModelDecoration): boolean;
361
- /**
362
- * Replace all previous decorations with `newDecorations`.
363
- */
364
- set(newDecorations: readonly IModelDeltaDecoration[]): string[];
365
- /**
366
- * Remove all previous decorations.
367
- */
368
- clear(): void;
369
- }
370
85
  /**
371
86
  * An editor contribution that gets created every time a new editor gets created and gets disposed when the editor gets disposed.
372
87
  */
@@ -465,4 +180,4 @@ interface IDecorationRenderOptions extends IThemeDecorationRenderOptions {
465
180
  dark?: IThemeDecorationRenderOptions;
466
181
  }
467
182
 
468
- export { ICodeEditorViewState, IContentDecorationRenderOptions, ICursorState, IDecorationRenderOptions, IDiffEditor, IDiffEditorModel, IDiffEditorViewModel, IDiffEditorViewState, IEditor, IEditorAction, IEditorContribution, IEditorDecorationsCollection, IEditorModel, IEditorViewState, IThemeDecorationRenderOptions, IViewState, ScrollType };
183
+ export { ICodeEditorViewState, IContentDecorationRenderOptions, ICursorState, IDecorationRenderOptions, IDiffEditor, IDiffEditorModel, IDiffEditorViewModel, IDiffEditorViewState, IEditor, IEditorContribution, IThemeDecorationRenderOptions, IViewState };
@@ -238,27 +238,6 @@ interface IModelDeltaDecoration {
238
238
  */
239
239
  options: IModelDecorationOptions;
240
240
  }
241
- /**
242
- * A decoration in the model.
243
- */
244
- interface IModelDecoration {
245
- /**
246
- * Identifier for a decoration.
247
- */
248
- readonly id: string;
249
- /**
250
- * Identifier for a decoration's owner.
251
- */
252
- readonly ownerId: number;
253
- /**
254
- * Range that this decoration covers.
255
- */
256
- readonly range: Range;
257
- /**
258
- * Options associated with this decoration.
259
- */
260
- readonly options: IModelDecorationOptions;
261
- }
262
241
  /**
263
242
  * An accessor that can add, change or remove model decorations.
264
243
  * @internal
@@ -541,4 +520,4 @@ interface IInternalModelContentChange extends IModelContentChange {
541
520
  forceMoveMarkers: boolean;
542
521
  }
543
522
 
544
- export { ApplyEditsResult, BracketPairColorizationOptions, DefaultEndOfLine, EndOfLinePreference, EndOfLineSequence, FindMatch, GlyphMarginLane, IDecorationOptions, IIdentifiedSingleEditOperation, IInternalModelContentChange, IModelDecoration, IModelDecorationGlyphMarginOptions, IModelDecorationMinimapOptions, IModelDecorationOptions, IModelDecorationOverviewRulerOptions, IModelDecorationsChangeAccessor, IModelDeltaDecoration, IReadonlyTextBuffer, ISingleEditOperationIdentifier, ITextBuffer, ITextBufferFactory, ITextModel, ITextModelCreationOptions, ITextSnapshot, IValidEditOperation, InjectedTextCursorStops, InjectedTextOptions, MinimapPosition, OverviewRulerLane, SearchData, TrackedRangeStickiness, ValidAnnotatedEditOperation };
523
+ export { ApplyEditsResult, BracketPairColorizationOptions, DefaultEndOfLine, EndOfLinePreference, EndOfLineSequence, FindMatch, GlyphMarginLane, IDecorationOptions, IIdentifiedSingleEditOperation, IInternalModelContentChange, IModelDecorationGlyphMarginOptions, IModelDecorationMinimapOptions, IModelDecorationOptions, IModelDecorationOverviewRulerOptions, IModelDecorationsChangeAccessor, IModelDeltaDecoration, IReadonlyTextBuffer, ISingleEditOperationIdentifier, ITextBuffer, ITextBufferFactory, ITextModel, ITextModelCreationOptions, ITextSnapshot, IValidEditOperation, InjectedTextCursorStops, InjectedTextOptions, MinimapPosition, OverviewRulerLane, SearchData, TrackedRangeStickiness, ValidAnnotatedEditOperation };
@@ -18,13 +18,5 @@ interface IModelContentChange {
18
18
  */
19
19
  readonly text: string;
20
20
  }
21
- /**
22
- * An event describing that model decorations have changed.
23
- */
24
- interface IModelDecorationsChangedEvent {
25
- readonly affectsMinimap: boolean;
26
- readonly affectsOverviewRuler: boolean;
27
- readonly affectsGlyphMargin: boolean;
28
- }
29
21
 
30
- export { IModelContentChange, IModelDecorationsChangedEvent };
22
+ export { IModelContentChange };
@@ -1,6 +1,7 @@
1
1
  import { ServiceIdentifier } from '../../instantiation/common/instantiation.js';
2
2
  import { Event } from '../../../base/common/event.js';
3
- import { StorageValue } from '../../../base/parts/storage/common/storage.js';
3
+ import { Disposable } from '../../../base/common/lifecycle.js';
4
+ import { StorageValue, IStorageChangeEvent, IStorage } from '../../../base/parts/storage/common/storage.js';
4
5
  import { IUserDataProfile } from '../../userDataProfile/common/userDataProfile.js';
5
6
  import { IAnyWorkspaceIdentifier } from '../../workspace/common/workspace.js';
6
7
 
@@ -216,5 +217,63 @@ interface IStorageTargetChangeEvent {
216
217
  */
217
218
  readonly scope: StorageScope;
218
219
  }
220
+ interface IStorageServiceOptions {
221
+ readonly flushInterval: number;
222
+ }
223
+ declare abstract class AbstractStorageService extends Disposable implements IStorageService {
224
+ private readonly options;
225
+ readonly _serviceBrand: undefined;
226
+ private static DEFAULT_FLUSH_INTERVAL;
227
+ private readonly _onDidChangeValue;
228
+ readonly onDidChangeValue: Event<IStorageValueChangeEvent>;
229
+ private readonly _onDidChangeTarget;
230
+ readonly onDidChangeTarget: Event<IStorageTargetChangeEvent>;
231
+ private readonly _onWillSaveState;
232
+ readonly onWillSaveState: Event<IWillSaveStateEvent>;
233
+ private initializationPromise;
234
+ private readonly flushWhenIdleScheduler;
235
+ private readonly runFlushWhenIdle;
236
+ constructor(options?: IStorageServiceOptions);
237
+ private doFlushWhenIdle;
238
+ protected shouldFlushWhenIdle(): boolean;
239
+ protected stopFlushWhenIdle(): void;
240
+ initialize(): Promise<void>;
241
+ protected emitDidChangeValue(scope: StorageScope, event: IStorageChangeEvent): void;
242
+ protected emitWillSaveState(reason: WillSaveStateReason): void;
243
+ get(key: string, scope: StorageScope, fallbackValue: string): string;
244
+ get(key: string, scope: StorageScope): string | undefined;
245
+ getBoolean(key: string, scope: StorageScope, fallbackValue: boolean): boolean;
246
+ getBoolean(key: string, scope: StorageScope): boolean | undefined;
247
+ getNumber(key: string, scope: StorageScope, fallbackValue: number): number;
248
+ getNumber(key: string, scope: StorageScope): number | undefined;
249
+ getObject(key: string, scope: StorageScope, fallbackValue: object): object;
250
+ getObject(key: string, scope: StorageScope): object | undefined;
251
+ storeAll(entries: Array<IStorageEntry>, external: boolean): void;
252
+ store(key: string, value: StorageValue, scope: StorageScope, target: StorageTarget, external?: boolean): void;
253
+ remove(key: string, scope: StorageScope, external?: boolean): void;
254
+ private withPausedEmitters;
255
+ keys(scope: StorageScope, target: StorageTarget): string[];
256
+ private updateKeyTarget;
257
+ private _workspaceKeyTargets;
258
+ private get workspaceKeyTargets();
259
+ private _profileKeyTargets;
260
+ private get profileKeyTargets();
261
+ private _applicationKeyTargets;
262
+ private get applicationKeyTargets();
263
+ private getKeyTargets;
264
+ private loadKeyTargets;
265
+ isNew(scope: StorageScope): boolean;
266
+ flush(reason?: WillSaveStateReason): Promise<void>;
267
+ log(): Promise<void>;
268
+ switch(to: IAnyWorkspaceIdentifier | IUserDataProfile, preserveData: boolean): Promise<void>;
269
+ protected canSwitchProfile(from: IUserDataProfile, to: IUserDataProfile): boolean;
270
+ protected switchData(oldStorage: Map<string, string>, newStorage: IStorage, scope: StorageScope): void;
271
+ abstract hasScope(scope: IAnyWorkspaceIdentifier | IUserDataProfile): boolean;
272
+ protected abstract doInitialize(): Promise<void>;
273
+ protected abstract getStorage(scope: StorageScope): IStorage | undefined;
274
+ protected abstract getLogDetails(scope: StorageScope): string | undefined;
275
+ protected abstract switchToProfile(toProfile: IUserDataProfile, preserveData: boolean): Promise<void>;
276
+ protected abstract switchToWorkspace(toWorkspace: IAnyWorkspaceIdentifier | IUserDataProfile, preserveData: boolean): Promise<void>;
277
+ }
219
278
 
220
- export { IStorageEntry, IStorageService, IStorageTargetChangeEvent, IStorageValueChangeEvent, IWillSaveStateEvent, StorageScope, StorageTarget, WillSaveStateReason };
279
+ export { AbstractStorageService, IStorageEntry, IStorageService, IStorageServiceOptions, IStorageTargetChangeEvent, IStorageValueChangeEvent, IWillSaveStateEvent, StorageScope, StorageTarget, WillSaveStateReason };
@@ -1,6 +1,17 @@
1
1
  import { refineServiceDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
2
2
  import { ILayoutService } from 'monaco-editor/esm/vs/platform/layout/browser/layoutService.js';
3
3
  const IWorkbenchLayoutService = refineServiceDecorator(ILayoutService);
4
+ var Parts;
5
+ ( (function(Parts) {
6
+ Parts["TITLEBAR_PART"] = "workbench.parts.titlebar";
7
+ Parts["BANNER_PART"] = "workbench.parts.banner";
8
+ Parts["ACTIVITYBAR_PART"] = "workbench.parts.activitybar";
9
+ Parts["SIDEBAR_PART"] = "workbench.parts.sidebar";
10
+ Parts["PANEL_PART"] = "workbench.parts.panel";
11
+ Parts["AUXILIARYBAR_PART"] = "workbench.parts.auxiliarybar";
12
+ Parts["EDITOR_PART"] = "workbench.parts.editor";
13
+ Parts["STATUSBAR_PART"] = "workbench.parts.statusbar";
14
+ })(Parts || (Parts = {})));
4
15
  function positionToString(position) {
5
16
  switch (position) {
6
17
  case 0 : return 'left';
@@ -9,4 +20,4 @@ function positionToString(position) {
9
20
  default: return 'bottom';
10
21
  }
11
22
  }
12
- export { IWorkbenchLayoutService, positionToString };
23
+ export { IWorkbenchLayoutService, Parts, positionToString };