@codingame/monaco-vscode-api 1.79.12 → 1.79.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/colorRegistry.d.ts +2043 -0
- package/dist/contextkey.d.ts +1 -1
- package/dist/editor.d.ts +2 -2
- package/dist/editorBrowser.d.ts +9 -1
- package/dist/extensions.d2.ts +1 -1
- package/dist/extensionsRegistry.d.ts +1 -1
- package/dist/files.d.ts +1 -1
- package/dist/hover.d.ts +3106 -0
- package/dist/keybinding.d.ts +1 -1
- package/dist/languageFeatures.d.ts +6 -2041
- package/dist/monaco.d.ts +5 -4
- package/dist/service-override/views.d.ts +562 -5
- package/dist/service-override/views.js +1 -1
- package/dist/services.d.ts +272 -2464
- package/dist/services.js +6 -1
- package/monaco-editor-treemending.patch +531 -531
- package/package.json +1 -1
- package/dist/views.d.ts +0 -270
|
@@ -0,0 +1,2043 @@
|
|
|
1
|
+
import { S as ServiceIdentifier, a as ServicesAccessor } from './instantiation.js';
|
|
2
|
+
import { E as Event, a as IDisposable, C as CancellationToken } from './event.js';
|
|
3
|
+
import { I as IJSONSchema } from './jsonSchema.js';
|
|
4
|
+
import { V as VSBuffer } from './files.js';
|
|
5
|
+
import { U as URI } from './uri.js';
|
|
6
|
+
import { j as ITextModel, P as Position, R as Range, S as Selection, k as IRange, E as EndOfLineSequence, l as IPosition, m as IMarkdownString, n as ISingleEditOperation } from './editorBrowser.js';
|
|
7
|
+
import { T as ThemeIcon } from './themables.js';
|
|
8
|
+
import { E as ExtensionIdentifier } from './extensions.d2.ts';
|
|
9
|
+
import { S as Severity$1 } from './severity.js';
|
|
10
|
+
|
|
11
|
+
type TypeConstraint = string | Function;
|
|
12
|
+
/**
|
|
13
|
+
* Given an object with all optional properties, requires at least one to be defined.
|
|
14
|
+
* i.e. AtLeastOne<MyObject>;
|
|
15
|
+
*/
|
|
16
|
+
type AtLeastOne<T, U = {
|
|
17
|
+
[K in keyof T]: Pick<T, K>;
|
|
18
|
+
}> = Partial<T> & U[keyof U];
|
|
19
|
+
|
|
20
|
+
interface ICommandEvent {
|
|
21
|
+
commandId: string;
|
|
22
|
+
args: any[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare const ICommandService: ServiceIdentifier<ICommandService>;
|
|
26
|
+
interface ICommandService {
|
|
27
|
+
readonly _serviceBrand: undefined;
|
|
28
|
+
onWillExecuteCommand: Event<ICommandEvent>;
|
|
29
|
+
onDidExecuteCommand: Event<ICommandEvent>;
|
|
30
|
+
executeCommand<T = any>(commandId: string, ...args: any[]): Promise<T | undefined>;
|
|
31
|
+
}
|
|
32
|
+
type ICommandsMap = Map<string, ICommand>;
|
|
33
|
+
interface ICommandHandler {
|
|
34
|
+
(accessor: ServicesAccessor, ...args: any[]): void;
|
|
35
|
+
}
|
|
36
|
+
interface ICommand {
|
|
37
|
+
id: string;
|
|
38
|
+
handler: ICommandHandler;
|
|
39
|
+
description?: ICommandHandlerDescription | null;
|
|
40
|
+
}
|
|
41
|
+
interface ICommandHandlerDescription {
|
|
42
|
+
readonly description: string;
|
|
43
|
+
readonly args: ReadonlyArray<{
|
|
44
|
+
readonly name: string;
|
|
45
|
+
readonly isOptional?: boolean;
|
|
46
|
+
readonly description?: string;
|
|
47
|
+
readonly constraint?: TypeConstraint;
|
|
48
|
+
readonly schema?: IJSONSchema;
|
|
49
|
+
}>;
|
|
50
|
+
readonly returns?: string;
|
|
51
|
+
}
|
|
52
|
+
interface ICommandRegistry {
|
|
53
|
+
onDidRegisterCommand: Event<string>;
|
|
54
|
+
registerCommand(id: string, command: ICommandHandler): IDisposable;
|
|
55
|
+
registerCommand(command: ICommand): IDisposable;
|
|
56
|
+
registerCommandAlias(oldId: string, newId: string): IDisposable;
|
|
57
|
+
getCommand(id: string): ICommand | undefined;
|
|
58
|
+
getCommands(): ICommandsMap;
|
|
59
|
+
}
|
|
60
|
+
declare const CommandsRegistry: ICommandRegistry;
|
|
61
|
+
|
|
62
|
+
declare class RGBA {
|
|
63
|
+
_rgbaBrand: void;
|
|
64
|
+
/**
|
|
65
|
+
* Red: integer in [0-255]
|
|
66
|
+
*/
|
|
67
|
+
readonly r: number;
|
|
68
|
+
/**
|
|
69
|
+
* Green: integer in [0-255]
|
|
70
|
+
*/
|
|
71
|
+
readonly g: number;
|
|
72
|
+
/**
|
|
73
|
+
* Blue: integer in [0-255]
|
|
74
|
+
*/
|
|
75
|
+
readonly b: number;
|
|
76
|
+
/**
|
|
77
|
+
* Alpha: float in [0-1]
|
|
78
|
+
*/
|
|
79
|
+
readonly a: number;
|
|
80
|
+
constructor(r: number, g: number, b: number, a?: number);
|
|
81
|
+
static equals(a: RGBA, b: RGBA): boolean;
|
|
82
|
+
}
|
|
83
|
+
declare class HSLA {
|
|
84
|
+
_hslaBrand: void;
|
|
85
|
+
/**
|
|
86
|
+
* Hue: integer in [0, 360]
|
|
87
|
+
*/
|
|
88
|
+
readonly h: number;
|
|
89
|
+
/**
|
|
90
|
+
* Saturation: float in [0, 1]
|
|
91
|
+
*/
|
|
92
|
+
readonly s: number;
|
|
93
|
+
/**
|
|
94
|
+
* Luminosity: float in [0, 1]
|
|
95
|
+
*/
|
|
96
|
+
readonly l: number;
|
|
97
|
+
/**
|
|
98
|
+
* Alpha: float in [0, 1]
|
|
99
|
+
*/
|
|
100
|
+
readonly a: number;
|
|
101
|
+
constructor(h: number, s: number, l: number, a: number);
|
|
102
|
+
static equals(a: HSLA, b: HSLA): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Converts an RGB color value to HSL. Conversion formula
|
|
105
|
+
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
|
|
106
|
+
* Assumes r, g, and b are contained in the set [0, 255] and
|
|
107
|
+
* returns h in the set [0, 360], s, and l in the set [0, 1].
|
|
108
|
+
*/
|
|
109
|
+
static fromRGBA(rgba: RGBA): HSLA;
|
|
110
|
+
private static _hue2rgb;
|
|
111
|
+
/**
|
|
112
|
+
* Converts an HSL color value to RGB. Conversion formula
|
|
113
|
+
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
|
|
114
|
+
* Assumes h in the set [0, 360] s, and l are contained in the set [0, 1] and
|
|
115
|
+
* returns r, g, and b in the set [0, 255].
|
|
116
|
+
*/
|
|
117
|
+
static toRGBA(hsla: HSLA): RGBA;
|
|
118
|
+
}
|
|
119
|
+
declare class HSVA {
|
|
120
|
+
_hsvaBrand: void;
|
|
121
|
+
/**
|
|
122
|
+
* Hue: integer in [0, 360]
|
|
123
|
+
*/
|
|
124
|
+
readonly h: number;
|
|
125
|
+
/**
|
|
126
|
+
* Saturation: float in [0, 1]
|
|
127
|
+
*/
|
|
128
|
+
readonly s: number;
|
|
129
|
+
/**
|
|
130
|
+
* Value: float in [0, 1]
|
|
131
|
+
*/
|
|
132
|
+
readonly v: number;
|
|
133
|
+
/**
|
|
134
|
+
* Alpha: float in [0, 1]
|
|
135
|
+
*/
|
|
136
|
+
readonly a: number;
|
|
137
|
+
constructor(h: number, s: number, v: number, a: number);
|
|
138
|
+
static equals(a: HSVA, b: HSVA): boolean;
|
|
139
|
+
static fromRGBA(rgba: RGBA): HSVA;
|
|
140
|
+
static toRGBA(hsva: HSVA): RGBA;
|
|
141
|
+
}
|
|
142
|
+
declare class Color {
|
|
143
|
+
static fromHex(hex: string): Color;
|
|
144
|
+
static equals(a: Color | null, b: Color | null): boolean;
|
|
145
|
+
readonly rgba: RGBA;
|
|
146
|
+
private _hsla?;
|
|
147
|
+
get hsla(): HSLA;
|
|
148
|
+
private _hsva?;
|
|
149
|
+
get hsva(): HSVA;
|
|
150
|
+
constructor(arg: RGBA | HSLA | HSVA);
|
|
151
|
+
equals(other: Color | null): boolean;
|
|
152
|
+
/**
|
|
153
|
+
* http://www.w3.org/TR/WCAG20/#relativeluminancedef
|
|
154
|
+
* Returns the number in the set [0, 1]. O => Darkest Black. 1 => Lightest white.
|
|
155
|
+
*/
|
|
156
|
+
getRelativeLuminance(): number;
|
|
157
|
+
private static _relativeLuminanceForComponent;
|
|
158
|
+
/**
|
|
159
|
+
* http://www.w3.org/TR/WCAG20/#contrast-ratiodef
|
|
160
|
+
* Returns the contrast ration number in the set [1, 21].
|
|
161
|
+
*/
|
|
162
|
+
getContrastRatio(another: Color): number;
|
|
163
|
+
/**
|
|
164
|
+
* http://24ways.org/2010/calculating-color-contrast
|
|
165
|
+
* Return 'true' if darker color otherwise 'false'
|
|
166
|
+
*/
|
|
167
|
+
isDarker(): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* http://24ways.org/2010/calculating-color-contrast
|
|
170
|
+
* Return 'true' if lighter color otherwise 'false'
|
|
171
|
+
*/
|
|
172
|
+
isLighter(): boolean;
|
|
173
|
+
isLighterThan(another: Color): boolean;
|
|
174
|
+
isDarkerThan(another: Color): boolean;
|
|
175
|
+
lighten(factor: number): Color;
|
|
176
|
+
darken(factor: number): Color;
|
|
177
|
+
transparent(factor: number): Color;
|
|
178
|
+
isTransparent(): boolean;
|
|
179
|
+
isOpaque(): boolean;
|
|
180
|
+
opposite(): Color;
|
|
181
|
+
blend(c: Color): Color;
|
|
182
|
+
makeOpaque(opaqueBackground: Color): Color;
|
|
183
|
+
flatten(...backgrounds: Color[]): Color;
|
|
184
|
+
private static _flatten;
|
|
185
|
+
private _toString?;
|
|
186
|
+
toString(): string;
|
|
187
|
+
static getLighterColor(of: Color, relative: Color, factor?: number): Color;
|
|
188
|
+
static getDarkerColor(of: Color, relative: Color, factor?: number): Color;
|
|
189
|
+
static readonly white: Color;
|
|
190
|
+
static readonly black: Color;
|
|
191
|
+
static readonly red: Color;
|
|
192
|
+
static readonly blue: Color;
|
|
193
|
+
static readonly green: Color;
|
|
194
|
+
static readonly cyan: Color;
|
|
195
|
+
static readonly lightgrey: Color;
|
|
196
|
+
static readonly transparent: Color;
|
|
197
|
+
}
|
|
198
|
+
declare namespace Color {
|
|
199
|
+
namespace Format {
|
|
200
|
+
namespace CSS {
|
|
201
|
+
function formatRGB(color: Color): string;
|
|
202
|
+
function formatRGBA(color: Color): string;
|
|
203
|
+
function formatHSL(color: Color): string;
|
|
204
|
+
function formatHSLA(color: Color): string;
|
|
205
|
+
/**
|
|
206
|
+
* Formats the color as #RRGGBB
|
|
207
|
+
*/
|
|
208
|
+
function formatHex(color: Color): string;
|
|
209
|
+
/**
|
|
210
|
+
* Formats the color as #RRGGBBAA
|
|
211
|
+
* If 'compact' is set, colors without transparancy will be printed as #RRGGBB
|
|
212
|
+
*/
|
|
213
|
+
function formatHexA(color: Color, compact?: boolean): string;
|
|
214
|
+
/**
|
|
215
|
+
* The default format will use HEX if opaque and RGBA otherwise.
|
|
216
|
+
*/
|
|
217
|
+
function format(color: Color): string;
|
|
218
|
+
/**
|
|
219
|
+
* Converts an Hex color value to a Color.
|
|
220
|
+
* returns r, g, and b are contained in the set [0, 255]
|
|
221
|
+
* @param hex string (#RGB, #RGBA, #RRGGBB or #RRGGBBAA).
|
|
222
|
+
*/
|
|
223
|
+
function parseHex(hex: string): Color | null;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
interface IDataTransferFile {
|
|
229
|
+
readonly id: string;
|
|
230
|
+
readonly name: string;
|
|
231
|
+
readonly uri?: URI;
|
|
232
|
+
data(): Promise<Uint8Array>;
|
|
233
|
+
}
|
|
234
|
+
interface IDataTransferItem {
|
|
235
|
+
asString(): Thenable<string>;
|
|
236
|
+
asFile(): IDataTransferFile | undefined;
|
|
237
|
+
value: any;
|
|
238
|
+
}
|
|
239
|
+
interface IReadonlyVSDataTransfer extends Iterable<readonly [string, IDataTransferItem]> {
|
|
240
|
+
/**
|
|
241
|
+
* Get the total number of entries in this data transfer.
|
|
242
|
+
*/
|
|
243
|
+
get size(): number;
|
|
244
|
+
/**
|
|
245
|
+
* Check if this data transfer contains data for `mimeType`.
|
|
246
|
+
*
|
|
247
|
+
* This uses exact matching and does not support wildcards.
|
|
248
|
+
*/
|
|
249
|
+
has(mimeType: string): boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Check if this data transfer contains data matching `pattern`.
|
|
252
|
+
*
|
|
253
|
+
* This allows matching for wildcards, such as `image/*`.
|
|
254
|
+
*
|
|
255
|
+
* Use the special `files` mime type to match any file in the data transfer.
|
|
256
|
+
*/
|
|
257
|
+
matches(pattern: string): boolean;
|
|
258
|
+
/**
|
|
259
|
+
* Retrieve the first entry for `mimeType`.
|
|
260
|
+
*
|
|
261
|
+
* Note that if you want to find all entries for a given mime type, use {@link IReadonlyVSDataTransfer.entries} instead.
|
|
262
|
+
*/
|
|
263
|
+
get(mimeType: string): IDataTransferItem | undefined;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Open ended enum at runtime
|
|
268
|
+
*/
|
|
269
|
+
declare const enum LanguageId {
|
|
270
|
+
Null = 0,
|
|
271
|
+
PlainText = 1
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Open ended enum at runtime
|
|
275
|
+
*/
|
|
276
|
+
declare const enum ColorId {
|
|
277
|
+
None = 0,
|
|
278
|
+
DefaultForeground = 1,
|
|
279
|
+
DefaultBackground = 2
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* A standard token type.
|
|
283
|
+
*/
|
|
284
|
+
declare const enum StandardTokenType {
|
|
285
|
+
Other = 0,
|
|
286
|
+
Comment = 1,
|
|
287
|
+
String = 2,
|
|
288
|
+
RegEx = 3
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
*/
|
|
292
|
+
interface ITokenPresentation {
|
|
293
|
+
foreground: ColorId;
|
|
294
|
+
italic: boolean;
|
|
295
|
+
bold: boolean;
|
|
296
|
+
underline: boolean;
|
|
297
|
+
strikethrough: boolean;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
*
|
|
302
|
+
*/
|
|
303
|
+
interface IRelatedInformation {
|
|
304
|
+
resource: URI;
|
|
305
|
+
message: string;
|
|
306
|
+
startLineNumber: number;
|
|
307
|
+
startColumn: number;
|
|
308
|
+
endLineNumber: number;
|
|
309
|
+
endColumn: number;
|
|
310
|
+
}
|
|
311
|
+
declare const enum MarkerTag {
|
|
312
|
+
Unnecessary = 1,
|
|
313
|
+
Deprecated = 2
|
|
314
|
+
}
|
|
315
|
+
declare enum MarkerSeverity {
|
|
316
|
+
Hint = 1,
|
|
317
|
+
Info = 2,
|
|
318
|
+
Warning = 4,
|
|
319
|
+
Error = 8
|
|
320
|
+
}
|
|
321
|
+
declare namespace MarkerSeverity {
|
|
322
|
+
function compare(a: MarkerSeverity, b: MarkerSeverity): number;
|
|
323
|
+
function toString(a: MarkerSeverity): string;
|
|
324
|
+
function fromSeverity(severity: Severity$1): MarkerSeverity;
|
|
325
|
+
function toSeverity(severity: MarkerSeverity): Severity$1;
|
|
326
|
+
}
|
|
327
|
+
interface IResourceMarker {
|
|
328
|
+
resource: URI;
|
|
329
|
+
marker: IMarkerData;
|
|
330
|
+
}
|
|
331
|
+
interface IMarker {
|
|
332
|
+
owner: string;
|
|
333
|
+
resource: URI;
|
|
334
|
+
severity: MarkerSeverity;
|
|
335
|
+
code?: string | {
|
|
336
|
+
value: string;
|
|
337
|
+
target: URI;
|
|
338
|
+
};
|
|
339
|
+
message: string;
|
|
340
|
+
source?: string;
|
|
341
|
+
startLineNumber: number;
|
|
342
|
+
startColumn: number;
|
|
343
|
+
endLineNumber: number;
|
|
344
|
+
endColumn: number;
|
|
345
|
+
modelVersionId?: number;
|
|
346
|
+
relatedInformation?: IRelatedInformation[];
|
|
347
|
+
tags?: MarkerTag[];
|
|
348
|
+
}
|
|
349
|
+
interface MarkerStatistics {
|
|
350
|
+
errors: number;
|
|
351
|
+
warnings: number;
|
|
352
|
+
infos: number;
|
|
353
|
+
unknowns: number;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* A structure defining a problem/warning/etc.
|
|
357
|
+
*/
|
|
358
|
+
interface IMarkerData {
|
|
359
|
+
code?: string | {
|
|
360
|
+
value: string;
|
|
361
|
+
target: URI;
|
|
362
|
+
};
|
|
363
|
+
severity: MarkerSeverity;
|
|
364
|
+
message: string;
|
|
365
|
+
source?: string;
|
|
366
|
+
startLineNumber: number;
|
|
367
|
+
startColumn: number;
|
|
368
|
+
endLineNumber: number;
|
|
369
|
+
endColumn: number;
|
|
370
|
+
modelVersionId?: number;
|
|
371
|
+
relatedInformation?: IRelatedInformation[];
|
|
372
|
+
tags?: MarkerTag[];
|
|
373
|
+
}
|
|
374
|
+
declare namespace IMarkerData {
|
|
375
|
+
function makeKey(markerData: IMarkerData): string;
|
|
376
|
+
function makeKeyOptionalMessage(markerData: IMarkerData, useMessage: boolean): string;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
interface IMarkerService {
|
|
380
|
+
readonly _serviceBrand: undefined;
|
|
381
|
+
getStatistics(): MarkerStatistics;
|
|
382
|
+
changeOne(owner: string, resource: URI, markers: IMarkerData[]): void;
|
|
383
|
+
changeAll(owner: string, data: IResourceMarker[]): void;
|
|
384
|
+
remove(owner: string, resources: URI[]): void;
|
|
385
|
+
read(filter?: {
|
|
386
|
+
owner?: string;
|
|
387
|
+
resource?: URI;
|
|
388
|
+
severities?: number;
|
|
389
|
+
take?: number;
|
|
390
|
+
}): IMarker[];
|
|
391
|
+
readonly onMarkerChanged: Event<readonly URI[]>;
|
|
392
|
+
}
|
|
393
|
+
declare const IMarkerService: ServiceIdentifier<IMarkerService>;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* @internal
|
|
397
|
+
*/
|
|
398
|
+
interface ILanguageIdCodec {
|
|
399
|
+
encodeLanguageId(languageId: string): LanguageId;
|
|
400
|
+
decodeLanguageId(languageId: LanguageId): string;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* A provider result represents the values a provider, like the {@link HoverProvider},
|
|
404
|
+
* may return. For once this is the actual result type `T`, like `Hover`, or a thenable that resolves
|
|
405
|
+
* to that type `T`. In addition, `null` and `undefined` can be returned - either directly or from a
|
|
406
|
+
* thenable.
|
|
407
|
+
*/
|
|
408
|
+
type ProviderResult<T> = T | undefined | null | Thenable<T | undefined | null>;
|
|
409
|
+
/**
|
|
410
|
+
* A hover represents additional information for a symbol or word. Hovers are
|
|
411
|
+
* rendered in a tooltip-like widget.
|
|
412
|
+
*/
|
|
413
|
+
interface Hover {
|
|
414
|
+
/**
|
|
415
|
+
* The contents of this hover.
|
|
416
|
+
*/
|
|
417
|
+
contents: IMarkdownString[];
|
|
418
|
+
/**
|
|
419
|
+
* The range to which this hover applies. When missing, the
|
|
420
|
+
* editor will use the range at the current position or the
|
|
421
|
+
* current position itself.
|
|
422
|
+
*/
|
|
423
|
+
range?: IRange;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* The hover provider interface defines the contract between extensions and
|
|
427
|
+
* the [hover](https://code.visualstudio.com/docs/editor/intellisense)-feature.
|
|
428
|
+
*/
|
|
429
|
+
interface HoverProvider {
|
|
430
|
+
/**
|
|
431
|
+
* Provide a hover for the given position and document. Multiple hovers at the same
|
|
432
|
+
* position will be merged by the editor. A hover can have a range which defaults
|
|
433
|
+
* to the word range at the position when omitted.
|
|
434
|
+
*/
|
|
435
|
+
provideHover(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<Hover>;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* An evaluatable expression represents additional information for an expression in a document. Evaluatable expressions are
|
|
439
|
+
* evaluated by a debugger or runtime and their result is rendered in a tooltip-like widget.
|
|
440
|
+
* @internal
|
|
441
|
+
*/
|
|
442
|
+
interface EvaluatableExpression {
|
|
443
|
+
/**
|
|
444
|
+
* The range to which this expression applies.
|
|
445
|
+
*/
|
|
446
|
+
range: IRange;
|
|
447
|
+
/**
|
|
448
|
+
* This expression overrides the expression extracted from the range.
|
|
449
|
+
*/
|
|
450
|
+
expression?: string;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* The evaluatable expression provider interface defines the contract between extensions and
|
|
454
|
+
* the debug hover.
|
|
455
|
+
* @internal
|
|
456
|
+
*/
|
|
457
|
+
interface EvaluatableExpressionProvider {
|
|
458
|
+
/**
|
|
459
|
+
* Provide a hover for the given position and document. Multiple hovers at the same
|
|
460
|
+
* position will be merged by the editor. A hover can have a range which defaults
|
|
461
|
+
* to the word range at the position when omitted.
|
|
462
|
+
*/
|
|
463
|
+
provideEvaluatableExpression(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<EvaluatableExpression>;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* A value-object that contains contextual information when requesting inline values from a InlineValuesProvider.
|
|
467
|
+
* @internal
|
|
468
|
+
*/
|
|
469
|
+
interface InlineValueContext {
|
|
470
|
+
frameId: number;
|
|
471
|
+
stoppedLocation: Range;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Provide inline value as text.
|
|
475
|
+
* @internal
|
|
476
|
+
*/
|
|
477
|
+
interface InlineValueText {
|
|
478
|
+
type: 'text';
|
|
479
|
+
range: IRange;
|
|
480
|
+
text: string;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Provide inline value through a variable lookup.
|
|
484
|
+
* @internal
|
|
485
|
+
*/
|
|
486
|
+
interface InlineValueVariableLookup {
|
|
487
|
+
type: 'variable';
|
|
488
|
+
range: IRange;
|
|
489
|
+
variableName?: string;
|
|
490
|
+
caseSensitiveLookup: boolean;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Provide inline value through an expression evaluation.
|
|
494
|
+
* @internal
|
|
495
|
+
*/
|
|
496
|
+
interface InlineValueExpression {
|
|
497
|
+
type: 'expression';
|
|
498
|
+
range: IRange;
|
|
499
|
+
expression?: string;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Inline value information can be provided by different means:
|
|
503
|
+
* - directly as a text value (class InlineValueText).
|
|
504
|
+
* - as a name to use for a variable lookup (class InlineValueVariableLookup)
|
|
505
|
+
* - as an evaluatable expression (class InlineValueEvaluatableExpression)
|
|
506
|
+
* The InlineValue types combines all inline value types into one type.
|
|
507
|
+
* @internal
|
|
508
|
+
*/
|
|
509
|
+
type InlineValue = InlineValueText | InlineValueVariableLookup | InlineValueExpression;
|
|
510
|
+
/**
|
|
511
|
+
* The inline values provider interface defines the contract between extensions and
|
|
512
|
+
* the debugger's inline values feature.
|
|
513
|
+
* @internal
|
|
514
|
+
*/
|
|
515
|
+
interface InlineValuesProvider {
|
|
516
|
+
/**
|
|
517
|
+
*/
|
|
518
|
+
onDidChangeInlineValues?: Event<void> | undefined;
|
|
519
|
+
/**
|
|
520
|
+
* Provide the "inline values" for the given range and document. Multiple hovers at the same
|
|
521
|
+
* position will be merged by the editor. A hover can have a range which defaults
|
|
522
|
+
* to the word range at the position when omitted.
|
|
523
|
+
*/
|
|
524
|
+
provideInlineValues(model: ITextModel, viewPort: Range, context: InlineValueContext, token: CancellationToken): ProviderResult<InlineValue[]>;
|
|
525
|
+
}
|
|
526
|
+
declare const enum CompletionItemKind {
|
|
527
|
+
Method = 0,
|
|
528
|
+
Function = 1,
|
|
529
|
+
Constructor = 2,
|
|
530
|
+
Field = 3,
|
|
531
|
+
Variable = 4,
|
|
532
|
+
Class = 5,
|
|
533
|
+
Struct = 6,
|
|
534
|
+
Interface = 7,
|
|
535
|
+
Module = 8,
|
|
536
|
+
Property = 9,
|
|
537
|
+
Event = 10,
|
|
538
|
+
Operator = 11,
|
|
539
|
+
Unit = 12,
|
|
540
|
+
Value = 13,
|
|
541
|
+
Constant = 14,
|
|
542
|
+
Enum = 15,
|
|
543
|
+
EnumMember = 16,
|
|
544
|
+
Keyword = 17,
|
|
545
|
+
Text = 18,
|
|
546
|
+
Color = 19,
|
|
547
|
+
File = 20,
|
|
548
|
+
Reference = 21,
|
|
549
|
+
Customcolor = 22,
|
|
550
|
+
Folder = 23,
|
|
551
|
+
TypeParameter = 24,
|
|
552
|
+
User = 25,
|
|
553
|
+
Issue = 26,
|
|
554
|
+
Snippet = 27
|
|
555
|
+
}
|
|
556
|
+
interface CompletionItemLabel {
|
|
557
|
+
label: string;
|
|
558
|
+
detail?: string;
|
|
559
|
+
description?: string;
|
|
560
|
+
}
|
|
561
|
+
declare const enum CompletionItemTag {
|
|
562
|
+
Deprecated = 1
|
|
563
|
+
}
|
|
564
|
+
declare const enum CompletionItemInsertTextRule {
|
|
565
|
+
None = 0,
|
|
566
|
+
/**
|
|
567
|
+
* Adjust whitespace/indentation of multiline insert texts to
|
|
568
|
+
* match the current line indentation.
|
|
569
|
+
*/
|
|
570
|
+
KeepWhitespace = 1,
|
|
571
|
+
/**
|
|
572
|
+
* `insertText` is a snippet.
|
|
573
|
+
*/
|
|
574
|
+
InsertAsSnippet = 4
|
|
575
|
+
}
|
|
576
|
+
interface CompletionItemRanges {
|
|
577
|
+
insert: IRange;
|
|
578
|
+
replace: IRange;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* A completion item represents a text snippet that is
|
|
582
|
+
* proposed to complete text that is being typed.
|
|
583
|
+
*/
|
|
584
|
+
interface CompletionItem {
|
|
585
|
+
/**
|
|
586
|
+
* The label of this completion item. By default
|
|
587
|
+
* this is also the text that is inserted when selecting
|
|
588
|
+
* this completion.
|
|
589
|
+
*/
|
|
590
|
+
label: string | CompletionItemLabel;
|
|
591
|
+
/**
|
|
592
|
+
* The kind of this completion item. Based on the kind
|
|
593
|
+
* an icon is chosen by the editor.
|
|
594
|
+
*/
|
|
595
|
+
kind: CompletionItemKind;
|
|
596
|
+
/**
|
|
597
|
+
* A modifier to the `kind` which affect how the item
|
|
598
|
+
* is rendered, e.g. Deprecated is rendered with a strikeout
|
|
599
|
+
*/
|
|
600
|
+
tags?: ReadonlyArray<CompletionItemTag>;
|
|
601
|
+
/**
|
|
602
|
+
* A human-readable string with additional information
|
|
603
|
+
* about this item, like type or symbol information.
|
|
604
|
+
*/
|
|
605
|
+
detail?: string;
|
|
606
|
+
/**
|
|
607
|
+
* A human-readable string that represents a doc-comment.
|
|
608
|
+
*/
|
|
609
|
+
documentation?: string | IMarkdownString;
|
|
610
|
+
/**
|
|
611
|
+
* A string that should be used when comparing this item
|
|
612
|
+
* with other items. When `falsy` the {@link CompletionItem.label label}
|
|
613
|
+
* is used.
|
|
614
|
+
*/
|
|
615
|
+
sortText?: string;
|
|
616
|
+
/**
|
|
617
|
+
* A string that should be used when filtering a set of
|
|
618
|
+
* completion items. When `falsy` the {@link CompletionItem.label label}
|
|
619
|
+
* is used.
|
|
620
|
+
*/
|
|
621
|
+
filterText?: string;
|
|
622
|
+
/**
|
|
623
|
+
* Select this item when showing. *Note* that only one completion item can be selected and
|
|
624
|
+
* that the editor decides which item that is. The rule is that the *first* item of those
|
|
625
|
+
* that match best is selected.
|
|
626
|
+
*/
|
|
627
|
+
preselect?: boolean;
|
|
628
|
+
/**
|
|
629
|
+
* A string or snippet that should be inserted in a document when selecting
|
|
630
|
+
* this completion.
|
|
631
|
+
*/
|
|
632
|
+
insertText: string;
|
|
633
|
+
/**
|
|
634
|
+
* Additional rules (as bitmask) that should be applied when inserting
|
|
635
|
+
* this completion.
|
|
636
|
+
*/
|
|
637
|
+
insertTextRules?: CompletionItemInsertTextRule;
|
|
638
|
+
/**
|
|
639
|
+
* A range of text that should be replaced by this completion item.
|
|
640
|
+
*
|
|
641
|
+
* Defaults to a range from the start of the {@link TextDocument.getWordRangeAtPosition current word} to the
|
|
642
|
+
* current position.
|
|
643
|
+
*
|
|
644
|
+
* *Note:* The range must be a {@link Range.isSingleLine single line} and it must
|
|
645
|
+
* {@link Range.contains contain} the position at which completion has been {@link CompletionItemProvider.provideCompletionItems requested}.
|
|
646
|
+
*/
|
|
647
|
+
range: IRange | CompletionItemRanges;
|
|
648
|
+
/**
|
|
649
|
+
* An optional set of characters that when pressed while this completion is active will accept it first and
|
|
650
|
+
* then type that character. *Note* that all commit characters should have `length=1` and that superfluous
|
|
651
|
+
* characters will be ignored.
|
|
652
|
+
*/
|
|
653
|
+
commitCharacters?: string[];
|
|
654
|
+
/**
|
|
655
|
+
* An optional array of additional text edits that are applied when
|
|
656
|
+
* selecting this completion. Edits must not overlap with the main edit
|
|
657
|
+
* nor with themselves.
|
|
658
|
+
*/
|
|
659
|
+
additionalTextEdits?: ISingleEditOperation[];
|
|
660
|
+
/**
|
|
661
|
+
* A command that should be run upon acceptance of this item.
|
|
662
|
+
*/
|
|
663
|
+
command?: Command;
|
|
664
|
+
/**
|
|
665
|
+
* @internal
|
|
666
|
+
*/
|
|
667
|
+
extensionId?: ExtensionIdentifier;
|
|
668
|
+
/**
|
|
669
|
+
* @internal
|
|
670
|
+
*/
|
|
671
|
+
_id?: [number, number];
|
|
672
|
+
}
|
|
673
|
+
interface CompletionList {
|
|
674
|
+
suggestions: CompletionItem[];
|
|
675
|
+
incomplete?: boolean;
|
|
676
|
+
dispose?(): void;
|
|
677
|
+
/**
|
|
678
|
+
* @internal
|
|
679
|
+
*/
|
|
680
|
+
duration?: number;
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* How a suggest provider was triggered.
|
|
684
|
+
*/
|
|
685
|
+
declare const enum CompletionTriggerKind {
|
|
686
|
+
Invoke = 0,
|
|
687
|
+
TriggerCharacter = 1,
|
|
688
|
+
TriggerForIncompleteCompletions = 2
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Contains additional information about the context in which
|
|
692
|
+
* {@link CompletionItemProvider.provideCompletionItems completion provider} is triggered.
|
|
693
|
+
*/
|
|
694
|
+
interface CompletionContext {
|
|
695
|
+
/**
|
|
696
|
+
* How the completion was triggered.
|
|
697
|
+
*/
|
|
698
|
+
triggerKind: CompletionTriggerKind;
|
|
699
|
+
/**
|
|
700
|
+
* Character that triggered the completion item provider.
|
|
701
|
+
*
|
|
702
|
+
* `undefined` if provider was not triggered by a character.
|
|
703
|
+
*/
|
|
704
|
+
triggerCharacter?: string;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* The completion item provider interface defines the contract between extensions and
|
|
708
|
+
* the [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense).
|
|
709
|
+
*
|
|
710
|
+
* When computing *complete* completion items is expensive, providers can optionally implement
|
|
711
|
+
* the `resolveCompletionItem`-function. In that case it is enough to return completion
|
|
712
|
+
* items with a {@link CompletionItem.label label} from the
|
|
713
|
+
* {@link CompletionItemProvider.provideCompletionItems provideCompletionItems}-function. Subsequently,
|
|
714
|
+
* when a completion item is shown in the UI and gains focus this provider is asked to resolve
|
|
715
|
+
* the item, like adding {@link CompletionItem.documentation doc-comment} or {@link CompletionItem.detail details}.
|
|
716
|
+
*/
|
|
717
|
+
interface CompletionItemProvider {
|
|
718
|
+
/**
|
|
719
|
+
* @internal
|
|
720
|
+
*/
|
|
721
|
+
_debugDisplayName?: string;
|
|
722
|
+
triggerCharacters?: string[];
|
|
723
|
+
/**
|
|
724
|
+
* Provide completion items for the given position and document.
|
|
725
|
+
*/
|
|
726
|
+
provideCompletionItems(model: ITextModel, position: Position, context: CompletionContext, token: CancellationToken): ProviderResult<CompletionList>;
|
|
727
|
+
/**
|
|
728
|
+
* Given a completion item fill in more data, like {@link CompletionItem.documentation doc-comment}
|
|
729
|
+
* or {@link CompletionItem.detail details}.
|
|
730
|
+
*
|
|
731
|
+
* The editor will only resolve a completion item once.
|
|
732
|
+
*/
|
|
733
|
+
resolveCompletionItem?(item: CompletionItem, token: CancellationToken): ProviderResult<CompletionItem>;
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* How an {@link InlineCompletionsProvider inline completion provider} was triggered.
|
|
737
|
+
*/
|
|
738
|
+
declare enum InlineCompletionTriggerKind {
|
|
739
|
+
/**
|
|
740
|
+
* Completion was triggered automatically while editing.
|
|
741
|
+
* It is sufficient to return a single completion item in this case.
|
|
742
|
+
*/
|
|
743
|
+
Automatic = 0,
|
|
744
|
+
/**
|
|
745
|
+
* Completion was triggered explicitly by a user gesture.
|
|
746
|
+
* Return multiple completion items to enable cycling through them.
|
|
747
|
+
*/
|
|
748
|
+
Explicit = 1
|
|
749
|
+
}
|
|
750
|
+
interface InlineCompletionContext {
|
|
751
|
+
/**
|
|
752
|
+
* How the completion was triggered.
|
|
753
|
+
*/
|
|
754
|
+
readonly triggerKind: InlineCompletionTriggerKind;
|
|
755
|
+
readonly selectedSuggestionInfo: SelectedSuggestionInfo | undefined;
|
|
756
|
+
}
|
|
757
|
+
declare class SelectedSuggestionInfo {
|
|
758
|
+
readonly range: IRange;
|
|
759
|
+
readonly text: string;
|
|
760
|
+
readonly completionKind: CompletionItemKind;
|
|
761
|
+
readonly isSnippetText: boolean;
|
|
762
|
+
constructor(range: IRange, text: string, completionKind: CompletionItemKind, isSnippetText: boolean);
|
|
763
|
+
equals(other: SelectedSuggestionInfo): boolean;
|
|
764
|
+
}
|
|
765
|
+
interface InlineCompletion {
|
|
766
|
+
/**
|
|
767
|
+
* The text to insert.
|
|
768
|
+
* If the text contains a line break, the range must end at the end of a line.
|
|
769
|
+
* If existing text should be replaced, the existing text must be a prefix of the text to insert.
|
|
770
|
+
*
|
|
771
|
+
* The text can also be a snippet. In that case, a preview with default parameters is shown.
|
|
772
|
+
* When accepting the suggestion, the full snippet is inserted.
|
|
773
|
+
*/
|
|
774
|
+
readonly insertText: string | {
|
|
775
|
+
snippet: string;
|
|
776
|
+
};
|
|
777
|
+
/**
|
|
778
|
+
* A text that is used to decide if this inline completion should be shown.
|
|
779
|
+
* An inline completion is shown if the text to replace is a subword of the filter text.
|
|
780
|
+
*/
|
|
781
|
+
readonly filterText?: string;
|
|
782
|
+
/**
|
|
783
|
+
* An optional array of additional text edits that are applied when
|
|
784
|
+
* selecting this completion. Edits must not overlap with the main edit
|
|
785
|
+
* nor with themselves.
|
|
786
|
+
*/
|
|
787
|
+
readonly additionalTextEdits?: ISingleEditOperation[];
|
|
788
|
+
/**
|
|
789
|
+
* The range to replace.
|
|
790
|
+
* Must begin and end on the same line.
|
|
791
|
+
*/
|
|
792
|
+
readonly range?: IRange;
|
|
793
|
+
readonly command?: Command;
|
|
794
|
+
/**
|
|
795
|
+
* If set to `true`, unopened closing brackets are removed and unclosed opening brackets are closed.
|
|
796
|
+
* Defaults to `false`.
|
|
797
|
+
*/
|
|
798
|
+
readonly completeBracketPairs?: boolean;
|
|
799
|
+
}
|
|
800
|
+
interface InlineCompletions<TItem extends InlineCompletion = InlineCompletion> {
|
|
801
|
+
readonly items: readonly TItem[];
|
|
802
|
+
/**
|
|
803
|
+
* A list of commands associated with the inline completions of this list.
|
|
804
|
+
*/
|
|
805
|
+
readonly commands?: Command[];
|
|
806
|
+
readonly suppressSuggestions?: boolean | undefined;
|
|
807
|
+
/**
|
|
808
|
+
* When set and the user types a suggestion without derivating from it, the inline suggestion is not updated.
|
|
809
|
+
*/
|
|
810
|
+
readonly enableForwardStability?: boolean | undefined;
|
|
811
|
+
}
|
|
812
|
+
interface InlineCompletionsProvider<T extends InlineCompletions = InlineCompletions> {
|
|
813
|
+
provideInlineCompletions(model: ITextModel, position: Position, context: InlineCompletionContext, token: CancellationToken): ProviderResult<T>;
|
|
814
|
+
/**
|
|
815
|
+
* Will be called when an item is shown.
|
|
816
|
+
* @param updatedInsertText Is useful to understand bracket completion.
|
|
817
|
+
*/
|
|
818
|
+
handleItemDidShow?(completions: T, item: T['items'][number], updatedInsertText: string): void;
|
|
819
|
+
/**
|
|
820
|
+
* Will be called when an item is partially accepted.
|
|
821
|
+
*/
|
|
822
|
+
handlePartialAccept?(completions: T, item: T['items'][number], acceptedCharacters: number): void;
|
|
823
|
+
/**
|
|
824
|
+
* Will be called when a completions list is no longer in use and can be garbage-collected.
|
|
825
|
+
*/
|
|
826
|
+
freeInlineCompletions(completions: T): void;
|
|
827
|
+
}
|
|
828
|
+
interface CodeAction {
|
|
829
|
+
title: string;
|
|
830
|
+
command?: Command;
|
|
831
|
+
edit?: WorkspaceEdit;
|
|
832
|
+
diagnostics?: IMarkerData[];
|
|
833
|
+
kind?: string;
|
|
834
|
+
isPreferred?: boolean;
|
|
835
|
+
disabled?: string;
|
|
836
|
+
}
|
|
837
|
+
declare const enum CodeActionTriggerType {
|
|
838
|
+
Invoke = 1,
|
|
839
|
+
Auto = 2
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* @internal
|
|
843
|
+
*/
|
|
844
|
+
interface CodeActionContext {
|
|
845
|
+
only?: string;
|
|
846
|
+
trigger: CodeActionTriggerType;
|
|
847
|
+
}
|
|
848
|
+
interface CodeActionList extends IDisposable {
|
|
849
|
+
readonly actions: ReadonlyArray<CodeAction>;
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* The code action interface defines the contract between extensions and
|
|
853
|
+
* the [light bulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) feature.
|
|
854
|
+
* @internal
|
|
855
|
+
*/
|
|
856
|
+
interface CodeActionProvider {
|
|
857
|
+
displayName?: string;
|
|
858
|
+
/**
|
|
859
|
+
* Provide commands for the given document and range.
|
|
860
|
+
*/
|
|
861
|
+
provideCodeActions(model: ITextModel, range: Range | Selection, context: CodeActionContext, token: CancellationToken): ProviderResult<CodeActionList>;
|
|
862
|
+
/**
|
|
863
|
+
* Given a code action fill in the edit. Will only invoked when missing.
|
|
864
|
+
*/
|
|
865
|
+
resolveCodeAction?(codeAction: CodeAction, token: CancellationToken): ProviderResult<CodeAction>;
|
|
866
|
+
/**
|
|
867
|
+
* Optional list of CodeActionKinds that this provider returns.
|
|
868
|
+
*/
|
|
869
|
+
readonly providedCodeActionKinds?: ReadonlyArray<string>;
|
|
870
|
+
readonly documentation?: ReadonlyArray<{
|
|
871
|
+
readonly kind: string;
|
|
872
|
+
readonly command: Command;
|
|
873
|
+
}>;
|
|
874
|
+
/**
|
|
875
|
+
* @internal
|
|
876
|
+
*/
|
|
877
|
+
_getAdditionalMenuItems?(context: CodeActionContext, actions: readonly CodeAction[]): Command[];
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* @internal
|
|
881
|
+
*/
|
|
882
|
+
interface DocumentPasteEdit {
|
|
883
|
+
readonly id: string;
|
|
884
|
+
readonly label: string;
|
|
885
|
+
readonly detail: string;
|
|
886
|
+
readonly priority: number;
|
|
887
|
+
insertText: string | {
|
|
888
|
+
readonly snippet: string;
|
|
889
|
+
};
|
|
890
|
+
additionalEdit?: WorkspaceEdit;
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* @internal
|
|
894
|
+
*/
|
|
895
|
+
interface DocumentPasteEditProvider {
|
|
896
|
+
readonly id?: string;
|
|
897
|
+
readonly copyMimeTypes?: readonly string[];
|
|
898
|
+
readonly pasteMimeTypes?: readonly string[];
|
|
899
|
+
prepareDocumentPaste?(model: ITextModel, ranges: readonly IRange[], dataTransfer: IReadonlyVSDataTransfer, token: CancellationToken): Promise<undefined | IReadonlyVSDataTransfer>;
|
|
900
|
+
provideDocumentPasteEdits?(model: ITextModel, ranges: readonly IRange[], dataTransfer: IReadonlyVSDataTransfer, token: CancellationToken): Promise<DocumentPasteEdit | undefined>;
|
|
901
|
+
}
|
|
902
|
+
/**
|
|
903
|
+
* Represents a parameter of a callable-signature. A parameter can
|
|
904
|
+
* have a label and a doc-comment.
|
|
905
|
+
*/
|
|
906
|
+
interface ParameterInformation {
|
|
907
|
+
/**
|
|
908
|
+
* The label of this signature. Will be shown in
|
|
909
|
+
* the UI.
|
|
910
|
+
*/
|
|
911
|
+
label: string | [number, number];
|
|
912
|
+
/**
|
|
913
|
+
* The human-readable doc-comment of this signature. Will be shown
|
|
914
|
+
* in the UI but can be omitted.
|
|
915
|
+
*/
|
|
916
|
+
documentation?: string | IMarkdownString;
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* Represents the signature of something callable. A signature
|
|
920
|
+
* can have a label, like a function-name, a doc-comment, and
|
|
921
|
+
* a set of parameters.
|
|
922
|
+
*/
|
|
923
|
+
interface SignatureInformation {
|
|
924
|
+
/**
|
|
925
|
+
* The label of this signature. Will be shown in
|
|
926
|
+
* the UI.
|
|
927
|
+
*/
|
|
928
|
+
label: string;
|
|
929
|
+
/**
|
|
930
|
+
* The human-readable doc-comment of this signature. Will be shown
|
|
931
|
+
* in the UI but can be omitted.
|
|
932
|
+
*/
|
|
933
|
+
documentation?: string | IMarkdownString;
|
|
934
|
+
/**
|
|
935
|
+
* The parameters of this signature.
|
|
936
|
+
*/
|
|
937
|
+
parameters: ParameterInformation[];
|
|
938
|
+
/**
|
|
939
|
+
* Index of the active parameter.
|
|
940
|
+
*
|
|
941
|
+
* If provided, this is used in place of `SignatureHelp.activeSignature`.
|
|
942
|
+
*/
|
|
943
|
+
activeParameter?: number;
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* Signature help represents the signature of something
|
|
947
|
+
* callable. There can be multiple signatures but only one
|
|
948
|
+
* active and only one active parameter.
|
|
949
|
+
*/
|
|
950
|
+
interface SignatureHelp {
|
|
951
|
+
/**
|
|
952
|
+
* One or more signatures.
|
|
953
|
+
*/
|
|
954
|
+
signatures: SignatureInformation[];
|
|
955
|
+
/**
|
|
956
|
+
* The active signature.
|
|
957
|
+
*/
|
|
958
|
+
activeSignature: number;
|
|
959
|
+
/**
|
|
960
|
+
* The active parameter of the active signature.
|
|
961
|
+
*/
|
|
962
|
+
activeParameter: number;
|
|
963
|
+
}
|
|
964
|
+
interface SignatureHelpResult extends IDisposable {
|
|
965
|
+
value: SignatureHelp;
|
|
966
|
+
}
|
|
967
|
+
declare enum SignatureHelpTriggerKind {
|
|
968
|
+
Invoke = 1,
|
|
969
|
+
TriggerCharacter = 2,
|
|
970
|
+
ContentChange = 3
|
|
971
|
+
}
|
|
972
|
+
interface SignatureHelpContext {
|
|
973
|
+
readonly triggerKind: SignatureHelpTriggerKind;
|
|
974
|
+
readonly triggerCharacter?: string;
|
|
975
|
+
readonly isRetrigger: boolean;
|
|
976
|
+
readonly activeSignatureHelp?: SignatureHelp;
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* The signature help provider interface defines the contract between extensions and
|
|
980
|
+
* the [parameter hints](https://code.visualstudio.com/docs/editor/intellisense)-feature.
|
|
981
|
+
*/
|
|
982
|
+
interface SignatureHelpProvider {
|
|
983
|
+
readonly signatureHelpTriggerCharacters?: ReadonlyArray<string>;
|
|
984
|
+
readonly signatureHelpRetriggerCharacters?: ReadonlyArray<string>;
|
|
985
|
+
/**
|
|
986
|
+
* Provide help for the signature at the given position and document.
|
|
987
|
+
*/
|
|
988
|
+
provideSignatureHelp(model: ITextModel, position: Position, token: CancellationToken, context: SignatureHelpContext): ProviderResult<SignatureHelpResult>;
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* A document highlight kind.
|
|
992
|
+
*/
|
|
993
|
+
declare enum DocumentHighlightKind {
|
|
994
|
+
/**
|
|
995
|
+
* A textual occurrence.
|
|
996
|
+
*/
|
|
997
|
+
Text = 0,
|
|
998
|
+
/**
|
|
999
|
+
* Read-access of a symbol, like reading a variable.
|
|
1000
|
+
*/
|
|
1001
|
+
Read = 1,
|
|
1002
|
+
/**
|
|
1003
|
+
* Write-access of a symbol, like writing to a variable.
|
|
1004
|
+
*/
|
|
1005
|
+
Write = 2
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* A document highlight is a range inside a text document which deserves
|
|
1009
|
+
* special attention. Usually a document highlight is visualized by changing
|
|
1010
|
+
* the background color of its range.
|
|
1011
|
+
*/
|
|
1012
|
+
interface DocumentHighlight {
|
|
1013
|
+
/**
|
|
1014
|
+
* The range this highlight applies to.
|
|
1015
|
+
*/
|
|
1016
|
+
range: IRange;
|
|
1017
|
+
/**
|
|
1018
|
+
* The highlight kind, default is {@link DocumentHighlightKind.Text text}.
|
|
1019
|
+
*/
|
|
1020
|
+
kind?: DocumentHighlightKind;
|
|
1021
|
+
}
|
|
1022
|
+
/**
|
|
1023
|
+
* The document highlight provider interface defines the contract between extensions and
|
|
1024
|
+
* the word-highlight-feature.
|
|
1025
|
+
*/
|
|
1026
|
+
interface DocumentHighlightProvider {
|
|
1027
|
+
/**
|
|
1028
|
+
* Provide a set of document highlights, like all occurrences of a variable or
|
|
1029
|
+
* all exit-points of a function.
|
|
1030
|
+
*/
|
|
1031
|
+
provideDocumentHighlights(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<DocumentHighlight[]>;
|
|
1032
|
+
}
|
|
1033
|
+
/**
|
|
1034
|
+
* The linked editing range provider interface defines the contract between extensions and
|
|
1035
|
+
* the linked editing feature.
|
|
1036
|
+
*/
|
|
1037
|
+
interface LinkedEditingRangeProvider {
|
|
1038
|
+
/**
|
|
1039
|
+
* Provide a list of ranges that can be edited together.
|
|
1040
|
+
*/
|
|
1041
|
+
provideLinkedEditingRanges(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<LinkedEditingRanges>;
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Represents a list of ranges that can be edited together along with a word pattern to describe valid contents.
|
|
1045
|
+
*/
|
|
1046
|
+
interface LinkedEditingRanges {
|
|
1047
|
+
/**
|
|
1048
|
+
* A list of ranges that can be edited together. The ranges must have
|
|
1049
|
+
* identical length and text content. The ranges cannot overlap
|
|
1050
|
+
*/
|
|
1051
|
+
ranges: IRange[];
|
|
1052
|
+
/**
|
|
1053
|
+
* An optional word pattern that describes valid contents for the given ranges.
|
|
1054
|
+
* If no pattern is provided, the language configuration's word pattern will be used.
|
|
1055
|
+
*/
|
|
1056
|
+
wordPattern?: RegExp;
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Value-object that contains additional information when
|
|
1060
|
+
* requesting references.
|
|
1061
|
+
*/
|
|
1062
|
+
interface ReferenceContext {
|
|
1063
|
+
/**
|
|
1064
|
+
* Include the declaration of the current symbol.
|
|
1065
|
+
*/
|
|
1066
|
+
includeDeclaration: boolean;
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* The reference provider interface defines the contract between extensions and
|
|
1070
|
+
* the [find references](https://code.visualstudio.com/docs/editor/editingevolved#_peek)-feature.
|
|
1071
|
+
*/
|
|
1072
|
+
interface ReferenceProvider {
|
|
1073
|
+
/**
|
|
1074
|
+
* Provide a set of project-wide references for the given position and document.
|
|
1075
|
+
*/
|
|
1076
|
+
provideReferences(model: ITextModel, position: Position, context: ReferenceContext, token: CancellationToken): ProviderResult<Location[]>;
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* Represents a location inside a resource, such as a line
|
|
1080
|
+
* inside a text file.
|
|
1081
|
+
*/
|
|
1082
|
+
interface Location {
|
|
1083
|
+
/**
|
|
1084
|
+
* The resource identifier of this location.
|
|
1085
|
+
*/
|
|
1086
|
+
uri: URI;
|
|
1087
|
+
/**
|
|
1088
|
+
* The document range of this locations.
|
|
1089
|
+
*/
|
|
1090
|
+
range: IRange;
|
|
1091
|
+
}
|
|
1092
|
+
interface LocationLink {
|
|
1093
|
+
/**
|
|
1094
|
+
* A range to select where this link originates from.
|
|
1095
|
+
*/
|
|
1096
|
+
originSelectionRange?: IRange;
|
|
1097
|
+
/**
|
|
1098
|
+
* The target uri this link points to.
|
|
1099
|
+
*/
|
|
1100
|
+
uri: URI;
|
|
1101
|
+
/**
|
|
1102
|
+
* The full range this link points to.
|
|
1103
|
+
*/
|
|
1104
|
+
range: IRange;
|
|
1105
|
+
/**
|
|
1106
|
+
* A range to select this link points to. Must be contained
|
|
1107
|
+
* in `LocationLink.range`.
|
|
1108
|
+
*/
|
|
1109
|
+
targetSelectionRange?: IRange;
|
|
1110
|
+
}
|
|
1111
|
+
type Definition = Location | Location[] | LocationLink[];
|
|
1112
|
+
/**
|
|
1113
|
+
* The definition provider interface defines the contract between extensions and
|
|
1114
|
+
* the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition)
|
|
1115
|
+
* and peek definition features.
|
|
1116
|
+
*/
|
|
1117
|
+
interface DefinitionProvider {
|
|
1118
|
+
/**
|
|
1119
|
+
* Provide the definition of the symbol at the given position and document.
|
|
1120
|
+
*/
|
|
1121
|
+
provideDefinition(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* The definition provider interface defines the contract between extensions and
|
|
1125
|
+
* the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition)
|
|
1126
|
+
* and peek definition features.
|
|
1127
|
+
*/
|
|
1128
|
+
interface DeclarationProvider {
|
|
1129
|
+
/**
|
|
1130
|
+
* Provide the declaration of the symbol at the given position and document.
|
|
1131
|
+
*/
|
|
1132
|
+
provideDeclaration(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* The implementation provider interface defines the contract between extensions and
|
|
1136
|
+
* the go to implementation feature.
|
|
1137
|
+
*/
|
|
1138
|
+
interface ImplementationProvider {
|
|
1139
|
+
/**
|
|
1140
|
+
* Provide the implementation of the symbol at the given position and document.
|
|
1141
|
+
*/
|
|
1142
|
+
provideImplementation(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* The type definition provider interface defines the contract between extensions and
|
|
1146
|
+
* the go to type definition feature.
|
|
1147
|
+
*/
|
|
1148
|
+
interface TypeDefinitionProvider {
|
|
1149
|
+
/**
|
|
1150
|
+
* Provide the type definition of the symbol at the given position and document.
|
|
1151
|
+
*/
|
|
1152
|
+
provideTypeDefinition(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* A symbol kind.
|
|
1156
|
+
*/
|
|
1157
|
+
declare const enum SymbolKind {
|
|
1158
|
+
File = 0,
|
|
1159
|
+
Module = 1,
|
|
1160
|
+
Namespace = 2,
|
|
1161
|
+
Package = 3,
|
|
1162
|
+
Class = 4,
|
|
1163
|
+
Method = 5,
|
|
1164
|
+
Property = 6,
|
|
1165
|
+
Field = 7,
|
|
1166
|
+
Constructor = 8,
|
|
1167
|
+
Enum = 9,
|
|
1168
|
+
Interface = 10,
|
|
1169
|
+
Function = 11,
|
|
1170
|
+
Variable = 12,
|
|
1171
|
+
Constant = 13,
|
|
1172
|
+
String = 14,
|
|
1173
|
+
Number = 15,
|
|
1174
|
+
Boolean = 16,
|
|
1175
|
+
Array = 17,
|
|
1176
|
+
Object = 18,
|
|
1177
|
+
Key = 19,
|
|
1178
|
+
Null = 20,
|
|
1179
|
+
EnumMember = 21,
|
|
1180
|
+
Struct = 22,
|
|
1181
|
+
Event = 23,
|
|
1182
|
+
Operator = 24,
|
|
1183
|
+
TypeParameter = 25
|
|
1184
|
+
}
|
|
1185
|
+
declare const enum SymbolTag {
|
|
1186
|
+
Deprecated = 1
|
|
1187
|
+
}
|
|
1188
|
+
interface DocumentSymbol {
|
|
1189
|
+
name: string;
|
|
1190
|
+
detail: string;
|
|
1191
|
+
kind: SymbolKind;
|
|
1192
|
+
tags: ReadonlyArray<SymbolTag>;
|
|
1193
|
+
containerName?: string;
|
|
1194
|
+
range: IRange;
|
|
1195
|
+
selectionRange: IRange;
|
|
1196
|
+
children?: DocumentSymbol[];
|
|
1197
|
+
}
|
|
1198
|
+
/**
|
|
1199
|
+
* The document symbol provider interface defines the contract between extensions and
|
|
1200
|
+
* the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-symbol)-feature.
|
|
1201
|
+
*/
|
|
1202
|
+
interface DocumentSymbolProvider {
|
|
1203
|
+
displayName?: string;
|
|
1204
|
+
/**
|
|
1205
|
+
* Provide symbol information for the given document.
|
|
1206
|
+
*/
|
|
1207
|
+
provideDocumentSymbols(model: ITextModel, token: CancellationToken): ProviderResult<DocumentSymbol[]>;
|
|
1208
|
+
}
|
|
1209
|
+
interface TextEdit {
|
|
1210
|
+
range: IRange;
|
|
1211
|
+
text: string;
|
|
1212
|
+
eol?: EndOfLineSequence;
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* Interface used to format a model
|
|
1216
|
+
*/
|
|
1217
|
+
interface FormattingOptions {
|
|
1218
|
+
/**
|
|
1219
|
+
* Size of a tab in spaces.
|
|
1220
|
+
*/
|
|
1221
|
+
tabSize: number;
|
|
1222
|
+
/**
|
|
1223
|
+
* Prefer spaces over tabs.
|
|
1224
|
+
*/
|
|
1225
|
+
insertSpaces: boolean;
|
|
1226
|
+
/**
|
|
1227
|
+
* The list of multiple ranges to format at once, if the provider supports it.
|
|
1228
|
+
*/
|
|
1229
|
+
ranges?: Range[];
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* The document formatting provider interface defines the contract between extensions and
|
|
1233
|
+
* the formatting-feature.
|
|
1234
|
+
*/
|
|
1235
|
+
interface DocumentFormattingEditProvider {
|
|
1236
|
+
/**
|
|
1237
|
+
* @internal
|
|
1238
|
+
*/
|
|
1239
|
+
readonly extensionId?: ExtensionIdentifier;
|
|
1240
|
+
readonly displayName?: string;
|
|
1241
|
+
/**
|
|
1242
|
+
* Provide formatting edits for a whole document.
|
|
1243
|
+
*/
|
|
1244
|
+
provideDocumentFormattingEdits(model: ITextModel, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
|
|
1245
|
+
}
|
|
1246
|
+
/**
|
|
1247
|
+
* The document formatting provider interface defines the contract between extensions and
|
|
1248
|
+
* the formatting-feature.
|
|
1249
|
+
*/
|
|
1250
|
+
interface DocumentRangeFormattingEditProvider {
|
|
1251
|
+
/**
|
|
1252
|
+
* @internal
|
|
1253
|
+
*/
|
|
1254
|
+
readonly extensionId?: ExtensionIdentifier;
|
|
1255
|
+
readonly displayName?: string;
|
|
1256
|
+
/**
|
|
1257
|
+
* Provide formatting edits for a range in a document.
|
|
1258
|
+
*
|
|
1259
|
+
* The given range is a hint and providers can decide to format a smaller
|
|
1260
|
+
* or larger range. Often this is done by adjusting the start and end
|
|
1261
|
+
* of the range to full syntax nodes.
|
|
1262
|
+
*/
|
|
1263
|
+
provideDocumentRangeFormattingEdits(model: ITextModel, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
|
|
1264
|
+
provideDocumentRangesFormattingEdits?(model: ITextModel, ranges: Range[], options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
|
|
1265
|
+
}
|
|
1266
|
+
/**
|
|
1267
|
+
* The document formatting provider interface defines the contract between extensions and
|
|
1268
|
+
* the formatting-feature.
|
|
1269
|
+
*/
|
|
1270
|
+
interface OnTypeFormattingEditProvider {
|
|
1271
|
+
/**
|
|
1272
|
+
* @internal
|
|
1273
|
+
*/
|
|
1274
|
+
readonly extensionId?: ExtensionIdentifier;
|
|
1275
|
+
autoFormatTriggerCharacters: string[];
|
|
1276
|
+
/**
|
|
1277
|
+
* Provide formatting edits after a character has been typed.
|
|
1278
|
+
*
|
|
1279
|
+
* The given position and character should hint to the provider
|
|
1280
|
+
* what range the position to expand to, like find the matching `{`
|
|
1281
|
+
* when `}` has been entered.
|
|
1282
|
+
*/
|
|
1283
|
+
provideOnTypeFormattingEdits(model: ITextModel, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* @internal
|
|
1287
|
+
*/
|
|
1288
|
+
interface IInplaceReplaceSupportResult {
|
|
1289
|
+
value: string;
|
|
1290
|
+
range: IRange;
|
|
1291
|
+
}
|
|
1292
|
+
/**
|
|
1293
|
+
* A link inside the editor.
|
|
1294
|
+
*/
|
|
1295
|
+
interface ILink {
|
|
1296
|
+
range: IRange;
|
|
1297
|
+
url?: URI | string;
|
|
1298
|
+
tooltip?: string;
|
|
1299
|
+
}
|
|
1300
|
+
interface ILinksList {
|
|
1301
|
+
links: ILink[];
|
|
1302
|
+
dispose?(): void;
|
|
1303
|
+
}
|
|
1304
|
+
/**
|
|
1305
|
+
* A provider of links.
|
|
1306
|
+
*/
|
|
1307
|
+
interface LinkProvider {
|
|
1308
|
+
provideLinks(model: ITextModel, token: CancellationToken): ProviderResult<ILinksList>;
|
|
1309
|
+
resolveLink?: (link: ILink, token: CancellationToken) => ProviderResult<ILink>;
|
|
1310
|
+
}
|
|
1311
|
+
/**
|
|
1312
|
+
* A color in RGBA format.
|
|
1313
|
+
*/
|
|
1314
|
+
interface IColor {
|
|
1315
|
+
/**
|
|
1316
|
+
* The red component in the range [0-1].
|
|
1317
|
+
*/
|
|
1318
|
+
readonly red: number;
|
|
1319
|
+
/**
|
|
1320
|
+
* The green component in the range [0-1].
|
|
1321
|
+
*/
|
|
1322
|
+
readonly green: number;
|
|
1323
|
+
/**
|
|
1324
|
+
* The blue component in the range [0-1].
|
|
1325
|
+
*/
|
|
1326
|
+
readonly blue: number;
|
|
1327
|
+
/**
|
|
1328
|
+
* The alpha component in the range [0-1].
|
|
1329
|
+
*/
|
|
1330
|
+
readonly alpha: number;
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
* String representations for a color
|
|
1334
|
+
*/
|
|
1335
|
+
interface IColorPresentation {
|
|
1336
|
+
/**
|
|
1337
|
+
* The label of this color presentation. It will be shown on the color
|
|
1338
|
+
* picker header. By default this is also the text that is inserted when selecting
|
|
1339
|
+
* this color presentation.
|
|
1340
|
+
*/
|
|
1341
|
+
label: string;
|
|
1342
|
+
/**
|
|
1343
|
+
* An {@link TextEdit edit} which is applied to a document when selecting
|
|
1344
|
+
* this presentation for the color.
|
|
1345
|
+
*/
|
|
1346
|
+
textEdit?: TextEdit;
|
|
1347
|
+
/**
|
|
1348
|
+
* An optional array of additional {@link TextEdit text edits} that are applied when
|
|
1349
|
+
* selecting this color presentation.
|
|
1350
|
+
*/
|
|
1351
|
+
additionalTextEdits?: TextEdit[];
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* A color range is a range in a text model which represents a color.
|
|
1355
|
+
*/
|
|
1356
|
+
interface IColorInformation {
|
|
1357
|
+
/**
|
|
1358
|
+
* The range within the model.
|
|
1359
|
+
*/
|
|
1360
|
+
range: IRange;
|
|
1361
|
+
/**
|
|
1362
|
+
* The color represented in this range.
|
|
1363
|
+
*/
|
|
1364
|
+
color: IColor;
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* A provider of colors for editor models.
|
|
1368
|
+
*/
|
|
1369
|
+
interface DocumentColorProvider {
|
|
1370
|
+
/**
|
|
1371
|
+
* Provides the color ranges for a specific model.
|
|
1372
|
+
*/
|
|
1373
|
+
provideDocumentColors(model: ITextModel, token: CancellationToken): ProviderResult<IColorInformation[]>;
|
|
1374
|
+
/**
|
|
1375
|
+
* Provide the string representations for a color.
|
|
1376
|
+
*/
|
|
1377
|
+
provideColorPresentations(model: ITextModel, colorInfo: IColorInformation, token: CancellationToken): ProviderResult<IColorPresentation[]>;
|
|
1378
|
+
}
|
|
1379
|
+
interface SelectionRange {
|
|
1380
|
+
range: IRange;
|
|
1381
|
+
}
|
|
1382
|
+
interface SelectionRangeProvider {
|
|
1383
|
+
/**
|
|
1384
|
+
* Provide ranges that should be selected from the given position.
|
|
1385
|
+
*/
|
|
1386
|
+
provideSelectionRanges(model: ITextModel, positions: Position[], token: CancellationToken): ProviderResult<SelectionRange[][]>;
|
|
1387
|
+
}
|
|
1388
|
+
interface FoldingContext {
|
|
1389
|
+
}
|
|
1390
|
+
/**
|
|
1391
|
+
* A provider of folding ranges for editor models.
|
|
1392
|
+
*/
|
|
1393
|
+
interface FoldingRangeProvider {
|
|
1394
|
+
/**
|
|
1395
|
+
* @internal
|
|
1396
|
+
*/
|
|
1397
|
+
readonly id?: string;
|
|
1398
|
+
/**
|
|
1399
|
+
* An optional event to signal that the folding ranges from this provider have changed.
|
|
1400
|
+
*/
|
|
1401
|
+
onDidChange?: Event<this>;
|
|
1402
|
+
/**
|
|
1403
|
+
* Provides the folding ranges for a specific model.
|
|
1404
|
+
*/
|
|
1405
|
+
provideFoldingRanges(model: ITextModel, context: FoldingContext, token: CancellationToken): ProviderResult<FoldingRange[]>;
|
|
1406
|
+
}
|
|
1407
|
+
interface FoldingRange {
|
|
1408
|
+
/**
|
|
1409
|
+
* The one-based start line of the range to fold. The folded area starts after the line's last character.
|
|
1410
|
+
*/
|
|
1411
|
+
start: number;
|
|
1412
|
+
/**
|
|
1413
|
+
* The one-based end line of the range to fold. The folded area ends with the line's last character.
|
|
1414
|
+
*/
|
|
1415
|
+
end: number;
|
|
1416
|
+
/**
|
|
1417
|
+
* Describes the {@link FoldingRangeKind Kind} of the folding range such as {@link FoldingRangeKind.Comment Comment} or
|
|
1418
|
+
* {@link FoldingRangeKind.Region Region}. The kind is used to categorize folding ranges and used by commands
|
|
1419
|
+
* like 'Fold all comments'. See
|
|
1420
|
+
* {@link FoldingRangeKind} for an enumeration of standardized kinds.
|
|
1421
|
+
*/
|
|
1422
|
+
kind?: FoldingRangeKind;
|
|
1423
|
+
}
|
|
1424
|
+
declare class FoldingRangeKind {
|
|
1425
|
+
value: string;
|
|
1426
|
+
/**
|
|
1427
|
+
* Kind for folding range representing a comment. The value of the kind is 'comment'.
|
|
1428
|
+
*/
|
|
1429
|
+
static readonly Comment: FoldingRangeKind;
|
|
1430
|
+
/**
|
|
1431
|
+
* Kind for folding range representing a import. The value of the kind is 'imports'.
|
|
1432
|
+
*/
|
|
1433
|
+
static readonly Imports: FoldingRangeKind;
|
|
1434
|
+
/**
|
|
1435
|
+
* Kind for folding range representing regions (for example marked by `#region`, `#endregion`).
|
|
1436
|
+
* The value of the kind is 'region'.
|
|
1437
|
+
*/
|
|
1438
|
+
static readonly Region: FoldingRangeKind;
|
|
1439
|
+
/**
|
|
1440
|
+
* Returns a {@link FoldingRangeKind} for the given value.
|
|
1441
|
+
*
|
|
1442
|
+
* @param value of the kind.
|
|
1443
|
+
*/
|
|
1444
|
+
static fromValue(value: string): FoldingRangeKind;
|
|
1445
|
+
/**
|
|
1446
|
+
* Creates a new {@link FoldingRangeKind}.
|
|
1447
|
+
*
|
|
1448
|
+
* @param value of the kind.
|
|
1449
|
+
*/
|
|
1450
|
+
constructor(value: string);
|
|
1451
|
+
}
|
|
1452
|
+
interface WorkspaceEditMetadata {
|
|
1453
|
+
needsConfirmation: boolean;
|
|
1454
|
+
label: string;
|
|
1455
|
+
description?: string;
|
|
1456
|
+
/**
|
|
1457
|
+
* @internal
|
|
1458
|
+
*/
|
|
1459
|
+
iconPath?: ThemeIcon | URI | {
|
|
1460
|
+
light: URI;
|
|
1461
|
+
dark: URI;
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
interface WorkspaceFileEditOptions {
|
|
1465
|
+
overwrite?: boolean;
|
|
1466
|
+
ignoreIfNotExists?: boolean;
|
|
1467
|
+
ignoreIfExists?: boolean;
|
|
1468
|
+
recursive?: boolean;
|
|
1469
|
+
copy?: boolean;
|
|
1470
|
+
folder?: boolean;
|
|
1471
|
+
skipTrashBin?: boolean;
|
|
1472
|
+
maxSize?: number;
|
|
1473
|
+
/**
|
|
1474
|
+
* @internal
|
|
1475
|
+
*/
|
|
1476
|
+
contents?: Promise<VSBuffer>;
|
|
1477
|
+
}
|
|
1478
|
+
interface IWorkspaceFileEdit {
|
|
1479
|
+
oldResource?: URI;
|
|
1480
|
+
newResource?: URI;
|
|
1481
|
+
options?: WorkspaceFileEditOptions;
|
|
1482
|
+
metadata?: WorkspaceEditMetadata;
|
|
1483
|
+
}
|
|
1484
|
+
interface IWorkspaceTextEdit {
|
|
1485
|
+
resource: URI;
|
|
1486
|
+
textEdit: TextEdit & {
|
|
1487
|
+
insertAsSnippet?: boolean;
|
|
1488
|
+
};
|
|
1489
|
+
versionId: number | undefined;
|
|
1490
|
+
metadata?: WorkspaceEditMetadata;
|
|
1491
|
+
}
|
|
1492
|
+
interface WorkspaceEdit {
|
|
1493
|
+
edits: Array<IWorkspaceTextEdit | IWorkspaceFileEdit>;
|
|
1494
|
+
}
|
|
1495
|
+
interface Rejection {
|
|
1496
|
+
rejectReason?: string;
|
|
1497
|
+
}
|
|
1498
|
+
interface RenameLocation {
|
|
1499
|
+
range: IRange;
|
|
1500
|
+
text: string;
|
|
1501
|
+
}
|
|
1502
|
+
interface RenameProvider {
|
|
1503
|
+
provideRenameEdits(model: ITextModel, position: Position, newName: string, token: CancellationToken): ProviderResult<WorkspaceEdit & Rejection>;
|
|
1504
|
+
resolveRenameLocation?(model: ITextModel, position: Position, token: CancellationToken): ProviderResult<RenameLocation & Rejection>;
|
|
1505
|
+
}
|
|
1506
|
+
interface Command {
|
|
1507
|
+
id: string;
|
|
1508
|
+
title: string;
|
|
1509
|
+
tooltip?: string;
|
|
1510
|
+
arguments?: any[];
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* @internal
|
|
1514
|
+
*/
|
|
1515
|
+
declare namespace Command {
|
|
1516
|
+
/**
|
|
1517
|
+
* @internal
|
|
1518
|
+
*/
|
|
1519
|
+
function is(obj: any): obj is Command;
|
|
1520
|
+
}
|
|
1521
|
+
interface CodeLens {
|
|
1522
|
+
range: IRange;
|
|
1523
|
+
id?: string;
|
|
1524
|
+
command?: Command;
|
|
1525
|
+
}
|
|
1526
|
+
interface CodeLensList {
|
|
1527
|
+
lenses: CodeLens[];
|
|
1528
|
+
dispose(): void;
|
|
1529
|
+
}
|
|
1530
|
+
interface CodeLensProvider {
|
|
1531
|
+
onDidChange?: Event<this>;
|
|
1532
|
+
provideCodeLenses(model: ITextModel, token: CancellationToken): ProviderResult<CodeLensList>;
|
|
1533
|
+
resolveCodeLens?(model: ITextModel, codeLens: CodeLens, token: CancellationToken): ProviderResult<CodeLens>;
|
|
1534
|
+
}
|
|
1535
|
+
declare enum InlayHintKind {
|
|
1536
|
+
Type = 1,
|
|
1537
|
+
Parameter = 2
|
|
1538
|
+
}
|
|
1539
|
+
interface InlayHintLabelPart {
|
|
1540
|
+
label: string;
|
|
1541
|
+
tooltip?: string | IMarkdownString;
|
|
1542
|
+
command?: Command;
|
|
1543
|
+
location?: Location;
|
|
1544
|
+
}
|
|
1545
|
+
interface InlayHint {
|
|
1546
|
+
label: string | InlayHintLabelPart[];
|
|
1547
|
+
tooltip?: string | IMarkdownString;
|
|
1548
|
+
textEdits?: TextEdit[];
|
|
1549
|
+
position: IPosition;
|
|
1550
|
+
kind?: InlayHintKind;
|
|
1551
|
+
paddingLeft?: boolean;
|
|
1552
|
+
paddingRight?: boolean;
|
|
1553
|
+
}
|
|
1554
|
+
interface InlayHintList {
|
|
1555
|
+
hints: InlayHint[];
|
|
1556
|
+
dispose(): void;
|
|
1557
|
+
}
|
|
1558
|
+
interface InlayHintsProvider {
|
|
1559
|
+
displayName?: string;
|
|
1560
|
+
onDidChangeInlayHints?: Event<void>;
|
|
1561
|
+
provideInlayHints(model: ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHintList>;
|
|
1562
|
+
resolveInlayHint?(hint: InlayHint, token: CancellationToken): ProviderResult<InlayHint>;
|
|
1563
|
+
}
|
|
1564
|
+
interface SemanticTokensLegend {
|
|
1565
|
+
readonly tokenTypes: string[];
|
|
1566
|
+
readonly tokenModifiers: string[];
|
|
1567
|
+
}
|
|
1568
|
+
interface SemanticTokens {
|
|
1569
|
+
readonly resultId?: string;
|
|
1570
|
+
readonly data: Uint32Array;
|
|
1571
|
+
}
|
|
1572
|
+
interface SemanticTokensEdit {
|
|
1573
|
+
readonly start: number;
|
|
1574
|
+
readonly deleteCount: number;
|
|
1575
|
+
readonly data?: Uint32Array;
|
|
1576
|
+
}
|
|
1577
|
+
interface SemanticTokensEdits {
|
|
1578
|
+
readonly resultId?: string;
|
|
1579
|
+
readonly edits: SemanticTokensEdit[];
|
|
1580
|
+
}
|
|
1581
|
+
interface DocumentSemanticTokensProvider {
|
|
1582
|
+
onDidChange?: Event<void>;
|
|
1583
|
+
getLegend(): SemanticTokensLegend;
|
|
1584
|
+
provideDocumentSemanticTokens(model: ITextModel, lastResultId: string | null, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensEdits>;
|
|
1585
|
+
releaseDocumentSemanticTokens(resultId: string | undefined): void;
|
|
1586
|
+
}
|
|
1587
|
+
interface DocumentRangeSemanticTokensProvider {
|
|
1588
|
+
getLegend(): SemanticTokensLegend;
|
|
1589
|
+
provideDocumentRangeSemanticTokens(model: ITextModel, range: Range, token: CancellationToken): ProviderResult<SemanticTokens>;
|
|
1590
|
+
}
|
|
1591
|
+
/**
|
|
1592
|
+
* @internal
|
|
1593
|
+
*/
|
|
1594
|
+
interface DocumentOnDropEdit {
|
|
1595
|
+
readonly id: string;
|
|
1596
|
+
readonly label: string;
|
|
1597
|
+
readonly priority: number;
|
|
1598
|
+
insertText: string | {
|
|
1599
|
+
readonly snippet: string;
|
|
1600
|
+
};
|
|
1601
|
+
additionalEdit?: WorkspaceEdit;
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* @internal
|
|
1605
|
+
*/
|
|
1606
|
+
interface DocumentOnDropEditProvider {
|
|
1607
|
+
readonly dropMimeTypes?: readonly string[];
|
|
1608
|
+
provideDocumentOnDropEdits(model: ITextModel, position: IPosition, dataTransfer: IReadonlyVSDataTransfer, token: CancellationToken): ProviderResult<DocumentOnDropEdit>;
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
interface IAction {
|
|
1612
|
+
readonly id: string;
|
|
1613
|
+
label: string;
|
|
1614
|
+
tooltip: string;
|
|
1615
|
+
class: string | undefined;
|
|
1616
|
+
enabled: boolean;
|
|
1617
|
+
checked?: boolean;
|
|
1618
|
+
run(...args: unknown[]): unknown;
|
|
1619
|
+
}
|
|
1620
|
+
interface IActionRunner extends IDisposable {
|
|
1621
|
+
readonly onDidRun: Event<IRunEvent>;
|
|
1622
|
+
readonly onWillRun: Event<IRunEvent>;
|
|
1623
|
+
run(action: IAction, context?: unknown): unknown;
|
|
1624
|
+
}
|
|
1625
|
+
interface IRunEvent {
|
|
1626
|
+
readonly action: IAction;
|
|
1627
|
+
readonly error?: Error;
|
|
1628
|
+
}
|
|
1629
|
+
declare class SubmenuAction implements IAction {
|
|
1630
|
+
readonly id: string;
|
|
1631
|
+
readonly label: string;
|
|
1632
|
+
readonly class: string | undefined;
|
|
1633
|
+
readonly tooltip: string;
|
|
1634
|
+
readonly enabled: boolean;
|
|
1635
|
+
readonly checked: undefined;
|
|
1636
|
+
private readonly _actions;
|
|
1637
|
+
get actions(): readonly IAction[];
|
|
1638
|
+
constructor(id: string, label: string, actions: readonly IAction[], cssClass?: string);
|
|
1639
|
+
run(): Promise<void>;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
type Severity = Severity$1;
|
|
1643
|
+
type NotificationMessage = string | Error;
|
|
1644
|
+
declare enum NotificationPriority {
|
|
1645
|
+
/**
|
|
1646
|
+
* Default priority: notification will be visible unless do not disturb mode is enabled.
|
|
1647
|
+
*/
|
|
1648
|
+
DEFAULT = 0,
|
|
1649
|
+
/**
|
|
1650
|
+
* Silent priority: notification will only be visible from the notifications center.
|
|
1651
|
+
*/
|
|
1652
|
+
SILENT = 1,
|
|
1653
|
+
/**
|
|
1654
|
+
* Urgent priority: notification will be visible even when do not disturb mode is enabled.
|
|
1655
|
+
*/
|
|
1656
|
+
URGENT = 2
|
|
1657
|
+
}
|
|
1658
|
+
interface INotificationProperties {
|
|
1659
|
+
/**
|
|
1660
|
+
* Sticky notifications are not automatically removed after a certain timeout.
|
|
1661
|
+
*
|
|
1662
|
+
* Currently, only 2 kinds of notifications are sticky:
|
|
1663
|
+
* - Error notifications with primary actions
|
|
1664
|
+
* - Notifications that show progress
|
|
1665
|
+
*/
|
|
1666
|
+
readonly sticky?: boolean;
|
|
1667
|
+
/**
|
|
1668
|
+
* Allows to override the priority of the notification based on needs.
|
|
1669
|
+
*/
|
|
1670
|
+
readonly priority?: NotificationPriority;
|
|
1671
|
+
/**
|
|
1672
|
+
* Adds an action to never show the notification again. The choice will be persisted
|
|
1673
|
+
* such as future requests will not cause the notification to show again.
|
|
1674
|
+
*/
|
|
1675
|
+
readonly neverShowAgain?: INeverShowAgainOptions;
|
|
1676
|
+
}
|
|
1677
|
+
declare enum NeverShowAgainScope {
|
|
1678
|
+
/**
|
|
1679
|
+
* Will never show this notification on the current workspace again.
|
|
1680
|
+
*/
|
|
1681
|
+
WORKSPACE = 0,
|
|
1682
|
+
/**
|
|
1683
|
+
* Will never show this notification on any workspace of the same
|
|
1684
|
+
* profile again.
|
|
1685
|
+
*/
|
|
1686
|
+
PROFILE = 1,
|
|
1687
|
+
/**
|
|
1688
|
+
* Will never show this notification on any workspace across all
|
|
1689
|
+
* profiles again.
|
|
1690
|
+
*/
|
|
1691
|
+
APPLICATION = 2
|
|
1692
|
+
}
|
|
1693
|
+
interface INeverShowAgainOptions {
|
|
1694
|
+
/**
|
|
1695
|
+
* The id is used to persist the selection of not showing the notification again.
|
|
1696
|
+
*/
|
|
1697
|
+
readonly id: string;
|
|
1698
|
+
/**
|
|
1699
|
+
* By default the action will show up as primary action. Setting this to true will
|
|
1700
|
+
* make it a secondary action instead.
|
|
1701
|
+
*/
|
|
1702
|
+
readonly isSecondary?: boolean;
|
|
1703
|
+
/**
|
|
1704
|
+
* Whether to persist the choice in the current workspace or for all workspaces. By
|
|
1705
|
+
* default it will be persisted for all workspaces across all profiles
|
|
1706
|
+
* (= `NeverShowAgainScope.APPLICATION`).
|
|
1707
|
+
*/
|
|
1708
|
+
readonly scope?: NeverShowAgainScope;
|
|
1709
|
+
}
|
|
1710
|
+
interface INotification extends INotificationProperties {
|
|
1711
|
+
/**
|
|
1712
|
+
* The id of the notification. If provided, will be used to compare
|
|
1713
|
+
* notifications with others to decide whether a notification is
|
|
1714
|
+
* duplicate or not.
|
|
1715
|
+
*/
|
|
1716
|
+
readonly id?: string;
|
|
1717
|
+
/**
|
|
1718
|
+
* The severity of the notification. Either `Info`, `Warning` or `Error`.
|
|
1719
|
+
*/
|
|
1720
|
+
readonly severity: Severity;
|
|
1721
|
+
/**
|
|
1722
|
+
* The message of the notification. This can either be a `string` or `Error`. Messages
|
|
1723
|
+
* can optionally include links in the format: `[text](link)`
|
|
1724
|
+
*/
|
|
1725
|
+
readonly message: NotificationMessage;
|
|
1726
|
+
/**
|
|
1727
|
+
* The source of the notification appears as additional information.
|
|
1728
|
+
*/
|
|
1729
|
+
readonly source?: string | {
|
|
1730
|
+
label: string;
|
|
1731
|
+
id: string;
|
|
1732
|
+
};
|
|
1733
|
+
/**
|
|
1734
|
+
* Actions to show as part of the notification. Primary actions show up as
|
|
1735
|
+
* buttons as part of the message and will close the notification once clicked.
|
|
1736
|
+
*
|
|
1737
|
+
* Secondary actions are meant to provide additional configuration or context
|
|
1738
|
+
* for the notification and will show up less prominent. A notification does not
|
|
1739
|
+
* close automatically when invoking a secondary action.
|
|
1740
|
+
*
|
|
1741
|
+
* **Note:** If your intent is to show a message with actions to the user, consider
|
|
1742
|
+
* the `INotificationService.prompt()` method instead which are optimized for
|
|
1743
|
+
* this usecase and much easier to use!
|
|
1744
|
+
*/
|
|
1745
|
+
actions?: INotificationActions;
|
|
1746
|
+
/**
|
|
1747
|
+
* The initial set of progress properties for the notification. To update progress
|
|
1748
|
+
* later on, access the `INotificationHandle.progress` property.
|
|
1749
|
+
*/
|
|
1750
|
+
readonly progress?: INotificationProgressProperties;
|
|
1751
|
+
}
|
|
1752
|
+
interface INotificationActions {
|
|
1753
|
+
/**
|
|
1754
|
+
* Primary actions show up as buttons as part of the message and will close
|
|
1755
|
+
* the notification once clicked.
|
|
1756
|
+
*
|
|
1757
|
+
* Pass `ActionWithMenuAction` for an action that has additional menu actions.
|
|
1758
|
+
*/
|
|
1759
|
+
readonly primary?: readonly IAction[];
|
|
1760
|
+
/**
|
|
1761
|
+
* Secondary actions are meant to provide additional configuration or context
|
|
1762
|
+
* for the notification and will show up less prominent. A notification does not
|
|
1763
|
+
* close automatically when invoking a secondary action.
|
|
1764
|
+
*/
|
|
1765
|
+
readonly secondary?: readonly IAction[];
|
|
1766
|
+
}
|
|
1767
|
+
interface INotificationProgressProperties {
|
|
1768
|
+
/**
|
|
1769
|
+
* Causes the progress bar to spin infinitley.
|
|
1770
|
+
*/
|
|
1771
|
+
readonly infinite?: boolean;
|
|
1772
|
+
/**
|
|
1773
|
+
* Indicate the total amount of work.
|
|
1774
|
+
*/
|
|
1775
|
+
readonly total?: number;
|
|
1776
|
+
/**
|
|
1777
|
+
* Indicate that a specific chunk of work is done.
|
|
1778
|
+
*/
|
|
1779
|
+
readonly worked?: number;
|
|
1780
|
+
}
|
|
1781
|
+
interface INotificationProgress {
|
|
1782
|
+
/**
|
|
1783
|
+
* Causes the progress bar to spin infinitley.
|
|
1784
|
+
*/
|
|
1785
|
+
infinite(): void;
|
|
1786
|
+
/**
|
|
1787
|
+
* Indicate the total amount of work.
|
|
1788
|
+
*/
|
|
1789
|
+
total(value: number): void;
|
|
1790
|
+
/**
|
|
1791
|
+
* Indicate that a specific chunk of work is done.
|
|
1792
|
+
*/
|
|
1793
|
+
worked(value: number): void;
|
|
1794
|
+
/**
|
|
1795
|
+
* Indicate that the long running operation is done.
|
|
1796
|
+
*/
|
|
1797
|
+
done(): void;
|
|
1798
|
+
}
|
|
1799
|
+
interface INotificationHandle {
|
|
1800
|
+
/**
|
|
1801
|
+
* Will be fired once the notification is closed.
|
|
1802
|
+
*/
|
|
1803
|
+
readonly onDidClose: Event<void>;
|
|
1804
|
+
/**
|
|
1805
|
+
* Will be fired whenever the visibility of the notification changes.
|
|
1806
|
+
* A notification can either be visible as toast or inside the notification
|
|
1807
|
+
* center if it is visible.
|
|
1808
|
+
*/
|
|
1809
|
+
readonly onDidChangeVisibility: Event<boolean>;
|
|
1810
|
+
/**
|
|
1811
|
+
* Allows to indicate progress on the notification even after the
|
|
1812
|
+
* notification is already visible.
|
|
1813
|
+
*/
|
|
1814
|
+
readonly progress: INotificationProgress;
|
|
1815
|
+
/**
|
|
1816
|
+
* Allows to update the severity of the notification.
|
|
1817
|
+
*/
|
|
1818
|
+
updateSeverity(severity: Severity): void;
|
|
1819
|
+
/**
|
|
1820
|
+
* Allows to update the message of the notification even after the
|
|
1821
|
+
* notification is already visible.
|
|
1822
|
+
*/
|
|
1823
|
+
updateMessage(message: NotificationMessage): void;
|
|
1824
|
+
/**
|
|
1825
|
+
* Allows to update the actions of the notification even after the
|
|
1826
|
+
* notification is already visible.
|
|
1827
|
+
*/
|
|
1828
|
+
updateActions(actions?: INotificationActions): void;
|
|
1829
|
+
/**
|
|
1830
|
+
* Hide the notification and remove it from the notification center.
|
|
1831
|
+
*/
|
|
1832
|
+
close(): void;
|
|
1833
|
+
}
|
|
1834
|
+
interface IBasePromptChoice {
|
|
1835
|
+
/**
|
|
1836
|
+
* Label to show for the choice to the user.
|
|
1837
|
+
*/
|
|
1838
|
+
readonly label: string;
|
|
1839
|
+
/**
|
|
1840
|
+
* Whether to keep the notification open after the choice was selected
|
|
1841
|
+
* by the user. By default, will close the notification upon click.
|
|
1842
|
+
*/
|
|
1843
|
+
readonly keepOpen?: boolean;
|
|
1844
|
+
/**
|
|
1845
|
+
* Triggered when the user selects the choice.
|
|
1846
|
+
*/
|
|
1847
|
+
run: () => void;
|
|
1848
|
+
}
|
|
1849
|
+
interface IPromptChoice extends IBasePromptChoice {
|
|
1850
|
+
/**
|
|
1851
|
+
* Primary choices show up as buttons in the notification below the message.
|
|
1852
|
+
* Secondary choices show up under the gear icon in the header of the notification.
|
|
1853
|
+
*/
|
|
1854
|
+
readonly isSecondary?: boolean;
|
|
1855
|
+
}
|
|
1856
|
+
interface IPromptChoiceWithMenu extends IPromptChoice {
|
|
1857
|
+
/**
|
|
1858
|
+
* Additional choices those will be shown in the dropdown menu for this choice.
|
|
1859
|
+
*/
|
|
1860
|
+
readonly menu: IBasePromptChoice[];
|
|
1861
|
+
/**
|
|
1862
|
+
* Menu is not supported on secondary choices
|
|
1863
|
+
*/
|
|
1864
|
+
readonly isSecondary: false | undefined;
|
|
1865
|
+
}
|
|
1866
|
+
interface IPromptOptions extends INotificationProperties {
|
|
1867
|
+
/**
|
|
1868
|
+
* Will be called if the user closed the notification without picking
|
|
1869
|
+
* any of the provided choices.
|
|
1870
|
+
*/
|
|
1871
|
+
onCancel?: () => void;
|
|
1872
|
+
}
|
|
1873
|
+
interface IStatusMessageOptions {
|
|
1874
|
+
/**
|
|
1875
|
+
* An optional timeout after which the status message should show. By default
|
|
1876
|
+
* the status message will show immediately.
|
|
1877
|
+
*/
|
|
1878
|
+
readonly showAfter?: number;
|
|
1879
|
+
/**
|
|
1880
|
+
* An optional timeout after which the status message is to be hidden. By default
|
|
1881
|
+
* the status message will not hide until another status message is displayed.
|
|
1882
|
+
*/
|
|
1883
|
+
readonly hideAfter?: number;
|
|
1884
|
+
}
|
|
1885
|
+
declare enum NotificationsFilter {
|
|
1886
|
+
/**
|
|
1887
|
+
* No filter is enabled.
|
|
1888
|
+
*/
|
|
1889
|
+
OFF = 0,
|
|
1890
|
+
/**
|
|
1891
|
+
* All notifications are configured as silent. See
|
|
1892
|
+
* `INotificationProperties.silent` for more info.
|
|
1893
|
+
*/
|
|
1894
|
+
SILENT = 1,
|
|
1895
|
+
/**
|
|
1896
|
+
* All notifications are silent except error notifications.
|
|
1897
|
+
*/
|
|
1898
|
+
ERROR = 2
|
|
1899
|
+
}
|
|
1900
|
+
declare const INotificationService: ServiceIdentifier<INotificationService>;
|
|
1901
|
+
/**
|
|
1902
|
+
* A service to bring up notifications and non-modal prompts.
|
|
1903
|
+
*
|
|
1904
|
+
* Note: use the `IDialogService` for a modal way to ask the user for input.
|
|
1905
|
+
*/
|
|
1906
|
+
interface INotificationService {
|
|
1907
|
+
readonly _serviceBrand: undefined;
|
|
1908
|
+
/**
|
|
1909
|
+
* The DND mode can be enabled or disabled
|
|
1910
|
+
* and will result in all info and warning
|
|
1911
|
+
* notifications to be silent.
|
|
1912
|
+
*/
|
|
1913
|
+
doNotDisturbMode: boolean;
|
|
1914
|
+
/**
|
|
1915
|
+
* Emitted when a new notification is added.
|
|
1916
|
+
*/
|
|
1917
|
+
readonly onDidAddNotification: Event<INotification>;
|
|
1918
|
+
/**
|
|
1919
|
+
* Emitted when a notification is removed.
|
|
1920
|
+
*/
|
|
1921
|
+
readonly onDidRemoveNotification: Event<INotification>;
|
|
1922
|
+
/**
|
|
1923
|
+
* Emitted when a do not disturb mode has changed.
|
|
1924
|
+
*/
|
|
1925
|
+
readonly onDidChangeDoNotDisturbMode: Event<void>;
|
|
1926
|
+
/**
|
|
1927
|
+
* Show the provided notification to the user. The returned `INotificationHandle`
|
|
1928
|
+
* can be used to control the notification afterwards.
|
|
1929
|
+
*
|
|
1930
|
+
* **Note:** If your intent is to show a message with actions to the user, consider
|
|
1931
|
+
* the `INotificationService.prompt()` method instead which are optimized for
|
|
1932
|
+
* this usecase and much easier to use!
|
|
1933
|
+
*
|
|
1934
|
+
* @returns a handle on the notification to e.g. hide it or update message, buttons, etc.
|
|
1935
|
+
*/
|
|
1936
|
+
notify(notification: INotification): INotificationHandle;
|
|
1937
|
+
/**
|
|
1938
|
+
* A convenient way of reporting infos. Use the `INotificationService.notify`
|
|
1939
|
+
* method if you need more control over the notification.
|
|
1940
|
+
*/
|
|
1941
|
+
info(message: NotificationMessage | NotificationMessage[]): void;
|
|
1942
|
+
/**
|
|
1943
|
+
* A convenient way of reporting warnings. Use the `INotificationService.notify`
|
|
1944
|
+
* method if you need more control over the notification.
|
|
1945
|
+
*/
|
|
1946
|
+
warn(message: NotificationMessage | NotificationMessage[]): void;
|
|
1947
|
+
/**
|
|
1948
|
+
* A convenient way of reporting errors. Use the `INotificationService.notify`
|
|
1949
|
+
* method if you need more control over the notification.
|
|
1950
|
+
*/
|
|
1951
|
+
error(message: NotificationMessage | NotificationMessage[]): void;
|
|
1952
|
+
/**
|
|
1953
|
+
* Shows a prompt in the notification area with the provided choices. The prompt
|
|
1954
|
+
* is non-modal. If you want to show a modal dialog instead, use `IDialogService`.
|
|
1955
|
+
*
|
|
1956
|
+
* @param severity the severity of the notification. Either `Info`, `Warning` or `Error`.
|
|
1957
|
+
* @param message the message to show as status.
|
|
1958
|
+
* @param choices options to be chosen from.
|
|
1959
|
+
* @param options provides some optional configuration options.
|
|
1960
|
+
*
|
|
1961
|
+
* @returns a handle on the notification to e.g. hide it or update message, buttons, etc.
|
|
1962
|
+
*/
|
|
1963
|
+
prompt(severity: Severity, message: string, choices: (IPromptChoice | IPromptChoiceWithMenu)[], options?: IPromptOptions): INotificationHandle;
|
|
1964
|
+
/**
|
|
1965
|
+
* Shows a status message in the status area with the provided text.
|
|
1966
|
+
*
|
|
1967
|
+
* @param message the message to show as status
|
|
1968
|
+
* @param options provides some optional configuration options
|
|
1969
|
+
*
|
|
1970
|
+
* @returns a disposable to hide the status message
|
|
1971
|
+
*/
|
|
1972
|
+
status(message: NotificationMessage, options?: IStatusMessageOptions): IDisposable;
|
|
1973
|
+
}
|
|
1974
|
+
declare class NoOpNotification implements INotificationHandle {
|
|
1975
|
+
readonly progress: NoOpProgress;
|
|
1976
|
+
readonly onDidClose: Event<any>;
|
|
1977
|
+
readonly onDidChangeVisibility: Event<any>;
|
|
1978
|
+
updateSeverity(severity: Severity): void;
|
|
1979
|
+
updateMessage(message: NotificationMessage): void;
|
|
1980
|
+
updateActions(actions?: INotificationActions): void;
|
|
1981
|
+
close(): void;
|
|
1982
|
+
}
|
|
1983
|
+
declare class NoOpProgress implements INotificationProgress {
|
|
1984
|
+
infinite(): void;
|
|
1985
|
+
done(): void;
|
|
1986
|
+
total(value: number): void;
|
|
1987
|
+
worked(value: number): void;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
type ColorIdentifier = string;
|
|
1991
|
+
declare const enum ColorTransformType {
|
|
1992
|
+
Darken = 0,
|
|
1993
|
+
Lighten = 1,
|
|
1994
|
+
Transparent = 2,
|
|
1995
|
+
Opaque = 3,
|
|
1996
|
+
OneOf = 4,
|
|
1997
|
+
LessProminent = 5,
|
|
1998
|
+
IfDefinedThenElse = 6
|
|
1999
|
+
}
|
|
2000
|
+
type ColorTransform = {
|
|
2001
|
+
op: ColorTransformType.Darken;
|
|
2002
|
+
value: ColorValue;
|
|
2003
|
+
factor: number;
|
|
2004
|
+
} | {
|
|
2005
|
+
op: ColorTransformType.Lighten;
|
|
2006
|
+
value: ColorValue;
|
|
2007
|
+
factor: number;
|
|
2008
|
+
} | {
|
|
2009
|
+
op: ColorTransformType.Transparent;
|
|
2010
|
+
value: ColorValue;
|
|
2011
|
+
factor: number;
|
|
2012
|
+
} | {
|
|
2013
|
+
op: ColorTransformType.Opaque;
|
|
2014
|
+
value: ColorValue;
|
|
2015
|
+
background: ColorValue;
|
|
2016
|
+
} | {
|
|
2017
|
+
op: ColorTransformType.OneOf;
|
|
2018
|
+
values: readonly ColorValue[];
|
|
2019
|
+
} | {
|
|
2020
|
+
op: ColorTransformType.LessProminent;
|
|
2021
|
+
value: ColorValue;
|
|
2022
|
+
background: ColorValue;
|
|
2023
|
+
factor: number;
|
|
2024
|
+
transparency: number;
|
|
2025
|
+
} | {
|
|
2026
|
+
op: ColorTransformType.IfDefinedThenElse;
|
|
2027
|
+
if: ColorIdentifier;
|
|
2028
|
+
then: ColorValue;
|
|
2029
|
+
else: ColorValue;
|
|
2030
|
+
};
|
|
2031
|
+
interface ColorDefaults {
|
|
2032
|
+
light: ColorValue | null;
|
|
2033
|
+
dark: ColorValue | null;
|
|
2034
|
+
hcDark: ColorValue | null;
|
|
2035
|
+
hcLight: ColorValue | null;
|
|
2036
|
+
}
|
|
2037
|
+
/**
|
|
2038
|
+
* A Color Value is either a color literal, a reference to an other color or a derived color
|
|
2039
|
+
*/
|
|
2040
|
+
type ColorValue = Color | string | ColorIdentifier | ColorTransform;
|
|
2041
|
+
declare function registerColor(id: string, defaults: ColorDefaults | null, description: string, needsTransparency?: boolean, deprecationMessage?: string): ColorIdentifier;
|
|
2042
|
+
|
|
2043
|
+
export { INeverShowAgainOptions as $, IAction as A, ICommandService as B, CommandsRegistry as C, DefinitionProvider as D, EvaluatableExpressionProvider as E, FoldingRangeProvider as F, Command as G, HoverProvider as H, INotificationService as I, TextEdit as J, IInplaceReplaceSupportResult as K, LinkProvider as L, WorkspaceEditMetadata as M, IWorkspaceFileEdit as N, OnTypeFormattingEditProvider as O, WorkspaceFileEditOptions as P, AtLeastOne as Q, ReferenceProvider as R, StandardTokenType as S, TypeDefinitionProvider as T, IMarkerService as U, NotificationsFilter as V, WorkspaceEdit as W, NotificationMessage as X, NotificationPriority as Y, INotificationProperties as Z, NeverShowAgainScope as _, ILanguageIdCodec as a, INotification as a0, INotificationActions as a1, INotificationProgress as a2, INotificationProgressProperties as a3, INotificationHandle as a4, IPromptChoice as a5, IPromptChoiceWithMenu as a6, IPromptOptions as a7, IStatusMessageOptions as a8, NoOpNotification as a9, NoOpProgress as aa, SubmenuAction as ab, ColorIdentifier as ac, Color as ad, IRunEvent as ae, ColorId as b, ITokenPresentation as c, DeclarationProvider as d, ImplementationProvider as e, CodeActionProvider as f, DocumentPasteEditProvider as g, RenameProvider as h, DocumentFormattingEditProvider as i, DocumentRangeFormattingEditProvider as j, DocumentSymbolProvider as k, InlayHintsProvider as l, DocumentColorProvider as m, CodeLensProvider as n, SignatureHelpProvider as o, DocumentHighlightProvider as p, DocumentRangeSemanticTokensProvider as q, registerColor as r, DocumentSemanticTokensProvider as s, SelectionRangeProvider as t, InlineCompletionsProvider as u, CompletionItemProvider as v, LinkedEditingRangeProvider as w, InlineValuesProvider as x, DocumentOnDropEditProvider as y, IActionRunner as z };
|