Merge from vscode merge-base (#22780)

* Revert "Revert "Merge from vscode merge-base (#22769)" (#22779)"

This reverts commit 47a1745180.

* Fix notebook download task

* Remove done call from extensions-ci
This commit is contained in:
Karl Burtram
2023-04-19 21:48:46 -07:00
committed by GitHub
parent decbe8dded
commit e7d3d047ec
2389 changed files with 92155 additions and 42602 deletions

View File

@@ -766,8 +766,9 @@ declare module 'vscode' {
/**
* An optional flag that controls if an {@link TextEditor editor}-tab shows as preview. Preview tabs will
* be replaced and reused until set to stay - either explicitly or through editing. The default behaviour depends
* on the `workbench.editor.enablePreview`-setting.
* be replaced and reused until set to stay - either explicitly or through editing.
*
* *Note* that the flag is ignored if a user has disabled preview editors in settings.
*/
preview?: boolean;
@@ -777,6 +778,67 @@ declare module 'vscode' {
selection?: Range;
}
/**
* Represents an event describing the change in a {@link NotebookEditor.selections notebook editor's selections}.
*/
export interface NotebookEditorSelectionChangeEvent {
/**
* The {@link NotebookEditor notebook editor} for which the selections have changed.
*/
readonly notebookEditor: NotebookEditor;
/**
* The new value for the {@link NotebookEditor.selections notebook editor's selections}.
*/
readonly selections: readonly NotebookRange[];
}
/**
* Represents an event describing the change in a {@link NotebookEditor.visibleRanges notebook editor's visibleRanges}.
*/
export interface NotebookEditorVisibleRangesChangeEvent {
/**
* The {@link NotebookEditor notebook editor} for which the visible ranges have changed.
*/
readonly notebookEditor: NotebookEditor;
/**
* The new value for the {@link NotebookEditor.visibleRanges notebook editor's visibleRanges}.
*/
readonly visibleRanges: readonly NotebookRange[];
}
/**
* Represents options to configure the behavior of showing a {@link NotebookDocument notebook document} in an {@link NotebookEditor notebook editor}.
*/
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.
*/
readonly viewColumn?: ViewColumn;
/**
* An optional flag that when `true` will stop the {@link NotebookEditor notebook editor} from taking focus.
*/
readonly preserveFocus?: boolean;
/**
* An optional flag that controls if an {@link NotebookEditor notebook editor}-tab shows as preview. Preview tabs will
* be replaced and reused until set to stay - either explicitly or through editing. The default behaviour depends
* on the `workbench.editor.enablePreview`-setting.
*/
readonly preview?: boolean;
/**
* An optional selection to apply for the document in the {@link NotebookEditor notebook editor}.
*/
readonly selections?: readonly NotebookRange[];
}
/**
* A reference to one of the workbench colors as defined in https://code.visualstudio.com/docs/getstarted/theme-color-reference.
* Using a theme color is preferred over a custom color as it gives theme authors and users the possibility to change the color.
@@ -1546,6 +1608,7 @@ declare module 'vscode' {
/**
* The event listeners can subscribe to.
*/
// {{SQL CARBON EDIT}}
// eslint-disable-next-line vscode-dts-event-naming
event: Event<T>;
@@ -1576,34 +1639,34 @@ declare module 'vscode' {
* true if this file system watcher has been created such that
* it ignores creation file system events.
*/
ignoreCreateEvents: boolean;
readonly ignoreCreateEvents: boolean;
/**
* true if this file system watcher has been created such that
* it ignores change file system events.
*/
ignoreChangeEvents: boolean;
readonly ignoreChangeEvents: boolean;
/**
* true if this file system watcher has been created such that
* it ignores delete file system events.
*/
ignoreDeleteEvents: boolean;
readonly ignoreDeleteEvents: boolean;
/**
* An event which fires on file/folder creation.
*/
onDidCreate: Event<Uri>;
readonly onDidCreate: Event<Uri>;
/**
* An event which fires on file/folder change.
*/
onDidChange: Event<Uri>;
readonly onDidChange: Event<Uri>;
/**
* An event which fires on file/folder deletion.
*/
onDidDelete: Event<Uri>;
readonly onDidDelete: Event<Uri>;
}
/**
@@ -1913,6 +1976,32 @@ declare module 'vscode' {
detail?: string;
}
/**
* Impacts the behavior and appearance of the validation message.
*/
export enum InputBoxValidationSeverity {
Info = 1,
Warning = 2,
Error = 3
}
/**
* Object to configure the behavior of the validation message.
*/
export interface InputBoxValidationMessage {
/**
* The validation message to display.
*/
readonly message: string;
/**
* The severity of the validation message.
* NOTE: When using `InputBoxValidationSeverity.Error`, the user will not be allowed to accept (hit ENTER) the input.
* `Info` and `Warning` will still allow the InputBox to accept the input.
*/
readonly severity: InputBoxValidationSeverity;
}
/**
* Options to configure the behavior of the input box UI.
*/
@@ -1962,10 +2051,11 @@ declare module 'vscode' {
* to the user.
*
* @param value The current value of the input box.
* @return A human-readable string which is presented as diagnostic message.
* Return `undefined`, `null`, or the empty string when 'value' is valid.
* @return Either a human-readable string which is presented as an error message or an {@link InputBoxValidationMessage}
* which can provide a specific message severity. Return `undefined`, `null`, or the empty string when 'value' is valid.
*/
validateInput?(value: string): string | undefined | null | Thenable<string | undefined | null>;
validateInput?(value: string): string | InputBoxValidationMessage | undefined | null |
Thenable<string | InputBoxValidationMessage | undefined | null>;
}
/**
@@ -3949,7 +4039,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;
@@ -4410,6 +4500,144 @@ declare module 'vscode' {
resolveCompletionItem?(item: T, token: CancellationToken): ProviderResult<T>;
}
/**
* The inline completion item provider interface defines the contract between extensions and
* the inline completion feature.
*
* Providers are asked for completions either explicitly by a user gesture or implicitly when typing.
*/
export interface InlineCompletionItemProvider {
/**
* Provides inline completion items for the given position and document.
* If inline completions are enabled, this method will be called whenever the user stopped typing.
* It will also be called when the user explicitly triggers inline completions or explicitly asks for the next or previous inline completion.
* In that case, all available inline completions should be returned.
* `context.triggerKind` can be used to distinguish between these scenarios.
*
* @param document The document inline completions are requested for.
* @param position The position inline completions are requested for.
* @param context A context object with additional information.
* @param token A cancellation token.
* @return An array of completion items or a thenable that resolves to an array of completion items.
*/
provideInlineCompletionItems(document: TextDocument, position: Position, context: InlineCompletionContext, token: CancellationToken): ProviderResult<InlineCompletionItem[] | InlineCompletionList>;
}
/**
* Represents a collection of {@link InlineCompletionItem inline completion items} to be presented
* in the editor.
*/
export class InlineCompletionList {
/**
* The inline completion items.
*/
items: InlineCompletionItem[];
/**
* Creates a new list of inline completion items.
*/
constructor(items: InlineCompletionItem[]);
}
/**
* Provides information about the context in which an inline completion was requested.
*/
export interface InlineCompletionContext {
/**
* Describes how the inline completion was triggered.
*/
readonly triggerKind: InlineCompletionTriggerKind;
/**
* Provides information about the currently selected item in the autocomplete widget if it is visible.
*
* If set, provided inline completions must extend the text of the selected item
* and use the same range, otherwise they are not shown as preview.
* As an example, if the document text is `console.` and the selected item is `.log` replacing the `.` in the document,
* the inline completion must also replace `.` and start with `.log`, for example `.log()`.
*
* Inline completion providers are requested again whenever the selected item changes.
*/
readonly selectedCompletionInfo: SelectedCompletionInfo | undefined;
}
/**
* Describes the currently selected completion item.
*/
export interface SelectedCompletionInfo {
/**
* The range that will be replaced if this completion item is accepted.
*/
readonly range: Range;
/**
* The text the range will be replaced with if this completion is accepted.
*/
readonly text: string;
}
/**
* Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.
*/
export enum InlineCompletionTriggerKind {
/**
* Completion was triggered explicitly by a user gesture.
* Return multiple completion items to enable cycling through them.
*/
Invoke = 0,
/**
* Completion was triggered automatically while editing.
* It is sufficient to return a single completion item in this case.
*/
Automatic = 1,
}
/**
* An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.
*
* @see {@link InlineCompletionItemProvider.provideInlineCompletionItems}
*/
export class InlineCompletionItem {
/**
* The text to replace the range with. Must be set.
* Is used both for the preview and the accept operation.
*/
insertText: string | SnippetString;
/**
* A text that is used to decide if this inline completion should be shown. When `falsy`
* the {@link InlineCompletionItem.insertText} is used.
*
* An inline completion is shown if the text to replace is a prefix of the filter text.
*/
filterText?: string;
/**
* The range to replace.
* Must begin and end on the same line.
*
* Prefer replacements over insertions to provide a better experience when the user deletes typed text.
*/
range?: Range;
/**
* An optional {@link Command} that is executed *after* inserting this completion.
*/
command?: Command;
/**
* Creates a new inline completion item.
*
* @param insertText The text to replace the range with.
* @param range The range to replace. If not set, the word at the requested position will be used.
* @param command An optional {@link Command} that is executed *after* inserting this completion.
*/
constructor(insertText: string | SnippetString, range?: Range, command?: Command);
}
/**
* A document link is a range in a text document that links to an internal or external resource, like another
* text document or a web site.
@@ -5181,6 +5409,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.
@@ -5753,7 +6023,7 @@ declare module 'vscode' {
* To get an instance of a `DiagnosticCollection` use
* {@link languages.createDiagnosticCollection createDiagnosticCollection}.
*/
export interface DiagnosticCollection {
export interface DiagnosticCollection extends Iterable<[uri: Uri, diagnostics: readonly Diagnostic[]]> {
/**
* The name of this diagnostic collection, for instance `typescript`. Every diagnostic
@@ -9094,6 +9364,43 @@ declare module 'vscode' {
*/
export const onDidChangeTextEditorViewColumn: Event<TextEditorViewColumnChangeEvent>;
/**
* The currently visible {@link NotebookEditor notebook editors} or an empty array.
*/
export const visibleNotebookEditors: readonly NotebookEditor[];
/**
* An {@link Event} which fires when the {@link window.visibleNotebookEditors visible notebook editors}
* has changed.
*/
export const onDidChangeVisibleNotebookEditors: Event<readonly NotebookEditor[]>;
/**
* The currently active {@link NotebookEditor notebook editor} or `undefined`. The active editor is the one
* that currently has focus or, when none has focus, the one that has changed
* input most recently.
*/
export const activeNotebookEditor: NotebookEditor | undefined;
/**
* An {@link Event} which fires when the {@link window.activeNotebookEditor active notebook editor}
* has changed. *Note* that the event also fires when the active editor changes
* to `undefined`.
*/
export const onDidChangeActiveNotebookEditor: Event<NotebookEditor | undefined>;
/**
* An {@link Event} which fires when the {@link NotebookEditor.selections notebook editor selections}
* have changed.
*/
export const onDidChangeNotebookEditorSelection: Event<NotebookEditorSelectionChangeEvent>;
/**
* An {@link Event} which fires when the {@link NotebookEditor.visibleRanges notebook editor visible ranges}
* have changed.
*/
export const onDidChangeNotebookEditorVisibleRanges: Event<NotebookEditorVisibleRangesChangeEvent>;
/**
* The currently opened terminals or an empty array.
*/
@@ -9173,6 +9480,16 @@ declare module 'vscode' {
*/
export function showTextDocument(uri: Uri, options?: TextDocumentShowOptions): Thenable<TextEditor>;
/**
* Show the given {@link NotebookDocument} in a {@link NotebookEditor notebook editor}.
*
* @param document A text document to be shown.
* @param options {@link NotebookDocumentShowOptions Editor options} to configure the behavior of showing the {@link NotebookEditor notebook editor}.
*
* @return A promise that resolves to an {@link NotebookEditor notebook editor}.
*/
export function showNotebookDocument(document: NotebookDocument, options?: NotebookDocumentShowOptions): Thenable<NotebookEditor>;
/**
* Create a TextEditorDecorationType that can be used to add decorations to text editors.
*
@@ -9780,18 +10097,62 @@ declare module 'vscode' {
* `true` if the {@link TreeView tree view} is visible otherwise `false`.
*/
readonly visible: boolean;
}
/**
* A class for encapsulating data transferred during a drag and drop event.
*
* You can use the `value` of the `DataTransferItem` to get back the object you put into it
* so long as the extension that created the `DataTransferItem` runs in the same extension host.
* A file associated with a {@linkcode DataTransferItem}.
*/
export interface DataTransferFile {
/**
* The name of the file.
*/
readonly name: string;
/**
* The full file path of the file.
*
* May be `undefined` on web.
*/
readonly uri?: Uri;
/**
* The full file contents of the file.
*/
data(): Thenable<Uint8Array>;
}
/**
* Encapsulates data transferred during drag and drop operations.
*/
export class DataTransferItem {
/**
* Get a string representation of this item.
*
* If {@linkcode DataTransferItem.value} is an object, this returns the result of json stringifying {@linkcode DataTransferItem.value} value.
*/
asString(): Thenable<string>;
/**
* Try getting the {@link DataTransferFile file} associated with this data transfer item.
*
* Note that the file object is only valid for the scope of the drag and drop operation.
*
* @returns The file for the data transfer or `undefined` if the item is either not a file or the
* file data cannot be accessed.
*/
asFile(): DataTransferFile | undefined;
/**
* Custom data stored on this item.
*
* You can use `value` to share data across operations. The original object can be retrieved so long as the extension that
* created the `DataTransferItem` runs in the same extension host.
*/
readonly value: any;
/**
* @param value Custom data stored on this item. Can be retrieved using {@linkcode DataTransferItem.value}.
*/
constructor(value: any);
}
@@ -9802,14 +10163,14 @@ declare module 'vscode' {
* data transfer. These additional mime types will only be included in the `handleDrop` when the the drag was initiated from
* an element in the same drag and drop controller.
*/
export class DataTransfer {
export class DataTransfer implements Iterable<[mimeType: string, item: DataTransferItem]> {
/**
* Retrieves the data transfer item for a given mime type.
*
* @param mimeType The mime type to get the data transfer item for, such as `text/plain` or `image/png`.
*
* Special mime types:
* - `text/uri-list` — A string with `toString()`ed Uris separated by newlines. To specify a cursor position in the file,
* - `text/uri-list` — A string with `toString()`ed Uris separated by `\r\n`. To specify a cursor position in the file,
* set the Uri's fragment to `L3,5`, where 3 is the line number and 5 is the column number.
*/
get(mimeType: string): DataTransferItem | undefined;
@@ -9823,9 +10184,16 @@ declare module 'vscode' {
/**
* Allows iteration through the data transfer items.
*
* @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) => void): 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.
*/
[Symbol.iterator](): IterableIterator<[mimeType: string, item: DataTransferItem]>;
}
/**
@@ -9841,6 +10209,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"
@@ -10492,7 +10862,7 @@ declare module 'vscode' {
/**
* A collection of mutations that an extension can apply to a process environment.
*/
export interface EnvironmentVariableCollection {
export interface EnvironmentVariableCollection extends Iterable<[variable: string, mutator: EnvironmentVariableMutator]> {
/**
* Whether the collection should be cached for the workspace and applied to the terminal
* across window reloads. When true the collection will be active immediately such when the
@@ -10851,8 +11221,10 @@ declare module 'vscode' {
/**
* An optional validation message indicating a problem with the current input value.
* By returning a string, the InputBox will use a default {@link InputBoxValidationSeverity} of Error.
* Returning undefined clears the validation message.
*/
validationMessage: string | undefined;
validationMessage: string | InputBoxValidationMessage | undefined;
}
/**
@@ -12067,6 +12439,19 @@ declare module 'vscode' {
*/
export function registerCompletionItemProvider(selector: DocumentSelector, provider: CompletionItemProvider, ...triggerCharacters: string[]): Disposable;
/**
* Registers an inline completion provider.
*
* Multiple providers can be registered for a language. 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.
*
* @param selector A selector that defines the documents this provider is applicable to.
* @param provider An inline completion provider.
* @return A {@link Disposable} that unregisters this provider when being disposed.
*/
export function registerInlineCompletionItemProvider(selector: DocumentSelector, provider: InlineCompletionItemProvider): Disposable;
/**
* Register a code action provider.
*
@@ -12444,6 +12829,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.
*
@@ -12452,7 +12847,32 @@ declare module 'vscode' {
* @return A {@link Disposable} that unsets this configuration.
*/
export function setLanguageConfiguration(language: string, configuration: LanguageConfiguration): Disposable;
}
/**
* Represents a notebook editor that is attached to a {@link NotebookDocument notebook}.
*/
export enum NotebookEditorRevealType {
/**
* The range will be revealed with as little scrolling as possible.
*/
Default = 0,
/**
* The range will always be revealed in the center of the viewport.
*/
InCenter = 1,
/**
* If the range is outside the viewport, it will be revealed in the center of the viewport.
* Otherwise, it will be revealed with as little scrolling as possible.
*/
InCenterIfOutsideViewport = 2,
/**
* The range will always be revealed at the top of the viewport.
*/
AtTop = 3
}
/**
@@ -12462,6 +12882,40 @@ declare module 'vscode' {
*/
export interface NotebookEditor {
/**
* The {@link NotebookDocument notebook document} associated with this notebook editor.
*/
readonly notebook: NotebookDocument;
/**
* The primary selection in this notebook editor.
*/
selection: NotebookRange;
/**
* All selections in this notebook editor.
*
* The primary selection (or focused range) is `selections[0]`. When the document has no cells, the primary selection is empty `{ start: 0, end: 0 }`;
*/
selections: readonly NotebookRange[];
/**
* The current visible ranges in the editor (vertically).
*/
readonly visibleRanges: readonly NotebookRange[];
/**
* The column in which this editor shows.
*/
readonly viewColumn?: ViewColumn;
/**
* Scroll as indicated by `revealType` in order to reveal the given range.
*
* @param range A range.
* @param revealType The scrolling strategy for revealing `range`.
*/
revealRange(range: NotebookRange, revealType?: NotebookEditorRevealType): void;
}
/**
@@ -13407,6 +13861,11 @@ declare module 'vscode' {
*/
placeholder: string;
/**
* Controls whether the input box is enabled (default is `true`).
*/
enabled: boolean;
/**
* Controls whether the input box is visible (default is `true`).
*/
@@ -14606,7 +15065,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;
@@ -14724,7 +15183,10 @@ declare module 'vscode' {
* If true, a modal dialog will be shown asking the user to sign in again. This is mostly used for scenarios
* where the token needs to be re minted because it has lost some authorization.
*
* Defaults to false.
* If there are no existing sessions and forceNewSession is true, it will behave identically to
* {@link AuthenticationGetSessionOptions.createIfNone createIfNone}.
*
* This defaults to false.
*/
forceNewSession?: boolean | { detail: string };
@@ -15279,7 +15741,7 @@ declare module 'vscode' {
* Collection of test items, found in {@link TestItem.children} and
* {@link TestController.items}.
*/
export interface TestItemCollection {
export interface TestItemCollection extends Iterable<[id: string, testItem: TestItem]> {
/**
* Gets the number of items in the collection.
*/
@@ -15297,7 +15759,7 @@ declare module 'vscode' {
* @param callback Function to execute for each entry.
* @param thisArg The `this` context used when invoking the handler function.
*/
forEach(callback: (item: TestItem, collection: TestItemCollection) => unknown, thisArg?: unknown): void;
forEach(callback: (item: TestItem, collection: TestItemCollection) => unknown, thisArg?: any): void;
/**
* Adds the test item to the children. If an item with the same ID already

View File

@@ -0,0 +1,6 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// empty placeholder declaration for the `contribEditSessions`-contribution point

View File

@@ -0,0 +1,6 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// empty placeholder declaration for the `mergeEditor/toolbar` menu

View File

@@ -0,0 +1,6 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// empty placeholder declaration for the `file/share`-submenu contribution point

View File

@@ -0,0 +1,17 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// empty placeholder for view size
// https://github.com/microsoft/vscode/issues/122283 @alexr00
/**
* View contributions can include a `size`, which can be a number. A number works similar to the css flex property.
*
* For example, if you have 3 views, with sizes 1, 1, and 2, the views of size 1 will together take up the same amount of space as the view of size 2.
*
* A number value will only be used as an initial size. After a user has changed the size of the view, the user's choice will be restored.
*/

View File

@@ -0,0 +1,6 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// empty placeholder declaration for the `webview/context`-menu contribution point

View File

@@ -0,0 +1,75 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/30066/
/**
* Provider invoked when the user copies and pastes code.
*/
interface DocumentPasteEditProvider {
/**
* Optional method invoked after the user copies text in a file.
*
* During {@link prepareDocumentPaste}, an extension can compute metadata that is attached to
* a {@link DataTransfer} and is passed back to the provider in {@link provideDocumentPasteEdits}.
*
* @param document Document where the copy took place.
* @param ranges Ranges being copied in the `document`.
* @param dataTransfer The data transfer associated with the copy. You can store additional values on this for later use in {@link provideDocumentPasteEdits}.
* @param token A cancellation token.
*/
prepareDocumentPaste?(document: TextDocument, ranges: readonly Range[], dataTransfer: DataTransfer, token: CancellationToken): void | Thenable<void>;
/**
* Invoked before the user pastes into a document.
*
* In this method, extensions can return a workspace edit that replaces the standard pasting behavior.
*
* @param document Document being pasted into
* @param ranges Currently selected ranges in the document.
* @param dataTransfer The data transfer associated with the paste.
* @param token A cancellation token.
*
* @return Optional workspace edit that applies the paste. Return undefined to use standard pasting.
*/
provideDocumentPasteEdits(document: TextDocument, ranges: readonly Range[], dataTransfer: DataTransfer, token: CancellationToken): ProviderResult<DocumentPasteEdit>;
}
/**
* An operation applied on paste
*/
class DocumentPasteEdit {
/**
* The text or snippet to insert at the pasted locations.
*/
readonly insertText: string | SnippetString;
/**
* An optional additional edit to apply on paste.
*/
readonly additionalEdit?: WorkspaceEdit;
/**
* @param insertText The text or snippet to insert at the pasted locations.
*/
constructor(insertText: string | SnippetString);
}
interface DocumentPasteProviderMetadata {
/**
* Mime types that `provideDocumentPasteEdits` should be invoked for.
*
* Use the special `files` mimetype to indicate the provider should be invoked if any files are present in the `DataTransfer`.
*/
readonly pasteMimeTypes: readonly string[];
}
namespace languages {
export function registerDocumentPasteEditProvider(selector: DocumentSelector, provider: DocumentPasteEditProvider, metadata: DocumentPasteProviderMetadata): Disposable;
}
}

View File

@@ -1,174 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/124024 @hediet @alexdima
export namespace languages {
/**
* Registers an inline completion provider.
*
* @return A {@link Disposable} that unregisters this provider when being disposed.
*/
// TODO@API what are the rules when multiple providers apply
export function registerInlineCompletionItemProvider(selector: DocumentSelector, provider: InlineCompletionItemProvider): Disposable;
}
export interface InlineCompletionItemProvider<T extends InlineCompletionItem = InlineCompletionItem> {
/**
* Provides inline completion items for the given position and document.
* If inline completions are enabled, this method will be called whenever the user stopped typing.
* It will also be called when the user explicitly triggers inline completions or asks for the next or previous inline completion.
* Use `context.triggerKind` to distinguish between these scenarios.
*/
provideInlineCompletionItems(document: TextDocument, position: Position, context: InlineCompletionContext, token: CancellationToken): ProviderResult<InlineCompletionList<T> | T[]>;
}
export interface InlineCompletionContext {
/**
* How the completion was triggered.
*/
readonly triggerKind: InlineCompletionTriggerKind;
/**
* Provides information about the currently selected item in the autocomplete widget if it is visible.
*
* If set, provided inline completions must extend the text of the selected item
* and use the same range, otherwise they are not shown as preview.
* As an example, if the document text is `console.` and the selected item is `.log` replacing the `.` in the document,
* the inline completion must also replace `.` and start with `.log`, for example `.log()`.
*
* Inline completion providers are requested again whenever the selected item changes.
*
* The user must configure `"editor.suggest.preview": true` for this feature.
*/
readonly selectedCompletionInfo: SelectedCompletionInfo | undefined;
}
// TODO@API remove kind, snippet properties
// TODO@API find a better name, xyzFilter, xyzConstraint
export interface SelectedCompletionInfo {
range: Range;
text: string;
completionKind: CompletionItemKind;
isSnippetText: boolean;
}
/**
* How an {@link InlineCompletionItemProvider inline completion provider} was triggered.
*/
// TODO@API align with CodeActionTriggerKind
// (1) rename Explicit to Invoke
// (2) swap order of Invoke and Automatic
export enum InlineCompletionTriggerKind {
/**
* Completion was triggered automatically while editing.
* It is sufficient to return a single completion item in this case.
*/
Automatic = 0,
/**
* Completion was triggered explicitly by a user gesture.
* Return multiple completion items to enable cycling through them.
*/
Explicit = 1,
}
/**
* @deprecated Return an array of Inline Completion items directly. Will be removed eventually.
*/
// TODO@API We could keep this and allow for `vscode.Command` instances that explain
// the result. That would replace the existing proposed menu-identifier and be more LSP friendly
// TODO@API maybe use MarkdownString
export class InlineCompletionList<T extends InlineCompletionItem = InlineCompletionItem> {
items: T[];
// command: Command; "Show More..."
// description: MarkdownString
/**
* @deprecated Return an array of Inline Completion items directly. Will be removed eventually.
*/
constructor(items: T[]);
}
export class InlineCompletionItem {
/**
* The text to replace the range with. Must be set.
* Is used both for the preview and the accept operation.
*
* The text the range refers to must be a subword of this value (`AB` and `BEF` are subwords of `ABCDEF`, but `Ab` is not).
* Additionally, if possible, it should be a prefix of this value for a better user-experience.
*
* However, any indentation of the text to replace does not matter for the subword constraint.
* Thus, ` B` can be replaced with ` ABC`, effectively removing a whitespace and inserting `A` and `C`.
*/
insertText?: string | SnippetString;
/**
* @deprecated Use `insertText` instead. Will be removed eventually.
*/
text?: string;
/**
* The range to replace.
* Must begin and end on the same line.
*
* Prefer replacements over insertions to avoid cache invalidation:
* Instead of reporting a completion that inserts an extension at the end of a word,
* the whole word (or even the whole line) should be replaced with the extended word (or extended line) to improve the UX.
* That way, when the user presses backspace, the cache can be reused and there is no flickering.
*/
range?: Range;
/**
* An optional {@link Command} that is executed *after* inserting this completion.
*/
command?: Command;
constructor(insertText: string, range?: Range, command?: Command);
}
// TODO@API move "never" API into new proposal
export interface InlineCompletionItem {
/**
* If set to `true`, unopened closing brackets are removed and unclosed opening brackets are closed.
* Defaults to `false`.
*/
completeBracketPairs?: boolean;
}
/**
* Be aware that this API will not ever be finalized.
*/
export namespace window {
// TODO@API move into provider (just like internal API). Only read property if proposal is enabled!
export function getInlineCompletionItemController<T extends InlineCompletionItem>(provider: InlineCompletionItemProvider<T>): InlineCompletionController<T>;
}
/**
* Be aware that this API will not ever be finalized.
*/
export interface InlineCompletionController<T extends InlineCompletionItem> {
/**
* Is fired when an inline completion item is shown to the user.
*/
// eslint-disable-next-line vscode-dts-event-naming
readonly onDidShowCompletionItem: Event<InlineCompletionItemDidShowEvent<T>>;
}
/**
* Be aware that this API will not ever be finalized.
*/
export interface InlineCompletionItemDidShowEvent<T extends InlineCompletionItem> {
completionItem: T;
}
}

View File

@@ -19,4 +19,25 @@ declare module 'vscode' {
// eslint-disable-next-line vscode-dts-provider-naming
handleDidShowCompletionItem?(completionItem: InlineCompletionItemNew): void;
}
export interface InlineCompletionItem {
/**
* If set to `true`, unopened closing brackets are removed and unclosed opening brackets are closed.
* Defaults to `false`.
*/
completeBracketPairs?: boolean;
}
export interface InlineCompletionItemProvider {
// eslint-disable-next-line vscode-dts-provider-naming
handleDidShowCompletionItem?(completionItem: InlineCompletionItem): void;
}
// When finalizing `commands`, make sure to add a corresponding constructor parameter.
export interface InlineCompletionList {
/**
* A list of commands associated with the inline completions of this list.
*/
commands?: Command[];
}
}

View File

@@ -35,11 +35,16 @@ declare module 'vscode' {
/**
* Provides inline completion items for the given position and document.
* If inline completions are enabled, this method will be called whenever the user stopped typing.
* It will also be called when the user explicitly triggers inline completions or asks for the next or previous inline completion.
* It will also be called when the user explicitly triggers inline completions or explicitly asks for the next or previous inline completion.
* In that case, all available inline completions should be returned.
* `context.triggerKind` can be used to distinguish between these scenarios.
*
* @param document The document inline completions are requested for.
* @param position The position inline completions are requested for.
* @param context A context object with additional information.
* @param token A cancellation token.
* @return An array of completion items or a thenable that resolves to an array of completion items.
*/
// TODO@API clarify "or asks for the next or previous inline completion"? Why would I return N items in the first place?
// TODO@API jsdoc for args, return-type
provideInlineCompletionItems(document: TextDocument, position: Position, context: InlineCompletionContextNew, token: CancellationToken): ProviderResult<InlineCompletionListNew | InlineCompletionItemNew[]>;
}
@@ -101,7 +106,6 @@ declare module 'vscode' {
* Represents a collection of {@link InlineCompletionItemNew inline completion items} to be presented
* in the editor.
*/
// TODO@API let keep this in `Additions` because of the insecurity about commands vs description
export class InlineCompletionListNew {
/**
* The inline completion items.
@@ -113,7 +117,9 @@ declare module 'vscode' {
*/
commands?: Command[];
// TODO@API jsdocs
/**
* Creates a new list of inline completion items with optionally given commands.
*/
constructor(items: InlineCompletionItemNew[], commands?: Command[]);
}
@@ -141,11 +147,7 @@ declare module 'vscode' {
* The range to replace.
* Must begin and end on the same line.
*
* TODO@API caching is an imlementation detail. drop that explanation?
* Prefer replacements over insertions to avoid cache invalidation:
* Instead of reporting a completion that inserts an extension at the end of a word,
* the whole word (or even the whole line) should be replaced with the extended word (or extended line) to improve the UX.
* That way, when the user presses backspace, the cache can be reused and there is no flickering.
* Prefer replacements over insertions to provide a better experience when the user deletes typed text.
*/
range?: Range;

View File

@@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/144944
/**
* Impacts the behavior and appearance of the validation message.
*/
export enum InputBoxValidationSeverity {
Info = 1,
Warning = 2,
Error = 3
}
/**
* Object to configure the behavior of the validation message.
*/
export interface InputBoxValidationMessage {
/**
* The validation message to display.
*/
readonly message: string;
/**
* The severity of the validation message.
* NOTE: When using `InputBoxValidationSeverity.Error`, the user will not be allowed to accept (hit ENTER) the input.
* `Info` and `Warning` will still allow the InputBox to accept the input.
*/
readonly severity: InputBoxValidationSeverity;
}
export interface InputBoxOptions {
/**
* The validation message to display. This will become the new {@link InputBoxOptions#validateInput} upon finalization.
*/
validateInput2?(value: string): string | InputBoxValidationMessage | undefined | null |
Thenable<string | InputBoxValidationMessage | undefined | null>;
}
export interface InputBox {
/**
* The validation message to display. This will become the new {@link InputBox#validationMessage} upon finalization.
*/
validationMessage2: string | InputBoxValidationMessage | undefined;
}
}

View File

@@ -0,0 +1,25 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
/**
* The tab represents an interactive window.
*/
export class TabInputInteractiveWindow {
/**
* The uri of the history notebook in the interactive window.
*/
readonly uri: Uri;
/**
* The uri of the input box in the interactive window.
*/
readonly inputBoxUri: Uri;
private constructor(uri: Uri, inputBoxUri: Uri);
}
export interface Tab {
readonly input: TabInputText | TabInputTextDiff | TabInputCustom | TabInputWebview | TabInputNotebook | TabInputNotebookDiff | TabInputTerminal | TabInputInteractiveWindow | unknown;
}
}

View File

@@ -5,8 +5,9 @@
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/106744
// https://github.com/microsoft/vscode/issues/147248
/** @deprecated */
interface NotebookDocumentBackup {
/**
* Unique identifier for the backup.
@@ -24,10 +25,12 @@ declare module 'vscode' {
delete(): void;
}
/** @deprecated */
interface NotebookDocumentBackupContext {
readonly destination: Uri;
}
/** @deprecated */
interface NotebookDocumentOpenContext {
readonly backupId?: string;
readonly untitledDocumentData?: Uint8Array;
@@ -35,6 +38,8 @@ declare module 'vscode' {
// todo@API use openNotebookDOCUMENT to align with openCustomDocument etc?
// todo@API rename to NotebookDocumentContentProvider
/** @deprecated */
export interface NotebookContentProvider {
readonly options?: NotebookDocumentContentOptions;
@@ -42,7 +47,7 @@ declare module 'vscode' {
/**
* Content providers should always use {@link FileSystemProvider file system providers} to
* resolve the raw content for `uri` as the resouce is not necessarily a file on disk.
* resolve the raw content for `uri` as the resource is not necessarily a file on disk.
*/
openNotebook(uri: Uri, openContext: NotebookDocumentOpenContext, token: CancellationToken): NotebookData | Thenable<NotebookData>;
@@ -60,6 +65,7 @@ declare module 'vscode' {
// TODO@api use NotebookDocumentFilter instead of just notebookType:string?
// TODO@API options duplicates the more powerful variant on NotebookContentProvider
/** @deprecated */
export function registerNotebookContentProvider(notebookType: string, provider: NotebookContentProvider, options?: NotebookDocumentContentOptions): Disposable;
}
}

View File

@@ -5,102 +5,33 @@
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/106744
// https://github.com/microsoft/vscode/issues/149271
/**
* Represents a notebook editor that is attached to a {@link NotebookDocument notebook}.
*/
export enum NotebookEditorRevealType {
/**
* The range will be revealed with as little scrolling as possible.
*/
Default = 0,
// ❗️ Important: The main NotebookEditor api has been finalized.
// This file only contains deprecated properties/functions from the proposal.
/**
* The range will always be revealed in the center of the viewport.
*/
InCenter = 1,
/**
* If the range is outside the viewport, it will be revealed in the center of the viewport.
* Otherwise, it will be revealed with as little scrolling as possible.
*/
InCenterIfOutsideViewport = 2,
/**
* The range will always be revealed at the top of the viewport.
*/
AtTop = 3
}
/**
* Represents a notebook editor that is attached to a {@link NotebookDocument notebook}.
*/
export interface NotebookEditor {
/**
* The document associated with this notebook editor.
*
* @deprecated Use {@linkcode NotebookEditor.notebook} instead.
*/
//todo@api rename to notebook?
readonly document: NotebookDocument;
/**
* The selections on this notebook editor.
*
* The primary selection (or focused range) is `selections[0]`. When the document has no cells, the primary selection is empty `{ start: 0, end: 0 }`;
*/
selections: readonly NotebookRange[];
/**
* The current visible ranges in the editor (vertically).
*/
readonly visibleRanges: readonly NotebookRange[];
/**
* Scroll as indicated by `revealType` in order to reveal the given range.
*
* @param range A range.
* @param revealType The scrolling strategy for revealing `range`.
*/
revealRange(range: NotebookRange, revealType?: NotebookEditorRevealType): void;
/**
* The column in which this editor shows.
*/
readonly viewColumn?: ViewColumn;
}
export interface NotebookEditorSelectionChangeEvent {
/**
* The {@link NotebookEditor notebook editor} for which the selections have changed.
*/
readonly notebookEditor: NotebookEditor;
readonly selections: readonly NotebookRange[];
}
export interface NotebookEditorVisibleRangesChangeEvent {
/**
* The {@link NotebookEditor notebook editor} for which the visible ranges have changed.
*/
readonly notebookEditor: NotebookEditor;
readonly visibleRanges: readonly NotebookRange[];
}
export interface NotebookDocumentShowOptions {
readonly viewColumn?: ViewColumn;
readonly preserveFocus?: boolean;
readonly preview?: boolean;
readonly selections?: readonly NotebookRange[];
}
export namespace window {
export const visibleNotebookEditors: readonly NotebookEditor[];
export const onDidChangeVisibleNotebookEditors: Event<readonly NotebookEditor[]>;
export const activeNotebookEditor: NotebookEditor | undefined;
export const onDidChangeActiveNotebookEditor: Event<NotebookEditor | undefined>;
export const onDidChangeNotebookEditorSelection: Event<NotebookEditorSelectionChangeEvent>;
export const onDidChangeNotebookEditorVisibleRanges: Event<NotebookEditorVisibleRangesChangeEvent>;
/**
* A short-hand for `openNotebookDocument(uri).then(document => showNotebookDocument(document, options))`.
*
* @deprecated Will not be finalized.
*
* @see {@link workspace.openNotebookDocument}
*
* @param uri The resource to open.
* @param options {@link NotebookDocumentShowOptions Editor options} to configure the behavior of showing the {@link NotebookEditor notebook editor}.
*
* @return A promise that resolves to an {@link NotebookEditor notebook editor}.
*/
export function showNotebookDocument(uri: Uri, options?: NotebookDocumentShowOptions): Thenable<NotebookEditor>;
export function showNotebookDocument(document: NotebookDocument, options?: NotebookDocumentShowOptions): Thenable<NotebookEditor>;
}
}

View File

@@ -1,28 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/106744
export interface NotebookEditor {
setDecorations(decorationType: NotebookEditorDecorationType, range: NotebookRange): void;
}
export interface NotebookDecorationRenderOptions {
backgroundColor?: string | ThemeColor;
borderColor?: string | ThemeColor;
top?: ThemableDecorationAttachmentRenderOptions;
}
export interface NotebookEditorDecorationType {
readonly key: string;
dispose(): void;
}
export namespace notebooks {
export function createNotebookEditorDecorationType(options: NotebookDecorationRenderOptions): NotebookEditorDecorationType;
}
}

View File

@@ -7,32 +7,34 @@ declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/106744
// todo@API add NotebookEdit-type which handles all these cases?
// export class NotebookEdit {
// range: NotebookRange;
// newCells: NotebookCellData[];
// newMetadata?: NotebookDocumentMetadata;
// constructor(range: NotebookRange, newCells: NotebookCellData)
// }
// export class NotebookCellEdit {
// newMetadata?: NotebookCellMetadata;
// }
// export interface WorkspaceEdit {
// set(uri: Uri, edits: TextEdit[] | NotebookEdit[]): void
// }
export interface WorkspaceEdit {
// todo@API add NotebookEdit-type which handles all these cases?
replaceNotebookMetadata(uri: Uri, value: { [key: string]: any }): void;
/**
* @deprecated Please migrate to the new `notebookWorkspaceEdit` proposed API.
*/
replaceNotebookCells(uri: Uri, range: NotebookRange, cells: NotebookCellData[], metadata?: WorkspaceEditEntryMetadata): void;
/**
* @deprecated Please migrate to the new `notebookWorkspaceEdit` proposed API.
*/
replaceNotebookCellMetadata(uri: Uri, index: number, cellMetadata: { [key: string]: any }, metadata?: WorkspaceEditEntryMetadata): void;
}
export interface NotebookEditorEdit {
/**
* @deprecated Please migrate to the new `notebookWorkspaceEdit` proposed API.
*/
replaceMetadata(value: { [key: string]: any }): void;
/**
* @deprecated Please migrate to the new `notebookWorkspaceEdit` proposed API.
*/
replaceCells(start: number, end: number, cells: NotebookCellData[]): void;
/**
* @deprecated Please migrate to the new `notebookWorkspaceEdit` proposed API.
*/
replaceCellMetadata(index: number, metadata: { [key: string]: any }): void;
}
@@ -44,10 +46,11 @@ declare module 'vscode' {
* be used to make edits. Note that the edit-builder is only valid while the
* callback executes.
*
* @deprecated Please migrate to the new `notebookWorkspaceEdit` proposed API.
*
* @param callback A function which can create edits using an {@link NotebookEditorEdit edit-builder}.
* @return A promise that resolves with a value indicating if the edits could be applied.
*/
// @jrieken REMOVE maybe
edit(callback: (editBuilder: NotebookEditorEdit) => void): Thenable<boolean>;
}
}

View File

@@ -0,0 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
}

View File

@@ -1,56 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
export interface NotebookProxyController {
/**
* The identifier of this notebook controller.
*
* _Note_ that controllers are remembered by their identifier and that extensions should use
* stable identifiers across sessions.
*/
readonly id: string;
/**
* The notebook type this controller is for.
*/
readonly notebookType: string;
/**
* The human-readable label of this notebook controller.
*/
label: string;
/**
* The human-readable description which is rendered less prominent.
*/
description?: string;
/**
* The human-readable detail which is rendered less prominent.
*/
detail?: string;
/**
* The human-readable label used to categorise controllers.
*/
kind?: string;
resolveHandler: () => NotebookController | string | Thenable<NotebookController | string>;
readonly onDidChangeSelectedNotebooks: Event<{ readonly notebook: NotebookDocument; readonly selected: boolean }>;
/**
* Dispose and free associated resources.
*/
dispose(): void;
}
export namespace notebooks {
export function createNotebookProxyController(id: string, notebookType: string, label: string, resolveHandler: () => NotebookController | string | Thenable<NotebookController | string>): NotebookProxyController;
}
}

View File

@@ -0,0 +1,85 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/106744
/**
* 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[]);
}
export interface WorkspaceEdit {
/**
* Set (and replace) edits for a resource.
*
* @param uri A resource identifier.
* @param edits An array of text or notebook edits.
*/
set(uri: Uri, edits: TextEdit[] | NotebookEdit[]): void;
}
}

View File

@@ -8,7 +8,9 @@ declare module 'vscode' {
export interface SourceControlActionButton {
command: Command;
secondaryCommands?: Command[][];
description?: string;
enabled: boolean;
}
export interface SourceControl {

View File

@@ -0,0 +1,15 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/145374
interface WorkspaceEdit {
// todo@API have a SnippetTextEdit and allow to set that?
replace(uri: Uri, range: Range, newText: string | SnippetString, metadata?: WorkspaceEditEntryMetadata): void;
}
}

View File

@@ -0,0 +1,25 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// https://github.com/microsoft/vscode/issues/153213
declare module 'vscode' {
export class TabInputTextMerge {
readonly base: Uri;
readonly input1: Uri;
readonly input2: Uri;
readonly result: Uri;
constructor(base: Uri, input1: Uri, input2: Uri, result: Uri);
}
export interface Tab {
readonly input: TabInputText | TabInputTextDiff | TabInputTextMerge | TabInputCustom | TabInputWebview | TabInputNotebook | TabInputNotebookDiff | TabInputTerminal | unknown;
}
}

View File

@@ -0,0 +1,47 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/130231
/**
* 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,
}
export interface TerminalExitStatus {
/**
* The reason that triggered the exit of a terminal.
*/
readonly reason: TerminalExitReason;
}
}

View File

@@ -1,30 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// todo@API,@jrieken is this needed? This is also in vscode.d.ts...
// https://github.com/microsoft/vscode/issues/114898
export interface Pseudoterminal {
/**
* An event that when fired allows changing the name of the terminal.
*
* **Example:** Change the terminal name to "My new terminal".
* ```typescript
* const writeEmitter = new vscode.EventEmitter<string>();
* const changeNameEmitter = new vscode.EventEmitter<string>();
* const pty: vscode.Pseudoterminal = {
* onDidWrite: writeEmitter.event,
* onDidChangeName: changeNameEmitter.event,
* open: () => changeNameEmitter.fire('My new terminal'),
* close: () => {}
* };
* vscode.window.createTerminal({ name: 'My terminal', pty });
* ```
*/
onDidChangeName?: Event<string>;
}
}

View File

@@ -30,7 +30,7 @@ declare module 'vscode' {
/**
* Give a FileCoverage to fill in more data, namely {@link FileCoverage.detailedCoverage}.
* The editor will only resolve a FileCoverage once, and onyl if detailedCoverage
* The editor will only resolve a FileCoverage once, and only if detailedCoverage
* is undefined.
*
* @param coverage A coverage object obtained from {@link provideFileCoverage}

View File

@@ -1,47 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/142990
export class SnippetTextEdit {
snippet: SnippetString;
range: Range;
constructor(range: Range, snippet: SnippetString);
}
/**
* Provider which handles dropping of resources into a text editor.
*
* The user can drop into a text editor by holding down `shift` while dragging. Requires `workbench.experimental.editor.dropIntoEditor.enabled` to be on.
*/
export interface DocumentOnDropProvider {
/**
* 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 SnippetTextEdit} or a thenable that resolves to such. The lack of a result can be
* signaled by returning `undefined` or `null`.
*/
provideDocumentOnDropEdits(document: TextDocument, position: Position, dataTransfer: DataTransfer, token: CancellationToken): ProviderResult<SnippetTextEdit>;
}
export namespace languages {
/**
* Registers a new {@link DocumentOnDropProvider}.
*
* @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 registerDocumentOnDropProvider(selector: DocumentSelector, provider: DocumentOnDropProvider): Disposable;
}
}

View File

@@ -142,7 +142,7 @@ declare module 'vscode' {
}
/**
* Represents the severiry of a TextSearchComplete message.
* Represents the severity of a TextSearchComplete message.
*/
export enum TextSearchCompleteMessageType {
Information = 1,