vscode.proposed.d.ts 58.5 KB
Newer Older
1 2 3 4 5
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

6 7 8 9 10 11 12 13 14 15
/**
 * This is the place for API experiments and proposals.
 * These API are NOT stable and subject to change. They are only available in the Insiders
 * distribution and CANNOT be used in published extensions.
 *
 * To test these API in local environment:
 * - Use Insiders release of VS Code.
 * - Add `"enableProposedApi": true` to your package.json.
 * - Copy this file to your project.
 */
16

17 18
declare module 'vscode' {

J
Johannes Rieken 已提交
19 20
	// #region auth provider: https://github.com/microsoft/vscode/issues/88309

21
	export interface AuthenticationSession {
22
		id: string;
23
		getAccessToken(): Thenable<string>;
24 25 26 27
		account: {
			displayName: string;
			id: string;
		};
R
rebornix 已提交
28
		scopes: string[];
29 30
	}

31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
	export class AuthenticationSession2 {
		/**
		 * The identifier of the authentication session.
		 */
		readonly id: string;

		/**
		 * The access token.
		 */
		readonly accessToken: string;

		/**
		 * The account associated with the session.
		 */
		readonly account: {
			/**
			 * The human-readable name of the account.
			 */
			readonly displayName: string;

			/**
			 * The unique identifier of the account.
			 */
			readonly id: string;
		};

		/**
		 * The permissions granted by the session's access token. Available scopes
		 * are defined by the authentication provider.
		 */
		readonly scopes: string[];

		constructor(id: string, accessToken: string, account: { displayName: string, id: string }, scopes: string[]);
	}

66 67 68 69 70 71 72 73 74 75
	/**
	 * An [event](#Event) which fires when an [AuthenticationProvider](#AuthenticationProvider) is added or removed.
	 */
	export interface AuthenticationProvidersChangeEvent {
		/**
		 * The ids of the [authenticationProvider](#AuthenticationProvider)s that have been added.
		 */
		readonly added: string[];

		/**
76
		 * The ids of the [authenticationProvider](#AuthenticationProvider)s that have been removed.
77 78 79 80
		 */
		readonly removed: string[];
	}

81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
	/**
	 * Options to be used when getting a session from an [AuthenticationProvider](#AuthenticationProvider).
	 */
	export interface AuthenticationGetSessionOptions {
		/**
		 *  Whether login should be performed if there is no matching session. Defaults to false.
		 */
		createIfNone?: boolean;

		/**
		 * Whether the existing user session preference should be cleared. Set to allow the user to switch accounts.
		 * Defaults to false.
		 */
		clearSessionPreference?: boolean;
	}

97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
	/**
	* An [event](#Event) which fires when an [AuthenticationSession](#AuthenticationSession) is added, removed, or changed.
	*/
	export interface AuthenticationSessionsChangeEvent {
		/**
		 * The ids of the [AuthenticationSession](#AuthenticationSession)s that have been added.
		*/
		readonly added: string[];

		/**
		 * The ids of the [AuthenticationSession](#AuthenticationSession)s that have been removed.
		 */
		readonly removed: string[];

		/**
		 * The ids of the [AuthenticationSession](#AuthenticationSession)s that have been changed.
		 */
		readonly changed: string[];
	}

117 118 119 120 121
	/**
	 * **WARNING** When writing an AuthenticationProvider, `id` should be treated as part of your extension's
	 * API, changing it is a breaking change for all extensions relying on the provider. The id is
	 * treated case-sensitively.
	 */
122
	export interface AuthenticationProvider {
123 124
		/**
		 * Used as an identifier for extensions trying to work with a particular
125
		 * provider: 'microsoft', 'github', etc. id must be unique, registering
126 127
		 * another provider with the same id will fail.
		 */
128
		readonly id: string;
129

130
		/**
131
		 * The human-readable name of the provider.
132
		 */
133 134 135 136 137 138
		readonly displayName: string;

		/**
		 * Whether it is possible to be signed into multiple accounts at once with this provider
		*/
		readonly supportsMultipleAccounts: boolean;
139

140
		/**
141
		 * An [event](#Event) which fires when the array of sessions has changed, or data
142 143
		 * within a session has changed.
		 */
144
		readonly onDidChangeSessions: Event<AuthenticationSessionsChangeEvent>;
145

146 147 148
		/**
		 * Returns an array of current sessions.
		 */
149
		getSessions(): Thenable<ReadonlyArray<AuthenticationSession2>>;
150

151 152 153
		/**
		 * Prompts a user to login.
		 */
154
		login(scopes: string[]): Thenable<AuthenticationSession2>;
155 156 157 158 159

		/**
		 * Removes the session corresponding to session id.
		 * @param sessionId The session id to log out of
		 */
160
		logout(sessionId: string): Thenable<void>;
161 162 163
	}

	export namespace authentication {
164 165 166 167 168 169 170 171 172
		/**
		 * Register an authentication provider.
		 *
		 * There can only be one provider per id and an error is being thrown when an id
		 * has already been used by another provider.
		 *
		 * @param provider The authentication provider provider.
		 * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
		 */
173
		export function registerAuthenticationProvider(provider: AuthenticationProvider): Disposable;
174 175 176 177

		/**
		 * Fires with the provider id that was registered or unregistered.
		 */
178
		export const onDidChangeAuthenticationProviders: Event<AuthenticationProvidersChangeEvent>;
179

180 181 182 183 184 185
		/**
		 * The ids of the currently registered authentication providers.
		 * @returns An array of the ids of authentication providers that are currently registered.
		 */
		export function getProviderIds(): Thenable<ReadonlyArray<string>>;

186
		/**
187
		 * An array of the ids of authentication providers that are currently registered.
188
		 */
189
		export const providerIds: string[];
190

191 192 193 194 195 196 197
		/**
		 * Returns whether a provider has any sessions matching the requested scopes. This request
		 * is transparent to the user, not UI is shown. Rejects if a provider with providerId is not
		 * registered.
		 * @param providerId The id of the provider
		 * @param scopes A list of scopes representing the permissions requested. These are dependent on the authentication
		 * provider
198
		 * @returns A thenable that resolve to whether the provider has sessions with the requested scopes.
199 200 201 202 203 204 205 206 207 208 209
		 */
		export function hasSessions(providerId: string, scopes: string[]): Thenable<boolean>;

		/**
		 * Get an authentication session matching the desired scopes. Rejects if a provider with providerId is not
		 * registered, or if the user does not consent to sharing authentication information with
		 * the extension. If there are multiple sessions with the same scopes, the user will be shown a
		 * quickpick to select which account they would like to use.
		 * @param providerId The id of the provider to use
		 * @param scopes A list of scopes representing the permissions requested. These are dependent on the authentication provider
		 * @param options The [getSessionOptions](#GetSessionOptions) to use
R
Rachel Macfarlane 已提交
210
		 * @returns A thenable that resolves to an authentication session
211
		 */
R
Rachel Macfarlane 已提交
212
		export function getSession(providerId: string, scopes: string[], options: AuthenticationGetSessionOptions & { createIfNone: true }): Thenable<AuthenticationSession2>;
213

R
Rachel Macfarlane 已提交
214 215 216 217 218 219 220 221
		/**
		 * Get an authentication session matching the desired scopes. Rejects if a provider with providerId is not
		 * registered, or if the user does not consent to sharing authentication information with
		 * the extension. If there are multiple sessions with the same scopes, the user will be shown a
		 * quickpick to select which account they would like to use.
		 * @param providerId The id of the provider to use
		 * @param scopes A list of scopes representing the permissions requested. These are dependent on the authentication provider
		 * @param options The [getSessionOptions](#GetSessionOptions) to use
R
Rachel Macfarlane 已提交
222
		 * @returns A thenable that resolves to an authentication session if available, or undefined if there are no sessions
R
Rachel Macfarlane 已提交
223
		 */
R
Rachel Macfarlane 已提交
224
		export function getSession(providerId: string, scopes: string[], options: AuthenticationGetSessionOptions): Thenable<AuthenticationSession2 | undefined>;
R
Rachel Macfarlane 已提交
225

226
		/**
227
		 * @deprecated
228 229 230
		 * Get existing authentication sessions. Rejects if a provider with providerId is not
		 * registered, or if the user does not consent to sharing authentication information with
		 * the extension.
231 232 233
		 * @param providerId The id of the provider to use
		 * @param scopes A list of scopes representing the permissions requested. These are dependent on the authentication
		 * provider
234
		 */
235
		export function getSessions(providerId: string, scopes: string[]): Thenable<ReadonlyArray<AuthenticationSession>>;
236 237

		/**
238
		 * @deprecated
239 240 241
		* Prompt a user to login to create a new authenticaiton session. Rejects if a provider with
		* providerId is not registered, or if the user does not consent to sharing authentication
		* information with the extension.
242 243 244
		* @param providerId The id of the provider to use
		* @param scopes A list of scopes representing the permissions requested. These are dependent on the authentication
		* provider
245 246 247
		*/
		export function login(providerId: string, scopes: string[]): Thenable<AuthenticationSession>;

248
		/**
249
		 * @deprecated
250 251 252 253 254 255 256
		* Logout of a specific session.
		* @param providerId The id of the provider to use
		* @param sessionId The session id to remove
		* provider
		*/
		export function logout(providerId: string, sessionId: string): Thenable<void>;

257
		/**
258
		* An [event](#Event) which fires when the array of sessions has changed, or data
259 260 261
		* within a session has changed for a provider. Fires with the ids of the providers
		* that have had session data change.
		*/
R
rebornix 已提交
262
		export const onDidChangeSessions: Event<{ [providerId: string]: AuthenticationSessionsChangeEvent; }>;
263 264
	}

J
Johannes Rieken 已提交
265 266
	//#endregion

A
Alex Ross 已提交
267
	//#region @alexdima - resolvers
A
Alex Dima 已提交
268

A
Tweaks  
Alex Dima 已提交
269 270 271 272
	export interface RemoteAuthorityResolverContext {
		resolveAttempt: number;
	}

A
Alex Dima 已提交
273 274 275 276 277 278 279
	export class ResolvedAuthority {
		readonly host: string;
		readonly port: number;

