@codingame/monaco-vscode-api 1.76.0-next.1 → 1.76.0-next.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.
package/dist/extHost.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { _ as __decorate, a as __param, E as Emitter$1, c as __classPrivateFieldSet, d as __classPrivateFieldGet } from './contextkey.js';
2
2
  import { l as checkProposedApiEnabled, u as unsupported, c as IExtensionService, m as ILoggerService, n as isLogLevel, i as isProposedApiEnabled } from './missing-services.js';
3
3
  import { b as IEditorService, I as IEditorGroupsService, h as IProductService, B as FileSystemProviderErrorCode, P as markAsFileSystemProviderError, A as ACTIVE_GROUP, p as SIDE_GROUP, Q as preferredSideBySideGroupDirection, S as Services, k as IUriIdentityService, f as IPaneCompositePartService, j as ITextFileService, c as IFileService, l as IWorkbenchEnvironmentService, m as IWorkingCopyFileService, g as IPathService, e as ILanguageStatusService, d as IHostService } from './services2.js';
4
- import { z as disposed, h as isStringArray, w as withUndefinedAsNull, A as mapArrayOrNot, B as delta$1, C as readonly, D as NotImplementedError, E as encodeBase64 } from './polyfill.js';
4
+ import { z as disposed, h as isStringArray, w as withUndefinedAsNull, B as mapArrayOrNot, C as delta$1, D as readonly, E as NotImplementedError, F as encodeBase64 } from './polyfill.js';
5
5
  import { illegalArgument, canceled, transformErrorForSerialization, CancellationError, onUnexpectedError, onUnexpectedExternalError, isCancellationError } from 'monaco-editor/esm/vs/base/common/errors.js';
6
6
  import { coalesceInPlace, equals as equals$1, coalesce, isNonEmptyArray, isFalsyOrEmpty, asArray, distinct } from 'monaco-editor/esm/vs/base/common/arrays.js';
7
7
  import { URI, uriToFsPath } from 'monaco-editor/esm/vs/base/common/uri.js';
