@codingame/monaco-vscode-api 1.68.7 → 1.69.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.
@@ -0,0 +1,15 @@
1
+ import { _util } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
2
+ function getInjectedParameters(instantiationService, ctor) {
3
+ return instantiationService.invokeFunction((accessor) => {
4
+ return _util.getServiceDependencies(ctor).sort((a, b) => a.index - b.index).map(d => accessor.get(d.id));
5
+ });
6
+ }
7
+ function createInjectedClass(ctor) {
8
+ const _ctor = ctor;
9
+ return class extends _ctor {
10
+ constructor(...args) {
11
+ super(...args.slice(1), ...getInjectedParameters(args[0], ctor));
12
+ }
13
+ };
14
+ }
15
+ export { createInjectedClass as c };
@@ -0,0 +1,17 @@
1
+ import { localize } from 'monaco-editor/esm/vs/nls.js';
2
+ function getParseErrorMessage(errorCode) {
3
+ switch (errorCode) {
4
+ case 1 : return ( localize('error.invalidSymbol', 'Invalid symbol'));
5
+ case 2 : return ( localize('error.invalidNumberFormat', 'Invalid number format'));
6
+ case 3 : return ( localize('error.propertyNameExpected', 'Property name expected'));
7
+ case 4 : return ( localize('error.valueExpected', 'Value expected'));
8
+ case 5 : return ( localize('error.colonExpected', 'Colon expected'));
9
+ case 6 : return ( localize('error.commaExpected', 'Comma expected'));
10
+ case 7 : return ( localize('error.closeBraceExpected', 'Closing brace expected'));
11
+ case 8 : return ( localize('error.closeBracketExpected', 'Closing bracket expected'));
12
+ case 9 : return ( localize('error.endOfFileExpected', 'End of file expected'));
13
+ default:
14
+ return '';
15
+ }
16
+ }
17
+ export { getParseErrorMessage as g };
@@ -0,0 +1,502 @@
1
+ import * as monaco from 'monaco-editor';
2
+
3
+ /**
4
+ * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.
5
+ * This class is a simple parser which creates the basic component parts
6
+ * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
7
+ * and encoding.
8
+ *
9
+ * ```txt
10
+ * foo://example.com:8042/over/there?name=ferret#nose
11
+ * \_/ \______________/\_________/ \_________/ \__/
12
+ * | | | | |
13
+ * scheme authority path query fragment
14
+ * | _____________________|__
15
+ * / \ / \
16
+ * urn:example:animal:ferret:nose
17
+ * ```
18
+ */
19
+ declare class URI implements UriComponents {
20
+ static isUri(thing: any): thing is URI;
21
+ /**
22
+ * scheme is the 'http' part of 'http://www.example.com/some/path?query#fragment'.
23
+ * The part before the first colon.
24
+ */
25
+ readonly scheme: string;
26
+ /**
27
+ * authority is the 'www.example.com' part of 'http://www.example.com/some/path?query#fragment'.
28
+ * The part between the first double slashes and the next slash.
29
+ */
30
+ readonly authority: string;
31
+ /**
32
+ * path is the '/some/path' part of 'http://www.example.com/some/path?query#fragment'.
33
+ */
34
+ readonly path: string;
35
+ /**
36
+ * query is the 'query' part of 'http://www.example.com/some/path?query#fragment'.
37
+ */
38
+ readonly query: string;
39
+ /**
40
+ * fragment is the 'fragment' part of 'http://www.example.com/some/path?query#fragment'.
41
+ */
42
+ readonly fragment: string;
43
+ /**
44
+ * @internal
45
+ */
46
+ protected constructor(scheme: string, authority?: string, path?: string, query?: string, fragment?: string, _strict?: boolean);
47
+ /**
48
+ * @internal
49
+ */
50
+ protected constructor(components: UriComponents);
51
+ /**
52
+ * Returns a string representing the corresponding file system path of this URI.
53
+ * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the
54
+ * platform specific path separator.
55
+ *
56
+ * * Will *not* validate the path for invalid characters and semantics.
57
+ * * Will *not* look at the scheme of this URI.
58
+ * * The result shall *not* be used for display purposes but for accessing a file on disk.
59
+ *
60
+ *
61
+ * The *difference* to `URI#path` is the use of the platform specific separator and the handling
62
+ * of UNC paths. See the below sample of a file-uri with an authority (UNC path).
63
+ *
64
+ * ```ts
65
+ const u = URI.parse('file://server/c$/folder/file.txt')
66
+ u.authority === 'server'
67
+ u.path === '/shares/c$/file.txt'
68
+ u.fsPath === '\\server\c$\folder\file.txt'
69
+ ```
70
+ *
71
+ * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,
72
+ * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working
73
+ * with URIs that represent files on disk (`file` scheme).
74
+ */
75
+ get fsPath(): string;
76
+ with(change: {
77
+ scheme?: string;
78
+ authority?: string | null;
79
+ path?: string | null;
80
+ query?: string | null;
81
+ fragment?: string | null;
82
+ }): URI;
83
+ /**
84
+ * Creates a new URI from a string, e.g. `http://www.example.com/some/path`,
85
+ * `file:///usr/home`, or `scheme:with/path`.
86
+ *
87
+ * @param value A string which represents an URI (see `URI#toString`).
88
+ */
89
+ static parse(value: string, _strict?: boolean): URI;
90
+ /**
91
+ * Creates a new URI from a file system path, e.g. `c:\my\files`,
92
+ * `/usr/home`, or `\\server\share\some\path`.
93
+ *
94
+ * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument
95
+ * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**
96
+ * `URI.parse('file://' + path)` because the path might contain characters that are
97
+ * interpreted (# and ?). See the following sample:
98
+ * ```ts
99
+ const good = URI.file('/coding/c#/project1');
100
+ good.scheme === 'file';
101
+ good.path === '/coding/c#/project1';
102
+ good.fragment === '';
103
+ const bad = URI.parse('file://' + '/coding/c#/project1');
104
+ bad.scheme === 'file';
105
+ bad.path === '/coding/c'; // path is now broken
106
+ bad.fragment === '/project1';
107
+ ```
108
+ *
109
+ * @param path A file system path (see `URI#fsPath`)
110
+ */
111
+ static file(path: string): URI;
112
+ static from(components: {
113
+ scheme: string;
114
+ authority?: string;
115
+ path?: string;
116
+ query?: string;
117
+ fragment?: string;
118
+ }): URI;
119
+ /**
120
+ * Join a URI path with path fragments and normalizes the resulting path.
121
+ *
122
+ * @param uri The input URI.
123
+ * @param pathFragment The path fragment to add to the URI path.
124
+ * @returns The resulting URI.
125
+ */
126
+ static joinPath(uri: URI, ...pathFragment: string[]): URI;
127
+ /**
128
+ * Creates a string representation for this URI. It's guaranteed that calling
129
+ * `URI.parse` with the result of this function creates an URI which is equal
130
+ * to this URI.
131
+ *
132
+ * * The result shall *not* be used for display purposes but for externalization or transport.
133
+ * * The result will be encoded using the percentage encoding and encoding happens mostly
134
+ * ignore the scheme-specific encoding rules.
135
+ *
136
+ * @param skipEncoding Do not encode the result, default is `false`
137
+ */
138
+ toString(skipEncoding?: boolean): string;
139
+ toJSON(): UriComponents;
140
+ static revive(data: UriComponents | URI): URI;
141
+ static revive(data: UriComponents | URI | undefined): URI | undefined;
142
+ static revive(data: UriComponents | URI | null): URI | null;
143
+ static revive(data: UriComponents | URI | undefined | null): URI | undefined | null;
144
+ }
145
+ interface UriComponents {
146
+ scheme: string;
147
+ authority: string;
148
+ path: string;
149
+ query: string;
150
+ fragment: string;
151
+ }
152
+
153
+ /**
154
+ * Type of extension.
155
+ *
156
+ * **NOTE**: This is defined in `platform/environment` because it can appear as a CLI argument.
157
+ */
158
+ declare type ExtensionKind = 'ui' | 'workspace' | 'web';
159
+
160
+ interface ICommand {
161
+ command: string;
162
+ title: string;
163
+ category?: string;
164
+ }
165
+ interface IConfigurationProperty {
166
+ description: string;
167
+ type: string | string[];
168
+ default?: any;
169
+ }
170
+ interface IConfiguration {
171
+ id?: string;
172
+ order?: number;
173
+ title?: string;
174
+ properties: {
175
+ [key: string]: IConfigurationProperty;
176
+ };
177
+ }
178
+ interface IDebugger {
179
+ label?: string;
180
+ type: string;
181
+ runtime?: string;
182
+ }
183
+ interface IGrammar {
184
+ language: string;
185
+ }
186
+ interface IJSONValidation {
187
+ fileMatch: string | string[];
188
+ url: string;
189
+ }
190
+ interface IKeyBinding {
191
+ command: string;
192
+ key: string;
193
+ when?: string;
194
+ mac?: string;
195
+ linux?: string;
196
+ win?: string;
197
+ }
198
+ interface ILanguage {
199
+ id: string;
200
+ extensions: string[];
201
+ aliases: string[];
202
+ }
203
+ interface IMenu {
204
+ command: string;
205
+ alt?: string;
206
+ when?: string;
207
+ group?: string;
208
+ }
209
+ interface ISnippet {
210
+ language: string;
211
+ }
212
+ interface ITheme {
213
+ label: string;
214
+ }
215
+ interface IViewContainer {
216
+ id: string;
217
+ title: string;
218
+ }
219
+ interface IView {
220
+ id: string;
221
+ name: string;
222
+ }
223
+ interface IColor {
224
+ id: string;
225
+ description: string;
226
+ defaults: {
227
+ light: string;
228
+ dark: string;
229
+ highContrast: string;
230
+ };
231
+ }
232
+ interface IWebviewEditor {
233
+ readonly viewType: string;
234
+ readonly priority: string;
235
+ readonly selector: readonly {
236
+ readonly filenamePattern?: string;
237
+ }[];
238
+ }
239
+ interface ICodeActionContributionAction {
240
+ readonly kind: string;
241
+ readonly title: string;
242
+ readonly description?: string;
243
+ }
244
+ interface ICodeActionContribution {
245
+ readonly languages: readonly string[];
246
+ readonly actions: readonly ICodeActionContributionAction[];
247
+ }
248
+ interface IAuthenticationContribution {
249
+ readonly id: string;
250
+ readonly label: string;
251
+ }
252
+ interface IWalkthroughStep {
253
+ readonly id: string;
254
+ readonly title: string;
255
+ readonly description: string | undefined;
256
+ readonly media: {
257
+ image: string | {
258
+ dark: string;
259
+ light: string;
260
+ hc: string;
261
+ };
262
+ altText: string;
263
+ markdown?: never;
264
+ svg?: never;
265
+ } | {
266
+ markdown: string;
267
+ image?: never;
268
+ svg?: never;
269
+ } | {
270
+ svg: string;
271
+ altText: string;
272
+ markdown?: never;
273
+ image?: never;
274
+ };
275
+ readonly completionEvents?: string[];
276
+ /** @deprecated use `completionEvents: 'onCommand:...'` */
277
+ readonly doneOn?: {
278
+ command: string;
279
+ };
280
+ readonly when?: string;
281
+ }
282
+ interface IWalkthrough {
283
+ readonly id: string;
284
+ readonly title: string;
285
+ readonly description: string;
286
+ readonly steps: IWalkthroughStep[];
287
+ readonly featuredFor: string[] | undefined;
288
+ readonly when?: string;
289
+ }
290
+ interface IStartEntry {
291
+ readonly title: string;
292
+ readonly description: string;
293
+ readonly command: string;
294
+ readonly when?: string;
295
+ readonly category: 'file' | 'folder' | 'notebook';
296
+ }
297
+ interface INotebookEntry {
298
+ readonly type: string;
299
+ readonly displayName: string;
300
+ }
301
+ interface INotebookRendererContribution {
302
+ readonly id: string;
303
+ readonly displayName: string;
304
+ readonly mimeTypes: string[];
305
+ }
306
+ interface ITranslation {
307
+ id: string;
308
+ path: string;
309
+ }
310
+ interface ILocalizationContribution {
311
+ languageId: string;
312
+ languageName?: string;
313
+ localizedLanguageName?: string;
314
+ translations: ITranslation[];
315
+ minimalTranslations?: {
316
+ [key: string]: string;
317
+ };
318
+ }
319
+ interface IExtensionContributions {
320
+ commands?: ICommand[];
321
+ configuration?: IConfiguration | IConfiguration[];
322
+ debuggers?: IDebugger[];
323
+ grammars?: IGrammar[];
324
+ jsonValidation?: IJSONValidation[];
325
+ keybindings?: IKeyBinding[];
326
+ languages?: ILanguage[];
327
+ menus?: {
328
+ [context: string]: IMenu[];
329
+ };
330
+ snippets?: ISnippet[];
331
+ themes?: ITheme[];
332
+ iconThemes?: ITheme[];
333
+ productIconThemes?: ITheme[];
334
+ viewsContainers?: {
335
+ [location: string]: IViewContainer[];
336
+ };
337
+ views?: {
338
+ [location: string]: IView[];
339
+ };
340
+ colors?: IColor[];
341
+ localizations?: ILocalizationContribution[];
342
+ readonly customEditors?: readonly IWebviewEditor[];
343
+ readonly codeActions?: readonly ICodeActionContribution[];
344
+ authentication?: IAuthenticationContribution[];
345
+ walkthroughs?: IWalkthrough[];
346
+ startEntries?: IStartEntry[];
347
+ readonly notebooks?: INotebookEntry[];
348
+ readonly notebookRenderer?: INotebookRendererContribution[];
349
+ }
350
+ interface IExtensionCapabilities {
351
+ readonly virtualWorkspaces?: ExtensionVirtualWorkspaceSupport;
352
+ readonly untrustedWorkspaces?: ExtensionUntrustedWorkspaceSupport;
353
+ }
354
+ declare type LimitedWorkspaceSupportType = 'limited';
355
+ declare type ExtensionUntrustedWorkspaceSupport = {
356
+ supported: true;
357
+ } | {
358
+ supported: false;
359
+ description: string;
360
+ } | {
361
+ supported: LimitedWorkspaceSupportType;
362
+ description: string;
363
+ restrictedConfigurations?: string[];
364
+ };
365
+ declare type ExtensionVirtualWorkspaceSupport = boolean | {
366
+ supported: true;
367
+ } | {
368
+ supported: false | LimitedWorkspaceSupportType;
369
+ description: string;
370
+ };
371
+ interface IRelaxedExtensionManifest {
372
+ name: string;
373
+ displayName?: string;
374
+ publisher: string;
375
+ version: string;
376
+ engines: {
377
+ readonly vscode: string;
378
+ };
379
+ description?: string;
380
+ main?: string;
381
+ browser?: string;
382
+ icon?: string;
383
+ categories?: string[];
384
+ keywords?: string[];
385
+ activationEvents?: string[];
386
+ extensionDependencies?: string[];
387
+ extensionPack?: string[];
388
+ extensionKind?: ExtensionKind | ExtensionKind[];
389
+ contributes?: IExtensionContributions;
390
+ repository?: {
391
+ url: string;
392
+ };
393
+ bugs?: {
394
+ url: string;
395
+ };
396
+ enabledApiProposals?: readonly string[];
397
+ api?: string;
398
+ scripts?: {
399
+ [key: string]: string;
400
+ };
401
+ capabilities?: IExtensionCapabilities;
402
+ }
403
+ declare const enum TargetPlatform {
404
+ WIN32_X64 = "win32-x64",
405
+ WIN32_IA32 = "win32-ia32",
406
+ WIN32_ARM64 = "win32-arm64",
407
+ LINUX_X64 = "linux-x64",
408
+ LINUX_ARM64 = "linux-arm64",
409
+ LINUX_ARMHF = "linux-armhf",
410
+ ALPINE_X64 = "alpine-x64",
411
+ ALPINE_ARM64 = "alpine-arm64",
412
+ DARWIN_X64 = "darwin-x64",
413
+ DARWIN_ARM64 = "darwin-arm64",
414
+ WEB = "web",
415
+ UNIVERSAL = "universal",
416
+ UNKNOWN = "unknown",
417
+ UNDEFINED = "undefined"
418
+ }
419
+ /**
420
+ * **!Do not construct directly!**
421
+ *
422
+ * **!Only static methods because it gets serialized!**
423
+ *
424
+ * This represents the "canonical" version for an extension identifier. Extension ids
425
+ * have to be case-insensitive (due to the marketplace), but we must ensure case
426
+ * preservation because the extension API is already public at this time.
427
+ *
428
+ * For example, given an extension with the publisher `"Hello"` and the name `"World"`,
429
+ * its canonical extension identifier is `"Hello.World"`. This extension could be
430
+ * referenced in some other extension's dependencies using the string `"hello.world"`.
431
+ *
432
+ * To make matters more complicated, an extension can optionally have an UUID. When two
433
+ * extensions have the same UUID, they are considered equal even if their identifier is different.
434
+ */
435
+ declare class ExtensionIdentifier {
436
+ readonly value: string;
437
+ private readonly _lower;
438
+ constructor(value: string);
439
+ static equals(a: ExtensionIdentifier | string | null | undefined, b: ExtensionIdentifier | string | null | undefined): boolean;
440
+ /**
441
+ * Gives the value by which to index (for equality).
442
+ */
443
+ static toKey(id: ExtensionIdentifier | string): string;
444
+ }
445
+ interface IRelaxedExtensionDescription extends IRelaxedExtensionManifest {
446
+ id?: string;
447
+ identifier: ExtensionIdentifier;
448
+ uuid?: string;
449
+ targetPlatform: TargetPlatform;
450
+ isBuiltin: boolean;
451
+ isUserBuiltin: boolean;
452
+ isUnderDevelopment: boolean;
453
+ extensionLocation: URI;
454
+ }
455
+ declare type IExtensionDescription = Readonly<IRelaxedExtensionDescription>;
456
+
457
+ interface IUserFriendlyKeybinding {
458
+ key: string;
459
+ command: string;
460
+ args?: any;
461
+ when?: string;
462
+ }
463
+
464
+ type IEditorOverrideServices = monaco.editor.IEditorOverrideServices
465
+
466
+ interface ILocalizedString {
467
+ /**
468
+ * The localized value of the string.
469
+ */
470
+ value: string;
471
+ /**
472
+ * The original (non localized value of the string)
473
+ */
474
+ original: string;
475
+ }
476
+
477
+ interface ContributedKeyBinding {
478
+ command: string;
479
+ args?: any;
480
+ key: string;
481
+ when?: string;
482
+ mac?: string;
483
+ linux?: string;
484
+ win?: string;
485
+ }
486
+ interface IUserFriendlyCommand {
487
+ command: string;
488
+ title: string | ILocalizedString;
489
+ shortTitle?: string | ILocalizedString;
490
+ enablement?: string;
491
+ category?: string | ILocalizedString;
492
+ icon?: string | {
493
+ light: string;
494
+ dark: string;
495
+ };
496
+ }
497
+ declare function setKeybindings(grammars: ContributedKeyBinding | ContributedKeyBinding[], extension?: IExtensionDescription): void;
498
+ declare function setCommands(keybindings: IUserFriendlyCommand | IUserFriendlyCommand[], extension?: IExtensionDescription): void;
499
+ declare function updateUserKeybindings(keybindingsJson: string): void;
500
+ declare function getServiceOverride(): IEditorOverrideServices;
501
+
502
+ export { ContributedKeyBinding, IUserFriendlyKeybinding, getServiceOverride as default, setCommands, setKeybindings, updateUserKeybindings };