		constructor(host: string, port: number);
	}

280
	export interface ResolvedOptions {
R
rebornix 已提交
281
		extensionHostEnv?: { [key: string]: string | null; };
282 283
	}

284
	export interface TunnelOptions {
R
rebornix 已提交
285
		remoteAddress: { port: number, host: string; };
A
Alex Ross 已提交
286 287 288
		// The desired local port. If this port can't be used, then another will be chosen.
		localAddressPort?: number;
		label?: string;
289 290
	}

A
Alex Ross 已提交
291
	export interface TunnelDescription {
R
rebornix 已提交
292
		remoteAddress: { port: number, host: string; };
A
Alex Ross 已提交
293
		//The complete local address(ex. localhost:1234)
R
rebornix 已提交
294
		localAddress: { port: number, host: string; } | string;
A
Alex Ross 已提交
295 296 297
	}

	export interface Tunnel extends TunnelDescription {
A
Alex Ross 已提交
298 299
		// Implementers of Tunnel should fire onDidDispose when dispose is called.
		onDidDispose: Event<void>;
300
		dispose(): void;
301 302 303
	}

	/**
304 305
	 * Used as part of the ResolverResult if the extension has any candidate,
	 * published, or forwarded ports.
306 307 308 309
	 */
	export interface TunnelInformation {
		/**
		 * Tunnels that are detected by the extension. The remotePort is used for display purposes.
A
Alex Ross 已提交
310
		 * The localAddress should be the complete local address (ex. localhost:1234) for connecting to the port. Tunnels provided through
311 312
		 * detected are read-only from the forwarded ports UI.
		 */
A
Alex Ross 已提交
313
		environmentTunnels?: TunnelDescription[];
A
Alex Ross 已提交
314

315 316 317
	}

	export type ResolverResult = ResolvedAuthority & ResolvedOptions & TunnelInformation;
318

A
Tweaks  
Alex Dima 已提交
319 320 321 322 323 324 325
	export class RemoteAuthorityResolverError extends Error {
		static NotAvailable(message?: string, handled?: boolean): RemoteAuthorityResolverError;
		static TemporarilyNotAvailable(message?: string): RemoteAuthorityResolverError;

		constructor(message?: string);
	}

A
Alex Dima 已提交
326
	export interface RemoteAuthorityResolver {
327
		resolve(authority: string, context: RemoteAuthorityResolverContext): ResolverResult | Thenable<ResolverResult>;
328 329 330 331 332
		/**
		 * Can be optionally implemented if the extension can forward ports better than the core.
		 * When not implemented, the core will use its default forwarding logic.
		 * When implemented, the core will use this to forward ports.
		 */
A
Alex Ross 已提交
333
		tunnelFactory?: (tunnelOptions: TunnelOptions) => Thenable<Tunnel> | undefined;
334 335 336 337 338

		/**
		 * Provides filtering for candidate ports.
		 */
		showCandidatePort?: (host: string, port: number, detail: string) => Thenable<boolean>;
339 340 341 342
	}

	export namespace workspace {
		/**
343
		 * Forwards a port. If the current resolver implements RemoteAuthorityResolver:forwardPort then that will be used to make the tunnel.
A
Alex Ross 已提交
344 345
		 * By default, openTunnel only support localhost; however, RemoteAuthorityResolver:tunnelFactory can be used to support other ips.
		 * @param tunnelOptions The `localPort` is a suggestion only. If that port is not available another will be chosen.
346
		 */
A
Alex Ross 已提交
347
		export function openTunnel(tunnelOptions: TunnelOptions): Thenable<Tunnel>;
348 349 350 351 352 353

		/**
		 * Gets an array of the currently available tunnels. This does not include environment tunnels, only tunnels that have been created by the user.
		 * Note that these are of type TunnelDescription and cannot be disposed.
		 */
		export let tunnels: Thenable<TunnelDescription[]>;
A
Alex Ross 已提交
354

355 356 357 358
		/**
		 * Fired when the list of tunnels has changed.
		 */
		export const onDidChangeTunnels: Event<void>;
A
Alex Dima 已提交
359 360
	}

361 362 363 364 365 366 367 368
	export interface ResourceLabelFormatter {
		scheme: string;
		authority?: string;
		formatting: ResourceLabelFormatting;
	}

	export interface ResourceLabelFormatting {
		label: string; // myLabel:/${path}
369
		// TODO@isidorn
J
Johannes Rieken 已提交
370
		// eslint-disable-next-line vscode-dts-literal-or-types
371 372 373 374 375 376 377
		separator: '/' | '\\' | '';
		tildify?: boolean;
		normalizeDriveLetter?: boolean;
		workspaceSuffix?: string;
		authorityPrefix?: string;
	}

A
Alex Dima 已提交
378 379
	export namespace workspace {
		export function registerRemoteAuthorityResolver(authorityPrefix: string, resolver: RemoteAuthorityResolver): Disposable;
380
		export function registerResourceLabelFormatter(formatter: ResourceLabelFormatter): Disposable;
381
	}
382

383 384
	//#endregion

J
Johannes Rieken 已提交
385
	//#region editor insets: https://github.com/microsoft/vscode/issues/85682
386

387 388
	export interface WebviewEditorInset {
		readonly editor: TextEditor;
389 390
		readonly line: number;
		readonly height: number;
391 392 393
		readonly webview: Webview;
		readonly onDidDispose: Event<void>;
		dispose(): void;
394 395
	}

396
	export namespace window {
397
		export function createWebviewTextEditorInset(editor: TextEditor, line: number, height: number, options?: WebviewOptions): WebviewEditorInset;
A
Alex Dima 已提交
398 399 400 401
	}

	//#endregion

J
Johannes Rieken 已提交
402
	//#region read/write in chunks: https://github.com/microsoft/vscode/issues/84515
403 404

	export interface FileSystemProvider {
R
rebornix 已提交
405
		open?(resource: Uri, options: { create: boolean; }): number | Thenable<number>;
406 407 408 409 410 411 412
		close?(fd: number): void | Thenable<void>;
		read?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable<number>;
		write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable<number>;
	}

	//#endregion

R
Rob Lourens 已提交
413
	//#region TextSearchProvider: https://github.com/microsoft/vscode/issues/59921
414

415 416 417
	/**
	 * The parameters of a query for text search.
	 */
418
	export interface TextSearchQuery {
419 420 421
		/**
		 * The text pattern to search for.
		 */
422
		pattern: string;
423

R
Rob Lourens 已提交
424 425 426 427 428
		/**
		 * Whether or not `pattern` should match multiple lines of text.
		 */
		isMultiline?: boolean;

429 430 431
		/**
		 * Whether or not `pattern` should be interpreted as a regular expression.
		 */
R
Rob Lourens 已提交
432
		isRegExp?: boolean;
433 434 435 436

		/**
		 * Whether or not the search should be case-sensitive.
		 */
R
Rob Lourens 已提交
437
		isCaseSensitive?: boolean;
438 439 440 441

		/**
		 * Whether or not to search for whole word matches only.
		 */
R
Rob Lourens 已提交
442
		isWordMatch?: boolean;
443 444
	}

445 446
	/**
	 * A file glob pattern to match file paths against.
447
	 * TODO@roblourens merge this with the GlobPattern docs/definition in vscode.d.ts.
448 449 450 451 452 453 454
	 * @see [GlobPattern](#GlobPattern)
	 */
	export type GlobString = string;

	/**
	 * Options common to file and text search
	 */
R
Rob Lourens 已提交
455
	export interface SearchOptions {
456 457 458
		/**
		 * The root folder to search within.
		 */
459
		folder: Uri;
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474

		/**
		 * Files that match an `includes` glob pattern should be included in the search.
		 */
		includes: GlobString[];

		/**
		 * Files that match an `excludes` glob pattern should be excluded from the search.
		 */
		excludes: GlobString[];

		/**
		 * Whether external files that exclude files, like .gitignore, should be respected.
		 * See the vscode setting `"search.useIgnoreFiles"`.
		 */
R
Rob Lourens 已提交
475
		useIgnoreFiles: boolean;
476 477 478 479 480

		/**
		 * Whether symlinks should be followed while searching.
		 * See the vscode setting `"search.followSymlinks"`.
		 */
R
Rob Lourens 已提交
481
		followSymlinks: boolean;
P
pkoushik 已提交
482 483 484 485 486 487

