@codingame/monaco-vscode-api 1.68.7 → 1.69.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.
@@ -0,0 +1,4795 @@
1
+ import * as monaco from 'monaco-editor';
2
+ import * as vscode from 'vscode';
3
+
4
+ interface IDisposable {
5
+ dispose(): void;
6
+ }
7
+ declare class DisposableStore implements IDisposable {
8
+ static DISABLE_DISPOSED_WARNING: boolean;
9
+ private _toDispose;
10
+ private _isDisposed;
11
+ constructor();
12
+ /**
13
+ * Dispose of all registered disposables and mark this object as disposed.
14
+ *
15
+ * Any future disposables added to this object will be disposed of on `add`.
16
+ */
17
+ dispose(): void;
18
+ /**
19
+ * Returns `true` if this object has been disposed
20
+ */
21
+ get isDisposed(): boolean;
22
+ /**
23
+ * Dispose of all registered disposables but do not mark this object as disposed.
24
+ */
25
+ clear(): void;
26
+ add<T extends IDisposable>(o: T): T;
27
+ }
28
+ declare abstract class Disposable implements IDisposable {
29
+ static readonly None: Readonly<IDisposable>;
30
+ protected readonly _store: DisposableStore;
31
+ constructor();
32
+ dispose(): void;
33
+ protected _register<T extends IDisposable>(o: T): T;
34
+ }
35
+
36
+ /**
37
+ * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.
38
+ * This class is a simple parser which creates the basic component parts
39
+ * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
40
+ * and encoding.
41
+ *
42
+ * ```txt
43
+ * foo://example.com:8042/over/there?name=ferret#nose
44
+ * \_/ \______________/\_________/ \_________/ \__/
45
+ * | | | | |
46
+ * scheme authority path query fragment
47
+ * | _____________________|__
48
+ * / \ / \
49
+ * urn:example:animal:ferret:nose
50
+ * ```
51
+ */
52
+ declare class URI implements UriComponents {
53
+ static isUri(thing: any): thing is URI;
54
+ /**
55
+ * scheme is the 'http' part of 'http://www.example.com/some/path?query#fragment'.
56
+ * The part before the first colon.
57
+ */
58
+ readonly scheme: string;
59
+ /**
60
+ * authority is the 'www.example.com' part of 'http://www.example.com/some/path?query#fragment'.
61
+ * The part between the first double slashes and the next slash.
62
+ */
63
+ readonly authority: string;
64
+ /**
65
+ * path is the '/some/path' part of 'http://www.example.com/some/path?query#fragment'.
66
+ */
67
+ readonly path: string;
68
+ /**
69
+ * query is the 'query' part of 'http://www.example.com/some/path?query#fragment'.
70
+ */
71
+ readonly query: string;
72
+ /**
73
+ * fragment is the 'fragment' part of 'http://www.example.com/some/path?query#fragment'.
74
+ */
75
+ readonly fragment: string;
76
+ /**
77
+ * @internal
78
+ */
79
+ protected constructor(scheme: string, authority?: string, path?: string, query?: string, fragment?: string, _strict?: boolean);
80
+ /**
81
+ * @internal
82
+ */
83
+ protected constructor(components: UriComponents);
84
+ /**
85
+ * Returns a string representing the corresponding file system path of this URI.
86
+ * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the
87
+ * platform specific path separator.
88
+ *
89
+ * * Will *not* validate the path for invalid characters and semantics.
90
+ * * Will *not* look at the scheme of this URI.
91
+ * * The result shall *not* be used for display purposes but for accessing a file on disk.
92
+ *
93
+ *
94
+ * The *difference* to `URI#path` is the use of the platform specific separator and the handling
95
+ * of UNC paths. See the below sample of a file-uri with an authority (UNC path).
96
+ *
97
+ * ```ts
98
+ const u = URI.parse('file://server/c$/folder/file.txt')
99
+ u.authority === 'server'
100
+ u.path === '/shares/c$/file.txt'
101
+ u.fsPath === '\\server\c$\folder\file.txt'
102
+ ```
103
+ *
104
+ * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,
105
+ * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working
106
+ * with URIs that represent files on disk (`file` scheme).
107
+ */
108
+ get fsPath(): string;
109
+ with(change: {
110
+ scheme?: string;
111
+ authority?: string | null;
112
+ path?: string | null;
113
+ query?: string | null;
114
+ fragment?: string | null;
115
+ }): URI;
116
+ /**
117
+ * Creates a new URI from a string, e.g. `http://www.example.com/some/path`,
118
+ * `file:///usr/home`, or `scheme:with/path`.
119
+ *
120
+ * @param value A string which represents an URI (see `URI#toString`).
121
+ */
122
+ static parse(value: string, _strict?: boolean): URI;
123
+ /**
124
+ * Creates a new URI from a file system path, e.g. `c:\my\files`,
125
+ * `/usr/home`, or `\\server\share\some\path`.
126
+ *
127
+ * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument
128
+ * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**
129
+ * `URI.parse('file://' + path)` because the path might contain characters that are
130
+ * interpreted (# and ?). See the following sample:
131
+ * ```ts
132
+ const good = URI.file('/coding/c#/project1');
133
+ good.scheme === 'file';
134
+ good.path === '/coding/c#/project1';
135
+ good.fragment === '';
136
+ const bad = URI.parse('file://' + '/coding/c#/project1');
137
+ bad.scheme === 'file';
138
+ bad.path === '/coding/c'; // path is now broken
139
+ bad.fragment === '/project1';
140
+ ```
141
+ *
142
+ * @param path A file system path (see `URI#fsPath`)
143
+ */
144
+ static file(path: string): URI;
145
+ static from(components: {
146
+ scheme: string;
147
+ authority?: string;
148
+ path?: string;
149
+ query?: string;
150
+ fragment?: string;
151
+ }): URI;
152
+ /**
153
+ * Join a URI path with path fragments and normalizes the resulting path.
154
+ *
155
+ * @param uri The input URI.
156
+ * @param pathFragment The path fragment to add to the URI path.
157
+ * @returns The resulting URI.
158
+ */
159
+ static joinPath(uri: URI, ...pathFragment: string[]): URI;
160
+ /**
161
+ * Creates a string representation for this URI. It's guaranteed that calling
162
+ * `URI.parse` with the result of this function creates an URI which is equal
163
+ * to this URI.
164
+ *
165
+ * * The result shall *not* be used for display purposes but for externalization or transport.
166
+ * * The result will be encoded using the percentage encoding and encoding happens mostly
167
+ * ignore the scheme-specific encoding rules.
168
+ *
169
+ * @param skipEncoding Do not encode the result, default is `false`
170
+ */
171
+ toString(skipEncoding?: boolean): string;
172
+ toJSON(): UriComponents;
173
+ static revive(data: UriComponents | URI): URI;
174
+ static revive(data: UriComponents | URI | undefined): URI | undefined;
175
+ static revive(data: UriComponents | URI | null): URI | null;
176
+ static revive(data: UriComponents | URI | undefined | null): URI | undefined | null;
177
+ }
178
+ interface UriComponents {
179
+ scheme: string;
180
+ authority: string;
181
+ path: string;
182
+ query: string;
183
+ fragment: string;
184
+ }
185
+
186
+ interface CancellationToken {
187
+ /**
188
+ * A flag signalling is cancellation has been requested.
189
+ */
190
+ readonly isCancellationRequested: boolean;
191
+ /**
192
+ * An event which fires when cancellation is requested. This event
193
+ * only ever fires `once` as cancellation can only happen once. Listeners
194
+ * that are registered after cancellation will be called (next event loop run),
195
+ * but also only once.
196
+ *
197
+ * @event
198
+ */
199
+ readonly onCancellationRequested: (listener: (e: any) => any, thisArgs?: any, disposables?: IDisposable[]) => IDisposable;
200
+ }
201
+ declare namespace CancellationToken {
202
+ function isCancellationToken(thing: unknown): thing is CancellationToken;
203
+ const None: Readonly<CancellationToken>;
204
+ const Cancelled: Readonly<CancellationToken>;
205
+ }
206
+
207
+ interface IObservable<T, TChange = void> {
208
+ readonly TChange: TChange;
209
+ /**
210
+ * Reads the current value.
211
+ *
212
+ * Must not be called from {@link IObserver.handleChange}.
213
+ */
214
+ get(): T;
215
+ /**
216
+ * Adds an observer.
217
+ */
218
+ addObserver(observer: IObserver): void;
219
+ removeObserver(observer: IObserver): void;
220
+ /**
221
+ * Subscribes the reader to this observable and returns the current value of this observable.
222
+ */
223
+ read(reader: IReader): T;
224
+ map<TNew>(fn: (value: T) => TNew): IObservable<TNew>;
225
+ readonly debugName: string;
226
+ }
227
+ interface IReader {
228
+ /**
229
+ * Reports an observable that was read.
230
+ *
231
+ * Is called by {@link IObservable.read}.
232
+ */
233
+ subscribeTo<T>(observable: IObservable<T, any>): void;
234
+ }
235
+ interface IObserver {
236
+ /**
237
+ * Indicates that an update operation is about to begin.
238
+ *
239
+ * During an update, invariants might not hold for subscribed observables and
240
+ * change events might be delayed.
241
+ * However, all changes must be reported before all update operations are over.
242
+ */
243
+ beginUpdate<T>(observable: IObservable<T>): void;
244
+ /**
245
+ * Is called by a subscribed observable immediately after it notices a change.
246
+ *
247
+ * When {@link IObservable.get} returns and no change has been reported,
248
+ * there has been no change for that observable.
249
+ *
250
+ * Implementations must not call into other observables!
251
+ * The change should be processed when {@link IObserver.endUpdate} is called.
252
+ */
253
+ handleChange<T, TChange>(observable: IObservable<T, TChange>, change: TChange): void;
254
+ /**
255
+ * Indicates that an update operation has completed.
256
+ */
257
+ endUpdate<T>(observable: IObservable<T>): void;
258
+ }
259
+
260
+ /**
261
+ * To an event a function with one or zero parameters
262
+ * can be subscribed. The event is the subscriber function itself.
263
+ */
264
+ type Event<T> = vscode.Event<T>
265
+ declare namespace Event {
266
+ const None: Event<any>;
267
+ /**
268
+ * Given an event, returns another event which only fires once.
269
+ */
270
+ function once<T>(event: Event<T>): Event<T>;
271
+ /**
272
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
273
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
274
+ * returned event causes this utility to leak a listener on the original event.
275
+ */
276
+ function map<I, O>(event: Event<I>, map: (i: I) => O, disposable?: DisposableStore): Event<O>;
277
+ /**
278
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
279
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
280
+ * returned event causes this utility to leak a listener on the original event.
281
+ */
282
+ function forEach<I>(event: Event<I>, each: (i: I) => void, disposable?: DisposableStore): Event<I>;
283
+ /**
284
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
285
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
286
+ * returned event causes this utility to leak a listener on the original event.
287
+ */
288
+ function filter<T, U>(event: Event<T | U>, filter: (e: T | U) => e is T, disposable?: DisposableStore): Event<T>;
289
+ function filter<T>(event: Event<T>, filter: (e: T) => boolean, disposable?: DisposableStore): Event<T>;
290
+ function filter<T, R>(event: Event<T | R>, filter: (e: T | R) => e is R, disposable?: DisposableStore): Event<R>;
291
+ /**
292
+ * Given an event, returns the same event but typed as `Event<void>`.
293
+ */
294
+ function signal<T>(event: Event<T>): Event<void>;
295
+ /**
296
+ * Given a collection of events, returns a single event which emits
297
+ * whenever any of the provided events emit.
298
+ */
299
+ function any<T>(...events: Event<T>[]): Event<T>;
300
+ function any(...events: Event<any>[]): Event<void>;
301
+ /**
302
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
303
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
304
+ * returned event causes this utility to leak a listener on the original event.
305
+ */
306
+ function reduce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, initial?: O, disposable?: DisposableStore): Event<O>;
307
+ /**
308
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
309
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
310
+ * returned event causes this utility to leak a listener on the original event.
311
+ */
312
+ function debounce<T>(event: Event<T>, merge: (last: T | undefined, event: T) => T, delay?: number, leading?: boolean, leakWarningThreshold?: number, disposable?: DisposableStore): Event<T>;
313
+ /**
314
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
315
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
316
+ * returned event causes this utility to leak a listener on the original event.
317
+ */
318
+ function debounce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, delay?: number, leading?: boolean, leakWarningThreshold?: number, disposable?: DisposableStore): Event<O>;
319
+ /**
320
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
321
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
322
+ * returned event causes this utility to leak a listener on the original event.
323
+ */
324
+ function latch<T>(event: Event<T>, equals?: (a: T, b: T) => boolean, disposable?: DisposableStore): Event<T>;
325
+ /**
326
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
327
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
328
+ * returned event causes this utility to leak a listener on the original event.
329
+ */
330
+ function split<T, U>(event: Event<T | U>, isT: (e: T | U) => e is T, disposable?: DisposableStore): [Event<T>, Event<U>];
331
+ /**
332
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
333
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
334
+ * returned event causes this utility to leak a listener on the original event.
335
+ */
336
+ function buffer<T>(event: Event<T>, flushAfterTimeout?: boolean, _buffer?: T[]): Event<T>;
337
+ interface IChainableEvent<T> extends IDisposable {
338
+ event: Event<T>;
339
+ map<O>(fn: (i: T) => O): IChainableEvent<O>;
340
+ forEach(fn: (i: T) => void): IChainableEvent<T>;
341
+ filter(fn: (e: T) => boolean): IChainableEvent<T>;
342
+ filter<R>(fn: (e: T | R) => e is R): IChainableEvent<R>;
343
+ reduce<R>(merge: (last: R | undefined, event: T) => R, initial?: R): IChainableEvent<R>;
344
+ latch(): IChainableEvent<T>;
345
+ debounce(merge: (last: T | undefined, event: T) => T, delay?: number, leading?: boolean, leakWarningThreshold?: number): IChainableEvent<T>;
346
+ debounce<R>(merge: (last: R | undefined, event: T) => R, delay?: number, leading?: boolean, leakWarningThreshold?: number): IChainableEvent<R>;
347
+ on(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore): IDisposable;
348
+ once(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[]): IDisposable;
349
+ }
350
+ function chain<T>(event: Event<T>): IChainableEvent<T>;
351
+ interface NodeEventEmitter {
352
+ on(event: string | symbol, listener: Function): unknown;
353
+ removeListener(event: string | symbol, listener: Function): unknown;
354
+ }
355
+ function fromNodeEventEmitter<T>(emitter: NodeEventEmitter, eventName: string, map?: (...args: any[]) => T): Event<T>;
356
+ interface DOMEventEmitter {
357
+ addEventListener(event: string | symbol, listener: Function): void;
358
+ removeEventListener(event: string | symbol, listener: Function): void;
359
+ }
360
+ function fromDOMEventEmitter<T>(emitter: DOMEventEmitter, eventName: string, map?: (...args: any[]) => T): Event<T>;
361
+ function toPromise<T>(event: Event<T>): Promise<T>;
362
+ function runAndSubscribe<T>(event: Event<T>, handler: (e: T | undefined) => any): IDisposable;
363
+ function runAndSubscribeWithStore<T>(event: Event<T>, handler: (e: T | undefined, disposableStore: DisposableStore) => any): IDisposable;
364
+ function fromObservable<T>(obs: IObservable<T, any>, store?: DisposableStore): Event<T>;
365
+ }
366
+
367
+ interface ServicesAccessor {
368
+ get<T>(id: ServiceIdentifier<T>): T;
369
+ }
370
+ /**
371
+ * Identifies a service of type `T`.
372
+ */
373
+ interface ServiceIdentifier<T> {
374
+ (...args: any[]): void;
375
+ type: T;
376
+ }
377
+
378
+ interface IContextKeyExprMapper {
379
+ mapDefined(key: string): ContextKeyExpression;
380
+ mapNot(key: string): ContextKeyExpression;
381
+ mapEquals(key: string, value: any): ContextKeyExpression;
382
+ mapNotEquals(key: string, value: any): ContextKeyExpression;
383
+ mapGreater(key: string, value: any): ContextKeyExpression;
384
+ mapGreaterEquals(key: string, value: any): ContextKeyExpression;
385
+ mapSmaller(key: string, value: any): ContextKeyExpression;
386
+ mapSmallerEquals(key: string, value: any): ContextKeyExpression;
387
+ mapRegex(key: string, regexp: RegExp | null): ContextKeyRegexExpr;
388
+ mapIn(key: string, valueKey: string): ContextKeyInExpr;
389
+ mapNotIn(key: string, valueKey: string): ContextKeyNotInExpr;
390
+ }
391
+ interface IContextKeyExpression {
392
+ cmp(other: ContextKeyExpression): number;
393
+ equals(other: ContextKeyExpression): boolean;
394
+ substituteConstants(): ContextKeyExpression | undefined;
395
+ evaluate(context: IContext): boolean;
396
+ serialize(): string;
397
+ keys(): string[];
398
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
399
+ negate(): ContextKeyExpression;
400
+ }
401
+ declare type ContextKeyExpression = (ContextKeyFalseExpr | ContextKeyTrueExpr | ContextKeyDefinedExpr | ContextKeyNotExpr | ContextKeyEqualsExpr | ContextKeyNotEqualsExpr | ContextKeyRegexExpr | ContextKeyNotRegexExpr | ContextKeyAndExpr | ContextKeyOrExpr | ContextKeyInExpr | ContextKeyNotInExpr | ContextKeyGreaterExpr | ContextKeyGreaterEqualsExpr | ContextKeySmallerExpr | ContextKeySmallerEqualsExpr);
402
+ declare class ContextKeyFalseExpr implements IContextKeyExpression {
403
+ static INSTANCE: ContextKeyFalseExpr;
404
+ readonly type = ContextKeyExprType.False;
405
+ protected constructor();
406
+ cmp(other: ContextKeyExpression): number;
407
+ equals(other: ContextKeyExpression): boolean;
408
+ substituteConstants(): ContextKeyExpression | undefined;
409
+ evaluate(context: IContext): boolean;
410
+ serialize(): string;
411
+ keys(): string[];
412
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
413
+ negate(): ContextKeyExpression;
414
+ }
415
+ declare class ContextKeyTrueExpr implements IContextKeyExpression {
416
+ static INSTANCE: ContextKeyTrueExpr;
417
+ readonly type = ContextKeyExprType.True;
418
+ protected constructor();
419
+ cmp(other: ContextKeyExpression): number;
420
+ equals(other: ContextKeyExpression): boolean;
421
+ substituteConstants(): ContextKeyExpression | undefined;
422
+ evaluate(context: IContext): boolean;
423
+ serialize(): string;
424
+ keys(): string[];
425
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
426
+ negate(): ContextKeyExpression;
427
+ }
428
+ declare class ContextKeyDefinedExpr implements IContextKeyExpression {
429
+ readonly key: string;
430
+ private negated;
431
+ static create(key: string, negated?: ContextKeyExpression | null): ContextKeyExpression;
432
+ readonly type = ContextKeyExprType.Defined;
433
+ protected constructor(key: string, negated: ContextKeyExpression | null);
434
+ cmp(other: ContextKeyExpression): number;
435
+ equals(other: ContextKeyExpression): boolean;
436
+ substituteConstants(): ContextKeyExpression | undefined;
437
+ evaluate(context: IContext): boolean;
438
+ serialize(): string;
439
+ keys(): string[];
440
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
441
+ negate(): ContextKeyExpression;
442
+ }
443
+ declare class ContextKeyEqualsExpr implements IContextKeyExpression {
444
+ private readonly key;
445
+ private readonly value;
446
+ private negated;
447
+ static create(key: string, value: any, negated?: ContextKeyExpression | null): ContextKeyExpression;
448
+ readonly type = ContextKeyExprType.Equals;
449
+ private constructor();
450
+ cmp(other: ContextKeyExpression): number;
451
+ equals(other: ContextKeyExpression): boolean;
452
+ substituteConstants(): ContextKeyExpression | undefined;
453
+ evaluate(context: IContext): boolean;
454
+ serialize(): string;
455
+ keys(): string[];
456
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
457
+ negate(): ContextKeyExpression;
458
+ }
459
+ declare class ContextKeyInExpr implements IContextKeyExpression {
460
+ private readonly key;
461
+ private readonly valueKey;
462
+ static create(key: string, valueKey: string): ContextKeyInExpr;
463
+ readonly type = ContextKeyExprType.In;
464
+ private negated;
465
+ private constructor();
466
+ cmp(other: ContextKeyExpression): number;
467
+ equals(other: ContextKeyExpression): boolean;
468
+ substituteConstants(): ContextKeyExpression | undefined;
469
+ evaluate(context: IContext): boolean;
470
+ serialize(): string;
471
+ keys(): string[];
472
+ map(mapFnc: IContextKeyExprMapper): ContextKeyInExpr;
473
+ negate(): ContextKeyExpression;
474
+ }
475
+ declare class ContextKeyNotInExpr implements IContextKeyExpression {
476
+ private readonly key;
477
+ private readonly valueKey;
478
+ static create(key: string, valueKey: string): ContextKeyNotInExpr;
479
+ readonly type = ContextKeyExprType.NotIn;
480
+ private readonly _negated;
481
+ private constructor();
482
+ cmp(other: ContextKeyExpression): number;
483
+ equals(other: ContextKeyExpression): boolean;
484
+ substituteConstants(): ContextKeyExpression | undefined;
485
+ evaluate(context: IContext): boolean;
486
+ serialize(): string;
487
+ keys(): string[];
488
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
489
+ negate(): ContextKeyExpression;
490
+ }
491
+ declare class ContextKeyNotEqualsExpr implements IContextKeyExpression {
492
+ private readonly key;
493
+ private readonly value;
494
+ private negated;
495
+ static create(key: string, value: any, negated?: ContextKeyExpression | null): ContextKeyExpression;
496
+ readonly type = ContextKeyExprType.NotEquals;
497
+ private constructor();
498
+ cmp(other: ContextKeyExpression): number;
499
+ equals(other: ContextKeyExpression): boolean;
500
+ substituteConstants(): ContextKeyExpression | undefined;
501
+ evaluate(context: IContext): boolean;
502
+ serialize(): string;
503
+ keys(): string[];
504
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
505
+ negate(): ContextKeyExpression;
506
+ }
507
+ declare class ContextKeyNotExpr implements IContextKeyExpression {
508
+ private readonly key;
509
+ private negated;
510
+ static create(key: string, negated?: ContextKeyExpression | null): ContextKeyExpression;
511
+ readonly type = ContextKeyExprType.Not;
512
+ private constructor();
513
+ cmp(other: ContextKeyExpression): number;
514
+ equals(other: ContextKeyExpression): boolean;
515
+ substituteConstants(): ContextKeyExpression | undefined;
516
+ evaluate(context: IContext): boolean;
517
+ serialize(): string;
518
+ keys(): string[];
519
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
520
+ negate(): ContextKeyExpression;
521
+ }
522
+ declare class ContextKeyGreaterExpr implements IContextKeyExpression {
523
+ private readonly key;
524
+ private readonly value;
525
+ private negated;
526
+ static create(key: string, _value: any, negated?: ContextKeyExpression | null): ContextKeyExpression;
527
+ readonly type = ContextKeyExprType.Greater;
528
+ private constructor();
529
+ cmp(other: ContextKeyExpression): number;
530
+ equals(other: ContextKeyExpression): boolean;
531
+ substituteConstants(): ContextKeyExpression | undefined;
532
+ evaluate(context: IContext): boolean;
533
+ serialize(): string;
534
+ keys(): string[];
535
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
536
+ negate(): ContextKeyExpression;
537
+ }
538
+ declare class ContextKeyGreaterEqualsExpr implements IContextKeyExpression {
539
+ private readonly key;
540
+ private readonly value;
541
+ private negated;
542
+ static create(key: string, _value: any, negated?: ContextKeyExpression | null): ContextKeyExpression;
543
+ readonly type = ContextKeyExprType.GreaterEquals;
544
+ private constructor();
545
+ cmp(other: ContextKeyExpression): number;
546
+ equals(other: ContextKeyExpression): boolean;
547
+ substituteConstants(): ContextKeyExpression | undefined;
548
+ evaluate(context: IContext): boolean;
549
+ serialize(): string;
550
+ keys(): string[];
551
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
552
+ negate(): ContextKeyExpression;
553
+ }
554
+ declare class ContextKeySmallerExpr implements IContextKeyExpression {
555
+ private readonly key;
556
+ private readonly value;
557
+ private negated;
558
+ static create(key: string, _value: any, negated?: ContextKeyExpression | null): ContextKeyExpression;
559
+ readonly type = ContextKeyExprType.Smaller;
560
+ private constructor();
561
+ cmp(other: ContextKeyExpression): number;
562
+ equals(other: ContextKeyExpression): boolean;
563
+ substituteConstants(): ContextKeyExpression | undefined;
564
+ evaluate(context: IContext): boolean;
565
+ serialize(): string;
566
+ keys(): string[];
567
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
568
+ negate(): ContextKeyExpression;
569
+ }
570
+ declare class ContextKeySmallerEqualsExpr implements IContextKeyExpression {
571
+ private readonly key;
572
+ private readonly value;
573
+ private negated;
574
+ static create(key: string, _value: any, negated?: ContextKeyExpression | null): ContextKeyExpression;
575
+ readonly type = ContextKeyExprType.SmallerEquals;
576
+ private constructor();
577
+ cmp(other: ContextKeyExpression): number;
578
+ equals(other: ContextKeyExpression): boolean;
579
+ substituteConstants(): ContextKeyExpression | undefined;
580
+ evaluate(context: IContext): boolean;
581
+ serialize(): string;
582
+ keys(): string[];
583
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
584
+ negate(): ContextKeyExpression;
585
+ }
586
+ declare class ContextKeyRegexExpr implements IContextKeyExpression {
587
+ private readonly key;
588
+ private readonly regexp;
589
+ static create(key: string, regexp: RegExp | null): ContextKeyRegexExpr;
590
+ readonly type = ContextKeyExprType.Regex;
591
+ private negated;
592
+ private constructor();
593
+ cmp(other: ContextKeyExpression): number;
594
+ equals(other: ContextKeyExpression): boolean;
595
+ substituteConstants(): ContextKeyExpression | undefined;
596
+ evaluate(context: IContext): boolean;
597
+ serialize(): string;
598
+ keys(): string[];
599
+ map(mapFnc: IContextKeyExprMapper): ContextKeyRegexExpr;
600
+ negate(): ContextKeyExpression;
601
+ }
602
+ declare class ContextKeyNotRegexExpr implements IContextKeyExpression {
603
+ private readonly _actual;
604
+ static create(actual: ContextKeyRegexExpr): ContextKeyExpression;
605
+ readonly type = ContextKeyExprType.NotRegex;
606
+ private constructor();
607
+ cmp(other: ContextKeyExpression): number;
608
+ equals(other: ContextKeyExpression): boolean;
609
+ substituteConstants(): ContextKeyExpression | undefined;
610
+ evaluate(context: IContext): boolean;
611
+ serialize(): string;
612
+ keys(): string[];
613
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
614
+ negate(): ContextKeyExpression;
615
+ }
616
+ declare class ContextKeyAndExpr implements IContextKeyExpression {
617
+ readonly expr: ContextKeyExpression[];
618
+ private negated;
619
+ static create(_expr: ReadonlyArray<ContextKeyExpression | null | undefined>, negated: ContextKeyExpression | null): ContextKeyExpression | undefined;
620
+ readonly type = ContextKeyExprType.And;
621
+ private constructor();
622
+ cmp(other: ContextKeyExpression): number;
623
+ equals(other: ContextKeyExpression): boolean;
624
+ substituteConstants(): ContextKeyExpression | undefined;
625
+ evaluate(context: IContext): boolean;
626
+ private static _normalizeArr;
627
+ serialize(): string;
628
+ keys(): string[];
629
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
630
+ negate(): ContextKeyExpression;
631
+ }
632
+ declare class ContextKeyOrExpr implements IContextKeyExpression {
633
+ readonly expr: ContextKeyExpression[];
634
+ private negated;
635
+ static create(_expr: ReadonlyArray<ContextKeyExpression | null | undefined>, negated: ContextKeyExpression | null, extraRedundantCheck: boolean): ContextKeyExpression | undefined;
636
+ readonly type = ContextKeyExprType.Or;
637
+ private constructor();
638
+ cmp(other: ContextKeyExpression): number;
639
+ equals(other: ContextKeyExpression): boolean;
640
+ substituteConstants(): ContextKeyExpression | undefined;
641
+ evaluate(context: IContext): boolean;
642
+ private static _normalizeArr;
643
+ serialize(): string;
644
+ keys(): string[];
645
+ map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
646
+ negate(): ContextKeyExpression;
647
+ }
648
+ declare type ContextKeyValue = null | undefined | boolean | number | string | Array<null | undefined | boolean | number | string> | Record<string, null | undefined | boolean | number | string>;
649
+ interface IContext {
650
+ getValue<T extends ContextKeyValue = ContextKeyValue>(key: string): T | undefined;
651
+ }
652
+ interface IContextKey<T extends ContextKeyValue = ContextKeyValue> {
653
+ set(value: T): void;
654
+ reset(): void;
655
+ get(): T | undefined;
656
+ }
657
+ interface IContextKeyServiceTarget {
658
+ parentElement: IContextKeyServiceTarget | null;
659
+ setAttribute(attr: string, value: string): void;
660
+ removeAttribute(attr: string): void;
661
+ hasAttribute(attr: string): boolean;
662
+ getAttribute(attr: string): string | null;
663
+ }
664
+ interface IReadableSet<T> {
665
+ has(value: T): boolean;
666
+ }
667
+ interface IContextKeyChangeEvent {
668
+ affectsSome(keys: IReadableSet<string>): boolean;
669
+ allKeysContainedIn(keys: IReadableSet<string>): boolean;
670
+ }
671
+ declare const IContextKeyService: ServiceIdentifier<IContextKeyService>;
672
+ interface IContextKeyService {
673
+ readonly _serviceBrand: undefined;
674
+ dispose(): void;
675
+ onDidChangeContext: Event<IContextKeyChangeEvent>;
676
+ bufferChangeEvents(callback: Function): void;
677
+ createKey<T extends ContextKeyValue>(key: string, defaultValue: T | undefined): IContextKey<T>;
678
+ contextMatchesRules(rules: ContextKeyExpression | undefined): boolean;
679
+ getContextKeyValue<T>(key: string): T | undefined;
680
+ createScoped(target: IContextKeyServiceTarget): IContextKeyService;
681
+ createOverlay(overlay: Iterable<[string, any]>): IContextKeyService;
682
+ getContext(target: IContextKeyServiceTarget | null): IContext;
683
+ updateParent(parentContextKeyService: IContextKeyService): void;
684
+ }
685
+
686
+ /**
687
+ * An interface for a JavaScript object that
688
+ * acts a dictionary. The keys are strings.
689
+ */
690
+ declare type IStringDictionary<V> = Record<string, V>;
691
+
692
+ declare type JSONSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'null' | 'array' | 'object';
693
+ interface IJSONSchema {
694
+ id?: string;
695
+ $id?: string;
696
+ $schema?: string;
697
+ type?: JSONSchemaType | JSONSchemaType[];
698
+ title?: string;
699
+ default?: any;
700
+ definitions?: IJSONSchemaMap;
701
+ description?: string;
702
+ properties?: IJSONSchemaMap;
703
+ patternProperties?: IJSONSchemaMap;
704
+ additionalProperties?: boolean | IJSONSchema;
705
+ minProperties?: number;
706
+ maxProperties?: number;
707
+ dependencies?: IJSONSchemaMap | {
708
+ [prop: string]: string[];
709
+ };
710
+ items?: IJSONSchema | IJSONSchema[];
711
+ minItems?: number;
712
+ maxItems?: number;
713
+ uniqueItems?: boolean;
714
+ additionalItems?: boolean | IJSONSchema;
715
+ pattern?: string;
716
+ minLength?: number;
717
+ maxLength?: number;
718
+ minimum?: number;
719
+ maximum?: number;
720
+ exclusiveMinimum?: boolean | number;
721
+ exclusiveMaximum?: boolean | number;
722
+ multipleOf?: number;
723
+ required?: string[];
724
+ $ref?: string;
725
+ anyOf?: IJSONSchema[];
726
+ allOf?: IJSONSchema[];
727
+ oneOf?: IJSONSchema[];
728
+ not?: IJSONSchema;
729
+ enum?: any[];
730
+ format?: string;
731
+ const?: any;
732
+ contains?: IJSONSchema;
733
+ propertyNames?: IJSONSchema;
734
+ examples?: any[];
735
+ $comment?: string;
736
+ if?: IJSONSchema;
737
+ then?: IJSONSchema;
738
+ else?: IJSONSchema;
739
+ unevaluatedProperties?: boolean | IJSONSchema;
740
+ unevaluatedItems?: boolean | IJSONSchema;
741
+ minContains?: number;
742
+ maxContains?: number;
743
+ deprecated?: boolean;
744
+ dependentRequired?: {
745
+ [prop: string]: string[];
746
+ };
747
+ dependentSchemas?: IJSONSchemaMap;
748
+ $defs?: {
749
+ [name: string]: IJSONSchema;
750
+ };
751
+ $anchor?: string;
752
+ $recursiveRef?: string;
753
+ $recursiveAnchor?: string;
754
+ $vocabulary?: any;
755
+ prefixItems?: IJSONSchema[];
756
+ $dynamicRef?: string;
757
+ $dynamicAnchor?: string;
758
+ defaultSnippets?: IJSONSchemaSnippet[];
759
+ errorMessage?: string;
760
+ patternErrorMessage?: string;
761
+ deprecationMessage?: string;
762
+ markdownDeprecationMessage?: string;
763
+ enumDescriptions?: string[];
764
+ markdownEnumDescriptions?: string[];
765
+ markdownDescription?: string;
766
+ doNotSuggest?: boolean;
767
+ suggestSortText?: string;
768
+ allowComments?: boolean;
769
+ allowTrailingCommas?: boolean;
770
+ }
771
+ interface IJSONSchemaMap {
772
+ [name: string]: IJSONSchema;
773
+ }
774
+ interface IJSONSchemaSnippet {
775
+ label?: string;
776
+ description?: string;
777
+ body?: any;
778
+ bodyText?: string;
779
+ }
780
+
781
+ declare type PolicyName = string;
782
+
783
+ declare enum EditPresentationTypes {
784
+ Multiline = "multilineText",
785
+ Singleline = "singlelineText"
786
+ }
787
+ declare const enum ConfigurationScope {
788
+ /**
789
+ * Application specific configuration, which can be configured only in local user settings.
790
+ */
791
+ APPLICATION = 1,
792
+ /**
793
+ * Machine specific configuration, which can be configured only in local and remote user settings.
794
+ */
795
+ MACHINE = 2,
796
+ /**
797
+ * Window specific configuration, which can be configured in the user or workspace settings.
798
+ */
799
+ WINDOW = 3,
800
+ /**
801
+ * Resource specific configuration, which can be configured in the user, workspace or folder settings.
802
+ */
803
+ RESOURCE = 4,
804
+ /**
805
+ * Resource specific configuration that can be configured in language specific settings
806
+ */
807
+ LANGUAGE_OVERRIDABLE = 5,
808
+ /**
809
+ * Machine specific configuration that can also be configured in workspace or folder settings.
810
+ */
811
+ MACHINE_OVERRIDABLE = 6
812
+ }
813
+ interface IPolicy {
814
+ /**
815
+ * The policy name.
816
+ */
817
+ readonly name: PolicyName;
818
+ /**
819
+ * The Code version in which this policy was introduced.
820
+ */
821
+ readonly minimumVersion: `${number}.${number}`;
822
+ }
823
+ interface IConfigurationPropertySchema extends IJSONSchema {
824
+ scope?: ConfigurationScope;
825
+ /**
826
+ * When restricted, value of this configuration will be read only from trusted sources.
827
+ * For eg., If the workspace is not trusted, then the value of this configuration is not read from workspace settings file.
828
+ */
829
+ restricted?: boolean;
830
+ /**
831
+ * When `false` this property is excluded from the registry. Default is to include.
832
+ */
833
+ included?: boolean;
834
+ /**
835
+ * List of tags associated to the property.
836
+ * - A tag can be used for filtering
837
+ * - Use `experimental` tag for marking the setting as experimental. **Note:** Defaults of experimental settings can be changed by the running experiments.
838
+ */
839
+ tags?: string[];
840
+ /**
841
+ * When enabled this setting is ignored during sync and user can override this.
842
+ */
843
+ ignoreSync?: boolean;
844
+ /**
845
+ * When enabled this setting is ignored during sync and user cannot override this.
846
+ */
847
+ disallowSyncIgnore?: boolean;
848
+ /**
849
+ * Labels for enumeration items
850
+ */
851
+ enumItemLabels?: string[];
852
+ /**
853
+ * When specified, controls the presentation format of string settings.
854
+ * Otherwise, the presentation format defaults to `singleline`.
855
+ */
856
+ editPresentation?: EditPresentationTypes;
857
+ /**
858
+ * When specified, gives an order number for the setting
859
+ * within the settings editor. Otherwise, the setting is placed at the end.
860
+ */
861
+ order?: number;
862
+ /**
863
+ * When specified, this setting's value can always be overwritten by
864
+ * a system-wide policy.
865
+ */
866
+ policy?: IPolicy;
867
+ }
868
+ declare const allSettings: {
869
+ properties: IStringDictionary<IConfigurationPropertySchema>;
870
+ patternProperties: IStringDictionary<IConfigurationPropertySchema>;
871
+ };
872
+
873
+ /**
874
+ * Configuration options for auto indentation in the editor
875
+ */
876
+ declare const enum EditorAutoIndentStrategy {
877
+ None = 0,
878
+ Keep = 1,
879
+ Brackets = 2,
880
+ Advanced = 3,
881
+ Full = 4
882
+ }
883
+
884
+ /**
885
+ * A position in the editor. This interface is suitable for serialization.
886
+ */
887
+ interface IPosition {
888
+ /**
889
+ * line number (starts at 1)
890
+ */
891
+ readonly lineNumber: number;
892
+ /**
893
+ * column (the first character in a line is between column 1 and column 2)
894
+ */
895
+ readonly column: number;
896
+ }
897
+ /**
898
+ * A position in the editor.
899
+ */
900
+ declare class Position {
901
+ /**
902
+ * line number (starts at 1)
903
+ */
904
+ readonly lineNumber: number;
905
+ /**
906
+ * column (the first character in a line is between column 1 and column 2)
907
+ */
908
+ readonly column: number;
909
+ constructor(lineNumber: number, column: number);
910
+ /**
911
+ * Create a new position from this position.
912
+ *
913
+ * @param newLineNumber new line number
914
+ * @param newColumn new column
915
+ */
916
+ with(newLineNumber?: number, newColumn?: number): Position;
917
+ /**
918
+ * Derive a new position from this position.
919
+ *
920
+ * @param deltaLineNumber line number delta
921
+ * @param deltaColumn column delta
922
+ */
923
+ delta(deltaLineNumber?: number, deltaColumn?: number): Position;
924
+ /**
925
+ * Test if this position equals other position
926
+ */
927
+ equals(other: IPosition): boolean;
928
+ /**
929
+ * Test if position `a` equals position `b`
930
+ */
931
+ static equals(a: IPosition | null, b: IPosition | null): boolean;
932
+ /**
933
+ * Test if this position is before other position.
934
+ * If the two positions are equal, the result will be false.
935
+ */
936
+ isBefore(other: IPosition): boolean;
937
+ /**
938
+ * Test if position `a` is before position `b`.
939
+ * If the two positions are equal, the result will be false.
940
+ */
941
+ static isBefore(a: IPosition, b: IPosition): boolean;
942
+ /**
943
+ * Test if this position is before other position.
944
+ * If the two positions are equal, the result will be true.
945
+ */
946
+ isBeforeOrEqual(other: IPosition): boolean;
947
+ /**
948
+ * Test if position `a` is before position `b`.
949
+ * If the two positions are equal, the result will be true.
950
+ */
951
+ static isBeforeOrEqual(a: IPosition, b: IPosition): boolean;
952
+ /**
953
+ * A function that compares positions, useful for sorting
954
+ */
955
+ static compare(a: IPosition, b: IPosition): number;
956
+ /**
957
+ * Clone this position.
958
+ */
959
+ clone(): Position;
960
+ /**
961
+ * Convert to a human-readable representation.
962
+ */
963
+ toString(): string;
964
+ /**
965
+ * Create a `Position` from an `IPosition`.
966
+ */
967
+ static lift(pos: IPosition): Position;
968
+ /**
969
+ * Test if `obj` is an `IPosition`.
970
+ */
971
+ static isIPosition(obj: any): obj is IPosition;
972
+ }
973
+
974
+ /**
975
+ * A range in the editor. This interface is suitable for serialization.
976
+ */
977
+ interface IRange {
978
+ /**
979
+ * Line number on which the range starts (starts at 1).
980
+ */
981
+ readonly startLineNumber: number;
982
+ /**
983
+ * Column on which the range starts in line `startLineNumber` (starts at 1).
984
+ */
985
+ readonly startColumn: number;
986
+ /**
987
+ * Line number on which the range ends.
988
+ */
989
+ readonly endLineNumber: number;
990
+ /**
991
+ * Column on which the range ends in line `endLineNumber`.
992
+ */
993
+ readonly endColumn: number;
994
+ }
995
+ /**
996
+ * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn)
997
+ */
998
+ declare class Range {
999
+ /**
1000
+ * Line number on which the range starts (starts at 1).
1001
+ */
1002
+ readonly startLineNumber: number;
1003
+ /**
1004
+ * Column on which the range starts in line `startLineNumber` (starts at 1).
1005
+ */
1006
+ readonly startColumn: number;
1007
+ /**
1008
+ * Line number on which the range ends.
1009
+ */
1010
+ readonly endLineNumber: number;
1011
+ /**
1012
+ * Column on which the range ends in line `endLineNumber`.
1013
+ */
1014
+ readonly endColumn: number;
1015
+ constructor(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number);
1016
+ /**
1017
+ * Test if this range is empty.
1018
+ */
1019
+ isEmpty(): boolean;
1020
+ /**
1021
+ * Test if `range` is empty.
1022
+ */
1023
+ static isEmpty(range: IRange): boolean;
1024
+ /**
1025
+ * Test if position is in this range. If the position is at the edges, will return true.
1026
+ */
1027
+ containsPosition(position: IPosition): boolean;
1028
+ /**
1029
+ * Test if `position` is in `range`. If the position is at the edges, will return true.
1030
+ */
1031
+ static containsPosition(range: IRange, position: IPosition): boolean;
1032
+ /**
1033
+ * Test if `position` is in `range`. If the position is at the edges, will return false.
1034
+ * @internal
1035
+ */
1036
+ static strictContainsPosition(range: IRange, position: IPosition): boolean;
1037
+ /**
1038
+ * Test if range is in this range. If the range is equal to this range, will return true.
1039
+ */
1040
+ containsRange(range: IRange): boolean;
1041
+ /**
1042
+ * Test if `otherRange` is in `range`. If the ranges are equal, will return true.
1043
+ */
1044
+ static containsRange(range: IRange, otherRange: IRange): boolean;
1045
+ /**
1046
+ * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true.
1047
+ */
1048
+ strictContainsRange(range: IRange): boolean;
1049
+ /**
1050
+ * Test if `otherRange` is strictly in `range` (must start after, and end before). If the ranges are equal, will return false.
1051
+ */
1052
+ static strictContainsRange(range: IRange, otherRange: IRange): boolean;
1053
+ /**
1054
+ * A reunion of the two ranges.
1055
+ * The smallest position will be used as the start point, and the largest one as the end point.
1056
+ */
1057
+ plusRange(range: IRange): Range;
1058
+ /**
1059
+ * A reunion of the two ranges.
1060
+ * The smallest position will be used as the start point, and the largest one as the end point.
1061
+ */
1062
+ static plusRange(a: IRange, b: IRange): Range;
1063
+ /**
1064
+ * A intersection of the two ranges.
1065
+ */
1066
+ intersectRanges(range: IRange): Range | null;
1067
+ /**
1068
+ * A intersection of the two ranges.
1069
+ */
1070
+ static intersectRanges(a: IRange, b: IRange): Range | null;
1071
+ /**
1072
+ * Test if this range equals other.
1073
+ */
1074
+ equalsRange(other: IRange | null): boolean;
1075
+ /**
1076
+ * Test if range `a` equals `b`.
1077
+ */
1078
+ static equalsRange(a: IRange | null, b: IRange | null): boolean;
1079
+ /**
1080
+ * Return the end position (which will be after or equal to the start position)
1081
+ */
1082
+ getEndPosition(): Position;
1083
+ /**
1084
+ * Return the end position (which will be after or equal to the start position)
1085
+ */
1086
+ static getEndPosition(range: IRange): Position;
1087
+ /**
1088
+ * Return the start position (which will be before or equal to the end position)
1089
+ */
1090
+ getStartPosition(): Position;
1091
+ /**
1092
+ * Return the start position (which will be before or equal to the end position)
1093
+ */
1094
+ static getStartPosition(range: IRange): Position;
1095
+ /**
1096
+ * Transform to a user presentable string representation.
1097
+ */
1098
+ toString(): string;
1099
+ /**
1100
+ * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.
1101
+ */
1102
+ setEndPosition(endLineNumber: number, endColumn: number): Range;
1103
+ /**
1104
+ * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.
1105
+ */
1106
+ setStartPosition(startLineNumber: number, startColumn: number): Range;
1107
+ /**
1108
+ * Create a new empty range using this range's start position.
1109
+ */
1110
+ collapseToStart(): Range;
1111
+ /**
1112
+ * Create a new empty range using this range's start position.
1113
+ */
1114
+ static collapseToStart(range: IRange): Range;
1115
+ static fromPositions(start: IPosition, end?: IPosition): Range;
1116
+ /**
1117
+ * Create a `Range` from an `IRange`.
1118
+ */
1119
+ static lift(range: undefined | null): null;
1120
+ static lift(range: IRange): Range;
1121
+ static lift(range: IRange | undefined | null): Range | null;
1122
+ /**
1123
+ * Test if `obj` is an `IRange`.
1124
+ */
1125
+ static isIRange(obj: any): obj is IRange;
1126
+ /**
1127
+ * Test if the two ranges are touching in any way.
1128
+ */
1129
+ static areIntersectingOrTouching(a: IRange, b: IRange): boolean;
1130
+ /**
1131
+ * Test if the two ranges are intersecting. If the ranges are touching it returns true.
1132
+ */
1133
+ static areIntersecting(a: IRange, b: IRange): boolean;
1134
+ /**
1135
+ * A function that compares ranges, useful for sorting ranges
1136
+ * It will first compare ranges on the startPosition and then on the endPosition
1137
+ */
1138
+ static compareRangesUsingStarts(a: IRange | null | undefined, b: IRange | null | undefined): number;
1139
+ /**
1140
+ * A function that compares ranges, useful for sorting ranges
1141
+ * It will first compare ranges on the endPosition and then on the startPosition
1142
+ */
1143
+ static compareRangesUsingEnds(a: IRange, b: IRange): number;
1144
+ /**
1145
+ * Test if the range spans multiple lines.
1146
+ */
1147
+ static spansMultipleLines(range: IRange): boolean;
1148
+ toJSON(): IRange;
1149
+ }
1150
+
1151
+ /**
1152
+ * A selection in the editor.
1153
+ * The selection is a range that has an orientation.
1154
+ */
1155
+ interface ISelection {
1156
+ /**
1157
+ * The line number on which the selection has started.
1158
+ */
1159
+ readonly selectionStartLineNumber: number;
1160
+ /**
1161
+ * The column on `selectionStartLineNumber` where the selection has started.
1162
+ */
1163
+ readonly selectionStartColumn: number;
1164
+ /**
1165
+ * The line number on which the selection has ended.
1166
+ */
1167
+ readonly positionLineNumber: number;
1168
+ /**
1169
+ * The column on `positionLineNumber` where the selection has ended.
1170
+ */
1171
+ readonly positionColumn: number;
1172
+ }
1173
+ /**
1174
+ * The direction of a selection.
1175
+ */
1176
+ declare const enum SelectionDirection {
1177
+ /**
1178
+ * The selection starts above where it ends.
1179
+ */
1180
+ LTR = 0,
1181
+ /**
1182
+ * The selection starts below where it ends.
1183
+ */
1184
+ RTL = 1
1185
+ }
1186
+ /**
1187
+ * A selection in the editor.
1188
+ * The selection is a range that has an orientation.
1189
+ */
1190
+ declare class Selection extends Range {
1191
+ /**
1192
+ * The line number on which the selection has started.
1193
+ */
1194
+ readonly selectionStartLineNumber: number;
1195
+ /**
1196
+ * The column on `selectionStartLineNumber` where the selection has started.
1197
+ */
1198
+ readonly selectionStartColumn: number;
1199
+ /**
1200
+ * The line number on which the selection has ended.
1201
+ */
1202
+ readonly positionLineNumber: number;
1203
+ /**
1204
+ * The column on `positionLineNumber` where the selection has ended.
1205
+ */
1206
+ readonly positionColumn: number;
1207
+ constructor(selectionStartLineNumber: number, selectionStartColumn: number, positionLineNumber: number, positionColumn: number);
1208
+ /**
1209
+ * Transform to a human-readable representation.
1210
+ */
1211
+ toString(): string;
1212
+ /**
1213
+ * Test if equals other selection.
1214
+ */
1215
+ equalsSelection(other: ISelection): boolean;
1216
+ /**
1217
+ * Test if the two selections are equal.
1218
+ */
1219
+ static selectionsEqual(a: ISelection, b: ISelection): boolean;
1220
+ /**
1221
+ * Get directions (LTR or RTL).
1222
+ */
1223
+ getDirection(): SelectionDirection;
1224
+ /**
1225
+ * Create a new selection with a different `positionLineNumber` and `positionColumn`.
1226
+ */
1227
+ setEndPosition(endLineNumber: number, endColumn: number): Selection;
1228
+ /**
1229
+ * Get the position at `positionLineNumber` and `positionColumn`.
1230
+ */
1231
+ getPosition(): Position;
1232
+ /**
1233
+ * Get the position at the start of the selection.
1234
+ */
1235
+ getSelectionStart(): Position;
1236
+ /**
1237
+ * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`.
1238
+ */
1239
+ setStartPosition(startLineNumber: number, startColumn: number): Selection;
1240
+ /**
1241
+ * Create a `Selection` from one or two positions
1242
+ */
1243
+ static fromPositions(start: IPosition, end?: IPosition): Selection;
1244
+ /**
1245
+ * Creates a `Selection` from a range, given a direction.
1246
+ */
1247
+ static fromRange(range: Range, direction: SelectionDirection): Selection;
1248
+ /**
1249
+ * Create a `Selection` from an `ISelection`.
1250
+ */
1251
+ static liftSelection(sel: ISelection): Selection;
1252
+ /**
1253
+ * `a` equals `b`.
1254
+ */
1255
+ static selectionsArrEqual(a: ISelection[], b: ISelection[]): boolean;
1256
+ /**
1257
+ * Test if `obj` is an `ISelection`.
1258
+ */
1259
+ static isISelection(obj: any): obj is ISelection;
1260
+ /**
1261
+ * Create with a direction.
1262
+ */
1263
+ static createWithDirection(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number, direction: SelectionDirection): Selection;
1264
+ }
1265
+
1266
+ interface IMarkdownString {
1267
+ readonly value: string;
1268
+ readonly isTrusted?: boolean;
1269
+ readonly supportThemeIcons?: boolean;
1270
+ readonly supportHtml?: boolean;
1271
+ readonly baseUri?: UriComponents;
1272
+ uris?: {
1273
+ [href: string]: UriComponents;
1274
+ };
1275
+ }
1276
+
1277
+ /**
1278
+ * A single edit operation, that acts as a simple replace.
1279
+ * i.e. Replace text at `range` with `text` in model.
1280
+ */
1281
+ interface ISingleEditOperation {
1282
+ /**
1283
+ * The range to replace. This can be empty to emulate a simple insert.
1284
+ */
1285
+ range: IRange;
1286
+ /**
1287
+ * The text to replace with. This can be null to emulate a simple delete.
1288
+ */
1289
+ text: string | null;
1290
+ /**
1291
+ * This indicates that this operation has "insert" semantics.
1292
+ * i.e. forceMoveMarkers = true => if `range` is collapsed, all markers at the position will be moved.
1293
+ */
1294
+ forceMoveMarkers?: boolean;
1295
+ }
1296
+
1297
+ /**
1298
+ * The Codicon library is a set of default icons that are built-in in VS Code.
1299
+ *
1300
+ * In the product (outside of base) Codicons should only be used as defaults. In order to have all icons in VS Code
1301
+ * themeable, component should define new, UI component specific icons using `iconRegistry.registerIcon`.
1302
+ * In that call a Codicon can be named as default.
1303
+ */
1304
+ declare class Codicon implements CSSIcon {
1305
+ readonly id: string;
1306
+ readonly definition: IconDefinition;
1307
+ description?: string | undefined;
1308
+ private constructor();
1309
+ get classNames(): string;
1310
+ get classNamesArray(): string[];
1311
+ get cssSelector(): string;
1312
+ private static _allCodicons;
1313
+ /**
1314
+ * @returns Returns all default icons covered by the codicon font. Only to be used by the icon registry in platform.
1315
+ */
1316
+ static getAll(): readonly Codicon[];
1317
+ static readonly add: Codicon;
1318
+ static readonly plus: Codicon;
1319
+ static readonly gistNew: Codicon;
1320
+ static readonly repoCreate: Codicon;
1321
+ static readonly lightbulb: Codicon;
1322
+ static readonly lightBulb: Codicon;
1323
+ static readonly repo: Codicon;
1324
+ static readonly repoDelete: Codicon;
1325
+ static readonly gistFork: Codicon;
1326
+ static readonly repoForked: Codicon;
1327
+ static readonly gitPullRequest: Codicon;
1328
+ static readonly gitPullRequestAbandoned: Codicon;
1329
+ static readonly recordKeys: Codicon;
1330
+ static readonly keyboard: Codicon;
1331
+ static readonly tag: Codicon;
1332
+ static readonly tagAdd: Codicon;
1333
+ static readonly tagRemove: Codicon;
1334
+ static readonly person: Codicon;
1335
+ static readonly personFollow: Codicon;
1336
+ static readonly personOutline: Codicon;
1337
+ static readonly personFilled: Codicon;
1338
+ static readonly gitBranch: Codicon;
1339
+ static readonly gitBranchCreate: Codicon;
1340
+ static readonly gitBranchDelete: Codicon;
1341
+ static readonly sourceControl: Codicon;
1342
+ static readonly mirror: Codicon;
1343
+ static readonly mirrorPublic: Codicon;
1344
+ static readonly star: Codicon;
1345
+ static readonly starAdd: Codicon;
1346
+ static readonly starDelete: Codicon;
1347
+ static readonly starEmpty: Codicon;
1348
+ static readonly comment: Codicon;
1349
+ static readonly commentAdd: Codicon;
1350
+ static readonly alert: Codicon;
1351
+ static readonly warning: Codicon;
1352
+ static readonly search: Codicon;
1353
+ static readonly searchSave: Codicon;
1354
+ static readonly logOut: Codicon;
1355
+ static readonly signOut: Codicon;
1356
+ static readonly logIn: Codicon;
1357
+ static readonly signIn: Codicon;
1358
+ static readonly eye: Codicon;
1359
+ static readonly eyeUnwatch: Codicon;
1360
+ static readonly eyeWatch: Codicon;
1361
+ static readonly circleFilled: Codicon;
1362
+ static readonly primitiveDot: Codicon;
1363
+ static readonly closeDirty: Codicon;
1364
+ static readonly debugBreakpoint: Codicon;
1365
+ static readonly debugBreakpointDisabled: Codicon;
1366
+ static readonly debugHint: Codicon;
1367
+ static readonly primitiveSquare: Codicon;
1368
+ static readonly edit: Codicon;
1369
+ static readonly pencil: Codicon;
1370
+ static readonly info: Codicon;
1371
+ static readonly issueOpened: Codicon;
1372
+ static readonly gistPrivate: Codicon;
1373
+ static readonly gitForkPrivate: Codicon;
1374
+ static readonly lock: Codicon;
1375
+ static readonly mirrorPrivate: Codicon;
1376
+ static readonly close: Codicon;
1377
+ static readonly removeClose: Codicon;
1378
+ static readonly x: Codicon;
1379
+ static readonly repoSync: Codicon;
1380
+ static readonly sync: Codicon;
1381
+ static readonly clone: Codicon;
1382
+ static readonly desktopDownload: Codicon;
1383
+ static readonly beaker: Codicon;
1384
+ static readonly microscope: Codicon;
1385
+ static readonly vm: Codicon;
1386
+ static readonly deviceDesktop: Codicon;
1387
+ static readonly file: Codicon;
1388
+ static readonly fileText: Codicon;
1389
+ static readonly more: Codicon;
1390
+ static readonly ellipsis: Codicon;
1391
+ static readonly kebabHorizontal: Codicon;
1392
+ static readonly mailReply: Codicon;
1393
+ static readonly reply: Codicon;
1394
+ static readonly organization: Codicon;
1395
+ static readonly organizationFilled: Codicon;
1396
+ static readonly organizationOutline: Codicon;
1397
+ static readonly newFile: Codicon;
1398
+ static readonly fileAdd: Codicon;
1399
+ static readonly newFolder: Codicon;
1400
+ static readonly fileDirectoryCreate: Codicon;
1401
+ static readonly trash: Codicon;
1402
+ static readonly trashcan: Codicon;
1403
+ static readonly history: Codicon;
1404
+ static readonly clock: Codicon;
1405
+ static readonly folder: Codicon;
1406
+ static readonly fileDirectory: Codicon;
1407
+ static readonly symbolFolder: Codicon;
1408
+ static readonly logoGithub: Codicon;
1409
+ static readonly markGithub: Codicon;
1410
+ static readonly github: Codicon;
1411
+ static readonly terminal: Codicon;
1412
+ static readonly console: Codicon;
1413
+ static readonly repl: Codicon;
1414
+ static readonly zap: Codicon;
1415
+ static readonly symbolEvent: Codicon;
1416
+ static readonly error: Codicon;
1417
+ static readonly stop: Codicon;
1418
+ static readonly variable: Codicon;
1419
+ static readonly symbolVariable: Codicon;
1420
+ static readonly array: Codicon;
1421
+ static readonly symbolArray: Codicon;
1422
+ static readonly symbolModule: Codicon;
1423
+ static readonly symbolPackage: Codicon;
1424
+ static readonly symbolNamespace: Codicon;
1425
+ static readonly symbolObject: Codicon;
1426
+ static readonly symbolMethod: Codicon;
1427
+ static readonly symbolFunction: Codicon;
1428
+ static readonly symbolConstructor: Codicon;
1429
+ static readonly symbolBoolean: Codicon;
1430
+ static readonly symbolNull: Codicon;
1431
+ static readonly symbolNumeric: Codicon;
1432
+ static readonly symbolNumber: Codicon;
1433
+ static readonly symbolStructure: Codicon;
1434
+ static readonly symbolStruct: Codicon;
1435
+ static readonly symbolParameter: Codicon;
1436
+ static readonly symbolTypeParameter: Codicon;
1437
+ static readonly symbolKey: Codicon;
1438
+ static readonly symbolText: Codicon;
1439
+ static readonly symbolReference: Codicon;
1440
+ static readonly goToFile: Codicon;
1441
+ static readonly symbolEnum: Codicon;
1442
+ static readonly symbolValue: Codicon;
1443
+ static readonly symbolRuler: Codicon;
1444
+ static readonly symbolUnit: Codicon;
1445
+ static readonly activateBreakpoints: Codicon;
1446
+ static readonly archive: Codicon;
1447
+ static readonly arrowBoth: Codicon;
1448
+ static readonly arrowDown: Codicon;
1449
+ static readonly arrowLeft: Codicon;
1450
+ static readonly arrowRight: Codicon;
1451
+ static readonly arrowSmallDown: Codicon;
1452
+ static readonly arrowSmallLeft: Codicon;
1453
+ static readonly arrowSmallRight: Codicon;
1454
+ static readonly arrowSmallUp: Codicon;
1455
+ static readonly arrowUp: Codicon;
1456
+ static readonly bell: Codicon;
1457
+ static readonly bold: Codicon;
1458
+ static readonly book: Codicon;
1459
+ static readonly bookmark: Codicon;
1460
+ static readonly debugBreakpointConditionalUnverified: Codicon;
1461
+ static readonly debugBreakpointConditional: Codicon;
1462
+ static readonly debugBreakpointConditionalDisabled: Codicon;
1463
+ static readonly debugBreakpointDataUnverified: Codicon;
1464
+ static readonly debugBreakpointData: Codicon;
1465
+ static readonly debugBreakpointDataDisabled: Codicon;
1466
+ static readonly debugBreakpointLogUnverified: Codicon;
1467
+ static readonly debugBreakpointLog: Codicon;
1468
+ static readonly debugBreakpointLogDisabled: Codicon;
1469
+ static readonly briefcase: Codicon;
1470
+ static readonly broadcast: Codicon;
1471
+ static readonly browser: Codicon;
1472
+ static readonly bug: Codicon;
1473
+ static readonly calendar: Codicon;
1474
+ static readonly caseSensitive: Codicon;
1475
+ static readonly check: Codicon;
1476
+ static readonly checklist: Codicon;
1477
+ static readonly chevronDown: Codicon;
1478
+ static readonly dropDownButton: Codicon;
1479
+ static readonly chevronLeft: Codicon;
1480
+ static readonly chevronRight: Codicon;
1481
+ static readonly chevronUp: Codicon;
1482
+ static readonly chromeClose: Codicon;
1483
+ static readonly chromeMaximize: Codicon;
1484
+ static readonly chromeMinimize: Codicon;
1485
+ static readonly chromeRestore: Codicon;
1486
+ static readonly circleOutline: Codicon;
1487
+ static readonly debugBreakpointUnverified: Codicon;
1488
+ static readonly circleSlash: Codicon;
1489
+ static readonly circuitBoard: Codicon;
1490
+ static readonly clearAll: Codicon;
1491
+ static readonly clippy: Codicon;
1492
+ static readonly closeAll: Codicon;
1493
+ static readonly cloudDownload: Codicon;
1494
+ static readonly cloudUpload: Codicon;
1495
+ static readonly code: Codicon;
1496
+ static readonly collapseAll: Codicon;
1497
+ static readonly colorMode: Codicon;
1498
+ static readonly commentDiscussion: Codicon;
1499
+ static readonly compareChanges: Codicon;
1500
+ static readonly creditCard: Codicon;
1501
+ static readonly dash: Codicon;
1502
+ static readonly dashboard: Codicon;
1503
+ static readonly database: Codicon;
1504
+ static readonly debugContinue: Codicon;
1505
+ static readonly debugDisconnect: Codicon;
1506
+ static readonly debugPause: Codicon;
1507
+ static readonly debugRestart: Codicon;
1508
+ static readonly debugStart: Codicon;
1509
+ static readonly debugStepInto: Codicon;
1510
+ static readonly debugStepOut: Codicon;
1511
+ static readonly debugStepOver: Codicon;
1512
+ static readonly debugStop: Codicon;
1513
+ static readonly debug: Codicon;
1514
+ static readonly deviceCameraVideo: Codicon;
1515
+ static readonly deviceCamera: Codicon;
1516
+ static readonly deviceMobile: Codicon;
1517
+ static readonly diffAdded: Codicon;
1518
+ static readonly diffIgnored: Codicon;
1519
+ static readonly diffModified: Codicon;
1520
+ static readonly diffRemoved: Codicon;
1521
+ static readonly diffRenamed: Codicon;
1522
+ static readonly diff: Codicon;
1523
+ static readonly discard: Codicon;
1524
+ static readonly editorLayout: Codicon;
1525
+ static readonly emptyWindow: Codicon;
1526
+ static readonly exclude: Codicon;
1527
+ static readonly extensions: Codicon;
1528
+ static readonly eyeClosed: Codicon;
1529
+ static readonly fileBinary: Codicon;
1530
+ static readonly fileCode: Codicon;
1531
+ static readonly fileMedia: Codicon;
1532
+ static readonly filePdf: Codicon;
1533
+ static readonly fileSubmodule: Codicon;
1534
+ static readonly fileSymlinkDirectory: Codicon;
1535
+ static readonly fileSymlinkFile: Codicon;
1536
+ static readonly fileZip: Codicon;
1537
+ static readonly files: Codicon;
1538
+ static readonly filter: Codicon;
1539
+ static readonly flame: Codicon;
1540
+ static readonly foldDown: Codicon;
1541
+ static readonly foldUp: Codicon;
1542
+ static readonly fold: Codicon;
1543
+ static readonly folderActive: Codicon;
1544
+ static readonly folderOpened: Codicon;
1545
+ static readonly gear: Codicon;
1546
+ static readonly gift: Codicon;
1547
+ static readonly gistSecret: Codicon;
1548
+ static readonly gist: Codicon;
1549
+ static readonly gitCommit: Codicon;
1550
+ static readonly gitCompare: Codicon;
1551
+ static readonly gitMerge: Codicon;
1552
+ static readonly githubAction: Codicon;
1553
+ static readonly githubAlt: Codicon;
1554
+ static readonly globe: Codicon;
1555
+ static readonly grabber: Codicon;
1556
+ static readonly graph: Codicon;
1557
+ static readonly gripper: Codicon;
1558
+ static readonly heart: Codicon;
1559
+ static readonly home: Codicon;
1560
+ static readonly horizontalRule: Codicon;
1561
+ static readonly hubot: Codicon;
1562
+ static readonly inbox: Codicon;
1563
+ static readonly issueClosed: Codicon;
1564
+ static readonly issueReopened: Codicon;
1565
+ static readonly issues: Codicon;
1566
+ static readonly italic: Codicon;
1567
+ static readonly jersey: Codicon;
1568
+ static readonly json: Codicon;
1569
+ static readonly kebabVertical: Codicon;
1570
+ static readonly key: Codicon;
1571
+ static readonly law: Codicon;
1572
+ static readonly lightbulbAutofix: Codicon;
1573
+ static readonly linkExternal: Codicon;
1574
+ static readonly link: Codicon;
1575
+ static readonly listOrdered: Codicon;
1576
+ static readonly listUnordered: Codicon;
1577
+ static readonly liveShare: Codicon;
1578
+ static readonly loading: Codicon;
1579
+ static readonly location: Codicon;
1580
+ static readonly mailRead: Codicon;
1581
+ static readonly mail: Codicon;
1582
+ static readonly markdown: Codicon;
1583
+ static readonly megaphone: Codicon;
1584
+ static readonly mention: Codicon;
1585
+ static readonly milestone: Codicon;
1586
+ static readonly mortarBoard: Codicon;
1587
+ static readonly move: Codicon;
1588
+ static readonly multipleWindows: Codicon;
1589
+ static readonly mute: Codicon;
1590
+ static readonly noNewline: Codicon;
1591
+ static readonly note: Codicon;
1592
+ static readonly octoface: Codicon;
1593
+ static readonly openPreview: Codicon;
1594
+ static readonly package_: Codicon;
1595
+ static readonly paintcan: Codicon;
1596
+ static readonly pin: Codicon;
1597
+ static readonly play: Codicon;
1598
+ static readonly run: Codicon;
1599
+ static readonly plug: Codicon;
1600
+ static readonly preserveCase: Codicon;
1601
+ static readonly preview: Codicon;
1602
+ static readonly project: Codicon;
1603
+ static readonly pulse: Codicon;
1604
+ static readonly question: Codicon;
1605
+ static readonly quote: Codicon;
1606
+ static readonly radioTower: Codicon;
1607
+ static readonly reactions: Codicon;
1608
+ static readonly references: Codicon;
1609
+ static readonly refresh: Codicon;
1610
+ static readonly regex: Codicon;
1611
+ static readonly remoteExplorer: Codicon;
1612
+ static readonly remote: Codicon;
1613
+ static readonly remove: Codicon;
1614
+ static readonly replaceAll: Codicon;
1615
+ static readonly replace: Codicon;
1616
+ static readonly repoClone: Codicon;
1617
+ static readonly repoForcePush: Codicon;
1618
+ static readonly repoPull: Codicon;
1619
+ static readonly repoPush: Codicon;
1620
+ static readonly report: Codicon;
1621
+ static readonly requestChanges: Codicon;
1622
+ static readonly rocket: Codicon;
1623
+ static readonly rootFolderOpened: Codicon;
1624
+ static readonly rootFolder: Codicon;
1625
+ static readonly rss: Codicon;
1626
+ static readonly ruby: Codicon;
1627
+ static readonly saveAll: Codicon;
1628
+ static readonly saveAs: Codicon;
1629
+ static readonly save: Codicon;
1630
+ static readonly screenFull: Codicon;
1631
+ static readonly screenNormal: Codicon;
1632
+ static readonly searchStop: Codicon;
1633
+ static readonly server: Codicon;
1634
+ static readonly settingsGear: Codicon;
1635
+ static readonly settings: Codicon;
1636
+ static readonly shield: Codicon;
1637
+ static readonly smiley: Codicon;
1638
+ static readonly sortPrecedence: Codicon;
1639
+ static readonly splitHorizontal: Codicon;
1640
+ static readonly splitVertical: Codicon;
1641
+ static readonly squirrel: Codicon;
1642
+ static readonly starFull: Codicon;
1643
+ static readonly starHalf: Codicon;
1644
+ static readonly symbolClass: Codicon;
1645
+ static readonly symbolColor: Codicon;
1646
+ static readonly symbolCustomColor: Codicon;
1647
+ static readonly symbolConstant: Codicon;
1648
+ static readonly symbolEnumMember: Codicon;
1649
+ static readonly symbolField: Codicon;
1650
+ static readonly symbolFile: Codicon;
1651
+ static readonly symbolInterface: Codicon;
1652
+ static readonly symbolKeyword: Codicon;
1653
+ static readonly symbolMisc: Codicon;
1654
+ static readonly symbolOperator: Codicon;
1655
+ static readonly symbolProperty: Codicon;
1656
+ static readonly wrench: Codicon;
1657
+ static readonly wrenchSubaction: Codicon;
1658
+ static readonly symbolSnippet: Codicon;
1659
+ static readonly tasklist: Codicon;
1660
+ static readonly telescope: Codicon;
1661
+ static readonly textSize: Codicon;
1662
+ static readonly threeBars: Codicon;
1663
+ static readonly thumbsdown: Codicon;
1664
+ static readonly thumbsup: Codicon;
1665
+ static readonly tools: Codicon;
1666
+ static readonly triangleDown: Codicon;
1667
+ static readonly triangleLeft: Codicon;
1668
+ static readonly triangleRight: Codicon;
1669
+ static readonly triangleUp: Codicon;
1670
+ static readonly twitter: Codicon;
1671
+ static readonly unfold: Codicon;
1672
+ static readonly unlock: Codicon;
1673
+ static readonly unmute: Codicon;
1674
+ static readonly unverified: Codicon;
1675
+ static readonly verified: Codicon;
1676
+ static readonly versions: Codicon;
1677
+ static readonly vmActive: Codicon;
1678
+ static readonly vmOutline: Codicon;
1679
+ static readonly vmRunning: Codicon;
1680
+ static readonly watch: Codicon;
1681
+ static readonly whitespace: Codicon;
1682
+ static readonly wholeWord: Codicon;
1683
+ static readonly window: Codicon;
1684
+ static readonly wordWrap: Codicon;
1685
+ static readonly zoomIn: Codicon;
1686
+ static readonly zoomOut: Codicon;
1687
+ static readonly listFilter: Codicon;
1688
+ static readonly listFlat: Codicon;
1689
+ static readonly listSelection: Codicon;
1690
+ static readonly selection: Codicon;
1691
+ static readonly listTree: Codicon;
1692
+ static readonly debugBreakpointFunctionUnverified: Codicon;
1693
+ static readonly debugBreakpointFunction: Codicon;
1694
+ static readonly debugBreakpointFunctionDisabled: Codicon;
1695
+ static readonly debugStackframeActive: Codicon;
1696
+ static readonly circleSmallFilled: Codicon;
1697
+ static readonly debugStackframeDot: Codicon;
1698
+ static readonly debugStackframe: Codicon;
1699
+ static readonly debugStackframeFocused: Codicon;
1700
+ static readonly debugBreakpointUnsupported: Codicon;
1701
+ static readonly symbolString: Codicon;
1702
+ static readonly debugReverseContinue: Codicon;
1703
+ static readonly debugStepBack: Codicon;
1704
+ static readonly debugRestartFrame: Codicon;
1705
+ static readonly callIncoming: Codicon;
1706
+ static readonly callOutgoing: Codicon;
1707
+ static readonly menu: Codicon;
1708
+ static readonly expandAll: Codicon;
1709
+ static readonly feedback: Codicon;
1710
+ static readonly groupByRefType: Codicon;
1711
+ static readonly ungroupByRefType: Codicon;
1712
+ static readonly account: Codicon;
1713
+ static readonly bellDot: Codicon;
1714
+ static readonly debugConsole: Codicon;
1715
+ static readonly library: Codicon;
1716
+ static readonly output: Codicon;
1717
+ static readonly runAll: Codicon;
1718
+ static readonly syncIgnored: Codicon;
1719
+ static readonly pinned: Codicon;
1720
+ static readonly githubInverted: Codicon;
1721
+ static readonly debugAlt: Codicon;
1722
+ static readonly serverProcess: Codicon;
1723
+ static readonly serverEnvironment: Codicon;
1724
+ static readonly pass: Codicon;
1725
+ static readonly stopCircle: Codicon;
1726
+ static readonly playCircle: Codicon;
1727
+ static readonly record: Codicon;
1728
+ static readonly debugAltSmall: Codicon;
1729
+ static readonly vmConnect: Codicon;
1730
+ static readonly cloud: Codicon;
1731
+ static readonly merge: Codicon;
1732
+ static readonly exportIcon: Codicon;
1733
+ static readonly graphLeft: Codicon;
1734
+ static readonly magnet: Codicon;
1735
+ static readonly notebook: Codicon;
1736
+ static readonly redo: Codicon;
1737
+ static readonly checkAll: Codicon;
1738
+ static readonly pinnedDirty: Codicon;
1739
+ static readonly passFilled: Codicon;
1740
+ static readonly circleLargeFilled: Codicon;
1741
+ static readonly circleLargeOutline: Codicon;
1742
+ static readonly combine: Codicon;
1743
+ static readonly gather: Codicon;
1744
+ static readonly table: Codicon;
1745
+ static readonly variableGroup: Codicon;
1746
+ static readonly typeHierarchy: Codicon;
1747
+ static readonly typeHierarchySub: Codicon;
1748
+ static readonly typeHierarchySuper: Codicon;
1749
+ static readonly gitPullRequestCreate: Codicon;
1750
+ static readonly runAbove: Codicon;
1751
+ static readonly runBelow: Codicon;
1752
+ static readonly notebookTemplate: Codicon;
1753
+ static readonly debugRerun: Codicon;
1754
+ static readonly workspaceTrusted: Codicon;
1755
+ static readonly workspaceUntrusted: Codicon;
1756
+ static readonly workspaceUnspecified: Codicon;
1757
+ static readonly terminalCmd: Codicon;
1758
+ static readonly terminalDebian: Codicon;
1759
+ static readonly terminalLinux: Codicon;
1760
+ static readonly terminalPowershell: Codicon;
1761
+ static readonly terminalTmux: Codicon;
1762
+ static readonly terminalUbuntu: Codicon;
1763
+ static readonly terminalBash: Codicon;
1764
+ static readonly arrowSwap: Codicon;
1765
+ static readonly copy: Codicon;
1766
+ static readonly personAdd: Codicon;
1767
+ static readonly filterFilled: Codicon;
1768
+ static readonly wand: Codicon;
1769
+ static readonly debugLineByLine: Codicon;
1770
+ static readonly inspect: Codicon;
1771
+ static readonly layers: Codicon;
1772
+ static readonly layersDot: Codicon;
1773
+ static readonly layersActive: Codicon;
1774
+ static readonly compass: Codicon;
1775
+ static readonly compassDot: Codicon;
1776
+ static readonly compassActive: Codicon;
1777
+ static readonly azure: Codicon;
1778
+ static readonly issueDraft: Codicon;
1779
+ static readonly gitPullRequestClosed: Codicon;
1780
+ static readonly gitPullRequestDraft: Codicon;
1781
+ static readonly debugAll: Codicon;
1782
+ static readonly debugCoverage: Codicon;
1783
+ static readonly runErrors: Codicon;
1784
+ static readonly folderLibrary: Codicon;
1785
+ static readonly debugContinueSmall: Codicon;
1786
+ static readonly beakerStop: Codicon;
1787
+ static readonly graphLine: Codicon;
1788
+ static readonly graphScatter: Codicon;
1789
+ static readonly pieChart: Codicon;
1790
+ static readonly bracket: Codicon;
1791
+ static readonly bracketDot: Codicon;
1792
+ static readonly bracketError: Codicon;
1793
+ static readonly lockSmall: Codicon;
1794
+ static readonly azureDevops: Codicon;
1795
+ static readonly verifiedFilled: Codicon;
1796
+ static readonly newLine: Codicon;
1797
+ static readonly layout: Codicon;
1798
+ static readonly layoutActivitybarLeft: Codicon;
1799
+ static readonly layoutActivitybarRight: Codicon;
1800
+ static readonly layoutPanelLeft: Codicon;
1801
+ static readonly layoutPanelCenter: Codicon;
1802
+ static readonly layoutPanelJustify: Codicon;
1803
+ static readonly layoutPanelRight: Codicon;
1804
+ static readonly layoutPanel: Codicon;
1805
+ static readonly layoutSidebarLeft: Codicon;
1806
+ static readonly layoutSidebarRight: Codicon;
1807
+ static readonly layoutStatusbar: Codicon;
1808
+ static readonly layoutMenubar: Codicon;
1809
+ static readonly layoutCentered: Codicon;
1810
+ static readonly layoutSidebarRightOff: Codicon;
1811
+ static readonly layoutPanelOff: Codicon;
1812
+ static readonly layoutSidebarLeftOff: Codicon;
1813
+ static readonly target: Codicon;
1814
+ static readonly indent: Codicon;
1815
+ static readonly recordSmall: Codicon;
1816
+ static readonly errorSmall: Codicon;
1817
+ static readonly arrowCircleDown: Codicon;
1818
+ static readonly arrowCircleLeft: Codicon;
1819
+ static readonly arrowCircleRight: Codicon;
1820
+ static readonly arrowCircleUp: Codicon;
1821
+ static readonly heartFilled: Codicon;
1822
+ static readonly map: Codicon;
1823
+ static readonly mapFilled: Codicon;
1824
+ static readonly circleSmall: Codicon;
1825
+ static readonly bellSlash: Codicon;
1826
+ static readonly bellSlashDot: Codicon;
1827
+ static readonly commentUnresolved: Codicon;
1828
+ static readonly gitPullRequestGoToChanges: Codicon;
1829
+ static readonly gitPullRequestNewChanges: Codicon;
1830
+ static readonly dialogError: Codicon;
1831
+ static readonly dialogWarning: Codicon;
1832
+ static readonly dialogInfo: Codicon;
1833
+ static readonly dialogClose: Codicon;
1834
+ static readonly treeItemExpanded: Codicon;
1835
+ static readonly treeFilterOnTypeOn: Codicon;
1836
+ static readonly treeFilterOnTypeOff: Codicon;
1837
+ static readonly treeFilterClear: Codicon;
1838
+ static readonly treeItemLoading: Codicon;
1839
+ static readonly menuSelection: Codicon;
1840
+ static readonly menuSubmenu: Codicon;
1841
+ static readonly menuBarMore: Codicon;
1842
+ static readonly scrollbarButtonLeft: Codicon;
1843
+ static readonly scrollbarButtonRight: Codicon;
1844
+ static readonly scrollbarButtonUp: Codicon;
1845
+ static readonly scrollbarButtonDown: Codicon;
1846
+ static readonly toolBarMore: Codicon;
1847
+ static readonly quickInputBack: Codicon;
1848
+ }
1849
+ interface CSSIcon {
1850
+ readonly id: string;
1851
+ }
1852
+ declare namespace CSSIcon {
1853
+ const iconNameSegment = "[A-Za-z0-9]+";
1854
+ const iconNameExpression = "[A-Za-z0-9-]+";
1855
+ const iconModifierExpression = "~[A-Za-z]+";
1856
+ const iconNameCharacter = "[A-Za-z0-9~-]";
1857
+ function asClassNameArray(icon: CSSIcon): string[];
1858
+ function asClassName(icon: CSSIcon): string;
1859
+ function asCSSSelector(icon: CSSIcon): string;
1860
+ }
1861
+ interface IconDefinition {
1862
+ fontCharacter: string;
1863
+ }
1864
+
1865
+ interface IDataTransferFile {
1866
+ readonly name: string;
1867
+ readonly uri?: URI;
1868
+ data(): Promise<Uint8Array>;
1869
+ }
1870
+ interface IDataTransferItem {
1871
+ asString(): Thenable<string>;
1872
+ asFile(): IDataTransferFile | undefined;
1873
+ value: any;
1874
+ }
1875
+ declare class VSDataTransfer {
1876
+ private readonly _entries;
1877
+ get size(): number;
1878
+ has(mimeType: string): boolean;
1879
+ get(mimeType: string): IDataTransferItem | undefined;
1880
+ append(mimeType: string, value: IDataTransferItem): void;
1881
+ replace(mimeType: string, value: IDataTransferItem): void;
1882
+ delete(mimeType: string): void;
1883
+ entries(): Iterable<[string, IDataTransferItem]>;
1884
+ values(): Iterable<IDataTransferItem>;
1885
+ forEach(f: (value: IDataTransferItem, key: string) => void): void;
1886
+ private toKey;
1887
+ }
1888
+
1889
+ /**
1890
+ * Open ended enum at runtime
1891
+ */
1892
+ declare const enum LanguageId {
1893
+ Null = 0,
1894
+ PlainText = 1
1895
+ }
1896
+ /**
1897
+ * Open ended enum at runtime
1898
+ */
1899
+ declare const enum ColorId {
1900
+ None = 0,
1901
+ DefaultForeground = 1,
1902
+ DefaultBackground = 2
1903
+ }
1904
+ /**
1905
+ * A standard token type.
1906
+ */
1907
+ declare const enum StandardTokenType {
1908
+ Other = 0,
1909
+ Comment = 1,
1910
+ String = 2,
1911
+ RegEx = 3
1912
+ }
1913
+ /**
1914
+ */
1915
+ interface ITokenPresentation {
1916
+ foreground: ColorId;
1917
+ italic: boolean;
1918
+ bold: boolean;
1919
+ underline: boolean;
1920
+ strikethrough: boolean;
1921
+ }
1922
+
1923
+ declare enum Severity$1 {
1924
+ Ignore = 0,
1925
+ Info = 1,
1926
+ Warning = 2,
1927
+ Error = 3
1928
+ }
1929
+ declare namespace Severity$1 {
1930
+ /**
1931
+ * Parses 'error', 'warning', 'warn', 'info' in call casings
1932
+ * and falls back to ignore.
1933
+ */
1934
+ function fromValue(value: string): Severity$1;
1935
+ function toString(severity: Severity$1): string;
1936
+ }
1937
+
1938
+ /**
1939
+ * **!Do not construct directly!**
1940
+ *
1941
+ * **!Only static methods because it gets serialized!**
1942
+ *
1943
+ * This represents the "canonical" version for an extension identifier. Extension ids
1944
+ * have to be case-insensitive (due to the marketplace), but we must ensure case
1945
+ * preservation because the extension API is already public at this time.
1946
+ *
1947
+ * For example, given an extension with the publisher `"Hello"` and the name `"World"`,
1948
+ * its canonical extension identifier is `"Hello.World"`. This extension could be
1949
+ * referenced in some other extension's dependencies using the string `"hello.world"`.
1950
+ *
1951
+ * To make matters more complicated, an extension can optionally have an UUID. When two
1952
+ * extensions have the same UUID, they are considered equal even if their identifier is different.
1953
+ */
1954
+ declare class ExtensionIdentifier {
1955
+ readonly value: string;
1956
+ private readonly _lower;
1957
+ constructor(value: string);
1958
+ static equals(a: ExtensionIdentifier | string | null | undefined, b: ExtensionIdentifier | string | null | undefined): boolean;
1959
+ /**
1960
+ * Gives the value by which to index (for equality).
1961
+ */
1962
+ static toKey(id: ExtensionIdentifier | string): string;
1963
+ }
1964
+
1965
+ /**
1966
+ *
1967
+ */
1968
+ interface IRelatedInformation {
1969
+ resource: URI;
1970
+ message: string;
1971
+ startLineNumber: number;
1972
+ startColumn: number;
1973
+ endLineNumber: number;
1974
+ endColumn: number;
1975
+ }
1976
+ declare const enum MarkerTag {
1977
+ Unnecessary = 1,
1978
+ Deprecated = 2
1979
+ }
1980
+ declare enum MarkerSeverity {
1981
+ Hint = 1,
1982
+ Info = 2,
1983
+ Warning = 4,
1984
+ Error = 8
1985
+ }
1986
+ declare namespace MarkerSeverity {
1987
+ function compare(a: MarkerSeverity, b: MarkerSeverity): number;
1988
+ function toString(a: MarkerSeverity): string;
1989
+ function fromSeverity(severity: Severity$1): MarkerSeverity;
1990
+ function toSeverity(severity: MarkerSeverity): Severity$1;
1991
+ }
1992
+ /**
1993
+ * A structure defining a problem/warning/etc.
1994
+ */
1995
+ interface IMarkerData {
1996
+ code?: string | {
1997
+ value: string;
1998
+ target: URI;
1999
+ };
2000
+ severity: MarkerSeverity;
2001
+ message: string;
2002
+ source?: string;
2003
+ startLineNumber: number;
2004
+ startColumn: number;
2005
+ endLineNumber: number;
2006
+ endColumn: number;
2007
+ relatedInformation?: IRelatedInformation[];
2008
+ tags?: MarkerTag[];
2009
+ }
2010
+ declare namespace IMarkerData {
2011
+ function makeKey(markerData: IMarkerData): string;
2012
+ function makeKeyOptionalMessage(markerData: IMarkerData, useMessage: boolean): string;
2013
+ }
2014
+
2015
+ interface ThemeColor {
2016
+ id: string;
2017
+ }
2018
+ declare namespace ThemeColor {
2019
+ function isThemeColor(obj: any): obj is ThemeColor;
2020
+ }
2021
+ interface ThemeIcon {
2022
+ readonly id: string;
2023
+ readonly color?: ThemeColor;
2024
+ }
2025
+ declare namespace ThemeIcon {
2026
+ function isThemeIcon(obj: any): obj is ThemeIcon;
2027
+ function fromString(str: string): ThemeIcon | undefined;
2028
+ function fromId(id: string): ThemeIcon;
2029
+ function modify(icon: ThemeIcon, modifier: 'disabled' | 'spin' | undefined): ThemeIcon;
2030
+ function getModifier(icon: ThemeIcon): string | undefined;
2031
+ function isEqual(ti1: ThemeIcon, ti2: ThemeIcon): boolean;
2032
+ function asThemeIcon(codicon: Codicon, color?: string): ThemeIcon;
2033
+ const asClassNameArray: (icon: ThemeIcon) => string[];
2034
+ const asClassName: (icon: ThemeIcon) => string;
2035
+ const asCSSSelector: (icon: ThemeIcon) => string;
2036
+ }
2037
+
2038
+ /**
2039
+ * @internal
2040
+ */
2041
+ interface ILanguageIdCodec {
2042
+ encodeLanguageId(languageId: string): LanguageId;
2043
+ decodeLanguageId(languageId: LanguageId): string;
2044
+ }
2045
+ /**
2046
+ * A provider result represents the values a provider, like the {@link HoverProvider},
2047
+ * may return. For once this is the actual result type `T`, like `Hover`, or a thenable that resolves
2048
+ * to that type `T`. In addition, `null` and `undefined` can be returned - either directly or from a
2049
+ * thenable.
2050
+ */
2051
+ declare type ProviderResult<T> = T | undefined | null | Thenable<T | undefined | null>;
2052
+ /**
2053
+ * A hover represents additional information for a symbol or word. Hovers are
2054
+ * rendered in a tooltip-like widget.
2055
+ */
2056
+ interface Hover {
2057
+ /**
2058
+ * The contents of this hover.
2059
+ */
2060
+ contents: IMarkdownString[];
2061
+ /**
2062
+ * The range to which this hover applies. When missing, the
2063
+ * editor will use the range at the current position or the
2064
+ * current position itself.
2065
+ */
2066
+ range?: IRange;
2067
+ }
2068
+ /**
2069
+ * The hover provider interface defines the contract between extensions and
2070
+ * the [hover](https://code.visualstudio.com/docs/editor/intellisense)-feature.
2071
+ */
2072
+ interface HoverProvider {
2073
+ /**
2074
+ * Provide a hover for the given position and document. Multiple hovers at the same
2075
+ * position will be merged by the editor. A hover can have a range which defaults
2076
+ * to the word range at the position when omitted.
2077
+ */
2078
+ provideHover(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<Hover>;
2079
+ }
2080
+ /**
2081
+ * An evaluatable expression represents additional information for an expression in a document. Evaluatable expressions are
2082
+ * evaluated by a debugger or runtime and their result is rendered in a tooltip-like widget.
2083
+ * @internal
2084
+ */
2085
+ interface EvaluatableExpression {
2086
+ /**
2087
+ * The range to which this expression applies.
2088
+ */
2089
+ range: IRange;
2090
+ /**
2091
+ * This expression overrides the expression extracted from the range.
2092
+ */
2093
+ expression?: string;
2094
+ }
2095
+ /**
2096
+ * The evaluatable expression provider interface defines the contract between extensions and
2097
+ * the debug hover.
2098
+ * @internal
2099
+ */
2100
+ interface EvaluatableExpressionProvider {
2101
+ /**
2102
+ * Provide a hover for the given position and document. Multiple hovers at the same
2103
+ * position will be merged by the editor. A hover can have a range which defaults
2104
+ * to the word range at the position when omitted.
2105
+ */
2106
+ provideEvaluatableExpression(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<EvaluatableExpression>;
2107
+ }
2108
+ /**
2109
+ * A value-object that contains contextual information when requesting inline values from a InlineValuesProvider.
2110
+ * @internal
2111
+ */
2112
+ interface InlineValueContext {
2113
+ frameId: number;
2114
+ stoppedLocation: Range;
2115
+ }
2116
+ /**
2117
+ * Provide inline value as text.
2118
+ * @internal
2119
+ */
2120
+ interface InlineValueText {
2121
+ type: 'text';
2122
+ range: IRange;
2123
+ text: string;
2124
+ }
2125
+ /**
2126
+ * Provide inline value through a variable lookup.
2127
+ * @internal
2128
+ */
2129
+ interface InlineValueVariableLookup {
2130
+ type: 'variable';
2131
+ range: IRange;
2132
+ variableName?: string;
2133
+ caseSensitiveLookup: boolean;
2134
+ }
2135
+ /**
2136
+ * Provide inline value through an expression evaluation.
2137
+ * @internal
2138
+ */
2139
+ interface InlineValueExpression {
2140
+ type: 'expression';
2141
+ range: IRange;
2142
+ expression?: string;
2143
+ }
2144
+ /**
2145
+ * Inline value information can be provided by different means:
2146
+ * - directly as a text value (class InlineValueText).
2147
+ * - as a name to use for a variable lookup (class InlineValueVariableLookup)
2148
+ * - as an evaluatable expression (class InlineValueEvaluatableExpression)
2149
+ * The InlineValue types combines all inline value types into one type.
2150
+ * @internal
2151
+ */
2152
+ declare type InlineValue = InlineValueText | InlineValueVariableLookup | InlineValueExpression;
2153
+ /**
2154
+ * The inline values provider interface defines the contract between extensions and
2155
+ * the debugger's inline values feature.
2156
+ * @internal
2157
+ */
2158
+ interface InlineValuesProvider {
2159
+ /**
2160
+ */
2161
+ onDidChangeInlineValues?: Event<void> | undefined;
2162
+ /**
2163
+ * Provide the "inline values" for the given range and document. Multiple hovers at the same
2164
+ * position will be merged by the editor. A hover can have a range which defaults
2165
+ * to the word range at the position when omitted.
2166
+ */
2167
+ provideInlineValues(model: ITextModel, viewPort: Range, context: InlineValueContext, token: CancellationToken): ProviderResult<InlineValue[]>;
2168
+ }
2169
+ declare const enum CompletionItemKind {
2170
+ Method = 0,
2171
+ Function = 1,
2172
+ Constructor = 2,
2173
+ Field = 3,
2174
+ Variable = 4,
2175
+ Class = 5,
2176
+ Struct = 6,
2177
+ Interface = 7,
2178
+ Module = 8,
2179
+ Property = 9,
2180
+ Event = 10,
2181
+ Operator = 11,
2182
+ Unit = 12,
2183
+ Value = 13,
2184
+ Constant = 14,
2185
+ Enum = 15,
2186
+ EnumMember = 16,
2187
+ Keyword = 17,
2188
+ Text = 18,
2189
+ Color = 19,
2190
+ File = 20,
2191
+ Reference = 21,
2192
+ Customcolor = 22,
2193
+ Folder = 23,
2194
+ TypeParameter = 24,
2195
+ User = 25,
2196
+ Issue = 26,
2197
+ Snippet = 27
2198
+ }
2199
+ interface CompletionItemLabel {
2200
+ label: string;
2201
+ detail?: string;
2202
+ description?: string;
2203
+ }
2204
+ declare const enum CompletionItemTag {
2205
+ Deprecated = 1
2206
+ }
2207
+ declare const enum CompletionItemInsertTextRule {
2208
+ /**
2209
+ * Adjust whitespace/indentation of multiline insert texts to
2210
+ * match the current line indentation.
2211
+ */
2212
+ KeepWhitespace = 1,
2213
+ /**
2214
+ * `insertText` is a snippet.
2215
+ */
2216
+ InsertAsSnippet = 4
2217
+ }
2218
+ interface CompletionItemRanges {
2219
+ insert: IRange;
2220
+ replace: IRange;
2221
+ }
2222
+ /**
2223
+ * A completion item represents a text snippet that is
2224
+ * proposed to complete text that is being typed.
2225
+ */
2226
+ interface CompletionItem {
2227
+ /**
2228
+ * The label of this completion item. By default
2229
+ * this is also the text that is inserted when selecting
2230
+ * this completion.
2231
+ */
2232
+ label: string | CompletionItemLabel;
2233
+ /**
2234
+ * The kind of this completion item. Based on the kind
2235
+ * an icon is chosen by the editor.
2236
+ */
2237
+ kind: CompletionItemKind;
2238
+ /**
2239
+ * A modifier to the `kind` which affect how the item
2240
+ * is rendered, e.g. Deprecated is rendered with a strikeout
2241
+ */
2242
+ tags?: ReadonlyArray<CompletionItemTag>;
2243
+ /**
2244
+ * A human-readable string with additional information
2245
+ * about this item, like type or symbol information.
2246
+ */
2247
+ detail?: string;
2248
+ /**
2249
+ * A human-readable string that represents a doc-comment.
2250
+ */
2251
+ documentation?: string | IMarkdownString;
2252
+ /**
2253
+ * A string that should be used when comparing this item
2254
+ * with other items. When `falsy` the {@link CompletionItem.label label}
2255
+ * is used.
2256
+ */
2257
+ sortText?: string;
2258
+ /**
2259
+ * A string that should be used when filtering a set of
2260
+ * completion items. When `falsy` the {@link CompletionItem.label label}
2261
+ * is used.
2262
+ */
2263
+ filterText?: string;
2264
+ /**
2265
+ * Select this item when showing. *Note* that only one completion item can be selected and
2266
+ * that the editor decides which item that is. The rule is that the *first* item of those
2267
+ * that match best is selected.
2268
+ */
2269
+ preselect?: boolean;
2270
+ /**
2271
+ * A string or snippet that should be inserted in a document when selecting
2272
+ * this completion.
2273
+ */
2274
+ insertText: string;
2275
+ /**
2276
+ * Additional rules (as bitmask) that should be applied when inserting
2277
+ * this completion.
2278
+ */
2279
+ insertTextRules?: CompletionItemInsertTextRule;
2280
+ /**
2281
+ * A range of text that should be replaced by this completion item.
2282
+ *
2283
+ * Defaults to a range from the start of the {@link TextDocument.getWordRangeAtPosition current word} to the
2284
+ * current position.
2285
+ *
2286
+ * *Note:* The range must be a {@link Range.isSingleLine single line} and it must
2287
+ * {@link Range.contains contain} the position at which completion has been {@link CompletionItemProvider.provideCompletionItems requested}.
2288
+ */
2289
+ range: IRange | CompletionItemRanges;
2290
+ /**
2291
+ * An optional set of characters that when pressed while this completion is active will accept it first and
2292
+ * then type that character. *Note* that all commit characters should have `length=1` and that superfluous
2293
+ * characters will be ignored.
2294
+ */
2295
+ commitCharacters?: string[];
2296
+ /**
2297
+ * An optional array of additional text edits that are applied when
2298
+ * selecting this completion. Edits must not overlap with the main edit
2299
+ * nor with themselves.
2300
+ */
2301
+ additionalTextEdits?: ISingleEditOperation[];
2302
+ /**
2303
+ * A command that should be run upon acceptance of this item.
2304
+ */
2305
+ command?: Command;
2306
+ /**
2307
+ * @internal
2308
+ */
2309
+ extensionId?: ExtensionIdentifier;
2310
+ /**
2311
+ * @internal
2312
+ */
2313
+ _id?: [number, number];
2314
+ }
2315
+ interface CompletionList {
2316
+ suggestions: CompletionItem[];
2317
+ incomplete?: boolean;
2318
+ dispose?(): void;
2319
+ /**
2320
+ * @internal
2321
+ */
2322
+ duration?: number;
2323
+ }
2324
+ /**
2325
+ * How a suggest provider was triggered.
2326
+ */
2327
+ declare const enum CompletionTriggerKind {
2328
+ Invoke = 0,
2329
+ TriggerCharacter = 1,
2330
+ TriggerForIncompleteCompletions = 2
2331
+ }
2332
+ /**
2333
+ * Contains additional information about the context in which
2334
+ * {@link CompletionItemProvider.provideCompletionItems completion provider} is triggered.
2335
+ */
2336
+ interface CompletionContext {
2337
+ /**
2338
+ * How the completion was triggered.
2339
+ */
2340
+ triggerKind: CompletionTriggerKind;
2341
+ /**
2342
+ * Character that triggered the completion item provider.
2343
+ *
2344
+ * `undefined` if provider was not triggered by a character.
2345
+ */
2346
+ triggerCharacter?: string;
2347
+ }
2348
+ /**
2349
+ * The completion item provider interface defines the contract between extensions and
2350
+ * the [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense).
2351
+ *
2352
+ * When computing *complete* completion items is expensive, providers can optionally implement
2353
+ * the `resolveCompletionItem`-function. In that case it is enough to return completion
2354
+ * items with a {@link CompletionItem.label label} from the
2355
+ * {@link CompletionItemProvider.provideCompletionItems provideCompletionItems}-function. Subsequently,
2356
+ * when a completion item is shown in the UI and gains focus this provider is asked to resolve
2357
+ * the item, like adding {@link CompletionItem.documentation doc-comment} or {@link CompletionItem.detail details}.
2358
+ */
2359
+ interface CompletionItemProvider {
2360
+ /**
2361
+ * @internal
2362
+ */
2363
+ _debugDisplayName?: string;
2364
+ triggerCharacters?: string[];
2365
+ /**
2366
+ * Provide completion items for the given position and document.
2367
+ */
2368
+ provideCompletionItems(model: ITextModel, position: Position, context: CompletionContext, token: CancellationToken): ProviderResult<CompletionList>;
2369
+ /**
2370
+ * Given a completion item fill in more data, like {@link CompletionItem.documentation doc-comment}
2371
+ * or {@link CompletionItem.detail details}.
2372
+ *
2373
+ * The editor will only resolve a completion item once.
2374
+ */
2375
+ resolveCompletionItem?(item: CompletionItem, token: CancellationToken): ProviderResult<CompletionItem>;
2376
+ }
2377
+ /**
2378
+ * How an {@link InlineCompletionsProvider inline completion provider} was triggered.
2379
+ */
2380
+ declare enum InlineCompletionTriggerKind {
2381
+ /**
2382
+ * Completion was triggered automatically while editing.
2383
+ * It is sufficient to return a single completion item in this case.
2384
+ */
2385
+ Automatic = 0,
2386
+ /**
2387
+ * Completion was triggered explicitly by a user gesture.
2388
+ * Return multiple completion items to enable cycling through them.
2389
+ */
2390
+ Explicit = 1
2391
+ }
2392
+ interface InlineCompletionContext {
2393
+ /**
2394
+ * How the completion was triggered.
2395
+ */
2396
+ readonly triggerKind: InlineCompletionTriggerKind;
2397
+ readonly selectedSuggestionInfo: SelectedSuggestionInfo | undefined;
2398
+ }
2399
+ interface SelectedSuggestionInfo {
2400
+ range: IRange;
2401
+ text: string;
2402
+ isSnippetText: boolean;
2403
+ completionKind: CompletionItemKind;
2404
+ }
2405
+ interface InlineCompletion {
2406
+ /**
2407
+ * The text to insert.
2408
+ * If the text contains a line break, the range must end at the end of a line.
2409
+ * If existing text should be replaced, the existing text must be a prefix of the text to insert.
2410
+ *
2411
+ * The text can also be a snippet. In that case, a preview with default parameters is shown.
2412
+ * When accepting the suggestion, the full snippet is inserted.
2413
+ */
2414
+ readonly insertText: string | {
2415
+ snippet: string;
2416
+ };
2417
+ /**
2418
+ * A text that is used to decide if this inline completion should be shown.
2419
+ * An inline completion is shown if the text to replace is a subword of the filter text.
2420
+ */
2421
+ readonly filterText?: string;
2422
+ /**
2423
+ * An optional array of additional text edits that are applied when
2424
+ * selecting this completion. Edits must not overlap with the main edit
2425
+ * nor with themselves.
2426
+ */
2427
+ readonly additionalTextEdits?: ISingleEditOperation[];
2428
+ /**
2429
+ * The range to replace.
2430
+ * Must begin and end on the same line.
2431
+ */
2432
+ readonly range?: IRange;
2433
+ readonly command?: Command;
2434
+ /**
2435
+ * If set to `true`, unopened closing brackets are removed and unclosed opening brackets are closed.
2436
+ * Defaults to `false`.
2437
+ */
2438
+ readonly completeBracketPairs?: boolean;
2439
+ }
2440
+ interface InlineCompletions<TItem extends InlineCompletion = InlineCompletion> {
2441
+ readonly items: readonly TItem[];
2442
+ /**
2443
+ * A list of commands associated with the inline completions of this list.
2444
+ */
2445
+ readonly commands?: Command[];
2446
+ }
2447
+ interface InlineCompletionsProvider<T extends InlineCompletions = InlineCompletions> {
2448
+ provideInlineCompletions(model: ITextModel, position: Position, context: InlineCompletionContext, token: CancellationToken): ProviderResult<T>;
2449
+ /**
2450
+ * Will be called when an item is shown.
2451
+ */
2452
+ handleItemDidShow?(completions: T, item: T['items'][number]): void;
2453
+ /**
2454
+ * Will be called when a completions list is no longer in use and can be garbage-collected.
2455
+ */
2456
+ freeInlineCompletions(completions: T): void;
2457
+ }
2458
+ interface CodeAction {
2459
+ title: string;
2460
+ command?: Command;
2461
+ edit?: WorkspaceEdit;
2462
+ diagnostics?: IMarkerData[];
2463
+ kind?: string;
2464
+ isPreferred?: boolean;
2465
+ disabled?: string;
2466
+ }
2467
+ declare const enum CodeActionTriggerType {
2468
+ Invoke = 1,
2469
+ Auto = 2
2470
+ }
2471
+ /**
2472
+ * @internal
2473
+ */
2474
+ interface CodeActionContext {
2475
+ only?: string;
2476
+ trigger: CodeActionTriggerType;
2477
+ }
2478
+ interface CodeActionList extends IDisposable {
2479
+ readonly actions: ReadonlyArray<CodeAction>;
2480
+ }
2481
+ /**
2482
+ * The code action interface defines the contract between extensions and
2483
+ * the [light bulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) feature.
2484
+ * @internal
2485
+ */
2486
+ interface CodeActionProvider {
2487
+ displayName?: string;
2488
+ /**
2489
+ * Provide commands for the given document and range.
2490
+ */
2491
+ provideCodeActions(model: ITextModel, range: Range | Selection, context: CodeActionContext, token: CancellationToken): ProviderResult<CodeActionList>;
2492
+ /**
2493
+ * Given a code action fill in the edit. Will only invoked when missing.
2494
+ */
2495
+ resolveCodeAction?(codeAction: CodeAction, token: CancellationToken): ProviderResult<CodeAction>;
2496
+ /**
2497
+ * Optional list of CodeActionKinds that this provider returns.
2498
+ */
2499
+ readonly providedCodeActionKinds?: ReadonlyArray<string>;
2500
+ readonly documentation?: ReadonlyArray<{
2501
+ readonly kind: string;
2502
+ readonly command: Command;
2503
+ }>;
2504
+ /**
2505
+ * @internal
2506
+ */
2507
+ _getAdditionalMenuItems?(context: CodeActionContext, actions: readonly CodeAction[]): Command[];
2508
+ }
2509
+ /**
2510
+ * @internal
2511
+ */
2512
+ interface DocumentPasteEdit {
2513
+ insertText: string | {
2514
+ snippet: string;
2515
+ };
2516
+ additionalEdit?: WorkspaceEdit;
2517
+ }
2518
+ /**
2519
+ * @internal
2520
+ */
2521
+ interface DocumentPasteEditProvider {
2522
+ readonly pasteMimeTypes: readonly string[];
2523
+ prepareDocumentPaste?(model: ITextModel, ranges: readonly IRange[], dataTransfer: VSDataTransfer, token: CancellationToken): Promise<undefined | VSDataTransfer>;
2524
+ provideDocumentPasteEdits(model: ITextModel, ranges: readonly IRange[], dataTransfer: VSDataTransfer, token: CancellationToken): Promise<DocumentPasteEdit | undefined>;
2525
+ }
2526
+ /**
2527
+ * Represents a parameter of a callable-signature. A parameter can
2528
+ * have a label and a doc-comment.
2529
+ */
2530
+ interface ParameterInformation {
2531
+ /**
2532
+ * The label of this signature. Will be shown in
2533
+ * the UI.
2534
+ */
2535
+ label: string | [number, number];
2536
+ /**
2537
+ * The human-readable doc-comment of this signature. Will be shown
2538
+ * in the UI but can be omitted.
2539
+ */
2540
+ documentation?: string | IMarkdownString;
2541
+ }
2542
+ /**
2543
+ * Represents the signature of something callable. A signature
2544
+ * can have a label, like a function-name, a doc-comment, and
2545
+ * a set of parameters.
2546
+ */
2547
+ interface SignatureInformation {
2548
+ /**
2549
+ * The label of this signature. Will be shown in
2550
+ * the UI.
2551
+ */
2552
+ label: string;
2553
+ /**
2554
+ * The human-readable doc-comment of this signature. Will be shown
2555
+ * in the UI but can be omitted.
2556
+ */
2557
+ documentation?: string | IMarkdownString;
2558
+ /**
2559
+ * The parameters of this signature.
2560
+ */
2561
+ parameters: ParameterInformation[];
2562
+ /**
2563
+ * Index of the active parameter.
2564
+ *
2565
+ * If provided, this is used in place of `SignatureHelp.activeSignature`.
2566
+ */
2567
+ activeParameter?: number;
2568
+ }
2569
+ /**
2570
+ * Signature help represents the signature of something
2571
+ * callable. There can be multiple signatures but only one
2572
+ * active and only one active parameter.
2573
+ */
2574
+ interface SignatureHelp {
2575
+ /**
2576
+ * One or more signatures.
2577
+ */
2578
+ signatures: SignatureInformation[];
2579
+ /**
2580
+ * The active signature.
2581
+ */
2582
+ activeSignature: number;
2583
+ /**
2584
+ * The active parameter of the active signature.
2585
+ */
2586
+ activeParameter: number;
2587
+ }
2588
+ interface SignatureHelpResult extends IDisposable {
2589
+ value: SignatureHelp;
2590
+ }
2591
+ declare enum SignatureHelpTriggerKind {
2592
+ Invoke = 1,
2593
+ TriggerCharacter = 2,
2594
+ ContentChange = 3
2595
+ }
2596
+ interface SignatureHelpContext {
2597
+ readonly triggerKind: SignatureHelpTriggerKind;
2598
+ readonly triggerCharacter?: string;
2599
+ readonly isRetrigger: boolean;
2600
+ readonly activeSignatureHelp?: SignatureHelp;
2601
+ }
2602
+ /**
2603
+ * The signature help provider interface defines the contract between extensions and
2604
+ * the [parameter hints](https://code.visualstudio.com/docs/editor/intellisense)-feature.
2605
+ */
2606
+ interface SignatureHelpProvider {
2607
+ readonly signatureHelpTriggerCharacters?: ReadonlyArray<string>;
2608
+ readonly signatureHelpRetriggerCharacters?: ReadonlyArray<string>;
2609
+ /**
2610
+ * Provide help for the signature at the given position and document.
2611
+ */
2612
+ provideSignatureHelp(model: ITextModel, position: Position, token: CancellationToken, context: SignatureHelpContext): ProviderResult<SignatureHelpResult>;
2613
+ }
2614
+ /**
2615
+ * A document highlight kind.
2616
+ */
2617
+ declare enum DocumentHighlightKind {
2618
+ /**
2619
+ * A textual occurrence.
2620
+ */
2621
+ Text = 0,
2622
+ /**
2623
+ * Read-access of a symbol, like reading a variable.
2624
+ */
2625
+ Read = 1,
2626
+ /**
2627
+ * Write-access of a symbol, like writing to a variable.
2628
+ */
2629
+ Write = 2
2630
+ }
2631
+ /**
2632
+ * A document highlight is a range inside a text document which deserves
2633
+ * special attention. Usually a document highlight is visualized by changing
2634
+ * the background color of its range.
2635
+ */
2636
+ interface DocumentHighlight {
2637
+ /**
2638
+ * The range this highlight applies to.
2639
+ */
2640
+ range: IRange;
2641
+ /**
2642
+ * The highlight kind, default is {@link DocumentHighlightKind.Text text}.
2643
+ */
2644
+ kind?: DocumentHighlightKind;
2645
+ }
2646
+ /**
2647
+ * The document highlight provider interface defines the contract between extensions and
2648
+ * the word-highlight-feature.
2649
+ */
2650
+ interface DocumentHighlightProvider {
2651
+ /**
2652
+ * Provide a set of document highlights, like all occurrences of a variable or
2653
+ * all exit-points of a function.
2654
+ */
2655
+ provideDocumentHighlights(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<DocumentHighlight[]>;
2656
+ }
2657
+ /**
2658
+ * The linked editing range provider interface defines the contract between extensions and
2659
+ * the linked editing feature.
2660
+ */
2661
+ interface LinkedEditingRangeProvider {
2662
+ /**
2663
+ * Provide a list of ranges that can be edited together.
2664
+ */
2665
+ provideLinkedEditingRanges(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<LinkedEditingRanges>;
2666
+ }
2667
+ /**
2668
+ * Represents a list of ranges that can be edited together along with a word pattern to describe valid contents.
2669
+ */
2670
+ interface LinkedEditingRanges {
2671
+ /**
2672
+ * A list of ranges that can be edited together. The ranges must have
2673
+ * identical length and text content. The ranges cannot overlap
2674
+ */
2675
+ ranges: IRange[];
2676
+ /**
2677
+ * An optional word pattern that describes valid contents for the given ranges.
2678
+ * If no pattern is provided, the language configuration's word pattern will be used.
2679
+ */
2680
+ wordPattern?: RegExp;
2681
+ }
2682
+ /**
2683
+ * Value-object that contains additional information when
2684
+ * requesting references.
2685
+ */
2686
+ interface ReferenceContext {
2687
+ /**
2688
+ * Include the declaration of the current symbol.
2689
+ */
2690
+ includeDeclaration: boolean;
2691
+ }
2692
+ /**
2693
+ * The reference provider interface defines the contract between extensions and
2694
+ * the [find references](https://code.visualstudio.com/docs/editor/editingevolved#_peek)-feature.
2695
+ */
2696
+ interface ReferenceProvider {
2697
+ /**
2698
+ * Provide a set of project-wide references for the given position and document.
2699
+ */
2700
+ provideReferences(model: ITextModel, position: Position, context: ReferenceContext, token: CancellationToken): ProviderResult<Location[]>;
2701
+ }
2702
+ /**
2703
+ * Represents a location inside a resource, such as a line
2704
+ * inside a text file.
2705
+ */
2706
+ interface Location {
2707
+ /**
2708
+ * The resource identifier of this location.
2709
+ */
2710
+ uri: URI;
2711
+ /**
2712
+ * The document range of this locations.
2713
+ */
2714
+ range: IRange;
2715
+ }
2716
+ interface LocationLink {
2717
+ /**
2718
+ * A range to select where this link originates from.
2719
+ */
2720
+ originSelectionRange?: IRange;
2721
+ /**
2722
+ * The target uri this link points to.
2723
+ */
2724
+ uri: URI;
2725
+ /**
2726
+ * The full range this link points to.
2727
+ */
2728
+ range: IRange;
2729
+ /**
2730
+ * A range to select this link points to. Must be contained
2731
+ * in `LocationLink.range`.
2732
+ */
2733
+ targetSelectionRange?: IRange;
2734
+ }
2735
+ declare type Definition = Location | Location[] | LocationLink[];
2736
+ /**
2737
+ * The definition provider interface defines the contract between extensions and
2738
+ * the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition)
2739
+ * and peek definition features.
2740
+ */
2741
+ interface DefinitionProvider {
2742
+ /**
2743
+ * Provide the definition of the symbol at the given position and document.
2744
+ */
2745
+ provideDefinition(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
2746
+ }
2747
+ /**
2748
+ * The definition provider interface defines the contract between extensions and
2749
+ * the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition)
2750
+ * and peek definition features.
2751
+ */
2752
+ interface DeclarationProvider {
2753
+ /**
2754
+ * Provide the declaration of the symbol at the given position and document.
2755
+ */
2756
+ provideDeclaration(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
2757
+ }
2758
+ /**
2759
+ * The implementation provider interface defines the contract between extensions and
2760
+ * the go to implementation feature.
2761
+ */
2762
+ interface ImplementationProvider {
2763
+ /**
2764
+ * Provide the implementation of the symbol at the given position and document.
2765
+ */
2766
+ provideImplementation(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
2767
+ }
2768
+ /**
2769
+ * The type definition provider interface defines the contract between extensions and
2770
+ * the go to type definition feature.
2771
+ */
2772
+ interface TypeDefinitionProvider {
2773
+ /**
2774
+ * Provide the type definition of the symbol at the given position and document.
2775
+ */
2776
+ provideTypeDefinition(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
2777
+ }
2778
+ /**
2779
+ * A symbol kind.
2780
+ */
2781
+ declare const enum SymbolKind {
2782
+ File = 0,
2783
+ Module = 1,
2784
+ Namespace = 2,
2785
+ Package = 3,
2786
+ Class = 4,
2787
+ Method = 5,
2788
+ Property = 6,
2789
+ Field = 7,
2790
+ Constructor = 8,
2791
+ Enum = 9,
2792
+ Interface = 10,
2793
+ Function = 11,
2794
+ Variable = 12,
2795
+ Constant = 13,
2796
+ String = 14,
2797
+ Number = 15,
2798
+ Boolean = 16,
2799
+ Array = 17,
2800
+ Object = 18,
2801
+ Key = 19,
2802
+ Null = 20,
2803
+ EnumMember = 21,
2804
+ Struct = 22,
2805
+ Event = 23,
2806
+ Operator = 24,
2807
+ TypeParameter = 25
2808
+ }
2809
+ declare const enum SymbolTag {
2810
+ Deprecated = 1
2811
+ }
2812
+ interface DocumentSymbol {
2813
+ name: string;
2814
+ detail: string;
2815
+ kind: SymbolKind;
2816
+ tags: ReadonlyArray<SymbolTag>;
2817
+ containerName?: string;
2818
+ range: IRange;
2819
+ selectionRange: IRange;
2820
+ children?: DocumentSymbol[];
2821
+ }
2822
+ /**
2823
+ * The document symbol provider interface defines the contract between extensions and
2824
+ * the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-symbol)-feature.
2825
+ */
2826
+ interface DocumentSymbolProvider {
2827
+ displayName?: string;
2828
+ /**
2829
+ * Provide symbol information for the given document.
2830
+ */
2831
+ provideDocumentSymbols(model: ITextModel, token: CancellationToken): ProviderResult<DocumentSymbol[]>;
2832
+ }
2833
+ interface TextEdit {
2834
+ range: IRange;
2835
+ text: string;
2836
+ eol?: EndOfLineSequence;
2837
+ }
2838
+ /**
2839
+ * Interface used to format a model
2840
+ */
2841
+ interface FormattingOptions {
2842
+ /**
2843
+ * Size of a tab in spaces.
2844
+ */
2845
+ tabSize: number;
2846
+ /**
2847
+ * Prefer spaces over tabs.
2848
+ */
2849
+ insertSpaces: boolean;
2850
+ }
2851
+ /**
2852
+ * The document formatting provider interface defines the contract between extensions and
2853
+ * the formatting-feature.
2854
+ */
2855
+ interface DocumentFormattingEditProvider {
2856
+ /**
2857
+ * @internal
2858
+ */
2859
+ readonly extensionId?: ExtensionIdentifier;
2860
+ readonly displayName?: string;
2861
+ /**
2862
+ * Provide formatting edits for a whole document.
2863
+ */
2864
+ provideDocumentFormattingEdits(model: ITextModel, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
2865
+ }
2866
+ /**
2867
+ * The document formatting provider interface defines the contract between extensions and
2868
+ * the formatting-feature.
2869
+ */
2870
+ interface DocumentRangeFormattingEditProvider {
2871
+ /**
2872
+ * @internal
2873
+ */
2874
+ readonly extensionId?: ExtensionIdentifier;
2875
+ readonly displayName?: string;
2876
+ /**
2877
+ * Provide formatting edits for a range in a document.
2878
+ *
2879
+ * The given range is a hint and providers can decide to format a smaller
2880
+ * or larger range. Often this is done by adjusting the start and end
2881
+ * of the range to full syntax nodes.
2882
+ */
2883
+ provideDocumentRangeFormattingEdits(model: ITextModel, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
2884
+ }
2885
+ /**
2886
+ * The document formatting provider interface defines the contract between extensions and
2887
+ * the formatting-feature.
2888
+ */
2889
+ interface OnTypeFormattingEditProvider {
2890
+ /**
2891
+ * @internal
2892
+ */
2893
+ readonly extensionId?: ExtensionIdentifier;
2894
+ autoFormatTriggerCharacters: string[];
2895
+ /**
2896
+ * Provide formatting edits after a character has been typed.
2897
+ *
2898
+ * The given position and character should hint to the provider
2899
+ * what range the position to expand to, like find the matching `{`
2900
+ * when `}` has been entered.
2901
+ */
2902
+ provideOnTypeFormattingEdits(model: ITextModel, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
2903
+ }
2904
+ /**
2905
+ * A link inside the editor.
2906
+ */
2907
+ interface ILink {
2908
+ range: IRange;
2909
+ url?: URI | string;
2910
+ tooltip?: string;
2911
+ }
2912
+ interface ILinksList {
2913
+ links: ILink[];
2914
+ dispose?(): void;
2915
+ }
2916
+ /**
2917
+ * A provider of links.
2918
+ */
2919
+ interface LinkProvider {
2920
+ provideLinks(model: ITextModel, token: CancellationToken): ProviderResult<ILinksList>;
2921
+ resolveLink?: (link: ILink, token: CancellationToken) => ProviderResult<ILink>;
2922
+ }
2923
+ /**
2924
+ * A color in RGBA format.
2925
+ */
2926
+ interface IColor {
2927
+ /**
2928
+ * The red component in the range [0-1].
2929
+ */
2930
+ readonly red: number;
2931
+ /**
2932
+ * The green component in the range [0-1].
2933
+ */
2934
+ readonly green: number;
2935
+ /**
2936
+ * The blue component in the range [0-1].
2937
+ */
2938
+ readonly blue: number;
2939
+ /**
2940
+ * The alpha component in the range [0-1].
2941
+ */
2942
+ readonly alpha: number;
2943
+ }
2944
+ /**
2945
+ * String representations for a color
2946
+ */
2947
+ interface IColorPresentation {
2948
+ /**
2949
+ * The label of this color presentation. It will be shown on the color
2950
+ * picker header. By default this is also the text that is inserted when selecting
2951
+ * this color presentation.
2952
+ */
2953
+ label: string;
2954
+ /**
2955
+ * An {@link TextEdit edit} which is applied to a document when selecting
2956
+ * this presentation for the color.
2957
+ */
2958
+ textEdit?: TextEdit;
2959
+ /**
2960
+ * An optional array of additional {@link TextEdit text edits} that are applied when
2961
+ * selecting this color presentation.
2962
+ */
2963
+ additionalTextEdits?: TextEdit[];
2964
+ }
2965
+ /**
2966
+ * A color range is a range in a text model which represents a color.
2967
+ */
2968
+ interface IColorInformation {
2969
+ /**
2970
+ * The range within the model.
2971
+ */
2972
+ range: IRange;
2973
+ /**
2974
+ * The color represented in this range.
2975
+ */
2976
+ color: IColor;
2977
+ }
2978
+ /**
2979
+ * A provider of colors for editor models.
2980
+ */
2981
+ interface DocumentColorProvider {
2982
+ /**
2983
+ * Provides the color ranges for a specific model.
2984
+ */
2985
+ provideDocumentColors(model: ITextModel, token: CancellationToken): ProviderResult<IColorInformation[]>;
2986
+ /**
2987
+ * Provide the string representations for a color.
2988
+ */
2989
+ provideColorPresentations(model: ITextModel, colorInfo: IColorInformation, token: CancellationToken): ProviderResult<IColorPresentation[]>;
2990
+ }
2991
+ interface SelectionRange {
2992
+ range: IRange;
2993
+ }
2994
+ interface SelectionRangeProvider {
2995
+ /**
2996
+ * Provide ranges that should be selected from the given position.
2997
+ */
2998
+ provideSelectionRanges(model: ITextModel, positions: Position[], token: CancellationToken): ProviderResult<SelectionRange[][]>;
2999
+ }
3000
+ interface FoldingContext {
3001
+ }
3002
+ /**
3003
+ * A provider of folding ranges for editor models.
3004
+ */
3005
+ interface FoldingRangeProvider {
3006
+ /**
3007
+ * An optional event to signal that the folding ranges from this provider have changed.
3008
+ */
3009
+ onDidChange?: Event<this>;
3010
+ /**
3011
+ * Provides the folding ranges for a specific model.
3012
+ */
3013
+ provideFoldingRanges(model: ITextModel, context: FoldingContext, token: CancellationToken): ProviderResult<FoldingRange[]>;
3014
+ }
3015
+ interface FoldingRange {
3016
+ /**
3017
+ * The one-based start line of the range to fold. The folded area starts after the line's last character.
3018
+ */
3019
+ start: number;
3020
+ /**
3021
+ * The one-based end line of the range to fold. The folded area ends with the line's last character.
3022
+ */
3023
+ end: number;
3024
+ /**
3025
+ * Describes the {@link FoldingRangeKind Kind} of the folding range such as {@link FoldingRangeKind.Comment Comment} or
3026
+ * {@link FoldingRangeKind.Region Region}. The kind is used to categorize folding ranges and used by commands
3027
+ * like 'Fold all comments'. See
3028
+ * {@link FoldingRangeKind} for an enumeration of standardized kinds.
3029
+ */
3030
+ kind?: FoldingRangeKind;
3031
+ }
3032
+ declare class FoldingRangeKind {
3033
+ value: string;
3034
+ /**
3035
+ * Kind for folding range representing a comment. The value of the kind is 'comment'.
3036
+ */
3037
+ static readonly Comment: FoldingRangeKind;
3038
+ /**
3039
+ * Kind for folding range representing a import. The value of the kind is 'imports'.
3040
+ */
3041
+ static readonly Imports: FoldingRangeKind;
3042
+ /**
3043
+ * Kind for folding range representing regions (for example marked by `#region`, `#endregion`).
3044
+ * The value of the kind is 'region'.
3045
+ */
3046
+ static readonly Region: FoldingRangeKind;
3047
+ /**
3048
+ * Creates a new {@link FoldingRangeKind}.
3049
+ *
3050
+ * @param value of the kind.
3051
+ */
3052
+ constructor(value: string);
3053
+ }
3054
+ interface WorkspaceEditMetadata {
3055
+ needsConfirmation: boolean;
3056
+ label: string;
3057
+ description?: string;
3058
+ /**
3059
+ * @internal
3060
+ */
3061
+ iconPath?: ThemeIcon | URI | {
3062
+ light: URI;
3063
+ dark: URI;
3064
+ };
3065
+ }
3066
+ interface WorkspaceFileEditOptions {
3067
+ overwrite?: boolean;
3068
+ ignoreIfNotExists?: boolean;
3069
+ ignoreIfExists?: boolean;
3070
+ recursive?: boolean;
3071
+ copy?: boolean;
3072
+ folder?: boolean;
3073
+ skipTrashBin?: boolean;
3074
+ maxSize?: number;
3075
+ }
3076
+ interface IWorkspaceFileEdit {
3077
+ oldResource?: URI;
3078
+ newResource?: URI;
3079
+ options?: WorkspaceFileEditOptions;
3080
+ metadata?: WorkspaceEditMetadata;
3081
+ }
3082
+ interface IWorkspaceTextEdit {
3083
+ resource: URI;
3084
+ textEdit: TextEdit & {
3085
+ insertAsSnippet?: boolean;
3086
+ };
3087
+ versionId: number | undefined;
3088
+ metadata?: WorkspaceEditMetadata;
3089
+ }
3090
+ interface WorkspaceEdit {
3091
+ edits: Array<IWorkspaceTextEdit | IWorkspaceFileEdit>;
3092
+ }
3093
+ interface Rejection {
3094
+ rejectReason?: string;
3095
+ }
3096
+ interface RenameLocation {
3097
+ range: IRange;
3098
+ text: string;
3099
+ }
3100
+ interface RenameProvider {
3101
+ provideRenameEdits(model: ITextModel, position: Position, newName: string, token: CancellationToken): ProviderResult<WorkspaceEdit & Rejection>;
3102
+ resolveRenameLocation?(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<RenameLocation & Rejection>;
3103
+ }
3104
+ interface Command {
3105
+ id: string;
3106
+ title: string;
3107
+ tooltip?: string;
3108
+ arguments?: any[];
3109
+ }
3110
+ /**
3111
+ * @internal
3112
+ */
3113
+ declare namespace Command {
3114
+ /**
3115
+ * @internal
3116
+ */
3117
+ function is(obj: any): obj is Command;
3118
+ }
3119
+ interface CodeLens {
3120
+ range: IRange;
3121
+ id?: string;
3122
+ command?: Command;
3123
+ }
3124
+ interface CodeLensList {
3125
+ lenses: CodeLens[];
3126
+ dispose(): void;
3127
+ }
3128
+ interface CodeLensProvider {
3129
+ onDidChange?: Event<this>;
3130
+ provideCodeLenses(model: ITextModel, token: CancellationToken): ProviderResult<CodeLensList>;
3131
+ resolveCodeLens?(model: ITextModel, codeLens: CodeLens, token: CancellationToken): ProviderResult<CodeLens>;
3132
+ }
3133
+ declare enum InlayHintKind {
3134
+ Type = 1,
3135
+ Parameter = 2
3136
+ }
3137
+ interface InlayHintLabelPart {
3138
+ label: string;
3139
+ tooltip?: string | IMarkdownString;
3140
+ command?: Command;
3141
+ location?: Location;
3142
+ }
3143
+ interface InlayHint {
3144
+ label: string | InlayHintLabelPart[];
3145
+ tooltip?: string | IMarkdownString;
3146
+ textEdits?: TextEdit[];
3147
+ position: IPosition;
3148
+ kind?: InlayHintKind;
3149
+ paddingLeft?: boolean;
3150
+ paddingRight?: boolean;
3151
+ }
3152
+ interface InlayHintList {
3153
+ hints: InlayHint[];
3154
+ dispose(): void;
3155
+ }
3156
+ interface InlayHintsProvider {
3157
+ displayName?: string;
3158
+ onDidChangeInlayHints?: Event<void>;
3159
+ provideInlayHints(model: ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHintList>;
3160
+ resolveInlayHint?(hint: InlayHint, token: CancellationToken): ProviderResult<InlayHint>;
3161
+ }
3162
+ interface SemanticTokensLegend {
3163
+ readonly tokenTypes: string[];
3164
+ readonly tokenModifiers: string[];
3165
+ }
3166
+ interface SemanticTokens {
3167
+ readonly resultId?: string;
3168
+ readonly data: Uint32Array;
3169
+ }
3170
+ interface SemanticTokensEdit {
3171
+ readonly start: number;
3172
+ readonly deleteCount: number;
3173
+ readonly data?: Uint32Array;
3174
+ }
3175
+ interface SemanticTokensEdits {
3176
+ readonly resultId?: string;
3177
+ readonly edits: SemanticTokensEdit[];
3178
+ }
3179
+ interface DocumentSemanticTokensProvider {
3180
+ onDidChange?: Event<void>;
3181
+ getLegend(): SemanticTokensLegend;
3182
+ provideDocumentSemanticTokens(model: ITextModel, lastResultId: string | null, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensEdits>;
3183
+ releaseDocumentSemanticTokens(resultId: string | undefined): void;
3184
+ }
3185
+ interface DocumentRangeSemanticTokensProvider {
3186
+ getLegend(): SemanticTokensLegend;
3187
+ provideDocumentRangeSemanticTokens(model: ITextModel, range: Range, token: CancellationToken): ProviderResult<SemanticTokens>;
3188
+ }
3189
+ /**
3190
+ * @internal
3191
+ */
3192
+ interface DocumentOnDropEdit {
3193
+ insertText: string | {
3194
+ snippet: string;
3195
+ };
3196
+ additionalEdit?: WorkspaceEdit;
3197
+ }
3198
+ /**
3199
+ * @internal
3200
+ */
3201
+ interface DocumentOnDropEditProvider {
3202
+ provideDocumentOnDropEdits(model: ITextModel, position: IPosition, dataTransfer: VSDataTransfer, token: CancellationToken): ProviderResult<DocumentOnDropEdit>;
3203
+ }
3204
+
3205
+ interface IViewLineTokens {
3206
+ equals(other: IViewLineTokens): boolean;
3207
+ getCount(): number;
3208
+ getForeground(tokenIndex: number): ColorId;
3209
+ getEndOffset(tokenIndex: number): number;
3210
+ getClassName(tokenIndex: number): string;
3211
+ getInlineStyle(tokenIndex: number, colorMap: string[]): string;
3212
+ getPresentation(tokenIndex: number): ITokenPresentation;
3213
+ findTokenIndexAtOffset(offset: number): number;
3214
+ getLineContent(): string;
3215
+ getMetadata(tokenIndex: number): number;
3216
+ getLanguageId(tokenIndex: number): string;
3217
+ }
3218
+ declare class LineTokens implements IViewLineTokens {
3219
+ _lineTokensBrand: void;
3220
+ private readonly _tokens;
3221
+ private readonly _tokensCount;
3222
+ private readonly _text;
3223
+ private readonly _languageIdCodec;
3224
+ static defaultTokenMetadata: number;
3225
+ static createEmpty(lineContent: string, decoder: ILanguageIdCodec): LineTokens;
3226
+ constructor(tokens: Uint32Array, text: string, decoder: ILanguageIdCodec);
3227
+ equals(other: IViewLineTokens): boolean;
3228
+ slicedEquals(other: LineTokens, sliceFromTokenIndex: number, sliceTokenCount: number): boolean;
3229
+ getLineContent(): string;
3230
+ getCount(): number;
3231
+ getStartOffset(tokenIndex: number): number;
3232
+ getMetadata(tokenIndex: number): number;
3233
+ getLanguageId(tokenIndex: number): string;
3234
+ getStandardTokenType(tokenIndex: number): StandardTokenType;
3235
+ getForeground(tokenIndex: number): ColorId;
3236
+ getClassName(tokenIndex: number): string;
3237
+ getInlineStyle(tokenIndex: number, colorMap: string[]): string;
3238
+ getPresentation(tokenIndex: number): ITokenPresentation;
3239
+ getEndOffset(tokenIndex: number): number;
3240
+ /**
3241
+ * Find the token containing offset `offset`.
3242
+ * @param offset The search offset
3243
+ * @return The index of the token containing the offset.
3244
+ */
3245
+ findTokenIndexAtOffset(offset: number): number;
3246
+ inflate(): IViewLineTokens;
3247
+ sliceAndInflate(startOffset: number, endOffset: number, deltaOffset: number): IViewLineTokens;
3248
+ static convertToEndOffset(tokens: Uint32Array, lineTextLength: number): void;
3249
+ static findIndexInTokensArray(tokens: Uint32Array, desiredIndex: number): number;
3250
+ /**
3251
+ * @pure
3252
+ * @param insertTokens Must be sorted by offset.
3253
+ */
3254
+ withInserted(insertTokens: {
3255
+ offset: number;
3256
+ text: string;
3257
+ tokenMetadata: number;
3258
+ }[]): LineTokens;
3259
+ }
3260
+
3261
+ declare class ScopedLineTokens {
3262
+ _scopedLineTokensBrand: void;
3263
+ readonly languageId: string;
3264
+ private readonly _actual;
3265
+ private readonly _firstTokenIndex;
3266
+ private readonly _lastTokenIndex;
3267
+ readonly firstCharOffset: number;
3268
+ private readonly _lastCharOffset;
3269
+ constructor(actual: LineTokens, languageId: string, firstTokenIndex: number, lastTokenIndex: number, firstCharOffset: number, lastCharOffset: number);
3270
+ getLineContent(): string;
3271
+ getActualLineContentBefore(offset: number): string;
3272
+ getTokenCount(): number;
3273
+ findTokenIndexAtOffset(offset: number): number;
3274
+ getStandardTokenType(tokenIndex: number): StandardTokenType;
3275
+ }
3276
+
3277
+ /**
3278
+ * Describes how comments for a language work.
3279
+ */
3280
+ interface CommentRule {
3281
+ /**
3282
+ * The line comment token, like `// this is a comment`
3283
+ */
3284
+ lineComment?: string | null;
3285
+ /**
3286
+ * The block comment character pair, like `/* block comment *&#47;`
3287
+ */
3288
+ blockComment?: CharacterPair | null;
3289
+ }
3290
+ /**
3291
+ * The language configuration interface defines the contract between extensions and
3292
+ * various editor features, like automatic bracket insertion, automatic indentation etc.
3293
+ */
3294
+ interface LanguageConfiguration {
3295
+ /**
3296
+ * The language's comment settings.
3297
+ */
3298
+ comments?: CommentRule;
3299
+ /**
3300
+ * The language's brackets.
3301
+ * This configuration implicitly affects pressing Enter around these brackets.
3302
+ */
3303
+ brackets?: CharacterPair[];
3304
+ /**
3305
+ * The language's word definition.
3306
+ * If the language supports Unicode identifiers (e.g. JavaScript), it is preferable
3307
+ * to provide a word definition that uses exclusion of known separators.
3308
+ * e.g.: A regex that matches anything except known separators (and dot is allowed to occur in a floating point number):
3309
+ * /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g
3310
+ */
3311
+ wordPattern?: RegExp;
3312
+ /**
3313
+ * The language's indentation settings.
3314
+ */
3315
+ indentationRules?: IndentationRule;
3316
+ /**
3317
+ * The language's rules to be evaluated when pressing Enter.
3318
+ */
3319
+ onEnterRules?: OnEnterRule[];
3320
+ /**
3321
+ * The language's auto closing pairs. The 'close' character is automatically inserted with the
3322
+ * 'open' character is typed. If not set, the configured brackets will be used.
3323
+ */
3324
+ autoClosingPairs?: IAutoClosingPairConditional[];
3325
+ /**
3326
+ * The language's surrounding pairs. When the 'open' character is typed on a selection, the
3327
+ * selected string is surrounded by the open and close characters. If not set, the autoclosing pairs
3328
+ * settings will be used.
3329
+ */
3330
+ surroundingPairs?: IAutoClosingPair[];
3331
+ /**
3332
+ * Defines a list of bracket pairs that are colorized depending on their nesting level.
3333
+ * If not set, the configured brackets will be used.
3334
+ */
3335
+ colorizedBracketPairs?: CharacterPair[];
3336
+ /**
3337
+ * Defines what characters must be after the cursor for bracket or quote autoclosing to occur when using the \'languageDefined\' autoclosing setting.
3338
+ *
3339
+ * This is typically the set of characters which can not start an expression, such as whitespace, closing brackets, non-unary operators, etc.
3340
+ */
3341
+ autoCloseBefore?: string;
3342
+ /**
3343
+ * The language's folding rules.
3344
+ */
3345
+ folding?: FoldingRules;
3346
+ /**
3347
+ * **Deprecated** Do not use.
3348
+ *
3349
+ * @deprecated Will be replaced by a better API soon.
3350
+ */
3351
+ __electricCharacterSupport?: {
3352
+ docComment?: IDocComment;
3353
+ };
3354
+ }
3355
+ /**
3356
+ * Describes indentation rules for a language.
3357
+ */
3358
+ interface IndentationRule {
3359
+ /**
3360
+ * If a line matches this pattern, then all the lines after it should be unindented once (until another rule matches).
3361
+ */
3362
+ decreaseIndentPattern: RegExp;
3363
+ /**
3364
+ * If a line matches this pattern, then all the lines after it should be indented once (until another rule matches).
3365
+ */
3366
+ increaseIndentPattern: RegExp;
3367
+ /**
3368
+ * If a line matches this pattern, then **only the next line** after it should be indented once.
3369
+ */
3370
+ indentNextLinePattern?: RegExp | null;
3371
+ /**
3372
+ * If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules.
3373
+ */
3374
+ unIndentedLinePattern?: RegExp | null;
3375
+ }
3376
+ /**
3377
+ * Describes language specific folding markers such as '#region' and '#endregion'.
3378
+ * The start and end regexes will be tested against the contents of all lines and must be designed efficiently:
3379
+ * - the regex should start with '^'
3380
+ * - regexp flags (i, g) are ignored
3381
+ */
3382
+ interface FoldingMarkers {
3383
+ start: RegExp;
3384
+ end: RegExp;
3385
+ }
3386
+ /**
3387
+ * Describes folding rules for a language.
3388
+ */
3389
+ interface FoldingRules {
3390
+ /**
3391
+ * Used by the indentation based strategy to decide whether empty lines belong to the previous or the next block.
3392
+ * A language adheres to the off-side rule if blocks in that language are expressed by their indentation.
3393
+ * See [wikipedia](https://en.wikipedia.org/wiki/Off-side_rule) for more information.
3394
+ * If not set, `false` is used and empty lines belong to the previous block.
3395
+ */
3396
+ offSide?: boolean;
3397
+ /**
3398
+ * Region markers used by the language.
3399
+ */
3400
+ markers?: FoldingMarkers;
3401
+ }
3402
+ /**
3403
+ * Describes a rule to be evaluated when pressing Enter.
3404
+ */
3405
+ interface OnEnterRule {
3406
+ /**
3407
+ * This rule will only execute if the text before the cursor matches this regular expression.
3408
+ */
3409
+ beforeText: RegExp;
3410
+ /**
3411
+ * This rule will only execute if the text after the cursor matches this regular expression.
3412
+ */
3413
+ afterText?: RegExp;
3414
+ /**
3415
+ * This rule will only execute if the text above the this line matches this regular expression.
3416
+ */
3417
+ previousLineText?: RegExp;
3418
+ /**
3419
+ * The action to execute.
3420
+ */
3421
+ action: EnterAction;
3422
+ }
3423
+ /**
3424
+ * Definition of documentation comments (e.g. Javadoc/JSdoc)
3425
+ */
3426
+ interface IDocComment {
3427
+ /**
3428
+ * The string that starts a doc comment (e.g. '/**')
3429
+ */
3430
+ open: string;
3431
+ /**
3432
+ * The string that appears on the last line and closes the doc comment (e.g. ' * /').
3433
+ */
3434
+ close?: string;
3435
+ }
3436
+ /**
3437
+ * A tuple of two characters, like a pair of
3438
+ * opening and closing brackets.
3439
+ */
3440
+ declare type CharacterPair = [string, string];
3441
+ interface IAutoClosingPair {
3442
+ open: string;
3443
+ close: string;
3444
+ }
3445
+ interface IAutoClosingPairConditional extends IAutoClosingPair {
3446
+ notIn?: string[];
3447
+ }
3448
+ /**
3449
+ * Describes what to do with the indentation when pressing Enter.
3450
+ */
3451
+ declare enum IndentAction {
3452
+ /**
3453
+ * Insert new line and copy the previous line's indentation.
3454
+ */
3455
+ None = 0,
3456
+ /**
3457
+ * Insert new line and indent once (relative to the previous line's indentation).
3458
+ */
3459
+ Indent = 1,
3460
+ /**
3461
+ * Insert two new lines:
3462
+ * - the first one indented which will hold the cursor
3463
+ * - the second one at the same indentation level
3464
+ */
3465
+ IndentOutdent = 2,
3466
+ /**
3467
+ * Insert new line and outdent once (relative to the previous line's indentation).
3468
+ */
3469
+ Outdent = 3
3470
+ }
3471
+ /**
3472
+ * Describes what to do when pressing Enter.
3473
+ */
3474
+ interface EnterAction {
3475
+ /**
3476
+ * Describe what to do with the indentation.
3477
+ */
3478
+ indentAction: IndentAction;
3479
+ /**
3480
+ * Describes text to be appended after the new line and after the indentation.
3481
+ */
3482
+ appendText?: string;
3483
+ /**
3484
+ * Describes the number of characters to remove from the new line's indentation.
3485
+ */
3486
+ removeText?: number;
3487
+ }
3488
+ /**
3489
+ * @internal
3490
+ */
3491
+ declare class StandardAutoClosingPairConditional {
3492
+ readonly open: string;
3493
+ readonly close: string;
3494
+ private readonly _inString;
3495
+ private readonly _inComment;
3496
+ private readonly _inRegEx;
3497
+ private _neutralCharacter;
3498
+ private _neutralCharacterSearched;
3499
+ constructor(source: IAutoClosingPairConditional);
3500
+ isOK(standardToken: StandardTokenType): boolean;
3501
+ shouldAutoClose(context: ScopedLineTokens, column: number): boolean;
3502
+ private _findNeutralCharacterInRange;
3503
+ /**
3504
+ * Find a character in the range [0-9a-zA-Z] that does not appear in the open or close
3505
+ */
3506
+ findNeutralCharacter(): string | null;
3507
+ }
3508
+ /**
3509
+ * @internal
3510
+ */
3511
+ declare class AutoClosingPairs {
3512
+ /** Key is first character of open */
3513
+ readonly autoClosingPairsOpenByStart: Map<string, StandardAutoClosingPairConditional[]>;
3514
+ /** Key is last character of open */
3515
+ readonly autoClosingPairsOpenByEnd: Map<string, StandardAutoClosingPairConditional[]>;
3516
+ /** Key is first character of close */
3517
+ readonly autoClosingPairsCloseByStart: Map<string, StandardAutoClosingPairConditional[]>;
3518
+ /** Key is last character of close */
3519
+ readonly autoClosingPairsCloseByEnd: Map<string, StandardAutoClosingPairConditional[]>;
3520
+ /** Key is close. Only has pairs that are a single character */
3521
+ readonly autoClosingPairsCloseSingleChar: Map<string, StandardAutoClosingPairConditional[]>;
3522
+ constructor(autoClosingPairs: StandardAutoClosingPairConditional[]);
3523
+ }
3524
+
3525
+ /**
3526
+ * Captures all bracket related configurations for a single language.
3527
+ * Immutable.
3528
+ */
3529
+ declare class LanguageBracketsConfiguration {
3530
+ readonly languageId: string;
3531
+ private readonly _openingBrackets;
3532
+ private readonly _closingBrackets;
3533
+ constructor(languageId: string, config: LanguageConfiguration);
3534
+ /**
3535
+ * No two brackets have the same bracket text.
3536
+ */
3537
+ get openingBrackets(): readonly OpeningBracketKind[];
3538
+ /**
3539
+ * No two brackets have the same bracket text.
3540
+ */
3541
+ get closingBrackets(): readonly ClosingBracketKind[];
3542
+ getOpeningBracketInfo(bracketText: string): OpeningBracketKind | undefined;
3543
+ getClosingBracketInfo(bracketText: string): ClosingBracketKind | undefined;
3544
+ getBracketInfo(bracketText: string): BracketKind | undefined;
3545
+ }
3546
+ declare type BracketKind = OpeningBracketKind | ClosingBracketKind;
3547
+ declare class BracketKindBase {
3548
+ protected readonly config: LanguageBracketsConfiguration;
3549
+ readonly bracketText: string;
3550
+ constructor(config: LanguageBracketsConfiguration, bracketText: string);
3551
+ get languageId(): string;
3552
+ }
3553
+ declare class OpeningBracketKind extends BracketKindBase {
3554
+ readonly openedBrackets: ReadonlySet<ClosingBracketKind>;
3555
+ readonly isOpeningBracket = true;
3556
+ constructor(config: LanguageBracketsConfiguration, bracketText: string, openedBrackets: ReadonlySet<ClosingBracketKind>);
3557
+ }
3558
+ declare class ClosingBracketKind extends BracketKindBase {
3559
+ /**
3560
+ * Non empty array of all opening brackets this bracket closes.
3561
+ */
3562
+ readonly closedBrackets: ReadonlySet<OpeningBracketKind>;
3563
+ readonly isOpeningBracket = false;
3564
+ constructor(config: LanguageBracketsConfiguration, bracketText: string,
3565
+ /**
3566
+ * Non empty array of all opening brackets this bracket closes.
3567
+ */
3568
+ closedBrackets: ReadonlySet<OpeningBracketKind>);
3569
+ /**
3570
+ * Checks if this bracket closes the given other bracket.
3571
+ * Brackets from other language configuration can be used (they will always return false).
3572
+ * If other is a bracket with the same language id, they have to be from the same configuration.
3573
+ */
3574
+ closes(other: OpeningBracketKind): boolean;
3575
+ getClosedBrackets(): readonly OpeningBracketKind[];
3576
+ }
3577
+
3578
+ declare class CharacterPairSupport {
3579
+ static readonly DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED = ";:.,=}])> \n\t";
3580
+ static readonly DEFAULT_AUTOCLOSE_BEFORE_WHITESPACE = " \n\t";
3581
+ private readonly _autoClosingPairs;
3582
+ private readonly _surroundingPairs;
3583
+ private readonly _autoCloseBefore;
3584
+ constructor(config: LanguageConfiguration);
3585
+ getAutoClosingPairs(): StandardAutoClosingPairConditional[];
3586
+ getAutoCloseBeforeSet(): string;
3587
+ getSurroundingPairs(): IAutoClosingPair[];
3588
+ }
3589
+
3590
+ /**
3591
+ * Represents a grouping of colliding bracket pairs.
3592
+ *
3593
+ * Most of the times this contains a single bracket pair,
3594
+ * but sometimes this contains multiple bracket pairs in cases
3595
+ * where the same string appears as a closing bracket for multiple
3596
+ * bracket pairs, or the same string appears an opening bracket for
3597
+ * multiple bracket pairs.
3598
+ *
3599
+ * e.g. of a group containing a single pair:
3600
+ * open: ['{'], close: ['}']
3601
+ *
3602
+ * e.g. of a group containing multiple pairs:
3603
+ * open: ['if', 'for'], close: ['end', 'end']
3604
+ */
3605
+ declare class RichEditBracket {
3606
+ _richEditBracketBrand: void;
3607
+ readonly languageId: string;
3608
+ /**
3609
+ * A 0-based consecutive unique identifier for this bracket pair.
3610
+ * If a language has 5 bracket pairs, out of which 2 are grouped together,
3611
+ * it is expected that the `index` goes from 0 to 4.
3612
+ */
3613
+ readonly index: number;
3614
+ /**
3615
+ * The open sequence for each bracket pair contained in this group.
3616
+ *
3617
+ * The open sequence at a specific index corresponds to the
3618
+ * closing sequence at the same index.
3619
+ *
3620
+ * [ open[i], closed[i] ] represent a bracket pair.
3621
+ */
3622
+ readonly open: string[];
3623
+ /**
3624
+ * The close sequence for each bracket pair contained in this group.
3625
+ *
3626
+ * The close sequence at a specific index corresponds to the
3627
+ * opening sequence at the same index.
3628
+ *
3629
+ * [ open[i], closed[i] ] represent a bracket pair.
3630
+ */
3631
+ readonly close: string[];
3632
+ /**
3633
+ * A regular expression that is useful to search for this bracket pair group in a string.
3634
+ *
3635
+ * This regular expression is built in a way that it is aware of the other bracket
3636
+ * pairs defined for the language, so it might match brackets from other groups.
3637
+ *
3638
+ * See the fine details in `getRegexForBracketPair`.
3639
+ */
3640
+ readonly forwardRegex: RegExp;
3641
+ /**
3642
+ * A regular expression that is useful to search for this bracket pair group in a string backwards.
3643
+ *
3644
+ * This regular expression is built in a way that it is aware of the other bracket
3645
+ * pairs defined for the language, so it might match brackets from other groups.
3646
+ *
3647
+ * See the fine defails in `getReversedRegexForBracketPair`.
3648
+ */
3649
+ readonly reversedRegex: RegExp;
3650
+ private readonly _openSet;
3651
+ private readonly _closeSet;
3652
+ constructor(languageId: string, index: number, open: string[], close: string[], forwardRegex: RegExp, reversedRegex: RegExp);
3653
+ /**
3654
+ * Check if the provided `text` is an open bracket in this group.
3655
+ */
3656
+ isOpen(text: string): boolean;
3657
+ /**
3658
+ * Check if the provided `text` is a close bracket in this group.
3659
+ */
3660
+ isClose(text: string): boolean;
3661
+ private static _toSet;
3662
+ }
3663
+ declare class RichEditBrackets {
3664
+ _richEditBracketsBrand: void;
3665
+ /**
3666
+ * All groups of brackets defined for this language.
3667
+ */
3668
+ readonly brackets: RichEditBracket[];
3669
+ /**
3670
+ * A regular expression that is useful to search for all bracket pairs in a string.
3671
+ *
3672
+ * See the fine details in `getRegexForBrackets`.
3673
+ */
3674
+ readonly forwardRegex: RegExp;
3675
+ /**
3676
+ * A regular expression that is useful to search for all bracket pairs in a string backwards.
3677
+ *
3678
+ * See the fine details in `getReversedRegexForBrackets`.
3679
+ */
3680
+ readonly reversedRegex: RegExp;
3681
+ /**
3682
+ * The length (i.e. str.length) for the longest bracket pair.
3683
+ */
3684
+ readonly maxBracketLength: number;
3685
+ /**
3686
+ * A map useful for decoding a regex match and finding which bracket group was matched.
3687
+ */
3688
+ readonly textIsBracket: {
3689
+ [text: string]: RichEditBracket;
3690
+ };
3691
+ /**
3692
+ * A set useful for decoding if a regex match is the open bracket of a bracket pair.
3693
+ */
3694
+ readonly textIsOpenBracket: {
3695
+ [text: string]: boolean;
3696
+ };
3697
+ constructor(languageId: string, _brackets: readonly CharacterPair[]);
3698
+ }
3699
+
3700
+ /**
3701
+ * Interface used to support electric characters
3702
+ * @internal
3703
+ */
3704
+ interface IElectricAction {
3705
+ matchOpenBracket: string;
3706
+ }
3707
+ declare class BracketElectricCharacterSupport {
3708
+ private readonly _richEditBrackets;
3709
+ constructor(richEditBrackets: RichEditBrackets | null);
3710
+ getElectricCharacters(): string[];
3711
+ onElectricCharacter(character: string, context: ScopedLineTokens, column: number): IElectricAction | null;
3712
+ }
3713
+
3714
+ declare class IndentRulesSupport {
3715
+ private readonly _indentationRules;
3716
+ constructor(indentationRules: IndentationRule);
3717
+ shouldIncrease(text: string): boolean;
3718
+ shouldDecrease(text: string): boolean;
3719
+ shouldIndentNextLine(text: string): boolean;
3720
+ shouldIgnore(text: string): boolean;
3721
+ getIndentMetadata(text: string): number;
3722
+ }
3723
+
3724
+ /**
3725
+ * Interface used to support insertion of mode specific comments.
3726
+ */
3727
+ interface ICommentsConfiguration {
3728
+ lineCommentToken?: string;
3729
+ blockCommentStartToken?: string;
3730
+ blockCommentEndToken?: string;
3731
+ }
3732
+ declare class LanguageConfigurationServiceChangeEvent {
3733
+ readonly languageId: string | undefined;
3734
+ constructor(languageId: string | undefined);
3735
+ affects(languageId: string): boolean;
3736
+ }
3737
+ interface ILanguageConfigurationService {
3738
+ readonly _serviceBrand: undefined;
3739
+ onDidChange: Event<LanguageConfigurationServiceChangeEvent>;
3740
+ /**
3741
+ * @param priority Use a higher number for higher priority
3742
+ */
3743
+ register(languageId: string, configuration: LanguageConfiguration, priority?: number): IDisposable;
3744
+ getLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration;
3745
+ }
3746
+ declare const ILanguageConfigurationService: ServiceIdentifier<ILanguageConfigurationService>;
3747
+ /**
3748
+ * Immutable.
3749
+ */
3750
+ declare class ResolvedLanguageConfiguration {
3751
+ readonly languageId: string;
3752
+ readonly underlyingConfig: LanguageConfiguration;
3753
+ private _brackets;
3754
+ private _electricCharacter;
3755
+ private readonly _onEnterSupport;
3756
+ readonly comments: ICommentsConfiguration | null;
3757
+ readonly characterPair: CharacterPairSupport;
3758
+ readonly wordDefinition: RegExp;
3759
+ readonly indentRulesSupport: IndentRulesSupport | null;
3760
+ readonly indentationRules: IndentationRule | undefined;
3761
+ readonly foldingRules: FoldingRules;
3762
+ readonly bracketsNew: LanguageBracketsConfiguration;
3763
+ constructor(languageId: string, underlyingConfig: LanguageConfiguration);
3764
+ getWordDefinition(): RegExp;
3765
+ get brackets(): RichEditBrackets | null;
3766
+ get electricCharacter(): BracketElectricCharacterSupport | null;
3767
+ onEnter(autoIndent: EditorAutoIndentStrategy, previousLineText: string, beforeEnterText: string, afterEnterText: string): EnterAction | null;
3768
+ getAutoClosingPairs(): AutoClosingPairs;
3769
+ getAutoCloseBeforeSet(): string;
3770
+ getSurroundingPairs(): IAutoClosingPair[];
3771
+ private static _handleComments;
3772
+ }
3773
+
3774
+ /**
3775
+ * Vertical Lane in the overview ruler of the editor.
3776
+ */
3777
+ declare enum OverviewRulerLane {
3778
+ Left = 1,
3779
+ Center = 2,
3780
+ Right = 4,
3781
+ Full = 7
3782
+ }
3783
+ /**
3784
+ * Position in the minimap to render the decoration.
3785
+ */
3786
+ declare enum MinimapPosition {
3787
+ Inline = 1,
3788
+ Gutter = 2
3789
+ }
3790
+ interface IDecorationOptions {
3791
+ /**
3792
+ * CSS color to render.
3793
+ * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry
3794
+ */
3795
+ color: string | ThemeColor | undefined;
3796
+ /**
3797
+ * CSS color to render.
3798
+ * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry
3799
+ */
3800
+ darkColor?: string | ThemeColor;
3801
+ }
3802
+ /**
3803
+ * Options for rendering a model decoration in the overview ruler.
3804
+ */
3805
+ interface IModelDecorationOverviewRulerOptions extends IDecorationOptions {
3806
+ /**
3807
+ * The position in the overview ruler.
3808
+ */
3809
+ position: OverviewRulerLane;
3810
+ }
3811
+ /**
3812
+ * Options for rendering a model decoration in the overview ruler.
3813
+ */
3814
+ interface IModelDecorationMinimapOptions extends IDecorationOptions {
3815
+ /**
3816
+ * The position in the overview ruler.
3817
+ */
3818
+ position: MinimapPosition;
3819
+ }
3820
+ /**
3821
+ * Options for a model decoration.
3822
+ */
3823
+ interface IModelDecorationOptions {
3824
+ /**
3825
+ * A debug description that can be used for inspecting model decorations.
3826
+ * @internal
3827
+ */
3828
+ description: string;
3829
+ /**
3830
+ * Customize the growing behavior of the decoration when typing at the edges of the decoration.
3831
+ * Defaults to TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges
3832
+ */
3833
+ stickiness?: TrackedRangeStickiness;
3834
+ /**
3835
+ * CSS class name describing the decoration.
3836
+ */
3837
+ className?: string | null;
3838
+ blockClassName?: string | null;
3839
+ /**
3840
+ * Message to be rendered when hovering over the glyph margin decoration.
3841
+ */
3842
+ glyphMarginHoverMessage?: IMarkdownString | IMarkdownString[] | null;
3843
+ /**
3844
+ * Array of MarkdownString to render as the decoration message.
3845
+ */
3846
+ hoverMessage?: IMarkdownString | IMarkdownString[] | null;
3847
+ /**
3848
+ * Should the decoration expand to encompass a whole line.
3849
+ */
3850
+ isWholeLine?: boolean;
3851
+ /**
3852
+ * Always render the decoration (even when the range it encompasses is collapsed).
3853
+ */
3854
+ showIfCollapsed?: boolean;
3855
+ /**
3856
+ * Collapse the decoration if its entire range is being replaced via an edit.
3857
+ * @internal
3858
+ */
3859
+ collapseOnReplaceEdit?: boolean;
3860
+ /**
3861
+ * Specifies the stack order of a decoration.
3862
+ * A decoration with greater stack order is always in front of a decoration with
3863
+ * a lower stack order when the decorations are on the same line.
3864
+ */
3865
+ zIndex?: number;
3866
+ /**
3867
+ * If set, render this decoration in the overview ruler.
3868
+ */
3869
+ overviewRuler?: IModelDecorationOverviewRulerOptions | null;
3870
+ /**
3871
+ * If set, render this decoration in the minimap.
3872
+ */
3873
+ minimap?: IModelDecorationMinimapOptions | null;
3874
+ /**
3875
+ * If set, the decoration will be rendered in the glyph margin with this CSS class name.
3876
+ */
3877
+ glyphMarginClassName?: string | null;
3878
+ /**
3879
+ * If set, the decoration will be rendered in the lines decorations with this CSS class name.
3880
+ */
3881
+ linesDecorationsClassName?: string | null;
3882
+ /**
3883
+ * If set, the decoration will be rendered in the lines decorations with this CSS class name, but only for the first line in case of line wrapping.
3884
+ */
3885
+ firstLineDecorationClassName?: string | null;
3886
+ /**
3887
+ * If set, the decoration will be rendered in the margin (covering its full width) with this CSS class name.
3888
+ */
3889
+ marginClassName?: string | null;
3890
+ /**
3891
+ * If set, the decoration will be rendered inline with the text with this CSS class name.
3892
+ * Please use this only for CSS rules that must impact the text. For example, use `className`
3893
+ * to have a background color decoration.
3894
+ */
3895
+ inlineClassName?: string | null;
3896
+ /**
3897
+ * If there is an `inlineClassName` which affects letter spacing.
3898
+ */
3899
+ inlineClassNameAffectsLetterSpacing?: boolean;
3900
+ /**
3901
+ * If set, the decoration will be rendered before the text with this CSS class name.
3902
+ */
3903
+ beforeContentClassName?: string | null;
3904
+ /**
3905
+ * If set, the decoration will be rendered after the text with this CSS class name.
3906
+ */
3907
+ afterContentClassName?: string | null;
3908
+ /**
3909
+ * If set, text will be injected in the view after the range.
3910
+ */
3911
+ after?: InjectedTextOptions | null;
3912
+ /**
3913
+ * If set, text will be injected in the view before the range.
3914
+ */
3915
+ before?: InjectedTextOptions | null;
3916
+ /**
3917
+ * If set, this decoration will not be rendered for comment tokens.
3918
+ * @internal
3919
+ */
3920
+ hideInCommentTokens?: boolean | null;
3921
+ /**
3922
+ * If set, this decoration will not be rendered for string tokens.
3923
+ * @internal
3924
+ */
3925
+ hideInStringTokens?: boolean | null;
3926
+ }
3927
+ /**
3928
+ * Configures text that is injected into the view without changing the underlying document.
3929
+ */
3930
+ interface InjectedTextOptions {
3931
+ /**
3932
+ * Sets the text to inject. Must be a single line.
3933
+ */
3934
+ readonly content: string;
3935
+ /**
3936
+ * If set, the decoration will be rendered inline with the text with this CSS class name.
3937
+ */
3938
+ readonly inlineClassName?: string | null;
3939
+ /**
3940
+ * If there is an `inlineClassName` which affects letter spacing.
3941
+ */
3942
+ readonly inlineClassNameAffectsLetterSpacing?: boolean;
3943
+ /**
3944
+ * This field allows to attach data to this injected text.
3945
+ * The data can be read when injected texts at a given position are queried.
3946
+ */
3947
+ readonly attachedData?: unknown;
3948
+ /**
3949
+ * Configures cursor stops around injected text.
3950
+ * Defaults to {@link InjectedTextCursorStops.Both}.
3951
+ */
3952
+ readonly cursorStops?: InjectedTextCursorStops | null;
3953
+ }
3954
+ declare enum InjectedTextCursorStops {
3955
+ Both = 0,
3956
+ Right = 1,
3957
+ Left = 2,
3958
+ None = 3
3959
+ }
3960
+ /**
3961
+ * New model decorations.
3962
+ */
3963
+ interface IModelDeltaDecoration {
3964
+ /**
3965
+ * Range that this decoration covers.
3966
+ */
3967
+ range: IRange;
3968
+ /**
3969
+ * Options associated with this decoration.
3970
+ */
3971
+ options: IModelDecorationOptions;
3972
+ }
3973
+ /**
3974
+ * An accessor that can add, change or remove model decorations.
3975
+ * @internal
3976
+ */
3977
+ interface IModelDecorationsChangeAccessor {
3978
+ /**
3979
+ * Add a new decoration.
3980
+ * @param range Range that this decoration covers.
3981
+ * @param options Options associated with this decoration.
3982
+ * @return An unique identifier associated with this decoration.
3983
+ */
3984
+ addDecoration(range: IRange, options: IModelDecorationOptions): string;
3985
+ /**
3986
+ * Change the range that an existing decoration covers.
3987
+ * @param id The unique identifier associated with the decoration.
3988
+ * @param newRange The new range that this decoration covers.
3989
+ */
3990
+ changeDecoration(id: string, newRange: IRange): void;
3991
+ /**
3992
+ * Change the options associated with an existing decoration.
3993
+ * @param id The unique identifier associated with the decoration.
3994
+ * @param newOptions The new options associated with this decoration.
3995
+ */
3996
+ changeDecorationOptions(id: string, newOptions: IModelDecorationOptions): void;
3997
+ /**
3998
+ * Remove an existing decoration.
3999
+ * @param id The unique identifier associated with the decoration.
4000
+ */
4001
+ removeDecoration(id: string): void;
4002
+ /**
4003
+ * Perform a minimum amount of operations, in order to transform the decorations
4004
+ * identified by `oldDecorations` to the decorations described by `newDecorations`
4005
+ * and returns the new identifiers associated with the resulting decorations.
4006
+ *
4007
+ * @param oldDecorations Array containing previous decorations identifiers.
4008
+ * @param newDecorations Array describing what decorations should result after the call.
4009
+ * @return An array containing the new decorations identifiers.
4010
+ */
4011
+ deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[];
4012
+ }
4013
+ /**
4014
+ * End of line character preference.
4015
+ */
4016
+ declare const enum EndOfLineSequence {
4017
+ /**
4018
+ * Use line feed (\n) as the end of line character.
4019
+ */
4020
+ LF = 0,
4021
+ /**
4022
+ * Use carriage return and line feed (\r\n) as the end of line character.
4023
+ */
4024
+ CRLF = 1
4025
+ }
4026
+ /**
4027
+ * Describes the behavior of decorations when typing/editing near their edges.
4028
+ * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior`
4029
+ */
4030
+ declare const enum TrackedRangeStickiness {
4031
+ AlwaysGrowsWhenTypingAtEdges = 0,
4032
+ NeverGrowsWhenTypingAtEdges = 1,
4033
+ GrowsOnlyWhenTypingBefore = 2,
4034
+ GrowsOnlyWhenTypingAfter = 3
4035
+ }
4036
+ /**
4037
+ * A model.
4038
+ */
4039
+ type ITextModel = monaco.editor.ITextModel
4040
+
4041
+ /**
4042
+ * An editor contribution that gets created every time a new editor gets created and gets disposed when the editor gets disposed.
4043
+ */
4044
+ interface IEditorContribution {
4045
+ /**
4046
+ * Dispose this contribution.
4047
+ */
4048
+ dispose(): void;
4049
+ /**
4050
+ * Store view state.
4051
+ */
4052
+ saveViewState?(): any;
4053
+ /**
4054
+ * Restore view state.
4055
+ */
4056
+ restoreViewState?(state: any): void;
4057
+ }
4058
+
4059
+ /**
4060
+ * A rich code editor.
4061
+ */
4062
+ type ICodeEditor = monaco.editor.ICodeEditor
4063
+
4064
+ interface IAction extends IDisposable {
4065
+ readonly id: string;
4066
+ label: string;
4067
+ tooltip: string;
4068
+ class: string | undefined;
4069
+ enabled: boolean;
4070
+ checked?: boolean;
4071
+ run(event?: unknown): unknown;
4072
+ }
4073
+
4074
+ declare type TypeConstraint = string | Function;
4075
+
4076
+ declare type ICommandsMap = Map<string, ICommand>;
4077
+ interface ICommandHandler {
4078
+ (accessor: ServicesAccessor, ...args: any[]): void;
4079
+ }
4080
+ interface ICommand {
4081
+ id: string;
4082
+ handler: ICommandHandler;
4083
+ description?: ICommandHandlerDescription | null;
4084
+ }
4085
+ interface ICommandHandlerDescription {
4086
+ readonly description: string;
4087
+ readonly args: ReadonlyArray<{
4088
+ readonly name: string;
4089
+ readonly isOptional?: boolean;
4090
+ readonly description?: string;
4091
+ readonly constraint?: TypeConstraint;
4092
+ readonly schema?: IJSONSchema;
4093
+ }>;
4094
+ readonly returns?: string;
4095
+ }
4096
+ interface ICommandRegistry {
4097
+ onDidRegisterCommand: Event<string>;
4098
+ registerCommand(id: string, command: ICommandHandler): IDisposable;
4099
+ registerCommand(command: ICommand): IDisposable;
4100
+ registerCommandAlias(oldId: string, newId: string): IDisposable;
4101
+ getCommand(id: string): ICommand | undefined;
4102
+ getCommands(): ICommandsMap;
4103
+ }
4104
+ declare const CommandsRegistry: ICommandRegistry;
4105
+
4106
+ type Severity = Severity$1;
4107
+ declare type NotificationMessage = string | Error;
4108
+ interface INotificationProperties {
4109
+ /**
4110
+ * Sticky notifications are not automatically removed after a certain timeout. By
4111
+ * default, notifications with primary actions and severity error are always sticky.
4112
+ */
4113
+ readonly sticky?: boolean;
4114
+ /**
4115
+ * Silent notifications are not shown to the user unless the notification center
4116
+ * is opened. The status bar will still indicate all number of notifications to
4117
+ * catch some attention.
4118
+ */
4119
+ readonly silent?: boolean;
4120
+ /**
4121
+ * Adds an action to never show the notification again. The choice will be persisted
4122
+ * such as future requests will not cause the notification to show again.
4123
+ */
4124
+ readonly neverShowAgain?: INeverShowAgainOptions;
4125
+ }
4126
+ declare enum NeverShowAgainScope {
4127
+ /**
4128
+ * Will never show this notification on the current workspace again.
4129
+ */
4130
+ WORKSPACE = 0,
4131
+ /**
4132
+ * Will never show this notification on any workspace of the same
4133
+ * profile again.
4134
+ */
4135
+ PROFILE = 1,
4136
+ /**
4137
+ * Will never show this notification on any workspace across all
4138
+ * profiles again.
4139
+ */
4140
+ APPLICATION = 2
4141
+ }
4142
+ interface INeverShowAgainOptions {
4143
+ /**
4144
+ * The id is used to persist the selection of not showing the notification again.
4145
+ */
4146
+ readonly id: string;
4147
+ /**
4148
+ * By default the action will show up as primary action. Setting this to true will
4149
+ * make it a secondary action instead.
4150
+ */
4151
+ readonly isSecondary?: boolean;
4152
+ /**
4153
+ * Whether to persist the choice in the current workspace or for all workspaces. By
4154
+ * default it will be persisted for all workspaces across all profiles
4155
+ * (= `NeverShowAgainScope.APPLICATION`).
4156
+ */
4157
+ readonly scope?: NeverShowAgainScope;
4158
+ }
4159
+ interface INotification extends INotificationProperties {
4160
+ /**
4161
+ * The id of the notification. If provided, will be used to compare
4162
+ * notifications with others to decide whether a notification is
4163
+ * duplicate or not.
4164
+ */
4165
+ readonly id?: string;
4166
+ /**
4167
+ * The severity of the notification. Either `Info`, `Warning` or `Error`.
4168
+ */
4169
+ readonly severity: Severity;
4170
+ /**
4171
+ * The message of the notification. This can either be a `string` or `Error`. Messages
4172
+ * can optionally include links in the format: `[text](link)`
4173
+ */
4174
+ readonly message: NotificationMessage;
4175
+ /**
4176
+ * The source of the notification appears as additional information.
4177
+ */
4178
+ readonly source?: string | {
4179
+ label: string;
4180
+ id: string;
4181
+ };
4182
+ /**
4183
+ * Actions to show as part of the notification. Primary actions show up as
4184
+ * buttons as part of the message and will close the notification once clicked.
4185
+ *
4186
+ * Secondary actions are meant to provide additional configuration or context
4187
+ * for the notification and will show up less prominent. A notification does not
4188
+ * close automatically when invoking a secondary action.
4189
+ *
4190
+ * **Note:** If your intent is to show a message with actions to the user, consider
4191
+ * the `INotificationService.prompt()` method instead which are optimized for
4192
+ * this usecase and much easier to use!
4193
+ */
4194
+ actions?: INotificationActions;
4195
+ /**
4196
+ * The initial set of progress properties for the notification. To update progress
4197
+ * later on, access the `INotificationHandle.progress` property.
4198
+ */
4199
+ readonly progress?: INotificationProgressProperties;
4200
+ }
4201
+ interface INotificationActions {
4202
+ /**
4203
+ * Primary actions show up as buttons as part of the message and will close
4204
+ * the notification once clicked.
4205
+ *
4206
+ * Pass `ActionWithMenuAction` for an action that has additional menu actions.
4207
+ */
4208
+ readonly primary?: readonly IAction[];
4209
+ /**
4210
+ * Secondary actions are meant to provide additional configuration or context
4211
+ * for the notification and will show up less prominent. A notification does not
4212
+ * close automatically when invoking a secondary action.
4213
+ */
4214
+ readonly secondary?: readonly IAction[];
4215
+ }
4216
+ interface INotificationProgressProperties {
4217
+ /**
4218
+ * Causes the progress bar to spin infinitley.
4219
+ */
4220
+ readonly infinite?: boolean;
4221
+ /**
4222
+ * Indicate the total amount of work.
4223
+ */
4224
+ readonly total?: number;
4225
+ /**
4226
+ * Indicate that a specific chunk of work is done.
4227
+ */
4228
+ readonly worked?: number;
4229
+ }
4230
+ interface INotificationProgress {
4231
+ /**
4232
+ * Causes the progress bar to spin infinitley.
4233
+ */
4234
+ infinite(): void;
4235
+ /**
4236
+ * Indicate the total amount of work.
4237
+ */
4238
+ total(value: number): void;
4239
+ /**
4240
+ * Indicate that a specific chunk of work is done.
4241
+ */
4242
+ worked(value: number): void;
4243
+ /**
4244
+ * Indicate that the long running operation is done.
4245
+ */
4246
+ done(): void;
4247
+ }
4248
+ interface INotificationHandle {
4249
+ /**
4250
+ * Will be fired once the notification is closed.
4251
+ */
4252
+ readonly onDidClose: Event<void>;
4253
+ /**
4254
+ * Will be fired whenever the visibility of the notification changes.
4255
+ * A notification can either be visible as toast or inside the notification
4256
+ * center if it is visible.
4257
+ */
4258
+ readonly onDidChangeVisibility: Event<boolean>;
4259
+ /**
4260
+ * Allows to indicate progress on the notification even after the
4261
+ * notification is already visible.
4262
+ */
4263
+ readonly progress: INotificationProgress;
4264
+ /**
4265
+ * Allows to update the severity of the notification.
4266
+ */
4267
+ updateSeverity(severity: Severity): void;
4268
+ /**
4269
+ * Allows to update the message of the notification even after the
4270
+ * notification is already visible.
4271
+ */
4272
+ updateMessage(message: NotificationMessage): void;
4273
+ /**
4274
+ * Allows to update the actions of the notification even after the
4275
+ * notification is already visible.
4276
+ */
4277
+ updateActions(actions?: INotificationActions): void;
4278
+ /**
4279
+ * Hide the notification and remove it from the notification center.
4280
+ */
4281
+ close(): void;
4282
+ }
4283
+ interface IBasePromptChoice {
4284
+ /**
4285
+ * Label to show for the choice to the user.
4286
+ */
4287
+ readonly label: string;
4288
+ /**
4289
+ * Whether to keep the notification open after the choice was selected
4290
+ * by the user. By default, will close the notification upon click.
4291
+ */
4292
+ readonly keepOpen?: boolean;
4293
+ /**
4294
+ * Triggered when the user selects the choice.
4295
+ */
4296
+ run: () => void;
4297
+ }
4298
+ interface IPromptChoice extends IBasePromptChoice {
4299
+ /**
4300
+ * Primary choices show up as buttons in the notification below the message.
4301
+ * Secondary choices show up under the gear icon in the header of the notification.
4302
+ */
4303
+ readonly isSecondary?: boolean;
4304
+ }
4305
+ interface IPromptChoiceWithMenu extends IPromptChoice {
4306
+ /**
4307
+ * Additional choices those will be shown in the dropdown menu for this choice.
4308
+ */
4309
+ readonly menu: IBasePromptChoice[];
4310
+ /**
4311
+ * Menu is not supported on secondary choices
4312
+ */
4313
+ readonly isSecondary: false | undefined;
4314
+ }
4315
+ interface IPromptOptions extends INotificationProperties {
4316
+ /**
4317
+ * Will be called if the user closed the notification without picking
4318
+ * any of the provided choices.
4319
+ */
4320
+ onCancel?: () => void;
4321
+ }
4322
+ interface IStatusMessageOptions {
4323
+ /**
4324
+ * An optional timeout after which the status message should show. By default
4325
+ * the status message will show immediately.
4326
+ */
4327
+ readonly showAfter?: number;
4328
+ /**
4329
+ * An optional timeout after which the status message is to be hidden. By default
4330
+ * the status message will not hide until another status message is displayed.
4331
+ */
4332
+ readonly hideAfter?: number;
4333
+ }
4334
+ declare const INotificationService: ServiceIdentifier<INotificationService>;
4335
+ /**
4336
+ * A service to bring up notifications and non-modal prompts.
4337
+ *
4338
+ * Note: use the `IDialogService` for a modal way to ask the user for input.
4339
+ */
4340
+ interface INotificationService {
4341
+ readonly _serviceBrand: undefined;
4342
+ /**
4343
+ * The DND mode can be enabled or disabled
4344
+ * and will result in all info and warning
4345
+ * notifications to be silent.
4346
+ */
4347
+ doNotDisturbMode: boolean;
4348
+ /**
4349
+ * Emitted when a new notification is added.
4350
+ */
4351
+ readonly onDidAddNotification: Event<INotification>;
4352
+ /**
4353
+ * Emitted when a notification is removed.
4354
+ */
4355
+ readonly onDidRemoveNotification: Event<INotification>;
4356
+ /**
4357
+ * Emitted when a do not disturb mode has changed.
4358
+ */
4359
+ readonly onDidChangeDoNotDisturbMode: Event<void>;
4360
+ /**
4361
+ * Show the provided notification to the user. The returned `INotificationHandle`
4362
+ * can be used to control the notification afterwards.
4363
+ *
4364
+ * **Note:** If your intent is to show a message with actions to the user, consider
4365
+ * the `INotificationService.prompt()` method instead which are optimized for
4366
+ * this usecase and much easier to use!
4367
+ *
4368
+ * @returns a handle on the notification to e.g. hide it or update message, buttons, etc.
4369
+ */
4370
+ notify(notification: INotification): INotificationHandle;
4371
+ /**
4372
+ * A convenient way of reporting infos. Use the `INotificationService.notify`
4373
+ * method if you need more control over the notification.
4374
+ */
4375
+ info(message: NotificationMessage | NotificationMessage[]): void;
4376
+ /**
4377
+ * A convenient way of reporting warnings. Use the `INotificationService.notify`
4378
+ * method if you need more control over the notification.
4379
+ */
4380
+ warn(message: NotificationMessage | NotificationMessage[]): void;
4381
+ /**
4382
+ * A convenient way of reporting errors. Use the `INotificationService.notify`
4383
+ * method if you need more control over the notification.
4384
+ */
4385
+ error(message: NotificationMessage | NotificationMessage[]): void;
4386
+ /**
4387
+ * Shows a prompt in the notification area with the provided choices. The prompt
4388
+ * is non-modal. If you want to show a modal dialog instead, use `IDialogService`.
4389
+ *
4390
+ * @param severity the severity of the notification. Either `Info`, `Warning` or `Error`.
4391
+ * @param message the message to show as status.
4392
+ * @param choices options to be chosen from.
4393
+ * @param options provides some optional configuration options.
4394
+ *
4395
+ * @returns a handle on the notification to e.g. hide it or update message, buttons, etc.
4396
+ */
4397
+ prompt(severity: Severity, message: string, choices: (IPromptChoice | IPromptChoiceWithMenu)[], options?: IPromptOptions): INotificationHandle;
4398
+ /**
4399
+ * Shows a status message in the status area with the provided text.
4400
+ *
4401
+ * @param message the message to show as status
4402
+ * @param options provides some optional configuration options
4403
+ *
4404
+ * @returns a disposable to hide the status message
4405
+ */
4406
+ status(message: NotificationMessage, options?: IStatusMessageOptions): IDisposable;
4407
+ }
4408
+
4409
+ interface IRelativePattern {
4410
+ /**
4411
+ * A base file path to which this pattern will be matched against relatively.
4412
+ */
4413
+ readonly base: string;
4414
+ /**
4415
+ * A file glob pattern like `*.{ts,js}` that will be matched on file paths
4416
+ * relative to the base path.
4417
+ *
4418
+ * Example: Given a base of `/home/work/folder` and a file path of `/home/work/folder/index.js`,
4419
+ * the file glob pattern will match on `index.js`.
4420
+ */
4421
+ readonly pattern: string;
4422
+ }
4423
+
4424
+ interface LanguageFilter {
4425
+ readonly language?: string;
4426
+ readonly scheme?: string;
4427
+ readonly pattern?: string | IRelativePattern;
4428
+ readonly notebookType?: string;
4429
+ /**
4430
+ * This provider is implemented in the UI thread.
4431
+ */
4432
+ readonly hasAccessToAllModels?: boolean;
4433
+ readonly exclusive?: boolean;
4434
+ }
4435
+ declare type LanguageSelector = string | LanguageFilter | ReadonlyArray<string | LanguageFilter>;
4436
+
4437
+ interface NotebookInfo {
4438
+ readonly uri: URI;
4439
+ readonly type: string;
4440
+ }
4441
+ interface NotebookInfoResolver {
4442
+ (uri: URI): NotebookInfo | undefined;
4443
+ }
4444
+ declare class LanguageFeatureRegistry<T> {
4445
+ private readonly _notebookInfoResolver?;
4446
+ private _clock;
4447
+ private readonly _entries;
4448
+ private readonly _onDidChange;
4449
+ readonly onDidChange: Event<number>;
4450
+ constructor(_notebookInfoResolver?: NotebookInfoResolver | undefined);
4451
+ register(selector: LanguageSelector, provider: T): IDisposable;
4452
+ has(model: ITextModel): boolean;
4453
+ all(model: ITextModel): T[];
4454
+ ordered(model: ITextModel): T[];
4455
+ orderedGroups(model: ITextModel): T[][];
4456
+ private _orderedForEach;
4457
+ private _lastCandidate;
4458
+ private _updateScores;
4459
+ private static _compareByScoreAndTime;
4460
+ }
4461
+
4462
+ declare const ILanguageFeaturesService: ServiceIdentifier<ILanguageFeaturesService>;
4463
+ interface ILanguageFeaturesService {
4464
+ readonly _serviceBrand: undefined;
4465
+ readonly referenceProvider: LanguageFeatureRegistry<ReferenceProvider>;
4466
+ readonly definitionProvider: LanguageFeatureRegistry<DefinitionProvider>;
4467
+ readonly typeDefinitionProvider: LanguageFeatureRegistry<TypeDefinitionProvider>;
4468
+ readonly declarationProvider: LanguageFeatureRegistry<DeclarationProvider>;
4469
+ readonly implementationProvider: LanguageFeatureRegistry<ImplementationProvider>;
4470
+ readonly codeActionProvider: LanguageFeatureRegistry<CodeActionProvider>;
4471
+ readonly documentPasteEditProvider: LanguageFeatureRegistry<DocumentPasteEditProvider>;
4472
+ readonly renameProvider: LanguageFeatureRegistry<RenameProvider>;
4473
+ readonly documentFormattingEditProvider: LanguageFeatureRegistry<DocumentFormattingEditProvider>;
4474
+ readonly documentRangeFormattingEditProvider: LanguageFeatureRegistry<DocumentRangeFormattingEditProvider>;
4475
+ readonly onTypeFormattingEditProvider: LanguageFeatureRegistry<OnTypeFormattingEditProvider>;
4476
+ readonly documentSymbolProvider: LanguageFeatureRegistry<DocumentSymbolProvider>;
4477
+ readonly inlayHintsProvider: LanguageFeatureRegistry<InlayHintsProvider>;
4478
+ readonly colorProvider: LanguageFeatureRegistry<DocumentColorProvider>;
4479
+ readonly codeLensProvider: LanguageFeatureRegistry<CodeLensProvider>;
4480
+ readonly signatureHelpProvider: LanguageFeatureRegistry<SignatureHelpProvider>;
4481
+ readonly hoverProvider: LanguageFeatureRegistry<HoverProvider>;
4482
+ readonly documentHighlightProvider: LanguageFeatureRegistry<DocumentHighlightProvider>;
4483
+ readonly documentRangeSemanticTokensProvider: LanguageFeatureRegistry<DocumentRangeSemanticTokensProvider>;
4484
+ readonly documentSemanticTokensProvider: LanguageFeatureRegistry<DocumentSemanticTokensProvider>;
4485
+ readonly selectionRangeProvider: LanguageFeatureRegistry<SelectionRangeProvider>;
4486
+ readonly foldingRangeProvider: LanguageFeatureRegistry<FoldingRangeProvider>;
4487
+ readonly linkProvider: LanguageFeatureRegistry<LinkProvider>;
4488
+ readonly inlineCompletionsProvider: LanguageFeatureRegistry<InlineCompletionsProvider>;
4489
+ readonly completionProvider: LanguageFeatureRegistry<CompletionItemProvider>;
4490
+ readonly linkedEditingRangeProvider: LanguageFeatureRegistry<LinkedEditingRangeProvider>;
4491
+ readonly inlineValuesProvider: LanguageFeatureRegistry<InlineValuesProvider>;
4492
+ readonly evaluatableExpressionProvider: LanguageFeatureRegistry<EvaluatableExpressionProvider>;
4493
+ readonly documentOnDropEditProvider: LanguageFeatureRegistry<DocumentOnDropEditProvider>;
4494
+ setNotebookTypeResolver(resolver: NotebookInfoResolver | undefined): void;
4495
+ }
4496
+
4497
+ /**
4498
+ * The options to create an editor.
4499
+ */
4500
+ type IStandaloneEditorConstructionOptions = monaco.editor.IStandaloneEditorConstructionOptions
4501
+ /**
4502
+ * The options to create a diff editor.
4503
+ */
4504
+ type IStandaloneDiffEditorConstructionOptions = monaco.editor.IStandaloneDiffEditorConstructionOptions
4505
+ type IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor
4506
+ type IStandaloneDiffEditor = monaco.editor.IStandaloneDiffEditor
4507
+
4508
+ declare const ILanguageFeatureDebounceService: ServiceIdentifier<ILanguageFeatureDebounceService>;
4509
+ interface ILanguageFeatureDebounceService {
4510
+ readonly _serviceBrand: undefined;
4511
+ for(feature: LanguageFeatureRegistry<object>, debugName: string, config?: {
4512
+ min?: number;
4513
+ max?: number;
4514
+ salt?: string;
4515
+ }): IFeatureDebounceInformation;
4516
+ }
4517
+ interface IFeatureDebounceInformation {
4518
+ get(model: ITextModel): number;
4519
+ update(model: ITextModel, value: number): number;
4520
+ default(): number;
4521
+ }
4522
+
4523
+ type IEditorOverrideServices = monaco.editor.IEditorOverrideServices
4524
+
4525
+ /**
4526
+ * Create a new editor under `domElement`.
4527
+ * `domElement` should be empty (not contain other dom nodes).
4528
+ * The editor will read the size of `domElement`.
4529
+ */
4530
+ declare function create(domElement: HTMLElement, options?: IStandaloneEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneCodeEditor;
4531
+ /**
4532
+ * Create a new diff editor under `domElement`.
4533
+ * `domElement` should be empty (not contain other dom nodes).
4534
+ * The editor will read the size of `domElement`.
4535
+ */
4536
+ declare function createDiffEditor(domElement: HTMLElement, options?: IStandaloneDiffEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneDiffEditor;
4537
+
4538
+ interface ErrorListenerCallback {
4539
+ (error: any): void;
4540
+ }
4541
+ interface ErrorListenerUnbind {
4542
+ (): void;
4543
+ }
4544
+ declare class ErrorHandler {
4545
+ private unexpectedErrorHandler;
4546
+ private listeners;
4547
+ constructor();
4548
+ addListener(listener: ErrorListenerCallback): ErrorListenerUnbind;
4549
+ private emit;
4550
+ private _removeListener;
4551
+ setUnexpectedErrorHandler(newUnexpectedErrorHandler: (e: any) => void): void;
4552
+ getUnexpectedErrorHandler(): (e: any) => void;
4553
+ onUnexpectedError(e: any): void;
4554
+ onUnexpectedExternalError(e: any): void;
4555
+ }
4556
+ declare const errorHandler: ErrorHandler;
4557
+
4558
+ interface ILineRange {
4559
+ startLineNumber: number;
4560
+ endLineNumber: number;
4561
+ }
4562
+ declare const enum FoldSource {
4563
+ provider = 0,
4564
+ userDefined = 1,
4565
+ recovered = 2
4566
+ }
4567
+ interface FoldRange {
4568
+ startLineNumber: number;
4569
+ endLineNumber: number;
4570
+ type: string | undefined;
4571
+ isCollapsed: boolean;
4572
+ source: FoldSource;
4573
+ }
4574
+ declare class FoldingRegions {
4575
+ private readonly _startIndexes;
4576
+ private readonly _endIndexes;
4577
+ private readonly _collapseStates;
4578
+ private readonly _userDefinedStates;
4579
+ private readonly _recoveredStates;
4580
+ private _parentsComputed;
4581
+ private readonly _types;
4582
+ constructor(startIndexes: Uint32Array, endIndexes: Uint32Array, types?: Array<string | undefined>);
4583
+ private ensureParentIndices;
4584
+ get length(): number;
4585
+ getStartLineNumber(index: number): number;
4586
+ getEndLineNumber(index: number): number;
4587
+ getType(index: number): string | undefined;
4588
+ hasTypes(): boolean;
4589
+ isCollapsed(index: number): boolean;
4590
+ setCollapsed(index: number, newState: boolean): void;
4591
+ private isUserDefined;
4592
+ private setUserDefined;
4593
+ private isRecovered;
4594
+ private setRecovered;
4595
+ getSource(index: number): FoldSource;
4596
+ setSource(index: number, source: FoldSource): void;
4597
+ setCollapsedAllOfType(type: string, newState: boolean): boolean;
4598
+ toRegion(index: number): FoldingRegion;
4599
+ getParentIndex(index: number): number;
4600
+ contains(index: number, line: number): boolean;
4601
+ private findIndex;
4602
+ findRange(line: number): number;
4603
+ private readonly sourceAbbr;
4604
+ toString(): string;
4605
+ toFoldRange(index: number): FoldRange;
4606
+ static fromFoldRanges(ranges: FoldRange[]): FoldingRegions;
4607
+ /**
4608
+ * Two inputs, each a FoldingRegions or a FoldRange[], are merged.
4609
+ * Each input must be pre-sorted on startLineNumber.
4610
+ * The first list is assumed to always include all regions currently defined by range providers.
4611
+ * The second list only contains the previously collapsed and all manual ranges.
4612
+ * If the line position matches, the range of the new range is taken, and the range is no longer manual
4613
+ * When an entry in one list overlaps an entry in the other, the second list's entry "wins" and
4614
+ * overlapping entries in the first list are discarded.
4615
+ * Invalid entries are discarded. An entry is invalid if:
4616
+ * the start and end line numbers aren't a valid range of line numbers,
4617
+ * it is out of sequence or has the same start line as a preceding entry,
4618
+ * it overlaps a preceding entry and is not fully contained by that entry.
4619
+ */
4620
+ static sanitizeAndMerge(rangesA: FoldingRegions | FoldRange[], rangesB: FoldingRegions | FoldRange[], maxLineNumber: number | undefined): FoldRange[];
4621
+ }
4622
+ declare class FoldingRegion {
4623
+ private readonly ranges;
4624
+ private index;
4625
+ constructor(ranges: FoldingRegions, index: number);
4626
+ get startLineNumber(): number;
4627
+ get endLineNumber(): number;
4628
+ get regionIndex(): number;
4629
+ get parentIndex(): number;
4630
+ get isCollapsed(): boolean;
4631
+ containedBy(range: ILineRange): boolean;
4632
+ containsLine(lineNumber: number): boolean;
4633
+ hidesLine(lineNumber: number): boolean;
4634
+ }
4635
+
4636
+ interface IDecorationProvider {
4637
+ getDecorationOption(isCollapsed: boolean, isHidden: boolean, isManual: boolean): IModelDecorationOptions;
4638
+ changeDecorations<T>(callback: (changeAccessor: IModelDecorationsChangeAccessor) => T): T | null;
4639
+ removeDecorations(decorationIds: string[]): void;
4640
+ }
4641
+ interface FoldingModelChangeEvent {
4642
+ model: FoldingModel;
4643
+ collapseStateChanged?: FoldingRegion[];
4644
+ }
4645
+ interface ILineMemento extends ILineRange {
4646
+ checksum?: number;
4647
+ isCollapsed?: boolean;
4648
+ source?: FoldSource;
4649
+ }
4650
+ declare type CollapseMemento = ILineMemento[];
4651
+ declare class FoldingModel {
4652
+ private readonly _textModel;
4653
+ private readonly _decorationProvider;
4654
+ private _regions;
4655
+ private _editorDecorationIds;
4656
+ private readonly _updateEventEmitter;
4657
+ readonly onDidChange: Event<FoldingModelChangeEvent>;
4658
+ get regions(): FoldingRegions;
4659
+ get textModel(): ITextModel;
4660
+ get decorationProvider(): IDecorationProvider;
4661
+ constructor(textModel: ITextModel, decorationProvider: IDecorationProvider);
4662
+ toggleCollapseState(toggledRegions: FoldingRegion[]): void;
4663
+ removeManualRanges(ranges: ILineRange[]): void;
4664
+ update(newRegions: FoldingRegions, blockedLineNumers?: number[]): void;
4665
+ updatePost(newRegions: FoldingRegions): void;
4666
+ private _currentFoldedOrManualRanges;
4667
+ /**
4668
+ * Collapse state memento, for persistence only
4669
+ */
4670
+ getMemento(): CollapseMemento | undefined;
4671
+ /**
4672
+ * Apply persisted state, for persistence only
4673
+ */
4674
+ applyMemento(state: CollapseMemento): void;
4675
+ private _getLinesChecksum;
4676
+ dispose(): void;
4677
+ getAllRegionsAtLine(lineNumber: number, filter?: (r: FoldingRegion, level: number) => boolean): FoldingRegion[];
4678
+ getRegionAtLine(lineNumber: number): FoldingRegion | null;
4679
+ getRegionsInside(region: FoldingRegion | null, filter?: RegionFilter | RegionFilterWithLevel): FoldingRegion[];
4680
+ }
4681
+ declare type RegionFilter = (r: FoldingRegion) => boolean;
4682
+ declare type RegionFilterWithLevel = (r: FoldingRegion, level: number) => boolean;
4683
+ /**
4684
+ * Folds all regions for which the lines start with a given regex
4685
+ * @param foldingModel the folding model
4686
+ */
4687
+ declare function setCollapseStateForMatchingLines(foldingModel: FoldingModel, regExp: RegExp, doCollapse: boolean): void;
4688
+
4689
+ interface FoldingStateMemento {
4690
+ collapsedRegions?: CollapseMemento;
4691
+ lineCount?: number;
4692
+ provider?: string;
4693
+ foldedImports?: boolean;
4694
+ }
4695
+ declare class FoldingController extends Disposable implements IEditorContribution {
4696
+ private readonly contextKeyService;
4697
+ private readonly languageConfigurationService;
4698
+ private readonly languageFeaturesService;
4699
+ static readonly ID = "editor.contrib.folding";
4700
+ static get(editor: ICodeEditor): FoldingController | null;
4701
+ private readonly editor;
4702
+ private _isEnabled;
4703
+ private _useFoldingProviders;
4704
+ private _unfoldOnClickAfterEndOfLine;
4705
+ private _restoringViewState;
4706
+ private _foldingImportsByDefault;
4707
+ private _currentModelHasFoldedImports;
4708
+ private _maxFoldingRegions;
4709
+ private _notifyTooManyRegions;
4710
+ private _tooManyRegionsNotified;
4711
+ private readonly foldingDecorationProvider;
4712
+ private foldingModel;
4713
+ private hiddenRangeModel;
4714
+ private rangeProvider;
4715
+ private foldingRegionPromise;
4716
+ private foldingModelPromise;
4717
+ private updateScheduler;
4718
+ private readonly updateDebounceInfo;
4719
+ private foldingEnabled;
4720
+ private cursorChangedScheduler;
4721
+ private readonly localToDispose;
4722
+ private mouseDownInfo;
4723
+ constructor(editor: ICodeEditor, contextKeyService: IContextKeyService, languageConfigurationService: ILanguageConfigurationService, notificationService: INotificationService, languageFeatureDebounceService: ILanguageFeatureDebounceService, languageFeaturesService: ILanguageFeaturesService);
4724
+ /**
4725
+ * Store view state.
4726
+ */
4727
+ saveViewState(): FoldingStateMemento | undefined;
4728
+ /**
4729
+ * Restore view state.
4730
+ */
4731
+ restoreViewState(state: FoldingStateMemento): void;
4732
+ private onModelChanged;
4733
+ private onFoldingStrategyChanged;
4734
+ private getRangeProvider;
4735
+ getFoldingModel(): Promise<FoldingModel | null> | null;
4736
+ private onDidChangeModelContent;
4737
+ triggerFoldingModelChanged(): void;
4738
+ private onHiddenRangesChanges;
4739
+ private onCursorPositionChanged;
4740
+ private revealCursor;
4741
+ private onEditorMouseDown;
4742
+ private onEditorMouseUp;
4743
+ reveal(position: IPosition): void;
4744
+ }
4745
+
4746
+ interface IRegistry {
4747
+ /**
4748
+ * Adds the extension functions and properties defined by data to the
4749
+ * platform. The provided id must be unique.
4750
+ * @param id a unique identifier
4751
+ * @param data a contribution
4752
+ */
4753
+ add(id: string, data: any): void;
4754
+ /**
4755
+ * Returns true iff there is an extension with the provided id.
4756
+ * @param id an extension identifier
4757
+ */
4758
+ knows(id: string): boolean;
4759
+ /**
4760
+ * Returns the extension functions and properties defined by the specified key or null.
4761
+ * @param id an extension identifier
4762
+ */
4763
+ as<T>(id: string): T;
4764
+ }
4765
+ declare const Registry: IRegistry;
4766
+
4767
+ interface ISchemaContributions {
4768
+ schemas: {
4769
+ [id: string]: IJSONSchema;
4770
+ };
4771
+ }
4772
+ interface IJSONContributionRegistry {
4773
+ readonly onDidChangeSchema: Event<string>;
4774
+ /**
4775
+ * Register a schema to the registry.
4776
+ */
4777
+ registerSchema(uri: string, unresolvedSchemaContent: IJSONSchema): void;
4778
+ /**
4779
+ * Notifies all listeners that the content of the given schema has changed.
4780
+ * @param uri The id of the schema
4781
+ */
4782
+ notifySchemaChanged(uri: string): void;
4783
+ /**
4784
+ * Get all schemas
4785
+ */
4786
+ getSchemaContributions(): ISchemaContributions;
4787
+ }
4788
+
4789
+ declare const createConfiguredEditor: typeof create;
4790
+ declare const createConfiguredDiffEditor: typeof createDiffEditor;
4791
+ declare const Extensions: {
4792
+ JSONContribution: string;
4793
+ };
4794
+
4795
+ export { CommandsRegistry, DisposableStore, Extensions, FoldingController, FoldingModel, IJSONContributionRegistry, IJSONSchema, Registry, allSettings, createConfiguredDiffEditor, createConfiguredEditor, errorHandler, setCollapseStateForMatchingLines };