@codingame/monaco-vscode-api 1.67.5 → 1.67.8-dev.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.
- package/README.md +57 -8
- package/dist/api.js +7254 -2544
- package/dist/services-f1f30499.js +300 -0
- package/dist/services.d.ts +17621 -1846
- package/dist/services.js +21 -27
- package/package.json +25 -31
- package/dist/api.amd.js +0 -11444
- package/dist/api.cjs +0 -11482
- package/dist/services.amd.js +0 -39
- package/dist/services.cjs +0 -39
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
2
|
+
import { IEnvironmentService } from 'monaco-editor/esm/vs/platform/environment/common/environment.js';
|
|
3
|
+
import { VSBuffer as VSBuffer$1 } from 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
4
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
5
|
+
import 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
6
|
+
import 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
7
|
+
import 'monaco-editor/esm/vs/editor/browser/services/bulkEditService.js';
|
|
8
|
+
import 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
9
|
+
import 'monaco-editor/esm/vs/editor/common/languages/language.js';
|
|
10
|
+
import 'monaco-editor/esm/vs/editor/common/languages/languageConfigurationRegistry.js';
|
|
11
|
+
import 'monaco-editor/esm/vs/editor/common/services/editorWorker.js';
|
|
12
|
+
import 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
|
|
13
|
+
import 'monaco-editor/esm/vs/editor/common/services/model.js';
|
|
14
|
+
import 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
|
|
15
|
+
import 'monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js';
|
|
16
|
+
import 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js';
|
|
17
|
+
import 'monaco-editor/esm/vs/platform/markers/common/markers.js';
|
|
18
|
+
import 'monaco-editor/esm/vs/platform/opener/common/opener.js';
|
|
19
|
+
import 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
|
|
20
|
+
import 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
21
|
+
import 'monaco-editor/esm/vs/base/common/severity.js';
|
|
22
|
+
function readonly(name) {
|
|
23
|
+
return name
|
|
24
|
+
? new Error(`readonly property '${name} cannot be changed'`)
|
|
25
|
+
: new Error('readonly property cannot be changed');
|
|
26
|
+
}
|
|
27
|
+
function disposed(what) {
|
|
28
|
+
const result = new Error(`${what} has been disposed`);
|
|
29
|
+
result.name = 'DISPOSED';
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
class ErrorNoTelemetry extends Error {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.logTelemetry = false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function refineServiceDecorator(serviceIdentifier) {
|
|
39
|
+
return serviceIdentifier;
|
|
40
|
+
}
|
|
41
|
+
const IFileService = createDecorator('fileService');
|
|
42
|
+
var FileType;
|
|
43
|
+
(function(FileType) {
|
|
44
|
+
FileType[FileType["Unknown"] = 0] = "Unknown";
|
|
45
|
+
FileType[FileType["File"] = 1] = "File";
|
|
46
|
+
FileType[FileType["Directory"] = 2] = "Directory";
|
|
47
|
+
FileType[FileType["SymbolicLink"] = 64] = "SymbolicLink";
|
|
48
|
+
})(FileType || (FileType = {}));
|
|
49
|
+
var FilePermission;
|
|
50
|
+
(function(FilePermission) {
|
|
51
|
+
FilePermission[FilePermission["Readonly"] = 1] = "Readonly";
|
|
52
|
+
})(FilePermission || (FilePermission = {}));
|
|
53
|
+
var FileSystemProviderErrorCode;
|
|
54
|
+
(function(FileSystemProviderErrorCode) {
|
|
55
|
+
FileSystemProviderErrorCode["FileExists"] = "EntryExists";
|
|
56
|
+
FileSystemProviderErrorCode["FileNotFound"] = "EntryNotFound";
|
|
57
|
+
FileSystemProviderErrorCode["FileNotADirectory"] = "EntryNotADirectory";
|
|
58
|
+
FileSystemProviderErrorCode["FileIsADirectory"] = "EntryIsADirectory";
|
|
59
|
+
FileSystemProviderErrorCode["FileExceedsMemoryLimit"] = "EntryExceedsMemoryLimit";
|
|
60
|
+
FileSystemProviderErrorCode["FileTooLarge"] = "EntryTooLarge";
|
|
61
|
+
FileSystemProviderErrorCode["FileWriteLocked"] = "EntryWriteLocked";
|
|
62
|
+
FileSystemProviderErrorCode["NoPermissions"] = "NoPermissions";
|
|
63
|
+
FileSystemProviderErrorCode["Unavailable"] = "Unavailable";
|
|
64
|
+
FileSystemProviderErrorCode["Unknown"] = "Unknown";
|
|
65
|
+
})(FileSystemProviderErrorCode || (FileSystemProviderErrorCode = {}));
|
|
66
|
+
function markAsFileSystemProviderError(error, code) {
|
|
67
|
+
error.name = code ? `${code} (FileSystemError)` : `FileSystemError`;
|
|
68
|
+
return error;
|
|
69
|
+
}
|
|
70
|
+
class FileOperationError extends ErrorNoTelemetry {
|
|
71
|
+
constructor(message, fileOperationResult, options) {
|
|
72
|
+
super(message);
|
|
73
|
+
this.fileOperationResult = fileOperationResult;
|
|
74
|
+
this.options = options;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const hasBuffer = (typeof Buffer !== 'undefined');
|
|
78
|
+
let textEncoder;
|
|
79
|
+
let textDecoder;
|
|
80
|
+
class VSBuffer {
|
|
81
|
+
constructor(buffer) {
|
|
82
|
+
this.buffer = buffer;
|
|
83
|
+
this.byteLength = this.buffer.byteLength;
|
|
84
|
+
}
|
|
85
|
+
static alloc(byteLength) {
|
|
86
|
+
if (hasBuffer) {
|
|
87
|
+
return (
|
|
88
|
+
new VSBuffer(Buffer.allocUnsafe(byteLength))
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
return (
|
|
93
|
+
new VSBuffer( new Uint8Array(byteLength))
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
static wrap(actual) {
|
|
98
|
+
if (hasBuffer && !(Buffer.isBuffer(actual))) {
|
|
99
|
+
actual = Buffer.from(actual.buffer, actual.byteOffset, actual.byteLength);
|
|
100
|
+
}
|
|
101
|
+
return (
|
|
102
|
+
new VSBuffer(actual)
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
static fromString(source, options) {
|
|
106
|
+
const dontUseNodeBuffer = options?.dontUseNodeBuffer || false;
|
|
107
|
+
if (!dontUseNodeBuffer && hasBuffer) {
|
|
108
|
+
return (
|
|
109
|
+
new VSBuffer(Buffer.from(source))
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
if (!textEncoder) {
|
|
114
|
+
textEncoder = new TextEncoder();
|
|
115
|
+
}
|
|
116
|
+
return (
|
|
117
|
+
new VSBuffer(textEncoder.encode(source))
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
static fromByteArray(source) {
|
|
122
|
+
const result = VSBuffer.alloc(source.length);
|
|
123
|
+
for (let i = 0, len = source.length; i < len; i++) {
|
|
124
|
+
result.buffer[i] = source[i];
|
|
125
|
+
}
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
static concat(buffers, totalLength) {
|
|
129
|
+
if (typeof totalLength === 'undefined') {
|
|
130
|
+
totalLength = 0;
|
|
131
|
+
for (let i = 0, len = buffers.length; i < len; i++) {
|
|
132
|
+
totalLength += buffers[i].byteLength;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const ret = VSBuffer.alloc(totalLength);
|
|
136
|
+
let offset = 0;
|
|
137
|
+
for (let i = 0, len = buffers.length; i < len; i++) {
|
|
138
|
+
const element = buffers[i];
|
|
139
|
+
ret.set(element, offset);
|
|
140
|
+
offset += element.byteLength;
|
|
141
|
+
}
|
|
142
|
+
return ret;
|
|
143
|
+
}
|
|
144
|
+
clone() {
|
|
145
|
+
const result = VSBuffer.alloc(this.byteLength);
|
|
146
|
+
result.set(this);
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
toString() {
|
|
150
|
+
if (hasBuffer) {
|
|
151
|
+
return this.buffer.toString();
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
if (!textDecoder) {
|
|
155
|
+
textDecoder = new TextDecoder();
|
|
156
|
+
}
|
|
157
|
+
return textDecoder.decode(this.buffer);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
slice(start, end) {
|
|
161
|
+
return (
|
|
162
|
+
new VSBuffer(this.buffer.subarray(start, end))
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
set(array, offset) {
|
|
166
|
+
if (array instanceof VSBuffer) {
|
|
167
|
+
this.buffer.set(array.buffer, offset);
|
|
168
|
+
}
|
|
169
|
+
else if (array instanceof Uint8Array) {
|
|
170
|
+
this.buffer.set(array, offset);
|
|
171
|
+
}
|
|
172
|
+
else if (array instanceof ArrayBuffer) {
|
|
173
|
+
this.buffer.set( new Uint8Array(array), offset);
|
|
174
|
+
}
|
|
175
|
+
else if (ArrayBuffer.isView(array)) {
|
|
176
|
+
this.buffer.set( new Uint8Array(array.buffer, array.byteOffset, array.byteLength), offset);
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
throw new Error(`Unknown argument 'array'`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
readUInt32BE(offset) {
|
|
183
|
+
return readUInt32BE(this.buffer, offset);
|
|
184
|
+
}
|
|
185
|
+
writeUInt32BE(value, offset) {
|
|
186
|
+
writeUInt32BE(this.buffer, value, offset);
|
|
187
|
+
}
|
|
188
|
+
readUInt32LE(offset) {
|
|
189
|
+
return readUInt32LE(this.buffer, offset);
|
|
190
|
+
}
|
|
191
|
+
writeUInt32LE(value, offset) {
|
|
192
|
+
writeUInt32LE(this.buffer, value, offset);
|
|
193
|
+
}
|
|
194
|
+
readUInt8(offset) {
|
|
195
|
+
return readUInt8(this.buffer, offset);
|
|
196
|
+
}
|
|
197
|
+
writeUInt8(value, offset) {
|
|
198
|
+
writeUInt8(this.buffer, value, offset);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function readUInt32BE(source, offset) {
|
|
202
|
+
return (source[offset] * 2 ** 24
|
|
203
|
+
+ source[offset + 1] * 2 ** 16
|
|
204
|
+
+ source[offset + 2] * 2 ** 8
|
|
205
|
+
+ source[offset + 3]);
|
|
206
|
+
}
|
|
207
|
+
function writeUInt32BE(destination, value, offset) {
|
|
208
|
+
destination[offset + 3] = value;
|
|
209
|
+
value = value >>> 8;
|
|
210
|
+
destination[offset + 2] = value;
|
|
211
|
+
value = value >>> 8;
|
|
212
|
+
destination[offset + 1] = value;
|
|
213
|
+
value = value >>> 8;
|
|
214
|
+
destination[offset] = value;
|
|
215
|
+
}
|
|
216
|
+
function readUInt32LE(source, offset) {
|
|
217
|
+
return (((source[offset + 0] << 0) >>> 0) |
|
|
218
|
+
((source[offset + 1] << 8) >>> 0) |
|
|
219
|
+
((source[offset + 2] << 16) >>> 0) |
|
|
220
|
+
((source[offset + 3] << 24) >>> 0));
|
|
221
|
+
}
|
|
222
|
+
function writeUInt32LE(destination, value, offset) {
|
|
223
|
+
destination[offset + 0] = (value & 0b11111111);
|
|
224
|
+
value = value >>> 8;
|
|
225
|
+
destination[offset + 1] = (value & 0b11111111);
|
|
226
|
+
value = value >>> 8;
|
|
227
|
+
destination[offset + 2] = (value & 0b11111111);
|
|
228
|
+
value = value >>> 8;
|
|
229
|
+
destination[offset + 3] = (value & 0b11111111);
|
|
230
|
+
}
|
|
231
|
+
function readUInt8(source, offset) {
|
|
232
|
+
return source[offset];
|
|
233
|
+
}
|
|
234
|
+
function writeUInt8(destination, value, offset) {
|
|
235
|
+
destination[offset] = value;
|
|
236
|
+
}
|
|
237
|
+
function toVSCodeVSBuffer (value) {
|
|
238
|
+
if (value instanceof VSBuffer$1) {
|
|
239
|
+
return new VSBuffer(value.buffer)
|
|
240
|
+
}
|
|
241
|
+
return value
|
|
242
|
+
}
|
|
243
|
+
function toMonacoVSBuffer (value) {
|
|
244
|
+
if (value instanceof VSBuffer) {
|
|
245
|
+
return new VSBuffer$1(value.buffer)
|
|
246
|
+
}
|
|
247
|
+
return value
|
|
248
|
+
}
|
|
249
|
+
for (const key of Object.getOwnPropertyNames(VSBuffer)) {
|
|
250
|
+
if (!Object.hasOwnProperty.call(VSBuffer$1, key)) {
|
|
251
|
+
VSBuffer$1[key] = function (...args) {
|
|
252
|
+
return toMonacoVSBuffer(VSBuffer[key].call(VSBuffer$1, ...args.map(toVSCodeVSBuffer)))
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
for (const key of Object.getOwnPropertyNames(VSBuffer.prototype)) {
|
|
257
|
+
if (!Object.hasOwnProperty.call(VSBuffer$1.prototype, key)) {
|
|
258
|
+
VSBuffer$1.prototype[key] = function (...args) {
|
|
259
|
+
return toMonacoVSBuffer(VSBuffer.prototype[key].call(this, ...args.map(toVSCodeVSBuffer)))
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
const IEditorGroupsService = createDecorator('editorGroupsService');
|
|
264
|
+
const IEditorService = createDecorator('editorService');
|
|
265
|
+
const ACTIVE_GROUP = -1;
|
|
266
|
+
const SIDE_GROUP = -2;
|
|
267
|
+
const ITextFileService = createDecorator('textFileService');
|
|
268
|
+
const IWorkbenchEnvironmentService = refineServiceDecorator(IEnvironmentService);
|
|
269
|
+
const IUriIdentityService = createDecorator('IUriIdentityService');
|
|
270
|
+
const IWorkingCopyFileService = createDecorator('workingCopyFileService');
|
|
271
|
+
const IPathService = createDecorator('pathService');
|
|
272
|
+
const IPaneCompositePartService = createDecorator('paneCompositePartService');
|
|
273
|
+
const IProductService = createDecorator('productService');
|
|
274
|
+
const ILanguageStatusService = createDecorator('ILanguageStatusService');
|
|
275
|
+
const IHostService = createDecorator('hostService');
|
|
276
|
+
let services;
|
|
277
|
+
var Services;
|
|
278
|
+
(function (Services) {
|
|
279
|
+
Services.get = () => {
|
|
280
|
+
if (services == null) {
|
|
281
|
+
throw new Error('Services has not been installed');
|
|
282
|
+
}
|
|
283
|
+
return services;
|
|
284
|
+
};
|
|
285
|
+
function install(_services) {
|
|
286
|
+
if (services != null) {
|
|
287
|
+
console.warn('Services have been overridden');
|
|
288
|
+
}
|
|
289
|
+
services = _services;
|
|
290
|
+
return {
|
|
291
|
+
dispose: () => {
|
|
292
|
+
if (services === _services) {
|
|
293
|
+
services = undefined;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
Services.install = install;
|
|
299
|
+
})(Services || (Services = {}));
|
|
300
|
+
export { ACTIVE_GROUP as A, FileSystemProviderErrorCode as F, IEditorService as I, SIDE_GROUP as S, IPaneCompositePartService as a, IUriIdentityService as b, ITextFileService as c, disposed as d, IFileService as e, IEditorGroupsService as f, IWorkbenchEnvironmentService as g, IWorkingCopyFileService as h, IPathService as i, Services as j, IProductService as k, ILanguageStatusService as l, markAsFileSystemProviderError as m, IHostService as n, FileType as o, FilePermission as p, readonly as r };
|