		/**
		 * Whether global files that exclude files, like .gitignore, should be respected.
		 * See the vscode setting `"search.useGlobalIgnoreFiles"`.
		 */
		useGlobalIgnoreFiles: boolean;
488
	}
489

R
Rob Lourens 已提交
490 491
	/**
	 * Options to specify the size of the result text preview.
R
Rob Lourens 已提交
492
	 * These options don't affect the size of the match itself, just the amount of preview text.
R
Rob Lourens 已提交
493
	 */
494
	export interface TextSearchPreviewOptions {
495
		/**
R
Rob Lourens 已提交
496
		 * The maximum number of lines in the preview.
R
Rob Lourens 已提交
497
		 * Only search providers that support multiline search will ever return more than one line in the match.
498
		 */
R
Rob Lourens 已提交
499
		matchLines: number;
R
Rob Lourens 已提交
500 501 502 503

		/**
		 * The maximum number of characters included per line.
		 */
R
Rob Lourens 已提交
504
		charsPerLine: number;
505 506
	}

507 508 509
	/**
	 * Options that apply to text search.
	 */
R
Rob Lourens 已提交
510
	export interface TextSearchOptions extends SearchOptions {
511
		/**
512
		 * The maximum number of results to be returned.
513
		 */
514 515
		maxResults: number;

R
Rob Lourens 已提交
516 517 518
		/**
		 * Options to specify the size of the result text preview.
		 */
519
		previewOptions?: TextSearchPreviewOptions;
520 521 522 523

		/**
		 * Exclude files larger than `maxFileSize` in bytes.
		 */
524
		maxFileSize?: number;
525 526 527 528 529

		/**
		 * Interpret files using this encoding.
		 * See the vscode setting `"files.encoding"`
		 */
530
		encoding?: string;
531 532 533 534 535 536 537 538 539 540

		/**
		 * Number of lines of context to include before each match.
		 */
		beforeContext?: number;

		/**
		 * Number of lines of context to include after each match.
		 */
		afterContext?: number;
541 542
	}

543 544 545 546 547 548 549 550 551 552 553 554 555 556
	/**
	 * Information collected when text search is complete.
	 */
	export interface TextSearchComplete {
		/**
		 * Whether the search hit the limit on the maximum number of search results.
		 * `maxResults` on [`TextSearchOptions`](#TextSearchOptions) specifies the max number of results.
		 * - If exactly that number of matches exist, this should be false.
		 * - If `maxResults` matches are returned and more exist, this should be true.
		 * - If search hits an internal limit which is less than `maxResults`, this should be true.
		 */
		limitHit?: boolean;
	}

R
Rob Lourens 已提交
557 558 559
	/**
	 * A preview of the text result.
	 */
560
	export interface TextSearchMatchPreview {
561
		/**
R
Rob Lourens 已提交
562
		 * The matching lines of text, or a portion of the matching line that contains the match.
563 564 565 566 567
		 */
		text: string;

		/**
		 * The Range within `text` corresponding to the text of the match.
568
		 * The number of matches must match the TextSearchMatch's range property.
569
		 */
570
		matches: Range | Range[];
571 572 573 574 575
	}

	/**
	 * A match from a text search
	 */
576
	export interface TextSearchMatch {
577 578 579
		/**
		 * The uri for the matching document.
		 */
580
		uri: Uri;
581 582

		/**
583
		 * The range of the match within the document, or multiple ranges for multiple matches.
584
		 */
585
		ranges: Range | Range[];
R
Rob Lourens 已提交
586

587
		/**
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609
		 * A preview of the text match.
		 */
		preview: TextSearchMatchPreview;
	}

	/**
	 * A line of context surrounding a TextSearchMatch.
	 */
	export interface TextSearchContext {
		/**
		 * The uri for the matching document.
		 */
		uri: Uri;

		/**
		 * One line of text.
		 * previewOptions.charsPerLine applies to this
		 */
		text: string;

		/**
		 * The line number of this line of context.
610
		 */
611
		lineNumber: number;
612 613
	}

614 615
	export type TextSearchResult = TextSearchMatch | TextSearchContext;

R
Rob Lourens 已提交
616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659
	/**
	 * A TextSearchProvider provides search results for text results inside files in the workspace.
	 */
	export interface TextSearchProvider {
		/**
		 * Provide results that match the given text pattern.
		 * @param query The parameters for this query.
		 * @param options A set of options to consider while searching.
		 * @param progress A progress callback that must be invoked for all results.
		 * @param token A cancellation token.
		 */
		provideTextSearchResults(query: TextSearchQuery, options: TextSearchOptions, progress: Progress<TextSearchResult>, token: CancellationToken): ProviderResult<TextSearchComplete>;
	}

	//#endregion

	//#region FileSearchProvider: https://github.com/microsoft/vscode/issues/73524

	/**
	 * The parameters of a query for file search.
	 */
	export interface FileSearchQuery {
		/**
		 * The search pattern to match against file paths.
		 */
		pattern: string;
	}

	/**
	 * Options that apply to file search.
	 */
	export interface FileSearchOptions extends SearchOptions {
		/**
		 * The maximum number of results to be returned.
		 */
		maxResults?: number;

		/**
		 * A CancellationToken that represents the session for this search query. If the provider chooses to, this object can be used as the key for a cache,
		 * and searches with the same session object can search the same cache. When the token is cancelled, the session is complete and the cache can be cleared.
		 */
		session?: CancellationToken;
	}

660
	/**
R
Rob Lourens 已提交
661 662 663 664 665 666 667
	 * A FileSearchProvider provides search results for files in the given folder that match a query string. It can be invoked by quickopen or other extensions.
	 *
	 * A FileSearchProvider is the more powerful of two ways to implement file search in VS Code. Use a FileSearchProvider if you wish to search within a folder for
	 * all files that match the user's query.
	 *
	 * The FileSearchProvider will be invoked on every keypress in quickopen. When `workspace.findFiles` is called, it will be invoked with an empty query string,
	 * and in that case, every file in the folder should be returned.
668
	 */
669
	export interface FileSearchProvider {
670 671 672 673 674 675
		/**
		 * Provide the set of files that match a certain file path pattern.
		 * @param query The parameters for this query.
		 * @param options A set of options to consider while searching files.
		 * @param token A cancellation token.
		 */
676
		provideFileSearchResults(query: FileSearchQuery, options: FileSearchOptions, token: CancellationToken): ProviderResult<Uri[]>;
677
	}
678

R
Rob Lourens 已提交
679
	export namespace workspace {
680
		/**
R
Rob Lourens 已提交
681 682 683 684 685 686 687
		 * Register a search provider.
		 *
		 * Only one provider can be registered per scheme.
		 *
		 * @param scheme The provider will be invoked for workspace folders that have this file scheme.
		 * @param provider The provider.
		 * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
688
		 */
R
Rob Lourens 已提交
689 690 691 692 693 694 695 696 697 698 699 700
		export function registerFileSearchProvider(scheme: string, provider: FileSearchProvider): Disposable;

		/**
		 * Register a text search provider.
		 *
		 * Only one provider can be registered per scheme.
		 *
		 * @param scheme The provider will be invoked for workspace folders that have this file scheme.
		 * @param provider The provider.
		 * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
		 */
		export function registerTextSearchProvider(scheme: string, provider: TextSearchProvider): Disposable;
701 702
	}

R
Rob Lourens 已提交
703 704 705 706
	//#endregion

	//#region findTextInFiles: https://github.com/microsoft/vscode/issues/59924

707 708 709
	/**
	 * Options that can be set on a findTextInFiles search.
	 */
R
Rob Lourens 已提交
710
	export interface FindTextInFilesOptions {
711 712 713 714 715
		/**
		 * A [glob pattern](#GlobPattern) that defines the files to search for. The glob pattern
		 * will be matched against the file paths of files relative to their workspace. Use a [relative pattern](#RelativePattern)
		 * to restrict the search results to a [workspace folder](#WorkspaceFolder).
		 */
716
		include?: GlobPattern;
717 718 719

		/**
		 * A [glob pattern](#GlobPattern) that defines files and folders to exclude. The glob pattern
720 721
		 * will be matched against the file paths of resulting matches relative to their workspace. When `undefined`, default excludes will
		 * apply.
722
		 */
723 724 725 726 727 728
		exclude?: GlobPattern;

		/**
		 * Whether to use the default and user-configured excludes. Defaults to true.
		 */
		useDefaultExcludes?: boolean;
729 730 731 732

		/**
		 * The maximum number of results to search for
		 */
R
Rob Lourens 已提交
733
		maxResults?: number;
734 735 736 737 738

		/**
		 * Whether external files that exclude files, like .gitignore, should be respected.
		 * See the vscode setting `"search.useIgnoreFiles"`.
		 */
R
Rob Lourens 已提交
739
		useIgnoreFiles?: boolean;
740

P
pkoushik 已提交
741 742 743 744
		/**
		 * Whether global files that exclude files, like .gitignore, should be respected.
		 * See the vscode setting `"search.useGlobalIgnoreFiles"`.
		 */
745
		useGlobalIgnoreFiles?: boolean;
P
pkoushik 已提交
746

747 748 749 750
		/**
		 * Whether symlinks should be followed while searching.
		 * See the vscode setting `"search.followSymlinks"`.
		 */
R
Rob Lourens 已提交
751
		followSymlinks?: boolean;
752 753 754 755 756

		/**
		 * Interpret files using this encoding.
		 * See the vscode setting `"files.encoding"`
		 */
R
Rob Lourens 已提交
757
		encoding?: string;
758

R
Rob Lourens 已提交
759 760 761
		/**
		 * Options to specify the size of the result text preview.
		 */
762
		previewOptions?: TextSearchPreviewOptions;
763 764 765 766 767 768 769 770 771 772

		/**
		 * Number of lines of context to include before each match.
		 */
		beforeContext?: number;