@@ -11,10 +11,10 @@ import { compare, equalsIgnoreCase, isFalsyOrWhitespace, nextCharLength, splitLi
11
11
  import { Mimes } from 'monaco-editor/esm/vs/base/common/mime.js';
12
12
  import { ResourceMap as ResourceMap$1 } from 'monaco-editor/esm/vs/base/common/map.js';
13
13
  import { MarkdownString as MarkdownString$2, parseHrefAndDimensions, isMarkdownString } from 'monaco-editor/esm/vs/base/common/htmlContent.js';
14
- import { marked as marked$1 } from 'monaco-editor/esm/vs/base/common/marked/marked.js';
15
14
  import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
16
15
  import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
17
16
  import { MarkerSeverity, IMarkerService } from 'monaco-editor/esm/vs/platform/markers/common/markers.js';
17
+ import { marked } from 'monaco-editor/esm/vs/base/common/marked/marked.js';
18
18
  import { revive, parse } from 'monaco-editor/esm/vs/base/common/marshalling.js';
19
19
  import { equals, mixin, cloneAndChange, deepFreeze, deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
20
20
  import { once } from 'monaco-editor/esm/vs/base/common/functional.js';
@@ -4186,7 +4186,6 @@ function cursorStyleToString(cursorStyle) {
4186
4186
  case TextEditorCursorStyle.UnderlineThin: return 'underline-thin';
4187
4187
  }
4188
4188
  }
4189
- const marked = marked$1.marked;
4190
4189
  var Selection$1;
4191
4190
  ( ((function(Selection) {
4192
4191
  function to(selection) {
@@ -1,5 +1,5 @@
1
1
  import { _ as __decorate, a as __param, E as Emitter } from './contextkey.js';
2
- import { w as withUndefinedAsNull } from './polyfill.js';
2
+ import { w as withUndefinedAsNull, A as AsyncReferenceCollection, R as ReferenceCollection } from './polyfill.js';
3
3
  import { L as LanguageDetectionLanguageEventSource, a as ILanguageDetectionService, u as unsupported } from './missing-services.js';
4
4
  import { MutableDisposable, Disposable, ImmortalReference, dispose, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
5
5
  import { ThrottledDelayer } from 'monaco-editor/esm/vs/base/common/async.js';
@@ -12,7 +12,6 @@ import { b as IEditorService, p as SIDE_GROUP, A as ACTIVE_GROUP, c as IFileServ
12
12
  import { MultiModelEditStackElement } from 'monaco-editor/esm/vs/editor/common/model/editStack.js';
13
13
  import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
14
14
  import { IUndoRedoService } from 'monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js';
15
- import { once } from 'monaco-editor/esm/vs/base/common/functional.js';
16
15
  import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
17
16
  import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
18
17
  import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
@@ -26,46 +25,6 @@ import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/comm
26
25
  import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
27
26
  import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
28
27
  import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
29
- class ReferenceCollection {
30
- constructor() {
31
- this.references = ( (new Map()));
32
- }
33
- acquire(key, ...args) {
34
- let reference = this.references.get(key);
35
- if (!reference) {
36
- reference = { counter: 0, object: this.createReferencedObject(key, ...args) };
37
- this.references.set(key, reference);
38
- }
39
- const { object } = reference;
40
- const dispose = once(() => {
41
- if (--reference.counter === 0) {
42
- this.destroyReferencedObject(key, reference.object);
43
- this.references.delete(key);
44
- }
45
- });
46
- reference.counter++;
47
- return { object, dispose };
48
- }
49
- }
50
- class AsyncReferenceCollection {
51
- constructor(referenceCollection) {
52
- this.referenceCollection = referenceCollection;
53
- }
54
- async acquire(key, ...args) {
55
- const ref = this.referenceCollection.acquire(key, ...args);
56
- try {
57
- const object = await ref.object;
58
- return {
59
- object,
60
- dispose: () => ref.dispose()
61
- };
62
- }
63
- catch (error) {
64
- ref.dispose();
65
- throw error;
66
- }
67
- }
68
- }
69
28
  function isResolvedTextEditorModel(model) {
70
29
  const candidate = model;
71
30
  return !!candidate.textEditorModel;
package/dist/polyfill.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VSBuffer as VSBuffer$1 } from 'monaco-editor/esm/vs/base/common/buffer.js';
2
- import { Disposable, DisposableStore, dispose, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
2
+ import { Disposable, DisposableMap as DisposableMap$1, DisposableStore, dispose as dispose$1, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
3
  import { ErrorHandler as ErrorHandler$1, illegalArgument, onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
4
4
  import { Themable as Themable$1 } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
5
5
  import { ProgressBar as ProgressBar$1 } from 'monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.js';
@@ -46,6 +46,8 @@ import { MultiplexLogger, ILogService } from 'monaco-editor/esm/vs/platform/log/
46
46
  import { SnippetParser } from 'monaco-editor/esm/vs/editor/contrib/snippet/browser/snippetParser.js';
47
47
  import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
48
48
  import { Keybinding as Keybinding$1, KeyCodeChord as KeyCodeChord$1 } from 'monaco-editor/esm/vs/base/common/keybindings.js';
49
+ import { Iterable } from 'monaco-editor/esm/vs/base/common/iterator.js';
50
+ import { once } from 'monaco-editor/esm/vs/base/common/functional.js';
49
51
  import { QuickInputController } from 'monaco-editor/esm/vs/platform/quickinput/browser/quickInput.js';
50
52
  import { getSingletonServiceDescriptors } from 'monaco-editor/esm/vs/platform/instantiation/common/extensions.js';
51
53
  import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
@@ -128,6 +130,117 @@ class ErrorNoTelemetry extends Error {
128
130
  return err.name === 'CodeExpectedError';
129
131
  }
130
132
  }
133
+ function dispose(arg) {
134
+ if (Iterable.is(arg)) {
135
+ const errors = [];
136
+ for (const d of arg) {
137
+ if (d) {
138
+ try {
139
+ d.dispose();
140
+ }
141
+ catch (e) {
142
+ errors.push(e);
143
+ }
144
+ }
145
+ }
146
+ if (errors.length === 1) {
147
+ throw errors[0];
148
+ }
149
+ else if (errors.length > 1) {
150
+ throw new AggregateError(errors, 'Encountered errors while disposing of store');
151
+ }
152
+ return Array.isArray(arg) ? [] : arg;
153
+ }
154
+ else if (arg) {
155
+ arg.dispose();
156
+ return arg;
157
+ }
158
+ }
159
+ class ReferenceCollection {
160
+ constructor() {
161
+ this.references = ( (new Map()));
162
+ }
163
+ acquire(key, ...args) {
164
+ let reference = this.references.get(key);
165
+ if (!reference) {
166
+ reference = { counter: 0, object: this.createReferencedObject(key, ...args) };
167
+ this.references.set(key, reference);
168
+ }
169
+ const { object } = reference;
170
+ const dispose = once(() => {
171
+ if (--reference.counter === 0) {
172
+ this.destroyReferencedObject(key, reference.object);
173
+ this.references.delete(key);
174
+ }
175
+ });
176
+ reference.counter++;
177
+ return { object, dispose };
178
+ }
179
+ }
180
+ class AsyncReferenceCollection {
181
+ constructor(referenceCollection) {
182
+ this.referenceCollection = referenceCollection;
183
+ }
184
+ async acquire(key, ...args) {
185
+ const ref = this.referenceCollection.acquire(key, ...args);
186
+ try {
187
+ const object = await ref.object;
188
+ return {
189
+ object,
190
+ dispose: () => ref.dispose()
191
+ };
192
+ }
193
+ catch (error) {
194
+ ref.dispose();
195
+ throw error;
196
+ }
197
+ }
198
+ }
199
+ class DisposableMap {
200
+ constructor() {
201
+ this._store = ( (new Map()));
202
+ this._isDisposed = false;
203
+ }
204
+ dispose() {
205
+ this._isDisposed = true;
206
+ this.clearAndDisposeAll();
207
+ }
208
+ clearAndDisposeAll() {
209
+ if (!this._store.size) {
210
+ return;
211
+ }
212
+ try {
213
+ dispose(( (this._store.values())));
214
+ }
215
+ finally {
216
+ this._store.clear();
217
+ }
218
+ }
219
+ has(key) {
220
+ return this._store.has(key);
221
+ }
222
+ get(key) {
223
+ return this._store.get(key);
224
+ }
225
+ set(key, value, skipDisposeOnOverwrite = false) {
226
+ if (this._isDisposed) {
227
+ console.warn(( (new Error(
228
+ 'Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!'
229
+ ))).stack);
230
+ }
231
+ if (!skipDisposeOnOverwrite) {
232
+ this._store.get(key)?.dispose();
233
+ }
234
+ this._store.set(key, value);
235
+ }
236
+ deleteAndDispose(key) {
237
+ this._store.get(key)?.dispose();
238
+ this._store.delete(key);
239
+ }
240
+ [Symbol.iterator]() {
241
+ return this._store[Symbol.iterator]();
242
+ }
243
+ }
131
244
  function isReadableStream(obj) {
132
245
  const candidate = obj;
133
246
  if (!candidate) {
@@ -4004,7 +4117,7 @@ class Trait {
4004
4117
  return binarySearch(this.sortedIndexes, index, numericSort) >= 0;
4005
4118
  }
4006
4119
  dispose() {
4007
- dispose(this._onChange);
4120
+ dispose$1(this._onChange);
4008
4121
  }
4009
4122
  }
4010
4123
  class SelectionTrait extends Trait {
@@ -5851,6 +5964,7 @@ polyfillPrototypeSimple(ProgressBar$1.prototype, ProgressBar.prototype);
5851
5964
  polyfillPrototypeSimple(DefaultConfiguration$1.prototype, DefaultConfiguration.prototype);
5852
5965
  polyfillPrototypeSimple(Keybinding$1.prototype, Keybinding.prototype);
5853
5966
  polyfillPrototypeSimple(KeyCodeChord$1.prototype, KeyCodeChord.prototype);
5967
+ polyfillPrototypeSimple(DisposableMap$1.prototype, DisposableMap.prototype);
5854
5968
  Object.defineProperty(DefaultConfiguration$1.prototype, '_onDidChangeConfiguration', {
5855
5969
  get() {
5856
5970
  if (this.__onDidChangeConfiguration == null) {
@@ -5925,4 +6039,4 @@ function toVSCodeColor(value) {
5925
6039
  return value;
5926
6040
  }
5927
6041
  polyfillPrototype(Color$1.prototype, Color.prototype, toMonacoColor, toVSCodeColor);
5928
- export { mapArrayOrNot as A, delta as B, readonly as C, NotImplementedError as D, encodeBase64 as E, IPolicyService as I, NullPolicyService as N, PolicyConfiguration as P, UserSettings as U, assertAllDefined as a, NullPolicyConfiguration as b, parseTree as c, findNodeAtLocation as d, createScanner as e, flatten as f, getNodeType as g, isStringArray as h, index as i, isReadableStream as j, peekStream as k, peekReadable as l, bufferToReadable as m, n, consumeStream as o, parse as p, isReadableBufferedStream as q, listenStream as r, streamToBuffer as s, transform as t, bufferedStreamToBuffer as u, readableToBuffer as v, withUndefinedAsNull as w, newWriteableBufferStream as x, newWriteableStream as y, disposed as z };
6042
+ export { AsyncReferenceCollection as A, mapArrayOrNot as B, delta as C, readonly as D, NotImplementedError as E, encodeBase64 as F, IPolicyService as I, NullPolicyService as N, PolicyConfiguration as P, ReferenceCollection as R, UserSettings as U, assertAllDefined as a, NullPolicyConfiguration as b, parseTree as c, findNodeAtLocation as d, createScanner as e, flatten as f, getNodeType as g, isStringArray as h, index as i, isReadableStream as j, peekStream as k, peekReadable as l, bufferToReadable as m, n, consumeStream as o, parse as p, isReadableBufferedStream as q, listenStream as r, streamToBuffer as s, transform as t, bufferedStreamToBuffer as u, readableToBuffer as v, withUndefinedAsNull as w, newWriteableBufferStream as x, newWriteableStream as y, disposed as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-api",
3
- "version": "1.76.0-next.1",
3
+ "version": "1.76.0-next.2",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor",
6
6
  "keywords": [],
@@ -158,8 +158,8 @@
158
158
  "@types/babel__core": "^7.20.0",
159
159
  "@types/semver": "^7.3.13",
160
160
  "@types/vscode": "~1.76.0",
161
- "@typescript-eslint/eslint-plugin": "^5.54.0",
162
- "@typescript-eslint/parser": "^5.54.0",
161
+ "@typescript-eslint/eslint-plugin": "^5.54.1",
162
+ "@typescript-eslint/parser": "^5.54.1",
163
163
  "eslint": "^8.35.0",
164
164
  "eslint-config-standard": "^17.0.0",
165
165
  "eslint-plugin-import": "^2.27.5",
@@ -168,13 +168,13 @@
168
168
  "eslint-plugin-unused-imports": "^2.0.0",
169
169
  "js-cleanup": "^1.2.0",
170
170
  "recast": "^0.22.0",
171
- "rollup": "^3.18.0",
171
+ "rollup": "^3.19.1",
172
172
  "rollup-plugin-dts": "^5.2.0",
173
173
  "rollup-plugin-styles": "^4.0.0",
174
174
  "semver": "^7.3.8",
175
175
  "ts-node": "^10.9.1",
176
176
  "typescript": "^4.9.5",
177
- "webpack": "^5.75.0",
177
+ "webpack": "^5.76.0",
178
178
  "zx": "^7.2.0"
179
179
  },
180
180
  "dependencies": {},