mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Bump eslint versions and update lint scripts
Pick up latest eslint to avoid a nasty warning about using an unsupported version of TS Also updates the eslint script to be more scoped on which files it checks
This commit is contained in:
583
proposed-api-sample/package-lock.json
generated
583
proposed-api-sample/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -29,7 +29,7 @@
|
||||
"scripts": {
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"compile": "tsc -p ./",
|
||||
"lint": "eslint . --ext .ts,.tsx",
|
||||
"lint": "eslint \"src/**/*.ts\"",
|
||||
"watch": "tsc -watch -p ./",
|
||||
"download-api": "vscode-dts dev",
|
||||
"postdownload-api": "vscode-dts main",
|
||||
@ -37,9 +37,9 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.11.7",
|
||||
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
||||
"@typescript-eslint/parser": "^5.30.0",
|
||||
"eslint": "^8.13.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.42.0",
|
||||
"@typescript-eslint/parser": "^5.42.0",
|
||||
"eslint": "^8.26.0",
|
||||
"typescript": "^4.8.4",
|
||||
"vscode-dts": "^0.3.2"
|
||||
}
|
||||
|
||||
484
proposed-api-sample/vscode.d.ts
vendored
484
proposed-api-sample/vscode.d.ts
vendored
@ -752,10 +752,10 @@ declare module 'vscode' {
|
||||
export interface TextDocumentShowOptions {
|
||||
/**
|
||||
* An optional view column in which the {@link TextEditor editor} should be shown.
|
||||
* The default is the {@link ViewColumn.Active active}, other values are adjusted to
|
||||
* be `Min(column, columnCount + 1)`, the {@link ViewColumn.Active active}-column is
|
||||
* not adjusted. Use {@linkcode ViewColumn.Beside} to open the
|
||||
* editor to the side of the currently active one.
|
||||
* The default is the {@link ViewColumn.Active active}. Columns that do not exist
|
||||
* will be created as needed up to the maximum of {@linkcode ViewColumn.Nine}.
|
||||
* Use {@linkcode ViewColumn.Beside} to open the editor to the side of the currently
|
||||
* active one.
|
||||
*/
|
||||
viewColumn?: ViewColumn;
|
||||
|
||||
@ -814,10 +814,10 @@ declare module 'vscode' {
|
||||
export interface NotebookDocumentShowOptions {
|
||||
/**
|
||||
* An optional view column in which the {@link NotebookEditor notebook editor} should be shown.
|
||||
* The default is the {@link ViewColumn.Active active}, other values are adjusted to
|
||||
* be `Min(column, columnCount + 1)`, the {@link ViewColumn.Active active}-column is
|
||||
* not adjusted. Use {@linkcode ViewColumn.Beside} to open the
|
||||
* editor to the side of the currently active one.
|
||||
* The default is the {@link ViewColumn.Active active}. Columns that do not exist
|
||||
* will be created as needed up to the maximum of {@linkcode ViewColumn.Nine}.
|
||||
* Use {@linkcode ViewColumn.Beside} to open the editor to the side of the currently
|
||||
* active one.
|
||||
*/
|
||||
readonly viewColumn?: ViewColumn;
|
||||
|
||||
@ -1608,7 +1608,6 @@ declare module 'vscode' {
|
||||
/**
|
||||
* The event listeners can subscribe to.
|
||||
*/
|
||||
// eslint-disable-next-line vscode-dts-event-naming
|
||||
event: Event<T>;
|
||||
|
||||
/**
|
||||
@ -1752,8 +1751,9 @@ declare module 'vscode' {
|
||||
|
||||
/**
|
||||
* Optional flag indicating if this item is picked initially. This is only honored when using
|
||||
* the {@link window.showQuickPick()} API. To do the same thing with the {@link window.createQuickPick()} API,
|
||||
* simply set the {@link QuickPick.selectedItems} to the items you want picked initially.
|
||||
* the {@link window.showQuickPick showQuickPick()} API. To do the same thing with
|
||||
* the {@link window.createQuickPick createQuickPick()} API, simply set the {@link QuickPick.selectedItems}
|
||||
* to the items you want picked initially.
|
||||
* (*Note:* This is only honored when the picker allows multiple selections.)
|
||||
*
|
||||
* @see {@link QuickPickOptions.canPickMany}
|
||||
@ -1772,8 +1772,8 @@ declare module 'vscode' {
|
||||
/**
|
||||
* Optional buttons that will be rendered on this particular item. These buttons will trigger
|
||||
* an {@link QuickPickItemButtonEvent} when clicked. Buttons are only rendered when using a quickpick
|
||||
* created by the {@link window.createQuickPick()} API. Buttons are not rendered when using
|
||||
* the {@link window.showQuickPick()} API.
|
||||
* created by the {@link window.createQuickPick createQuickPick()} API. Buttons are not rendered when using
|
||||
* the {@link window.showQuickPick showQuickPick()} API.
|
||||
*
|
||||
* Note: this property is ignored when {@link QuickPickItem.kind kind} is set to {@link QuickPickItemKind.Separator}
|
||||
*/
|
||||
@ -2019,7 +2019,7 @@ declare module 'vscode' {
|
||||
/**
|
||||
* Selection of the pre-filled {@linkcode InputBoxOptions.value value}. Defined as tuple of two number where the
|
||||
* first is the inclusive start index and the second the exclusive end index. When `undefined` the whole
|
||||
* word will be selected, when empty (start equals end) only the cursor will be set,
|
||||
* pre-filled value will be selected, when empty (start equals end) only the cursor will be set,
|
||||
* otherwise the defined range will be selected.
|
||||
*/
|
||||
valueSelection?: [number, number];
|
||||
@ -2276,6 +2276,18 @@ declare module 'vscode' {
|
||||
*/
|
||||
static readonly RefactorInline: CodeActionKind;
|
||||
|
||||
/**
|
||||
* Base kind for refactoring move actions: `refactor.move`
|
||||
*
|
||||
* Example move actions:
|
||||
*
|
||||
* - Move a function to a new file
|
||||
* - Move a property between classes
|
||||
* - Move method to base class
|
||||
* - ...
|
||||
*/
|
||||
static readonly RefactorMove: CodeActionKind;
|
||||
|
||||
/**
|
||||
* Base kind for refactoring rewrite actions: `refactor.rewrite`
|
||||
*
|
||||
@ -2285,7 +2297,6 @@ declare module 'vscode' {
|
||||
* - Add or remove parameter
|
||||
* - Encapsulate field
|
||||
* - Make method static
|
||||
* - Move method to base class
|
||||
* - ...
|
||||
*/
|
||||
static readonly RefactorRewrite: CodeActionKind;
|
||||
@ -2741,8 +2752,12 @@ declare module 'vscode' {
|
||||
/**
|
||||
* Indicates that this markdown string is from a trusted source. Only *trusted*
|
||||
* markdown supports links that execute commands, e.g. `[Run it](command:myCommandId)`.
|
||||
*
|
||||
* Defaults to `false` (commands are disabled).
|
||||
*
|
||||
* If this is an object, only the set of commands listed in `enabledCommands` are allowed.
|
||||
*/
|
||||
isTrusted?: boolean;
|
||||
isTrusted?: boolean | { readonly enabledCommands: readonly string[] };
|
||||
|
||||
/**
|
||||
* Indicates that this markdown string can contain {@link ThemeIcon ThemeIcons}, e.g. `$(zap)`.
|
||||
@ -3427,6 +3442,120 @@ declare module 'vscode' {
|
||||
constructor(range: Range, newText: string);
|
||||
}
|
||||
|
||||
/**
|
||||
* A snippet edit represents an interactive edit that is performed by
|
||||
* the editor.
|
||||
*
|
||||
* *Note* that a snippet edit can always be performed as a normal {@link TextEdit text edit}.
|
||||
* This will happen when no matching editor is open or when a {@link WorkspaceEdit workspace edit}
|
||||
* contains snippet edits for multiple files. In that case only those that match the active editor
|
||||
* will be performed as snippet edits and the others as normal text edits.
|
||||
*/
|
||||
export class SnippetTextEdit {
|
||||
|
||||
/**
|
||||
* Utility to create a replace snippet edit.
|
||||
*
|
||||
* @param range A range.
|
||||
* @param snippet A snippet string.
|
||||
* @return A new snippet edit object.
|
||||
*/
|
||||
static replace(range: Range, snippet: SnippetString): SnippetTextEdit;
|
||||
|
||||
/**
|
||||
* Utility to create an insert snippet edit.
|
||||
*
|
||||
* @param position A position, will become an empty range.
|
||||
* @param snippet A snippet string.
|
||||
* @return A new snippet edit object.
|
||||
*/
|
||||
static insert(position: Position, snippet: SnippetString): SnippetTextEdit;
|
||||
|
||||
/**
|
||||
* The range this edit applies to.
|
||||
*/
|
||||
range: Range;
|
||||
|
||||
/**
|
||||
* The {@link SnippetString snippet} this edit will perform.
|
||||
*/
|
||||
snippet: SnippetString;
|
||||
|
||||
/**
|
||||
* Create a new snippet edit.
|
||||
*
|
||||
* @param range A range.
|
||||
* @param snippet A snippet string.
|
||||
*/
|
||||
constructor(range: Range, snippet: SnippetString);
|
||||
}
|
||||
|
||||
/**
|
||||
* A notebook edit represents edits that should be applied to the contents of a notebook.
|
||||
*/
|
||||
export class NotebookEdit {
|
||||
|
||||
/**
|
||||
* Utility to create a edit that replaces cells in a notebook.
|
||||
*
|
||||
* @param range The range of cells to replace
|
||||
* @param newCells The new notebook cells.
|
||||
*/
|
||||
static replaceCells(range: NotebookRange, newCells: NotebookCellData[]): NotebookEdit;
|
||||
|
||||
/**
|
||||
* Utility to create an edit that replaces cells in a notebook.
|
||||
*
|
||||
* @param index The index to insert cells at.
|
||||
* @param newCells The new notebook cells.
|
||||
*/
|
||||
static insertCells(index: number, newCells: NotebookCellData[]): NotebookEdit;
|
||||
|
||||
/**
|
||||
* Utility to create an edit that deletes cells in a notebook.
|
||||
*
|
||||
* @param range The range of cells to delete.
|
||||
*/
|
||||
static deleteCells(range: NotebookRange): NotebookEdit;
|
||||
|
||||
/**
|
||||
* Utility to create an edit that update a cell's metadata.
|
||||
*
|
||||
* @param index The index of the cell to update.
|
||||
* @param newCellMetadata The new metadata for the cell.
|
||||
*/
|
||||
static updateCellMetadata(index: number, newCellMetadata: { [key: string]: any }): NotebookEdit;
|
||||
|
||||
/**
|
||||
* Utility to create an edit that updates the notebook's metadata.
|
||||
*
|
||||
* @param newNotebookMetadata The new metadata for the notebook.
|
||||
*/
|
||||
static updateNotebookMetadata(newNotebookMetadata: { [key: string]: any }): NotebookEdit;
|
||||
|
||||
/**
|
||||
* Range of the cells being edited. May be empty.
|
||||
*/
|
||||
range: NotebookRange;
|
||||
|
||||
/**
|
||||
* New cells being inserted. May be empty.
|
||||
*/
|
||||
newCells: NotebookCellData[];
|
||||
|
||||
/**
|
||||
* Optional new metadata for the cells.
|
||||
*/
|
||||
newCellMetadata?: { [key: string]: any };
|
||||
|
||||
/**
|
||||
* Optional new metadata for the notebook.
|
||||
*/
|
||||
newNotebookMetadata?: { [key: string]: any };
|
||||
|
||||
constructor(range: NotebookRange, newCells: NotebookCellData[]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional data for entries of a workspace edit. Supports to label entries and marks entries
|
||||
* as needing confirmation by the user. The editor groups edits with equal labels into tree nodes,
|
||||
@ -3455,6 +3584,16 @@ declare module 'vscode' {
|
||||
iconPath?: Uri | { light: Uri; dark: Uri } | ThemeIcon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional data about a workspace edit.
|
||||
*/
|
||||
export interface WorkspaceEditMetadata {
|
||||
/**
|
||||
* Signal to the editor that this edit is a refactoring.
|
||||
*/
|
||||
isRefactoring?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A workspace edit is a collection of textual and files changes for
|
||||
* multiple resources and documents.
|
||||
@ -3506,12 +3645,36 @@ declare module 'vscode' {
|
||||
has(uri: Uri): boolean;
|
||||
|
||||
/**
|
||||
* Set (and replace) text edits for a resource.
|
||||
* Set (and replace) notebook edits for a resource.
|
||||
*
|
||||
* @param uri A resource identifier.
|
||||
* @param edits An array of text edits.
|
||||
* @param edits An array of edits.
|
||||
*/
|
||||
set(uri: Uri, edits: TextEdit[]): void;
|
||||
set(uri: Uri, edits: readonly NotebookEdit[]): void;
|
||||
|
||||
/**
|
||||
* Set (and replace) notebook edits with metadata for a resource.
|
||||
*
|
||||
* @param uri A resource identifier.
|
||||
* @param edits An array of edits.
|
||||
*/
|
||||
set(uri: Uri, edits: ReadonlyArray<[NotebookEdit, WorkspaceEditEntryMetadata]>): void;
|
||||
|
||||
/**
|
||||
* Set (and replace) text edits or snippet edits for a resource.
|
||||
*
|
||||
* @param uri A resource identifier.
|
||||
* @param edits An array of edits.
|
||||
*/
|
||||
set(uri: Uri, edits: ReadonlyArray<TextEdit | SnippetTextEdit>): void;
|
||||
|
||||
/**
|
||||
* Set (and replace) text edits or snippet edits with metadata for a resource.
|
||||
*
|
||||
* @param uri A resource identifier.
|
||||
* @param edits An array of edits.
|
||||
*/
|
||||
set(uri: Uri, edits: ReadonlyArray<[TextEdit | SnippetTextEdit, WorkspaceEditEntryMetadata]>): void;
|
||||
|
||||
/**
|
||||
* Get the text edits for a resource.
|
||||
@ -3524,14 +3687,15 @@ declare module 'vscode' {
|
||||
/**
|
||||
* Create a regular file.
|
||||
*
|
||||
* @param uri Uri of the new file..
|
||||
* @param uri Uri of the new file.
|
||||
* @param options Defines if an existing file should be overwritten or be
|
||||
* ignored. When overwrite and ignoreIfExists are both set overwrite wins.
|
||||
* ignored. When `overwrite` and `ignoreIfExists` are both set `overwrite` wins.
|
||||
* When both are unset and when the file already exists then the edit cannot
|
||||
* be applied successfully.
|
||||
* be applied successfully. The `content`-property allows to set the initial contents
|
||||
* the file is being created with.
|
||||
* @param metadata Optional metadata for the entry.
|
||||
*/
|
||||
createFile(uri: Uri, options?: { overwrite?: boolean; ignoreIfExists?: boolean }, metadata?: WorkspaceEditEntryMetadata): void;
|
||||
createFile(uri: Uri, options?: { readonly overwrite?: boolean; readonly ignoreIfExists?: boolean; readonly contents?: Uint8Array }, metadata?: WorkspaceEditEntryMetadata): void;
|
||||
|
||||
/**
|
||||
* Delete a file or folder.
|
||||
@ -3539,7 +3703,7 @@ declare module 'vscode' {
|
||||
* @param uri The uri of the file that is to be deleted.
|
||||
* @param metadata Optional metadata for the entry.
|
||||
*/
|
||||
deleteFile(uri: Uri, options?: { recursive?: boolean; ignoreIfNotExists?: boolean }, metadata?: WorkspaceEditEntryMetadata): void;
|
||||
deleteFile(uri: Uri, options?: { readonly recursive?: boolean; readonly ignoreIfNotExists?: boolean }, metadata?: WorkspaceEditEntryMetadata): void;
|
||||
|
||||
/**
|
||||
* Rename a file or folder.
|
||||
@ -3550,7 +3714,7 @@ declare module 'vscode' {
|
||||
* ignored. When overwrite and ignoreIfExists are both set overwrite wins.
|
||||
* @param metadata Optional metadata for the entry.
|
||||
*/
|
||||
renameFile(oldUri: Uri, newUri: Uri, options?: { overwrite?: boolean; ignoreIfExists?: boolean }, metadata?: WorkspaceEditEntryMetadata): void;
|
||||
renameFile(oldUri: Uri, newUri: Uri, options?: { readonly overwrite?: boolean; readonly ignoreIfExists?: boolean }, metadata?: WorkspaceEditEntryMetadata): void;
|
||||
|
||||
/**
|
||||
* Get all text edits grouped by resource.
|
||||
@ -4038,7 +4202,7 @@ declare module 'vscode' {
|
||||
/**
|
||||
* The index of the active parameter.
|
||||
*
|
||||
* If provided, this is used in place of {@linkcode SignatureHelp.activeSignature}.
|
||||
* If provided, this is used in place of {@linkcode SignatureHelp.activeParameter}.
|
||||
*/
|
||||
activeParameter?: number;
|
||||
|
||||
@ -5408,6 +5572,48 @@ declare module 'vscode' {
|
||||
provideLinkedEditingRanges(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<LinkedEditingRanges>;
|
||||
}
|
||||
|
||||
/**
|
||||
* An edit operation applied {@link DocumentDropEditProvider on drop}.
|
||||
*/
|
||||
export class DocumentDropEdit {
|
||||
/**
|
||||
* The text or snippet to insert at the drop location.
|
||||
*/
|
||||
insertText: string | SnippetString;
|
||||
|
||||
/**
|
||||
* An optional additional edit to apply on drop.
|
||||
*/
|
||||
additionalEdit?: WorkspaceEdit;
|
||||
|
||||
/**
|
||||
* @param insertText The text or snippet to insert at the drop location.
|
||||
*/
|
||||
constructor(insertText: string | SnippetString);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provider which handles dropping of resources into a text editor.
|
||||
*
|
||||
* This allows users to drag and drop resources (including resources from external apps) into the editor. While dragging
|
||||
* and dropping files, users can hold down `shift` to drop the file into the editor instead of opening it.
|
||||
* Requires `editor.dropIntoEditor.enabled` to be on.
|
||||
*/
|
||||
export interface DocumentDropEditProvider {
|
||||
/**
|
||||
* Provide edits which inserts the content being dragged and dropped into the document.
|
||||
*
|
||||
* @param document The document in which the drop occurred.
|
||||
* @param position The position in the document where the drop occurred.
|
||||
* @param dataTransfer A {@link DataTransfer} object that holds data about what is being dragged and dropped.
|
||||
* @param token A cancellation token.
|
||||
*
|
||||
* @return A {@link DocumentDropEdit} or a thenable that resolves to such. The lack of a result can be
|
||||
* signaled by returning `undefined` or `null`.
|
||||
*/
|
||||
provideDocumentDropEdits(document: TextDocument, position: Position, dataTransfer: DataTransfer, token: CancellationToken): ProviderResult<DocumentDropEdit>;
|
||||
}
|
||||
|
||||
/**
|
||||
* A tuple of two characters, like a pair of
|
||||
* opening and closing brackets.
|
||||
@ -6494,10 +6700,10 @@ declare module 'vscode' {
|
||||
export interface TerminalEditorLocationOptions {
|
||||
/**
|
||||
* A view column in which the {@link Terminal terminal} should be shown in the editor area.
|
||||
* Use {@link ViewColumn.Active active} to open in the active editor group, other values are
|
||||
* adjusted to be `Min(column, columnCount + 1)`, the
|
||||
* {@link ViewColumn.Active active}-column is not adjusted. Use
|
||||
* {@linkcode ViewColumn.Beside} to open the editor to the side of the currently active one.
|
||||
* The default is the {@link ViewColumn.Active active}. Columns that do not exist
|
||||
* will be created as needed up to the maximum of {@linkcode ViewColumn.Nine}.
|
||||
* Use {@linkcode ViewColumn.Beside} to open the editor to the side of the currently
|
||||
* active one.
|
||||
*/
|
||||
viewColumn: ViewColumn;
|
||||
/**
|
||||
@ -8202,9 +8408,11 @@ declare module 'vscode' {
|
||||
/**
|
||||
* Controls whether command uris are enabled in webview content or not.
|
||||
*
|
||||
* Defaults to false.
|
||||
* Defaults to `false` (command uris are disabled).
|
||||
*
|
||||
* If you pass in an array, only the commands in the array are allowed.
|
||||
*/
|
||||
readonly enableCommandUris?: boolean;
|
||||
readonly enableCommandUris?: boolean | readonly string[];
|
||||
|
||||
/**
|
||||
* Root paths from which the webview can load local (filesystem) resources using uris from `asWebviewUri`
|
||||
@ -8529,6 +8737,12 @@ declare module 'vscode' {
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* The badge to display for this webview view.
|
||||
* To remove the badge, set to undefined.
|
||||
*/
|
||||
badge?: ViewBadge | undefined;
|
||||
|
||||
/**
|
||||
* Event fired when the view is disposed.
|
||||
*
|
||||
@ -9408,8 +9622,8 @@ declare module 'vscode' {
|
||||
* to control where the editor is being shown. Might change the {@link window.activeTextEditor active editor}.
|
||||
*
|
||||
* @param document A text document to be shown.
|
||||
* @param column A view column in which the {@link TextEditor editor} should be shown. The default is the {@link ViewColumn.Active active}, other values
|
||||
* are adjusted to be `Min(column, columnCount + 1)`, the {@link ViewColumn.Active active}-column is not adjusted. Use {@linkcode ViewColumn.Beside}
|
||||
* @param column A view column in which the {@link TextEditor editor} should be shown. The default is the {@link ViewColumn.Active active}.
|
||||
* Columns that do not exist will be created as needed up to the maximum of {@linkcode ViewColumn.Nine}. Use {@linkcode ViewColumn.Beside}
|
||||
* to open the editor to the side of the currently active one.
|
||||
* @param preserveFocus When `true` the editor will not take focus.
|
||||
* @return A promise that resolves to an {@link TextEditor editor}.
|
||||
@ -10145,7 +10359,7 @@ declare module 'vscode' {
|
||||
* @param callbackfn Callback for iteration through the data transfer items.
|
||||
* @param thisArg The `this` context used when invoking the handler function.
|
||||
*/
|
||||
forEach(callbackfn: (value: DataTransferItem, key: string, dataTransfer: DataTransfer) => void, thisArg?: any): void;
|
||||
forEach(callbackfn: (item: DataTransferItem, mimeType: string, dataTransfer: DataTransfer) => void, thisArg?: any): void;
|
||||
|
||||
/**
|
||||
* Get a new iterator with the `[mime, item]` pairs for each element in this data transfer.
|
||||
@ -10166,6 +10380,8 @@ declare module 'vscode' {
|
||||
* This includes drops from within the same tree.
|
||||
* The mime type of a tree is recommended to be of the format `application/vnd.code.tree.<treeidlowercase>`.
|
||||
*
|
||||
* Use the special `files` mime type to support all types of dropped files {@link DataTransferFile files}, regardless of the file's actual mime type.
|
||||
*
|
||||
* To learn the mime type of a dragged item:
|
||||
* 1. Set up your `DragAndDropController`
|
||||
* 2. Use the Developer: Set Log Level... command to set the level to "Debug"
|
||||
@ -10213,6 +10429,22 @@ declare module 'vscode' {
|
||||
handleDrop?(target: T | undefined, dataTransfer: DataTransfer, token: CancellationToken): Thenable<void> | void;
|
||||
}
|
||||
|
||||
/**
|
||||
* A badge presenting a value for a view
|
||||
*/
|
||||
export interface ViewBadge {
|
||||
|
||||
/**
|
||||
* A label to present in tooltip for the badge.
|
||||
*/
|
||||
readonly tooltip: string;
|
||||
|
||||
/**
|
||||
* The value to present in the badge.
|
||||
*/
|
||||
readonly value: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a Tree view
|
||||
*/
|
||||
@ -10266,6 +10498,12 @@ declare module 'vscode' {
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* The badge to display for this TreeView.
|
||||
* To remove the badge, set to undefined.
|
||||
*/
|
||||
badge?: ViewBadge | undefined;
|
||||
|
||||
/**
|
||||
* Reveals the given element in the tree view.
|
||||
* If the tree view is not visible then the tree view is shown and element is revealed.
|
||||
@ -10505,7 +10743,7 @@ declare module 'vscode' {
|
||||
* Whether the terminal process environment should be exactly as provided in
|
||||
* `TerminalOptions.env`. When this is false (default), the environment will be based on the
|
||||
* window's environment and also apply configured platform settings like
|
||||
* `terminal.integrated.windows.env` on top. When this is true, the complete environment
|
||||
* `terminal.integrated.env.windows` on top. When this is true, the complete environment
|
||||
* must be provided as nothing will be inherited from the process or any configuration.
|
||||
*/
|
||||
strictEnv?: boolean;
|
||||
@ -10779,6 +11017,41 @@ declare module 'vscode' {
|
||||
* without providing an exit code.
|
||||
*/
|
||||
readonly code: number | undefined;
|
||||
|
||||
/**
|
||||
* The reason that triggered the exit of a terminal.
|
||||
*/
|
||||
readonly reason: TerminalExitReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Terminal exit reason kind.
|
||||
*/
|
||||
export enum TerminalExitReason {
|
||||
/**
|
||||
* Unknown reason.
|
||||
*/
|
||||
Unknown = 0,
|
||||
|
||||
/**
|
||||
* The window closed/reloaded.
|
||||
*/
|
||||
Shutdown = 1,
|
||||
|
||||
/**
|
||||
* The shell process exited.
|
||||
*/
|
||||
Process = 2,
|
||||
|
||||
/**
|
||||
* The user closed the terminal.
|
||||
*/
|
||||
User = 3,
|
||||
|
||||
/**
|
||||
* An extension disposed the terminal.
|
||||
*/
|
||||
Extension = 4,
|
||||
}
|
||||
|
||||
/**
|
||||
@ -11048,7 +11321,7 @@ declare module 'vscode' {
|
||||
value: string;
|
||||
|
||||
/**
|
||||
* Optional placeholder in the filter text.
|
||||
* Optional placeholder shown in the filter textbox when no filter has been entered.
|
||||
*/
|
||||
placeholder: string | undefined;
|
||||
|
||||
@ -11140,7 +11413,18 @@ declare module 'vscode' {
|
||||
value: string;
|
||||
|
||||
/**
|
||||
* Optional placeholder in the filter text.
|
||||
* Selection range in the input value. Defined as tuple of two number where the
|
||||
* first is the inclusive start index and the second the exclusive end index. When `undefined` the whole
|
||||
* pre-filled value will be selected, when empty (start equals end) only the cursor will be set,
|
||||
* otherwise the defined range will be selected.
|
||||
*
|
||||
* This property does not get updated when the user types or makes a selection,
|
||||
* but it can be updated by the extension.
|
||||
*/
|
||||
valueSelection: readonly [number, number] | undefined;
|
||||
|
||||
/**
|
||||
* Optional placeholder shown when no value has been input.
|
||||
*/
|
||||
placeholder: string | undefined;
|
||||
|
||||
@ -11909,9 +12193,10 @@ declare module 'vscode' {
|
||||
* not be attempted, when a single edit fails.
|
||||
*
|
||||
* @param edit A workspace edit.
|
||||
* @param metadata Optional {@link WorkspaceEditMetadata metadata} for the edit.
|
||||
* @return A thenable that resolves when the edit could be applied.
|
||||
*/
|
||||
export function applyEdit(edit: WorkspaceEdit): Thenable<boolean>;
|
||||
export function applyEdit(edit: WorkspaceEdit, metadata?: WorkspaceEditMetadata): Thenable<boolean>;
|
||||
|
||||
/**
|
||||
* All text documents currently known to the editor.
|
||||
@ -12784,6 +13069,16 @@ declare module 'vscode' {
|
||||
*/
|
||||
export function registerLinkedEditingRangeProvider(selector: DocumentSelector, provider: LinkedEditingRangeProvider): Disposable;
|
||||
|
||||
/**
|
||||
* Registers a new {@link DocumentDropEditProvider}.
|
||||
*
|
||||
* @param selector A selector that defines the documents this provider applies to.
|
||||
* @param provider A drop provider.
|
||||
*
|
||||
* @return A {@link Disposable} that unregisters this provider when disposed of.
|
||||
*/
|
||||
export function registerDocumentDropEditProvider(selector: DocumentSelector, provider: DocumentDropEditProvider): Disposable;
|
||||
|
||||
/**
|
||||
* Set a {@link LanguageConfiguration language configuration} for a language.
|
||||
*
|
||||
@ -12937,7 +13232,7 @@ declare module 'vscode' {
|
||||
/**
|
||||
* The metadata of this cell. Can be anything but must be JSON-stringifyable.
|
||||
*/
|
||||
readonly metadata: { [key: string]: any };
|
||||
readonly metadata: { readonly [key: string]: any };
|
||||
|
||||
/**
|
||||
* The outputs of this cell.
|
||||
@ -13037,7 +13332,7 @@ declare module 'vscode' {
|
||||
export interface NotebookDocumentCellChange {
|
||||
|
||||
/**
|
||||
* The affected notebook.
|
||||
* The affected cell.
|
||||
*/
|
||||
readonly cell: NotebookCell;
|
||||
|
||||
@ -14551,6 +14846,26 @@ declare module 'vscode' {
|
||||
* If compact is true, debug sessions with a single child are hidden in the CALL STACK view to make the tree more compact.
|
||||
*/
|
||||
compact?: boolean;
|
||||
|
||||
/**
|
||||
* When true, a save will not be triggered for open editors when starting a debug session, regardless of the value of the `debug.saveBeforeStart` setting.
|
||||
*/
|
||||
suppressSaveBeforeStart?: boolean;
|
||||
|
||||
/**
|
||||
* When true, the debug toolbar will not be shown for this session.
|
||||
*/
|
||||
suppressDebugToolbar?: boolean;
|
||||
|
||||
/**
|
||||
* When true, the window statusbar color will not be changed for this session.
|
||||
*/
|
||||
suppressDebugStatusbar?: boolean;
|
||||
|
||||
/**
|
||||
* When true, the debug viewlet will not be automatically revealed for this session.
|
||||
*/
|
||||
suppressDebugView?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -15010,7 +15325,7 @@ declare module 'vscode' {
|
||||
/**
|
||||
* Optional commenting range provider. Provide a list {@link Range ranges} which support commenting to any given resource uri.
|
||||
*
|
||||
* If not provided, users can leave comments in any document opened in the editor.
|
||||
* If not provided, users cannot leave any comments.
|
||||
*/
|
||||
commentingRangeProvider?: CommentingRangeProvider;
|
||||
|
||||
@ -15321,6 +15636,82 @@ declare module 'vscode' {
|
||||
export function registerAuthenticationProvider(id: string, label: string, provider: AuthenticationProvider, options?: AuthenticationProviderOptions): Disposable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Namespace for localization-related functionality in the extension API. To use this properly,
|
||||
* you must have `l10n` defined in your extension manifest and have bundle.l10n.<language>.json files.
|
||||
* For more information on how to generate bundle.l10n.<language>.json files, check out the
|
||||
* [vscode-l10n repo](https://github.com/microsoft/vscode-l10n).
|
||||
*
|
||||
* Note: Built-in extensions (for example, Git, TypeScript Language Features, GitHub Authentication)
|
||||
* are excluded from the `l10n` property requirement. In other words, they do not need to specify
|
||||
* a `l10n` in the extension manifest because their translated strings come from Language Packs.
|
||||
*/
|
||||
export namespace l10n {
|
||||
/**
|
||||
* Marks a string for localization. If a localized bundle is available for the language specified by
|
||||
* {@link env.language} and the bundle has a localized value for this message, then that localized
|
||||
* value will be returned (with injected {@link args} values for any templated values).
|
||||
* @param message - The message to localize. Supports index templating where strings like `{0}` and `{1}` are
|
||||
* replaced by the item at that index in the {@link args} array.
|
||||
* @param args - The arguments to be used in the localized string. The index of the argument is used to
|
||||
* match the template placeholder in the localized string.
|
||||
* @returns localized string with injected arguments.
|
||||
* @example `l10n.t('Hello {0}!', 'World');`
|
||||
*/
|
||||
export function t(message: string, ...args: Array<string | number | boolean>): string;
|
||||
|
||||
/**
|
||||
* Marks a string for localization. If a localized bundle is available for the language specified by
|
||||
* {@link env.language} and the bundle has a localized value for this message, then that localized
|
||||
* value will be returned (with injected {@link args} values for any templated values).
|
||||
* @param message The message to localize. Supports named templating where strings like `{foo}` and `{bar}` are
|
||||
* replaced by the value in the Record for that key (foo, bar, etc).
|
||||
* @param args The arguments to be used in the localized string. The name of the key in the record is used to
|
||||
* match the template placeholder in the localized string.
|
||||
* @returns localized string with injected arguments.
|
||||
* @example `l10n.t('Hello {name}', { name: 'Erich' });`
|
||||
*/
|
||||
export function t(message: string, args: Record<string, any>): string;
|
||||
/**
|
||||
* Marks a string for localization. If a localized bundle is available for the language specified by
|
||||
* {@link env.language} and the bundle has a localized value for this message, then that localized
|
||||
* value will be returned (with injected args values for any templated values).
|
||||
* @param options The options to use when localizing the message.
|
||||
* @returns localized string with injected arguments.
|
||||
*/
|
||||
export function t(options: {
|
||||
/**
|
||||
* The message to localize. If {@link args} is an array, this message supports index templating where strings like
|
||||
* `{0}` and `{1}` are replaced by the item at that index in the {@link args} array. If `args` is a `Record<string, any>`,
|
||||
* this supports named templating where strings like `{foo}` and `{bar}` are replaced by the value in
|
||||
* the Record for that key (foo, bar, etc).
|
||||
*/
|
||||
message: string;
|
||||
/**
|
||||
* The arguments to be used in the localized string. As an array, the index of the argument is used to
|
||||
* match the template placeholder in the localized string. As a Record, the key is used to match the template
|
||||
* placeholder in the localized string.
|
||||
*/
|
||||
args?: Array<string | number | boolean> | Record<string, any>;
|
||||
/**
|
||||
* A comment to help translators understand the context of the message.
|
||||
*/
|
||||
comment: string | string[];
|
||||
}): string;
|
||||
/**
|
||||
* The bundle of localized strings that have been loaded for the extension.
|
||||
* It's undefined if no bundle has been loaded. The bundle is typically not loaded if
|
||||
* there was no bundle found or when we are running with the default language.
|
||||
*/
|
||||
export const bundle: { [key: string]: string } | undefined;
|
||||
/**
|
||||
* The URI of the localization bundle that has been loaded for the extension.
|
||||
* It's undefined if no bundle has been loaded. The bundle is typically not loaded if
|
||||
* there was no bundle found or when we are running with the default language.
|
||||
*/
|
||||
export const uri: Uri | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Namespace for testing functionality. Tests are published by registering
|
||||
* {@link TestController} instances, then adding {@link TestItem TestItems}.
|
||||
@ -15552,9 +15943,9 @@ declare module 'vscode' {
|
||||
|
||||
/**
|
||||
* A TestRunRequest is a precursor to a {@link TestRun}, which in turn is
|
||||
* created by passing a request to {@link tests.runTests}. The TestRunRequest
|
||||
* contains information about which tests should be run, which should not be
|
||||
* run, and how they are run (via the {@link TestRunRequest.profile profile}).
|
||||
* created by passing a request to {@link TestController.createTestRun}. The
|
||||
* TestRunRequest contains information about which tests should be run, which
|
||||
* should not be run, and how they are run (via the {@link TestRunRequest.profile profile}).
|
||||
*
|
||||
* In general, TestRunRequests are created by the editor and pass to
|
||||
* {@link TestRunProfile.runHandler}, however you can also create test
|
||||
@ -15597,7 +15988,8 @@ declare module 'vscode' {
|
||||
}
|
||||
|
||||
/**
|
||||
* Options given to {@link TestController.runTests}
|
||||
* A TestRun represents an in-progress or completed test run and
|
||||
* provides methods to report the state of individual tests in the run.
|
||||
*/
|
||||
export interface TestRun {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user