		/**
		 * Number of lines of context to include after each match.
		 */
		afterContext?: number;
R
Rob Lourens 已提交
773 774
	}

775
	export namespace workspace {
776 777 778 779 780 781 782
		/**
		 * Search text in files across all [workspace folders](#workspace.workspaceFolders) in the workspace.
		 * @param query The query parameters for the search - the search string, whether it's case-sensitive, or a regex, or matches whole words.
		 * @param callback A callback, called for each result
		 * @param token A token that can be used to signal cancellation to the underlying search engine.
		 * @return A thenable that resolves when the search is complete.
		 */
783
		export function findTextInFiles(query: TextSearchQuery, callback: (result: TextSearchResult) => void, token?: CancellationToken): Thenable<TextSearchComplete>;
784 785 786 787 788 789 790 791 792

		/**
		 * Search text in files across all [workspace folders](#workspace.workspaceFolders) in the workspace.
		 * @param query The query parameters for the search - the search string, whether it's case-sensitive, or a regex, or matches whole words.
		 * @param options An optional set of query options. Include and exclude patterns, maxResults, etc.
		 * @param callback A callback, called for each result
		 * @param token A token that can be used to signal cancellation to the underlying search engine.
		 * @return A thenable that resolves when the search is complete.
		 */
793
		export function findTextInFiles(query: TextSearchQuery, options: FindTextInFilesOptions, callback: (result: TextSearchResult) => void, token?: CancellationToken): Thenable<TextSearchComplete>;
794 795
	}

J
Johannes Rieken 已提交
796
	//#endregion
797

J
Johannes Rieken 已提交
798
	//#region diff command: https://github.com/microsoft/vscode/issues/84899
P
Pine Wu 已提交
799

J
Joao Moreno 已提交
800 801 802
	/**
	 * The contiguous set of modified lines in a diff.
	 */
J
Joao Moreno 已提交
803 804 805 806 807 808 809
	export interface LineChange {
		readonly originalStartLineNumber: number;
		readonly originalEndLineNumber: number;
		readonly modifiedStartLineNumber: number;
		readonly modifiedEndLineNumber: number;
	}

810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827
	export namespace commands {

		/**
		 * Registers a diff information command that can be invoked via a keyboard shortcut,
		 * a menu item, an action, or directly.
		 *
		 * Diff information commands are different from ordinary [commands](#commands.registerCommand) as
		 * they only execute when there is an active diff editor when the command is called, and the diff
		 * information has been computed. Also, the command handler of an editor command has access to
		 * the diff information.
		 *
		 * @param command A unique identifier for the command.
		 * @param callback A command handler function with access to the [diff information](#LineChange).
		 * @param thisArg The `this` context used when invoking the handler function.
		 * @return Disposable which unregisters this command on disposal.
		 */
		export function registerDiffInformationCommand(command: string, callback: (diff: LineChange[], ...args: any[]) => any, thisArg?: any): Disposable;
	}
828

J
Johannes Rieken 已提交
829 830
	//#endregion

J
Johannes Rieken 已提交
831
	//#region file-decorations: https://github.com/microsoft/vscode/issues/54938
832

833
	export class Decoration {
834
		letter?: string;
835 836 837
		title?: string;
		color?: ThemeColor;
		priority?: number;
838
		bubble?: boolean;
839 840
	}

841
	export interface DecorationProvider {
842
		onDidChangeDecorations: Event<undefined | Uri | Uri[]>;
843
		provideDecoration(uri: Uri, token: CancellationToken): ProviderResult<Decoration>;
844 845 846
	}

	export namespace window {
847
		export function registerDecorationProvider(provider: DecorationProvider): Disposable;
848 849 850
	}

	//#endregion
851

852
	//#region debug
853

I
isidor 已提交
854 855 856
	export interface DebugSessionOptions {
		/**
		 * Controls whether this session should run without debugging, thus ignoring breakpoints.
857
		 * When this property is not specified, the value from the parent session (if there is one) is used.
I
isidor 已提交
858 859 860 861
		 */
		noDebug?: boolean;
	}

862
	// deprecated debug API
A
Andre Weinand 已提交
863

864
	export interface DebugConfigurationProvider {
865
		/**
A
Andre Weinand 已提交
866 867
		 * Deprecated, use DebugAdapterDescriptorFactory.provideDebugAdapter instead.
		 * @deprecated Use DebugAdapterDescriptorFactory.createDebugAdapterDescriptor instead
868 869
		 */
		debugAdapterExecutable?(folder: WorkspaceFolder | undefined, token?: CancellationToken): ProviderResult<DebugAdapterExecutable>;
870 871
	}

J
Johannes Rieken 已提交
872 873
	//#endregion

874 875 876
	//#region LogLevel: https://github.com/microsoft/vscode/issues/85992

	/**
877
	 * @deprecated DO NOT USE, will be removed
878 879 880 881 882 883 884 885 886 887 888 889 890
	 */
	export enum LogLevel {
		Trace = 1,
		Debug = 2,
		Info = 3,
		Warning = 4,
		Error = 5,
		Critical = 6,
		Off = 7
	}

	export namespace env {
		/**
891
		 * @deprecated DO NOT USE, will be removed
892 893 894 895
		 */
		export const logLevel: LogLevel;

		/**
896
		 * @deprecated DO NOT USE, will be removed
897 898 899 900 901 902
		 */
		export const onDidChangeLogLevel: Event<LogLevel>;
	}

	//#endregion

903
	//#region @joaomoreno: SCM validation
904

J
Joao Moreno 已提交
905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949
	/**
	 * Represents the validation type of the Source Control input.
	 */
	export enum SourceControlInputBoxValidationType {

		/**
		 * Something not allowed by the rules of a language or other means.
		 */
		Error = 0,

		/**
		 * Something suspicious but allowed.
		 */
		Warning = 1,

		/**
		 * Something to inform about but not a problem.
		 */
		Information = 2
	}

	export interface SourceControlInputBoxValidation {

		/**
		 * The validation message to display.
		 */
		readonly message: string;

		/**
		 * The validation type.
		 */
		readonly type: SourceControlInputBoxValidationType;
	}

	/**
	 * Represents the input box in the Source Control viewlet.
	 */
	export interface SourceControlInputBox {

		/**
		 * A validation function for the input box. It's possible to change
		 * the validation provider simply by setting this property to a different function.
		 */
		validateInput?(value: string, cursorPosition: number): ProviderResult<SourceControlInputBoxValidation | undefined | null>;
	}
M
Matt Bierner 已提交
950

J
Johannes Rieken 已提交
951 952
	//#endregion

953
	//#region @joaomoreno: SCM selected provider
954 955 956 957 958 959 960 961 962 963 964 965

	export interface SourceControl {

		/**
		 * Whether the source control is selected.
		 */
		readonly selected: boolean;

		/**
		 * An event signaling when the selection state changes.
		 */
		readonly onDidChangeSelection: Event<boolean>;
966 967 968 969
	}

	//#endregion

D
Daniel Imms 已提交
970
	//#region Terminal data write event https://github.com/microsoft/vscode/issues/78502
971

972 973 974 975 976 977 978 979 980 981 982
	export interface TerminalDataWriteEvent {
		/**
		 * The [terminal](#Terminal) for which the data was written.
		 */
		readonly terminal: Terminal;
		/**
		 * The data being written.
		 */
		readonly data: string;
	}

D
Daniel Imms 已提交
983 984
	namespace window {
		/**
D
Daniel Imms 已提交
985 986 987
		 * An event which fires when the terminal's child pseudo-device is written to (the shell).
		 * In other words, this provides access to the raw data stream from the process running
		 * within the terminal, including VT sequences.
D
Daniel Imms 已提交
988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008
		 */
		export const onDidWriteTerminalData: Event<TerminalDataWriteEvent>;
	}

	//#endregion

	//#region Terminal dimensions property and change event https://github.com/microsoft/vscode/issues/55718

	/**
	 * An [event](#Event) which fires when a [Terminal](#Terminal)'s dimensions change.
	 */
	export interface TerminalDimensionsChangeEvent {
		/**
		 * The [terminal](#Terminal) for which the dimensions have changed.
		 */
		readonly terminal: Terminal;
		/**
		 * The new value for the [terminal's dimensions](#Terminal.dimensions).
		 */
		readonly dimensions: TerminalDimensions;
	}
1009

D
Daniel Imms 已提交
1010
	export namespace window {
D
Daniel Imms 已提交
1011 1012 1013 1014 1015 1016 1017
		/**
		 * An event which fires when the [dimensions](#Terminal.dimensions) of the terminal change.
		 */
		export const onDidChangeTerminalDimensions: Event<TerminalDimensionsChangeEvent>;
	}

	export interface Terminal {
1018
		/**
1019 1020 1021
		 * The current dimensions of the terminal. This will be `undefined` immediately after the
		 * terminal is created as the dimensions are not known until shortly after the terminal is
		 * created.
1022
		 */
1023
		readonly dimensions: TerminalDimensions | undefined;
D
Daniel Imms 已提交
1024 1025
	}

1026 1027
	//#endregion

1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056
	//#region Terminal link handlers https://github.com/microsoft/vscode/issues/91606

	export namespace window {
		/**
		 * Register a [TerminalLinkHandler](#TerminalLinkHandler) that can be used to intercept and
		 * handle links that are activated within terminals.
		 * @param handler The link handler being registered.
		 * @return A disposable that unregisters the link handler.
		 */
		export function registerTerminalLinkHandler(handler: TerminalLinkHandler): Disposable;
	}

	/**
	 * Describes how to handle terminal links.
	 */
	export interface TerminalLinkHandler {
		/**
		 * Handles a link that is activated within the terminal.
		 *
		 * @param terminal The terminal the link was activated on.
		 * @param link The text of the link activated.
		 * @return Whether the link was handled, if the link was handled this link will not be
		 * considered by any other extension or by the default built-in link handler.
		 */
		handleLink(terminal: Terminal, link: string): ProviderResult<boolean>;
	}

	//#endregion

1057
	//#region @jrieken -> exclusive document filters
1058 1059 1060 1061 1062 1063

	export interface DocumentFilter {
		exclusive?: boolean;
	}

	//#endregion
C
Christof Marti 已提交
1064

1065
	//#region @alexdima - OnEnter enhancement
1066 1067 1068 1069 1070 1071 1072
	export interface OnEnterRule {
		/**
		 * This rule will only execute if the text above the this line matches this regular expression.
		 */
		oneLineAboveText?: RegExp;
	}
	//#endregion
1073

1074
	//#region Tree View: https://github.com/microsoft/vscode/issues/61313
1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085
	/**
	 * Label describing the [Tree item](#TreeItem)
	 */
	export interface TreeItemLabel {

		/**
		 * A human-readable string describing the [Tree item](#TreeItem).
		 */
		label: string;

		/**
S
Sandeep Somavarapu 已提交
1086
		 * Ranges in the label to highlight. A range is defined as a tuple of two number where the
S
Sandeep Somavarapu 已提交
1087
		 * first is the inclusive start index and the second the exclusive end index
1088
		 */
S
Sandeep Somavarapu 已提交
1089
		highlights?: [number, number][];
1090 1091 1092 1093 1094 1095 1096 1097 1098

	}

	export class TreeItem2 extends TreeItem {
		/**
		 * Label describing this item. When `falsy`, it is derived from [resourceUri](#TreeItem.resourceUri).
		 */
		label?: string | TreeItemLabel | /* for compilation */ any;

1099 1100 1101 1102 1103
		/**
		 * Accessibility information used when screen reader interacts with this tree item.
		 */
		accessibilityInformation?: AccessibilityInformation;

1104 1105 1106 1107 1108 1109
		/**
		 * @param label Label describing this item
		 * @param collapsibleState [TreeItemCollapsibleState](#TreeItemCollapsibleState) of the tree item. Default is [TreeItemCollapsibleState.None](#TreeItemCollapsibleState.None)
		 */
		constructor(label: TreeItemLabel, collapsibleState?: TreeItemCollapsibleState);
	}
1110
	//#endregion
1111

1112
	//#region CustomExecution: https://github.com/microsoft/vscode/issues/81007
1113 1114 1115
	/**
	 * A task to execute
	 */
G
Gabriel DeBacker 已提交
1116
	export class Task2 extends Task {
1117
		detail?: string;
1118
	}
G
Gabriel DeBacker 已提交
1119

1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130
	export class CustomExecution2 extends CustomExecution {
		/**
		 * Constructs a CustomExecution task object. The callback will be executed the task is run, at which point the
		 * extension should return the Pseudoterminal it will "run in". The task should wait to do further execution until
		 * [Pseudoterminal.open](#Pseudoterminal.open) is called. Task cancellation should be handled using
		 * [Pseudoterminal.close](#Pseudoterminal.close). When the task is complete fire
		 * [Pseudoterminal.onDidClose](#Pseudoterminal.onDidClose).
		 * @param callback The callback that will be called when the task is started by a user.
		 */
		constructor(callback: (resolvedDefinition?: TaskDefinition) => Thenable<Pseudoterminal>);
	}
1131
	//#endregion
1132

1133
	//#region Task presentation group: https://github.com/microsoft/vscode/issues/47265
1134 1135 1136 1137 1138 1139 1140
	export interface TaskPresentationOptions {
		/**
		 * Controls whether the task is executed in a specific terminal group using split panes.
		 */
		group?: string;
	}
	//#endregion
1141

1142
	//#region Status bar item with ID and Name: https://github.com/microsoft/vscode/issues/74972
1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164

	export namespace window {

		/**
		 * Options to configure the status bar item.
		 */
		export interface StatusBarItemOptions {

			/**
			 * A unique identifier of the status bar item. The identifier
			 * is for example used to allow a user to show or hide the
			 * status bar item in the UI.
			 */
			id: string;

			/**
			 * A human readable name of the status bar item. The name is
			 * for example used as a label in the UI to show or hide the
			 * status bar item.
			 */
			name: string;

1165 1166 1167 1168 1169
			/**
			 * Accessibility information used when screen reader interacts with this status bar item.
			 */
			accessibilityInformation?: AccessibilityInformation;

1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193
			/**
			 * The alignment of the status bar item.
			 */
			alignment?: StatusBarAlignment;

			/**
			 * The priority of the status bar item. Higher value means the item should
			 * be shown more to the left.
			 */
			priority?: number;
		}

		/**
		 * Creates a status bar [item](#StatusBarItem).
		 *
		 * @param options The options of the item. If not provided, some default values
		 * will be assumed. For example, the `StatusBarItemOptions.id` will be the id
		 * of the extension and the `StatusBarItemOptions.name` will be the extension name.
		 * @return A new status bar item.
		 */
		export function createStatusBarItem(options?: StatusBarItemOptions): StatusBarItem;
	}

	//#endregion
1194

A
Alexandru Dima 已提交
1195 1196
	//#region OnTypeRename: https://github.com/microsoft/vscode/issues/88424

P
Pine Wu 已提交
1197 1198 1199 1200
	/**
	 * The rename provider interface defines the contract between extensions and
	 * the live-rename feature.
	 */
A
Alexandru Dima 已提交
1201
	export interface OnTypeRenameProvider {
P
Pine Wu 已提交
1202 1203 1204 1205 1206 1207 1208 1209 1210
		/**
		 * Provide a list of ranges that can be live renamed together.
		 *
		 * @param document The document in which the command was invoked.
		 * @param position The position at which the command was invoked.
		 * @param token A cancellation token.
		 * @return A list of ranges that can be live-renamed togehter. The ranges must have
		 * identical length and contain identical text content. The ranges cannot overlap.
		 */
A
Alexandru Dima 已提交
1211 1212 1213 1214
		provideOnTypeRenameRanges(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Range[]>;
	}

	namespace languages {
P
Pine Wu 已提交
1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227
		/**
		 * Register a rename provider that works on type.
		 *
		 * Multiple providers can be registered for a language. In that case providers are sorted
		 * by their [score](#languages.match) and the best-matching provider is used. Failure
		 * of the selected provider will cause a failure of the whole operation.
		 *
		 * @param selector A selector that defines the documents this provider is applicable to.
		 * @param provider An on type rename provider.
		 * @param stopPattern Stop on type renaming when input text matches the regular expression. Defaults to `^\s`.
		 * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
		 */
		export function registerOnTypeRenameProvider(selector: DocumentSelector, provider: OnTypeRenameProvider, stopPattern?: RegExp): Disposable;
A
Alexandru Dima 已提交
1228 1229 1230 1231
	}

	//#endregion

1232
	//#region Custom editor move https://github.com/microsoft/vscode/issues/86146
1233

1234
	// TODO: Also for custom editor
1235

1236
	export interface CustomTextEditorProvider {
M
Matt Bierner 已提交
1237

1238 1239 1240 1241 1242 1243 1244 1245
		/**
		 * Handle when the underlying resource for a custom editor is renamed.
		 *
		 * This allows the webview for the editor be preserved throughout the rename. If this method is not implemented,
		 * VS Code will destory the previous custom editor and create a replacement one.
		 *
		 * @param newDocument New text document to use for the custom editor.
		 * @param existingWebviewPanel Webview panel for the custom editor.
1246
		 * @param token A cancellation token that indicates the result is no longer needed.
1247 1248 1249
		 *
		 * @return Thenable indicating that the webview editor has been moved.
		 */
1250
		moveCustomTextEditor?(newDocument: TextDocument, existingWebviewPanel: WebviewPanel, token: CancellationToken): Thenable<void>;
1251 1252 1253
	}

	//#endregion
1254

J
Johannes Rieken 已提交
1255
	//#region allow QuickPicks to skip sorting: https://github.com/microsoft/vscode/issues/73904
P
Peter Elmers 已提交
1256 1257 1258

	export interface QuickPick<T extends QuickPickItem> extends QuickInput {
		/**
1259 1260
		 * An optional flag to sort the final results by index of first query match in label. Defaults to true.
		 */
P
Peter Elmers 已提交
1261 1262
		sortByLabel: boolean;
	}
E
Eric Amodio 已提交
1263 1264

	//#endregion
S
Sandeep Somavarapu 已提交
1265

1266
	//#region @rebornix: Notebook
R
rebornix 已提交
1267

R
rebornix 已提交
1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278
	export enum CellKind {
		Markdown = 1,
		Code = 2
	}

	export enum CellOutputKind {
		Text = 1,
		Error = 2,
		Rich = 3
	}

R
rebornix 已提交
1279
	export interface CellStreamOutput {
R
rebornix 已提交
1280
		outputKind: CellOutputKind.Text;
R
rebornix 已提交
1281 1282 1283
		text: string;
	}

R
rebornix 已提交
1284
	export interface CellErrorOutput {
R
rebornix 已提交
1285
		outputKind: CellOutputKind.Error;
R
rebornix 已提交
1286 1287 1288 1289 1290 1291 1292
		/**
		 * Exception Name
		 */
		ename: string;
		/**
		 * Exception Value
		 */
R
rebornix 已提交
1293
		evalue: string;
R
rebornix 已提交
1294 1295 1296
		/**
		 * Exception call stack
		 */
R
rebornix 已提交
1297 1298 1299
		traceback: string[];
	}

R
rebornix 已提交
1300 1301 1302 1303 1304 1305 1306
	export interface NotebookCellOutputMetadata {
		/**
		 * Additional attributes of a cell metadata.
		 */
		custom?: { [key: string]: any };
	}

R
rebornix 已提交
1307
	export interface CellDisplayOutput {
R
rebornix 已提交
1308
		outputKind: CellOutputKind.Rich;
R
rebornix 已提交
1309 1310 1311 1312 1313 1314
		/**
		 * { mime_type: value }
		 *
		 * Example:
		 * ```json
		 * {
R
rebornix 已提交
1315
		 *   "outputKind": vscode.CellOutputKind.Rich,
R
rebornix 已提交
1316 1317 1318 1319 1320 1321 1322 1323 1324 1325
		 *   "data": {
		 *      "text/html": [
		 *          "<h1>Hello</h1>"
		 *       ],
		 *      "text/plain": [
		 *        "<IPython.lib.display.IFrame at 0x11dee3e80>"
		 *      ]
		 *   }
		 * }
		 */
R
rebornix 已提交
1326
		data: { [key: string]: any; };
R
rebornix 已提交
1327 1328

		readonly metadata?: NotebookCellOutputMetadata;
R
rebornix 已提交
1329 1330
	}

R
rebornix 已提交
1331
	export type CellOutput = CellStreamOutput | CellErrorOutput | CellDisplayOutput;
R
rebornix 已提交
1332

R
Rob Lourens 已提交
1333 1334 1335 1336 1337 1338 1339
	export enum NotebookCellRunState {
		Running = 1,
		Idle = 2,
		Success = 3,
		Error = 4
	}

R
rebornix 已提交
1340
	export interface NotebookCellMetadata {
1341 1342 1343
		/**
		 * Controls if the content of a cell is editable or not.
		 */
R
rebornix 已提交
1344
		editable?: boolean;
R
rebornix 已提交
1345 1346 1347 1348 1349

		/**
		 * Controls if the cell is executable.
		 * This metadata is ignored for markdown cell.
		 */
R
rebornix 已提交
1350
		runnable?: boolean;
R
rebornix 已提交
1351

1352 1353 1354 1355 1356 1357
		/**
		 * Controls if the cell has a margin to support the breakpoint UI.
		 * This metadata is ignored for markdown cell.
		 */
		breakpointMargin?: boolean;

1358 1359 1360 1361 1362 1363
		/**
		 * Whether the [execution order](#NotebookCellMetadata.executionOrder) indicator will be displayed.
		 * Defaults to true.
		 */
		hasExecutionOrder?: boolean;

R
rebornix 已提交
1364
		/**
1365
		 * The order in which this cell was executed.
R
rebornix 已提交
1366
		 */
1367
		executionOrder?: number;
R
Rob Lourens 已提交
1368 1369 1370 1371 1372 1373 1374 1375 1376 1377

		/**
		 * A status message to be shown in the cell's status bar
		 */
		statusMessage?: string;

		/**
		 * The cell's current run state
		 */
		runState?: NotebookCellRunState;
1378 1379 1380 1381 1382 1383 1384 1385 1386 1387

		/**
		 * If the cell is running, the time at which the cell started running
		 */
		runStartTime?: number;

		/**
		 * The total duration of the cell's last run
		 */
		lastRunDuration?: number;
R
rebornix 已提交
1388 1389 1390 1391

		/**
		 * Additional attributes of a cell metadata.
		 */
R
rebornix 已提交
1392
		custom?: { [key: string]: any };
R
rebornix 已提交
1393 1394
	}

R
rebornix 已提交
1395
	export interface NotebookCell {
1396
		readonly notebook: NotebookDocument;
1397
		readonly uri: Uri;
R
rebornix 已提交
1398
		readonly cellKind: CellKind;
1399
		readonly document: TextDocument;
R
rebornix 已提交
1400
		language: string;
R
rebornix 已提交
1401
		outputs: CellOutput[];
R
rebornix 已提交
1402
		metadata: NotebookCellMetadata;
R
rebornix 已提交
1403 1404 1405
	}

	export interface NotebookDocumentMetadata {
1406 1407
		/**
		 * Controls if users can add or delete cells
1408
		 * Defaults to true
1409
		 */
1410
		editable?: boolean;
R
rebornix 已提交
1411

1412 1413 1414 1415 1416 1417
		/**
		 * Controls whether the full notebook can be run at once.
		 * Defaults to true
		 */
		runnable?: boolean;

1418 1419
		/**
		 * Default value for [cell editable metadata](#NotebookCellMetadata.editable).
1420
		 * Defaults to true.
1421
		 */
1422
		cellEditable?: boolean;
R
rebornix 已提交
1423 1424 1425

		/**
		 * Default value for [cell runnable metadata](#NotebookCellMetadata.runnable).
1426
		 * Defaults to true.
R
rebornix 已提交
1427
		 */
1428
		cellRunnable?: boolean;
R
rebornix 已提交
1429

1430
		/**
1431
		 * Default value for [cell hasExecutionOrder metadata](#NotebookCellMetadata.hasExecutionOrder).
1432 1433
		 * Defaults to true.
		 */
1434
		cellHasExecutionOrder?: boolean;
R
rebornix 已提交
1435 1436

		displayOrder?: GlobPattern[];
R
rebornix 已提交
1437 1438

		/**
1439
		 * Additional attributes of the document metadata.
R
rebornix 已提交
1440
		 */
1441
		custom?: { [key: string]: any };
R
rebornix 已提交
1442 1443
	}

R
rebornix 已提交
1444 1445 1446
	export interface NotebookDocument {
		readonly uri: Uri;
		readonly fileName: string;
R
rebornix 已提交
1447
		readonly viewType: string;
R
rebornix 已提交
1448
		readonly isDirty: boolean;
R
rebornix 已提交
1449
		readonly cells: NotebookCell[];
R
rebornix 已提交
1450
		languages: string[];
R
rebornix 已提交
1451
		displayOrder?: GlobPattern[];
1452
		metadata: NotebookDocumentMetadata;
1453 1454 1455
	}

	export interface NotebookConcatTextDocument {
1456 1457
		isClosed: boolean;
		dispose(): void;
1458
		onDidChange: Event<void>;
1459 1460 1461 1462 1463 1464 1465
		version: number;
		getText(): string;
		getText(range: Range): string;
		offsetAt(position: Position): number;
		positionAt(offset: number): Position;
		locationAt(positionOrRange: Position | Range): Location;
		positionAt(location: Location): Position;
R
rebornix 已提交
1466 1467
	}

R
rebornix 已提交
1468
	export interface NotebookEditorCellEdit {
R
rebornix 已提交
1469
		insert(index: number, content: string | string[], language: string, type: CellKind, outputs: CellOutput[], metadata: NotebookCellMetadata | undefined): void;
R
rebornix 已提交
1470 1471 1472
		delete(index: number): void;
	}

R
rebornix 已提交
1473
	export interface NotebookEditor {
R
rebornix 已提交
1474 1475 1476
		/**
		 * The document associated with this notebook editor.
		 */
R
rebornix 已提交
1477
		readonly document: NotebookDocument;
R
rebornix 已提交
1478 1479 1480 1481 1482

		/**
		 * The primary selected cell on this notebook editor.
		 */
		readonly selection?: NotebookCell;
1483

R
rebornix 已提交
1484 1485 1486
		/**
		 * The column in which this editor shows.
		 */
R
rebornix 已提交
1487
		viewColumn?: ViewColumn;
1488

R
rebornix 已提交
1489 1490 1491 1492 1493 1494 1495 1496 1497 1498
		/**
		 * Whether the panel is active (focused by the user).
		 */
		readonly active: boolean;

		/**
		 * Whether the panel is visible.
		 */
		readonly visible: boolean;

R
rebornix 已提交
1499 1500 1501 1502 1503
		/**
		 * Fired when the panel is disposed.
		 */
		readonly onDidDispose: Event<void>;

1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516
		/**
		 * Fired when the output hosting webview posts a message.
		 */
		readonly onDidReceiveMessage: Event<any>;
		/**
		 * Post a message to the output hosting webview.
		 *
		 * Messages are only delivered if the editor is live.
		 *
		 * @param message Body of the message. This must be a string or other json serilizable object.
		 */
		postMessage(message: any): Thenable<boolean>;

R
rebornix 已提交
1517 1518 1519 1520 1521
		/**
		 * Convert a uri for the local file system to one that can be used inside outputs webview.
		 */
		asWebviewUri(localResource: Uri): Uri;

R
rebornix 已提交
1522
		edit(callback: (editBuilder: NotebookEditorCellEdit) => void): Thenable<boolean>;
R
rebornix 已提交
1523 1524
	}

R
rebornix 已提交
1525
	export interface NotebookOutputSelector {
R
rebornix 已提交
1526 1527 1528 1529
		type: string;
		subTypes?: string[];
	}

1530 1531 1532 1533 1534 1535
	export interface NotebookRenderRequest {
		output: CellDisplayOutput;
		mimeType: string;
		outputId: string;
	}

R
rebornix 已提交
1536
	export interface NotebookOutputRenderer {
R
rebornix 已提交
1537 1538 1539
		/**
		 *
		 * @returns HTML fragment. We can probably return `CellOutput` instead of string ?
1540
		 *
R
rebornix 已提交
1541
		 */
1542 1543 1544
		render(document: NotebookDocument, request: NotebookRenderRequest): string;

		readonly preloads?: Uri[];
R
rebornix 已提交
1545 1546
	}

1547
	export interface NotebookCellsChangeData {
R
rebornix 已提交
1548 1549
		readonly start: number;
		readonly deletedCount: number;
1550
		readonly deletedItems: NotebookCell[];
R
rebornix 已提交
1551 1552 1553
		readonly items: NotebookCell[];
	}

R
rebornix 已提交
1554
	export interface NotebookCellsChangeEvent {
R
rebornix 已提交
1555 1556 1557 1558 1559

		/**
		 * The affected document.
		 */
		readonly document: NotebookDocument;
1560
		readonly changes: ReadonlyArray<NotebookCellsChangeData>;
R
rebornix 已提交
1561 1562
	}

R
rebornix 已提交
1563
	export interface NotebookCellMoveEvent {
R
rebornix 已提交
1564 1565

		/**
R
rebornix 已提交
1566
		 * The affected document.
R
rebornix 已提交
1567
		 */
R
rebornix 已提交
1568
		readonly document: NotebookDocument;
R
rebornix 已提交
1569
		readonly index: number;
R
rebornix 已提交
1570
		readonly newIndex: number;
R
rebornix 已提交
1571 1572
	}

1573
	export interface NotebookCellOutputsChangeEvent {
R
rebornix 已提交
1574 1575 1576 1577 1578

		/**
		 * The affected document.
		 */
		readonly document: NotebookDocument;
1579
		readonly cells: NotebookCell[];
R
rebornix 已提交
1580 1581 1582
	}

	export interface NotebookCellLanguageChangeEvent {
R
rebornix 已提交
1583 1584

		/**
R
rebornix 已提交
1585
		 * The affected document.
R
rebornix 已提交
1586
		 */
R
rebornix 已提交
1587 1588 1589
		readonly document: NotebookDocument;
		readonly cell: NotebookCell;
		readonly language: string;
R
rebornix 已提交
1590 1591
	}

R
rebornix 已提交
1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605
	export interface NotebookCellData {
		readonly cellKind: CellKind;
		readonly source: string;
		language: string;
		outputs: CellOutput[];
		metadata: NotebookCellMetadata;
	}

	export interface NotebookData {
		readonly cells: NotebookCellData[];
		readonly languages: string[];
		readonly metadata: NotebookDocumentMetadata;
	}

R
rebornix 已提交
1606 1607 1608 1609 1610 1611 1612 1613
	interface NotebookDocumentEditEvent {

		/**
		 * The document that the edit is for.
		 */
		readonly document: NotebookDocument;
	}

1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638
	interface NotebookDocumentBackup {
		/**
		 * Unique identifier for the backup.
		 *
		 * This id is passed back to your extension in `openCustomDocument` when opening a custom editor from a backup.
		 */
		readonly id: string;

		/**
		 * Delete the current backup.
		 *
		 * This is called by VS Code when it is clear the current backup is no longer needed, such as when a new backup
		 * is made or when the file is saved.
		 */
		delete(): void;
	}

	interface NotebookDocumentBackupContext {
		readonly destination: Uri;
	}

	interface NotebookDocumentOpenContext {
		readonly backupId?: string;
	}

R
rebornix 已提交
1639
	export interface NotebookContentProvider {
1640
		openNotebook(uri: Uri, openContext: NotebookDocumentOpenContext): NotebookData | Promise<NotebookData>;
R
rebornix 已提交
1641 1642
		saveNotebook(document: NotebookDocument, cancellation: CancellationToken): Promise<void>;
		saveNotebookAs(targetResource: Uri, document: NotebookDocument, cancellation: CancellationToken): Promise<void>;
R
rebornix 已提交
1643
		readonly onDidChangeNotebook: Event<NotebookDocumentEditEvent>;
1644 1645
		revertNotebook?(document: NotebookDocument, cancellation: CancellationToken): Promise<void>;
		backupNotebook?(document: NotebookDocument, context: NotebookDocumentBackupContext, cancellation: CancellationToken): Promise<NotebookDocumentBackup>;
R
rebornix 已提交
1646

R
rebornix 已提交
1647
		kernel?: NotebookKernel;
R
rebornix 已提交
1648 1649
	}

R
rebornix 已提交
1650
	export interface NotebookKernel {
R
rebornix 已提交
1651
		label: string;
R
rebornix 已提交
1652 1653 1654 1655 1656
		preloads?: Uri[];
		executeCell(document: NotebookDocument, cell: NotebookCell, token: CancellationToken): Promise<void>;
		executeAllCells(document: NotebookDocument, token: CancellationToken): Promise<void>;
	}

R
rebornix 已提交
1657
	export namespace notebook {
R
rebornix 已提交
1658 1659 1660 1661 1662
		export function registerNotebookContentProvider(
			notebookType: string,
			provider: NotebookContentProvider
		): Disposable;

R
rebornix 已提交
1663 1664 1665 1666 1667 1668
		export function registerNotebookKernel(
			id: string,
			selectors: GlobPattern[],
			kernel: NotebookKernel
		): Disposable;

R
rebornix 已提交
1669
		export function registerNotebookOutputRenderer(
R
rebornix 已提交
1670
			id: string,
R
rebornix 已提交
1671 1672 1673 1674
			outputSelector: NotebookOutputSelector,
			renderer: NotebookOutputRenderer
		): Disposable;

R
rebornix 已提交
1675
		export const onDidOpenNotebookDocument: Event<NotebookDocument>;
R
rebornix 已提交
1676
		export const onDidCloseNotebookDocument: Event<NotebookDocument>;
1677 1678 1679 1680 1681 1682

		/**
		 * All currently known notebook documents.
		 */
		export const notebookDocuments: ReadonlyArray<NotebookDocument>;

R
rebornix 已提交
1683 1684
		export let visibleNotebookEditors: NotebookEditor[];
		export const onDidChangeVisibleNotebookEditors: Event<NotebookEditor[]>;
R
rebornix 已提交
1685

R
rebornix 已提交
1686
		export let activeNotebookEditor: NotebookEditor | undefined;
R
rebornix 已提交
1687
		export const onDidChangeActiveNotebookEditor: Event<NotebookEditor | undefined>;
R
rebornix 已提交
1688
		export const onDidChangeNotebookCells: Event<NotebookCellsChangeEvent>;
1689
		export const onDidChangeCellOutputs: Event<NotebookCellOutputsChangeEvent>;
R
rebornix 已提交
1690
		export const onDidChangeCellLanguage: Event<NotebookCellLanguageChangeEvent>;
1691
		/**
J
Johannes Rieken 已提交
1692 1693
		 * Create a document that is the concatenation of all  notebook cells. By default all code-cells are included
		 * but a selector can be provided to narrow to down the set of cells.
1694 1695 1696 1697 1698
		 *
		 * @param notebook
		 * @param selector
		 */
		export function createConcatTextDocument(notebook: NotebookDocument, selector?: DocumentSelector): NotebookConcatTextDocument;
R
rebornix 已提交
1699 1700 1701
	}

	//#endregion
R
rebornix 已提交
1702

1703 1704
	//#region https://github.com/microsoft/vscode/issues/39441

P
label2  
Pine Wu 已提交
1705 1706 1707 1708
	export interface CompletionItem {
		/**
		 * Will be merged into CompletionItem#label
		 */
P
Pine Wu 已提交
1709
		label2?: CompletionItemLabel;
P
label2  
Pine Wu 已提交
1710 1711
	}

1712 1713
	export interface CompletionItemLabel {
		/**
P
Pine Wu 已提交
1714
		 * The function or variable. Rendered leftmost.
1715
		 */
P
Pine Wu 已提交
1716
		name: string;
1717

P
Pine Wu 已提交
1718
		/**
1719
		 * The parameters without the return type. Render after `name`.
P
Pine Wu 已提交
1720
		 */
1721
		parameters?: string;
P
Pine Wu 已提交
1722 1723

		/**
P
Pine Wu 已提交
1724
		 * The fully qualified name, like package name or file path. Rendered after `signature`.
P
Pine Wu 已提交
1725 1726
		 */
		qualifier?: string;
1727

P
Pine Wu 已提交
1728
		/**
P
Pine Wu 已提交
1729
		 * The return-type of a function or type of a property/variable. Rendered rightmost.
P
Pine Wu 已提交
1730
		 */
P
Pine Wu 已提交
1731
		type?: string;
1732 1733 1734 1735
	}

	//#endregion

1736
	//#region @eamodio - timeline: https://github.com/microsoft/vscode/issues/84297
1737 1738 1739

	export class TimelineItem {
		/**
1740
		 * A timestamp (in milliseconds since 1 January 1970 00:00:00) for when the timeline item occurred.
1741
		 */
E
Eric Amodio 已提交
1742
		timestamp: number;
1743 1744

		/**
1745
		 * A human-readable string describing the timeline item.
1746 1747 1748 1749
		 */
		label: string;

		/**
1750
		 * Optional id for the timeline item. It must be unique across all the timeline items provided by this source.
1751
		 *
1752
		 * If not provided, an id is generated using the timeline item's timestamp.
1753 1754 1755 1756
		 */
		id?: string;

		/**
1757
		 * The icon path or [ThemeIcon](#ThemeIcon) for the timeline item.
1758
		 */
R
rebornix 已提交
1759
		iconPath?: Uri | { light: Uri; dark: Uri; } | ThemeIcon;
1760 1761

		/**
1762
		 * A human readable string describing less prominent details of the timeline item.
1763 1764 1765 1766 1767 1768
		 */
		description?: string;

		/**
		 * The tooltip text when you hover over the timeline item.
		 */
1769
		detail?: string;
1770 1771 1772 1773 1774 1775 1776

		/**
		 * The [command](#Command) that should be executed when the timeline item is selected.
		 */
		command?: Command;

		/**
1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792
		 * Context value of the timeline item. This can be used to contribute specific actions to the item.
		 * For example, a timeline item is given a context value as `commit`. When contributing actions to `timeline/item/context`
		 * using `menus` extension point, you can specify context value for key `timelineItem` in `when` expression like `timelineItem == commit`.
		 * ```
		 *	"contributes": {
		 *		"menus": {
		 *			"timeline/item/context": [
		 *				{
		 *					"command": "extension.copyCommitId",
		 *					"when": "timelineItem == commit"
		 *				}
		 *			]
		 *		}
		 *	}
		 * ```
		 * This will show the `extension.copyCommitId` action only for items where `contextValue` is `commit`.
1793 1794 1795
		 */
		contextValue?: string;

1796 1797 1798 1799 1800
		/**
		 * Accessibility information used when screen reader interacts with this timeline item.
		 */
		accessibilityInformation?: AccessibilityInformation;

1801 1802
		/**
		 * @param label A human-readable string describing the timeline item
E
Eric Amodio 已提交
1803
		 * @param timestamp A timestamp (in milliseconds since 1 January 1970 00:00:00) for when the timeline item occurred
1804
		 */
E
Eric Amodio 已提交
1805
		constructor(label: string, timestamp: number);
1806 1807
	}

1808
	export interface TimelineChangeEvent {
E
Eric Amodio 已提交
1809
		/**
1810
		 * The [uri](#Uri) of the resource for which the timeline changed.
E
Eric Amodio 已提交
1811
		 */
E
Eric Amodio 已提交
1812
		uri: Uri;
1813

E
Eric Amodio 已提交
1814
		/**
1815
		 * A flag which indicates whether the entire timeline should be reset.
E
Eric Amodio 已提交
1816
		 */
1817 1818
		reset?: boolean;
	}
E
Eric Amodio 已提交
1819

1820 1821 1822
	export interface Timeline {
		readonly paging?: {
			/**
E
Eric Amodio 已提交
1823
			 * A provider-defined cursor specifying the starting point of timeline items which are after the ones returned.
E
Eric Amodio 已提交
1824
			 * Use `undefined` to signal that there are no more items to be returned.
1825
			 */
E
Eric Amodio 已提交
1826
			readonly cursor: string | undefined;
R
rebornix 已提交
1827
		};
E
Eric Amodio 已提交
1828 1829

		/**
1830
		 * An array of [timeline items](#TimelineItem).
E
Eric Amodio 已提交
1831
		 */
1832
		readonly items: readonly TimelineItem[];
E
Eric Amodio 已提交
1833 1834
	}

1835
	export interface TimelineOptions {
E
Eric Amodio 已提交
1836
		/**
E
Eric Amodio 已提交
1837
		 * A provider-defined cursor specifying the starting point of the timeline items that should be returned.
E
Eric Amodio 已提交
1838
		 */
1839
		cursor?: string;
E
Eric Amodio 已提交
1840 1841

		/**
1842 1843
		 * An optional maximum number timeline items or the all timeline items newer (inclusive) than the timestamp or id that should be returned.
		 * If `undefined` all timeline items should be returned.
E
Eric Amodio 已提交
1844
		 */
R
rebornix 已提交
1845
		limit?: number | { timestamp: number; id?: string; };
E
Eric Amodio 已提交
1846 1847
	}

1848
	export interface TimelineProvider {
1849
		/**
1850 1851
		 * An optional event to signal that the timeline for a source has changed.
		 * To signal that the timeline for all resources (uris) has changed, do not pass any argument or pass `undefined`.
1852
		 */
E
Eric Amodio 已提交
1853
		onDidChange?: Event<TimelineChangeEvent | undefined>;
1854 1855

		/**
1856
		 * An identifier of the source of the timeline items. This can be used to filter sources.
1857
		 */
1858
		readonly id: string;
1859

E
Eric Amodio 已提交
1860
		/**
1861
		 * A human-readable string describing the source of the timeline items. This can be used as the display label when filtering sources.
E
Eric Amodio 已提交
1862
		 */
1863
		readonly label: string;
1864 1865

		/**
E
Eric Amodio 已提交
1866
		 * Provide [timeline items](#TimelineItem) for a [Uri](#Uri).
1867
		 *
1868
		 * @param uri The [uri](#Uri) of the file to provide the timeline for.
1869
		 * @param options A set of options to determine how results should be returned.
1870
		 * @param token A cancellation token.
E
Eric Amodio 已提交
1871
		 * @return The [timeline result](#TimelineResult) or a thenable that resolves to such. The lack of a result
1872 1873
		 * can be signaled by returning `undefined`, `null`, or an empty array.
		 */
1874
		provideTimeline(uri: Uri, options: TimelineOptions, token: CancellationToken): ProviderResult<Timeline>;
1875 1876 1877 1878 1879 1880 1881 1882 1883 1884
	}

	export namespace workspace {
		/**
		 * Register a timeline provider.
		 *
		 * Multiple providers can be registered. In that case, providers are asked in
		 * parallel and the results are merged. A failing provider (rejected promise or exception) will
		 * not cause a failure of the whole operation.
		 *
1885
		 * @param scheme A scheme or schemes that defines which documents this provider is applicable to. Can be `*` to target all documents.
1886 1887
		 * @param provider A timeline provider.
		 * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
E
Eric Amodio 已提交
1888
		*/
1889
		export function registerTimelineProvider(scheme: string | string[], provider: TimelineProvider): Disposable;
1890 1891 1892
	}

	//#endregion
1893

1894 1895 1896 1897 1898 1899
	//#region https://github.com/microsoft/vscode/issues/86788

	export interface CodeActionProviderMetadata {
		/**
		 * Static documentation for a class of code actions.
		 *
M
Matt Bierner 已提交
1900 1901
		 * The documentation is shown in the code actions menu if either:
		 *
M
Matt Bierner 已提交
1902 1903 1904 1905
		 * - Code actions of `kind` are requested by VS Code. In this case, VS Code will show the documentation that
		 *   most closely matches the requested code action kind. For example, if a provider has documentation for
		 *   both `Refactor` and `RefactorExtract`, when the user requests code actions for `RefactorExtract`,
		 *   VS Code will use the documentation for `RefactorExtract` intead of the documentation for `Refactor`.
M
Matt Bierner 已提交
1906 1907
		 *
		 * - Any code actions of `kind` are returned by the provider.
1908
		 */
R
rebornix 已提交
1909
		readonly documentation?: ReadonlyArray<{ readonly kind: CodeActionKind, readonly command: Command; }>;
1910 1911 1912
	}

	//#endregion
1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925

	//#region Dialog title: https://github.com/microsoft/vscode/issues/82871

	/**
	 * Options to configure the behaviour of a file open dialog.
	 *
	 * * Note 1: A dialog can select files, folders, or both. This is not true for Windows
	 * which enforces to open either files or folder, but *not both*.
	 * * Note 2: Explicitly setting `canSelectFiles` and `canSelectFolders` to `false` is futile
	 * and the editor then silently adjusts the options to select files.
	 */
	export interface OpenDialogOptions {
		/**
1926 1927 1928 1929
		 * Dialog title.
		 *
		 * Depending on the underlying operating system this parameter might be ignored, since some
		 * systems do not present title on open dialogs.
1930 1931 1932 1933 1934 1935 1936 1937 1938
		 */
		title?: string;
	}

	/**
	 * Options to configure the behaviour of a file save dialog.
	 */
	export interface SaveDialogOptions {
		/**
1939 1940 1941 1942
		 * Dialog title.
		 *
		 * Depending on the underlying operating system this parameter might be ignored, since some
		 * systems do not present title on save dialogs.
1943 1944 1945 1946 1947
		 */
		title?: string;
	}

	//#endregion
1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967

	//#region Accessibility information: https://github.com/microsoft/vscode/issues/95360

	/**
	 * Accessibility information which controls screen reader behavior.
	 */
	export interface AccessibilityInformation {
		label: string;
		role?: string;
	}

	export interface StatusBarItem {
		/**
		 * Accessibility information used when screen reader interacts with this StatusBar item
		 */
		accessibilityInformation?: AccessibilityInformation;
	}

	//#endregion

1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986
	//#region https://github.com/microsoft/vscode/issues/91555

	export enum StandardTokenType {
		Other = 0,
		Comment = 1,
		String = 2,
		RegEx = 4
	}

	export interface TokenInformation {
		type: StandardTokenType;
		range: Range;
	}

	export namespace languages {
		export function getTokenInformationAtPosition(document: TextDocument, position: Position): Promise<TokenInformation>;
	}

	//#endregion
J
Johannes Rieken 已提交
1987
}