/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45declare module 'vscode' {67/**8* The version of the editor.9*/10export const version: string;1112/**13* Represents a reference to a command. Provides a title which14* will be used to represent a command in the UI and, optionally,15* an array of arguments which will be passed to the command handler16* function when invoked.17*/18export interface Command {19/**20* Title of the command, like `save`.21*/22title: string;2324/**25* The identifier of the actual command handler.26* @see {@link commands.registerCommand}27*/28command: string;2930/**31* A tooltip for the command, when represented in the UI.32*/33tooltip?: string;3435/**36* Arguments that the command handler should be37* invoked with.38*/39arguments?: any[];40}4142/**43* Represents a line of text, such as a line of source code.44*45* TextLine objects are __immutable__. When a {@link TextDocument document} changes,46* previously retrieved lines will not represent the latest state.47*/48export interface TextLine {4950/**51* The zero-based line number.52*/53readonly lineNumber: number;5455/**56* The text of this line without the line separator characters.57*/58readonly text: string;5960/**61* The range this line covers without the line separator characters.62*/63readonly range: Range;6465/**66* The range this line covers with the line separator characters.67*/68readonly rangeIncludingLineBreak: Range;6970/**71* The offset of the first character which is not a whitespace character as defined72* by `/\s/`. **Note** that if a line is all whitespace the length of the line is returned.73*/74readonly firstNonWhitespaceCharacterIndex: number;7576/**77* Whether this line is whitespace only, shorthand78* for {@link TextLine.firstNonWhitespaceCharacterIndex} === {@link TextLine.text TextLine.text.length}.79*/80readonly isEmptyOrWhitespace: boolean;81}8283/**84* Represents a text document, such as a source file. Text documents have85* {@link TextLine lines} and knowledge about an underlying resource like a file.86*/87export interface TextDocument {8889/**90* The associated uri for this document.91*92* *Note* that most documents use the `file`-scheme, which means they are files on disk. However, **not** all documents are93* saved on disk and therefore the `scheme` must be checked before trying to access the underlying file or siblings on disk.94*95* @see {@link FileSystemProvider}96* @see {@link TextDocumentContentProvider}97*/98readonly uri: Uri;99100/**101* The file system path of the associated resource. Shorthand102* notation for {@link TextDocument.uri TextDocument.uri.fsPath}. Independent of the uri scheme.103*/104readonly fileName: string;105106/**107* Is this document representing an untitled file which has never been saved yet. *Note* that108* this does not mean the document will be saved to disk, use {@linkcode Uri.scheme}109* to figure out where a document will be {@link FileSystemProvider saved}, e.g. `file`, `ftp` etc.110*/111readonly isUntitled: boolean;112113/**114* The identifier of the language associated with this document.115*/116readonly languageId: string;117118/**119* The file encoding of this document that will be used when the document is saved.120*121* Use the {@link workspace.onDidChangeTextDocument onDidChangeTextDocument}-event to122* get notified when the document encoding changes.123*124* Note that the possible encoding values are currently defined as any of the following:125* 'utf8', 'utf8bom', 'utf16le', 'utf16be', 'windows1252', 'iso88591', 'iso88593',126* 'iso885915', 'macroman', 'cp437', 'windows1256', 'iso88596', 'windows1257',127* 'iso88594', 'iso885914', 'windows1250', 'iso88592', 'cp852', 'windows1251',128* 'cp866', 'cp1125', 'iso88595', 'koi8r', 'koi8u', 'iso885913', 'windows1253',129* 'iso88597', 'windows1255', 'iso88598', 'iso885910', 'iso885916', 'windows1254',130* 'iso88599', 'windows1258', 'gbk', 'gb18030', 'cp950', 'big5hkscs', 'shiftjis',131* 'eucjp', 'euckr', 'windows874', 'iso885911', 'koi8ru', 'koi8t', 'gb2312',132* 'cp865', 'cp850'.133*/134readonly encoding: string;135136/**137* The version number of this document (it will strictly increase after each138* change, including undo/redo).139*/140readonly version: number;141142/**143* `true` if there are unpersisted changes.144*/145readonly isDirty: boolean;146147/**148* `true` if the document has been closed. A closed document isn't synchronized anymore149* and won't be re-used when the same resource is opened again.150*/151readonly isClosed: boolean;152153/**154* Save the underlying file.155*156* @returns A promise that will resolve to `true` when the file157* has been saved. If the save failed, will return `false`.158*/159save(): Thenable<boolean>;160161/**162* The {@link EndOfLine end of line} sequence that is predominately163* used in this document.164*/165readonly eol: EndOfLine;166167/**168* The number of lines in this document.169*/170readonly lineCount: number;171172/**173* Returns a text line denoted by the line number. Note174* that the returned object is *not* live and changes to the175* document are not reflected.176*177* @param line A line number in `[0, lineCount)`.178* @returns A {@link TextLine line}.179*/180lineAt(line: number): TextLine;181182/**183* Returns a text line denoted by the position. Note184* that the returned object is *not* live and changes to the185* document are not reflected.186*187* The position will be {@link TextDocument.validatePosition adjusted}.188*189* @see {@link TextDocument.lineAt}190*191* @param position A position.192* @returns A {@link TextLine line}.193*/194lineAt(position: Position): TextLine;195196/**197* Converts the position to a zero-based offset.198*199* The position will be {@link TextDocument.validatePosition adjusted}.200*201* @param position A position.202* @returns A valid zero-based offset in UTF-16 [code units](https://developer.mozilla.org/en-US/docs/Glossary/Code_unit).203*/204offsetAt(position: Position): number;205206/**207* Converts a zero-based offset to a position.208*209* @param offset A zero-based offset into the document. This offset is in UTF-16 [code units](https://developer.mozilla.org/en-US/docs/Glossary/Code_unit).210* @returns A valid {@link Position}.211*/212positionAt(offset: number): Position;213214/**215* Get the text of this document. A substring can be retrieved by providing216* a range. The range will be {@link TextDocument.validateRange adjusted}.217*218* @param range Include only the text included by the range.219* @returns The text inside the provided range or the entire text.220*/221getText(range?: Range): string;222223/**224* Get a word-range at the given position. By default words are defined by225* common separators, like space, -, _, etc. In addition, per language custom226* [word definitions] can be defined. It227* is also possible to provide a custom regular expression.228*229* * *Note 1:* A custom regular expression must not match the empty string and230* if it does, it will be ignored.231* * *Note 2:* A custom regular expression will fail to match multiline strings232* and in the name of speed regular expressions should not match words with233* spaces. Use {@linkcode TextLine.text} for more complex, non-wordy, scenarios.234*235* The position will be {@link TextDocument.validatePosition adjusted}.236*237* @param position A position.238* @param regex Optional regular expression that describes what a word is.239* @returns A range spanning a word, or `undefined`.240*/241getWordRangeAtPosition(position: Position, regex?: RegExp): Range | undefined;242243/**244* Ensure a range is completely contained in this document.245*246* @param range A range.247* @returns The given range or a new, adjusted range.248*/249validateRange(range: Range): Range;250251/**252* Ensure a position is contained in the range of this document.253*254* @param position A position.255* @returns The given position or a new, adjusted position.256*/257validatePosition(position: Position): Position;258}259260/**261* Represents a line and character position, such as262* the position of the cursor.263*264* Position objects are __immutable__. Use the {@link Position.with with} or265* {@link Position.translate translate} methods to derive new positions266* from an existing position.267*/268export class Position {269270/**271* The zero-based line value.272*/273readonly line: number;274275/**276* The zero-based character value.277*278* Character offsets are expressed using UTF-16 [code units](https://developer.mozilla.org/en-US/docs/Glossary/Code_unit).279*/280readonly character: number;281282/**283* @param line A zero-based line value.284* @param character A zero-based character value.285*/286constructor(line: number, character: number);287288/**289* Check if this position is before `other`.290*291* @param other A position.292* @returns `true` if position is on a smaller line293* or on the same line on a smaller character.294*/295isBefore(other: Position): boolean;296297/**298* Check if this position is before or equal to `other`.299*300* @param other A position.301* @returns `true` if position is on a smaller line302* or on the same line on a smaller or equal character.303*/304isBeforeOrEqual(other: Position): boolean;305306/**307* Check if this position is after `other`.308*309* @param other A position.310* @returns `true` if position is on a greater line311* or on the same line on a greater character.312*/313isAfter(other: Position): boolean;314315/**316* Check if this position is after or equal to `other`.317*318* @param other A position.319* @returns `true` if position is on a greater line320* or on the same line on a greater or equal character.321*/322isAfterOrEqual(other: Position): boolean;323324/**325* Check if this position is equal to `other`.326*327* @param other A position.328* @returns `true` if the line and character of the given position are equal to329* the line and character of this position.330*/331isEqual(other: Position): boolean;332333/**334* Compare this to `other`.335*336* @param other A position.337* @returns A number smaller than zero if this position is before the given position,338* a number greater than zero if this position is after the given position, or zero when339* this and the given position are equal.340*/341compareTo(other: Position): number;342343/**344* Create a new position relative to this position.345*346* @param lineDelta Delta value for the line value, default is `0`.347* @param characterDelta Delta value for the character value, default is `0`.348* @returns A position which line and character is the sum of the current line and349* character and the corresponding deltas.350*/351translate(lineDelta?: number, characterDelta?: number): Position;352353/**354* Derived a new position relative to this position.355*356* @param change An object that describes a delta to this position.357* @returns A position that reflects the given delta. Will return `this` position if the change358* is not changing anything.359*/360translate(change: {361/**362* Delta value for the line value, default is `0`.363*/364lineDelta?: number;365/**366* Delta value for the character value, default is `0`.367*/368characterDelta?: number;369}): Position;370371/**372* Create a new position derived from this position.373*374* @param line Value that should be used as line value, default is the {@link Position.line existing value}375* @param character Value that should be used as character value, default is the {@link Position.character existing value}376* @returns A position where line and character are replaced by the given values.377*/378with(line?: number, character?: number): Position;379380/**381* Derived a new position from this position.382*383* @param change An object that describes a change to this position.384* @returns A position that reflects the given change. Will return `this` position if the change385* is not changing anything.386*/387with(change: {388/**389* New line value, defaults the line value of `this`.390*/391line?: number;392/**393* New character value, defaults the character value of `this`.394*/395character?: number;396}): Position;397}398399/**400* A range represents an ordered pair of two positions.401* It is guaranteed that {@link Range.start start}.isBeforeOrEqual({@link Range.end end})402*403* Range objects are __immutable__. Use the {@link Range.with with},404* {@link Range.intersection intersection}, or {@link Range.union union} methods405* to derive new ranges from an existing range.406*/407export class Range {408409/**410* The start position. It is before or equal to {@link Range.end end}.411*/412readonly start: Position;413414/**415* The end position. It is after or equal to {@link Range.start start}.416*/417readonly end: Position;418419/**420* Create a new range from two positions. If `start` is not421* before or equal to `end`, the values will be swapped.422*423* @param start A position.424* @param end A position.425*/426constructor(start: Position, end: Position);427428/**429* Create a new range from number coordinates. It is a shorter equivalent of430* using `new Range(new Position(startLine, startCharacter), new Position(endLine, endCharacter))`431*432* @param startLine A zero-based line value.433* @param startCharacter A zero-based character value.434* @param endLine A zero-based line value.435* @param endCharacter A zero-based character value.436*/437constructor(startLine: number, startCharacter: number, endLine: number, endCharacter: number);438439/**440* `true` if `start` and `end` are equal.441*/442isEmpty: boolean;443444/**445* `true` if `start.line` and `end.line` are equal.446*/447isSingleLine: boolean;448449/**450* Check if a position or a range is contained in this range.451*452* @param positionOrRange A position or a range.453* @returns `true` if the position or range is inside or equal454* to this range.455*/456contains(positionOrRange: Position | Range): boolean;457458/**459* Check if `other` equals this range.460*461* @param other A range.462* @returns `true` when start and end are {@link Position.isEqual equal} to463* start and end of this range.464*/465isEqual(other: Range): boolean;466467/**468* Intersect `range` with this range and returns a new range or `undefined`469* if the ranges have no overlap.470*471* @param range A range.472* @returns A range of the greater start and smaller end positions. Will473* return undefined when there is no overlap.474*/475intersection(range: Range): Range | undefined;476477/**478* Compute the union of `other` with this range.479*480* @param other A range.481* @returns A range of smaller start position and the greater end position.482*/483union(other: Range): Range;484485/**486* Derived a new range from this range.487*488* @param start A position that should be used as start. The default value is the {@link Range.start current start}.489* @param end A position that should be used as end. The default value is the {@link Range.end current end}.490* @returns A range derived from this range with the given start and end position.491* If start and end are not different `this` range will be returned.492*/493with(start?: Position, end?: Position): Range;494495/**496* Derived a new range from this range.497*498* @param change An object that describes a change to this range.499* @returns A range that reflects the given change. Will return `this` range if the change500* is not changing anything.501*/502with(change: {503/**504* New start position, defaults to {@link Range.start current start}505*/506start?: Position;507/**508* New end position, defaults to {@link Range.end current end}509*/510end?: Position;511}): Range;512}513514/**515* Represents a text selection in an editor.516*/517export class Selection extends Range {518519/**520* The position at which the selection starts.521* This position might be before or after {@link Selection.active active}.522*/523readonly anchor: Position;524525/**526* The position of the cursor.527* This position might be before or after {@link Selection.anchor anchor}.528*/529readonly active: Position;530531/**532* Create a selection from two positions.533*534* @param anchor A position.535* @param active A position.536*/537constructor(anchor: Position, active: Position);538539/**540* Create a selection from four coordinates.541*542* @param anchorLine A zero-based line value.543* @param anchorCharacter A zero-based character value.544* @param activeLine A zero-based line value.545* @param activeCharacter A zero-based character value.546*/547constructor(anchorLine: number, anchorCharacter: number, activeLine: number, activeCharacter: number);548549/**550* A selection is reversed if its {@link Selection.anchor anchor} is the {@link Selection.end end} position.551*/552readonly isReversed: boolean;553}554555/**556* Represents sources that can cause {@link window.onDidChangeTextEditorSelection selection change events}.557*/558export enum TextEditorSelectionChangeKind {559/**560* Selection changed due to typing in the editor.561*/562Keyboard = 1,563/**564* Selection change due to clicking in the editor.565*/566Mouse = 2,567/**568* Selection changed because a command ran.569*/570Command = 3571}572573/**574* Represents an event describing the change in a {@link TextEditor.selections text editor's selections}.575*/576export interface TextEditorSelectionChangeEvent {577/**578* The {@link TextEditor text editor} for which the selections have changed.579*/580readonly textEditor: TextEditor;581/**582* The new value for the {@link TextEditor.selections text editor's selections}.583*/584readonly selections: readonly Selection[];585/**586* The {@link TextEditorSelectionChangeKind change kind} which has triggered this587* event. Can be `undefined`.588*/589readonly kind: TextEditorSelectionChangeKind | undefined;590}591592/**593* Represents an event describing the change in a {@link TextEditor.visibleRanges text editor's visible ranges}.594*/595export interface TextEditorVisibleRangesChangeEvent {596/**597* The {@link TextEditor text editor} for which the visible ranges have changed.598*/599readonly textEditor: TextEditor;600/**601* The new value for the {@link TextEditor.visibleRanges text editor's visible ranges}.602*/603readonly visibleRanges: readonly Range[];604}605606/**607* Represents an event describing the change in a {@link TextEditor.options text editor's options}.608*/609export interface TextEditorOptionsChangeEvent {610/**611* The {@link TextEditor text editor} for which the options have changed.612*/613readonly textEditor: TextEditor;614/**615* The new value for the {@link TextEditor.options text editor's options}.616*/617readonly options: TextEditorOptions;618}619620/**621* Represents an event describing the change of a {@link TextEditor.viewColumn text editor's view column}.622*/623export interface TextEditorViewColumnChangeEvent {624/**625* The {@link TextEditor text editor} for which the view column has changed.626*/627readonly textEditor: TextEditor;628/**629* The new value for the {@link TextEditor.viewColumn text editor's view column}.630*/631readonly viewColumn: ViewColumn;632}633634/**635* Rendering style of the cursor.636*/637export enum TextEditorCursorStyle {638/**639* Render the cursor as a vertical thick line.640*/641Line = 1,642/**643* Render the cursor as a block filled.644*/645Block = 2,646/**647* Render the cursor as a thick horizontal line.648*/649Underline = 3,650/**651* Render the cursor as a vertical thin line.652*/653LineThin = 4,654/**655* Render the cursor as a block outlined.656*/657BlockOutline = 5,658/**659* Render the cursor as a thin horizontal line.660*/661UnderlineThin = 6662}663664/**665* Rendering style of the line numbers.666*/667export enum TextEditorLineNumbersStyle {668/**669* Do not render the line numbers.670*/671Off = 0,672/**673* Render the line numbers.674*/675On = 1,676/**677* Render the line numbers with values relative to the primary cursor location.678*/679Relative = 2,680/**681* Render the line numbers on every 10th line number.682*/683Interval = 3,684}685686/**687* Represents a {@link TextEditor text editor}'s {@link TextEditor.options options}.688*/689export interface TextEditorOptions {690691/**692* The size in spaces a tab takes. This is used for two purposes:693* - the rendering width of a tab character;694* - the number of spaces to insert when {@link TextEditorOptions.insertSpaces insertSpaces} is true695* and `indentSize` is set to `"tabSize"`.696*697* When getting a text editor's options, this property will always be a number (resolved).698* When setting a text editor's options, this property is optional and it can be a number or `"auto"`.699*/700tabSize?: number | string;701702/**703* The number of spaces to insert when {@link TextEditorOptions.insertSpaces insertSpaces} is true.704*705* When getting a text editor's options, this property will always be a number (resolved).706* When setting a text editor's options, this property is optional and it can be a number or `"tabSize"`.707*/708indentSize?: number | string;709710/**711* When pressing Tab insert {@link TextEditorOptions.tabSize n} spaces.712* When getting a text editor's options, this property will always be a boolean (resolved).713* When setting a text editor's options, this property is optional and it can be a boolean or `"auto"`.714*/715insertSpaces?: boolean | string;716717/**718* The rendering style of the cursor in this editor.719* When getting a text editor's options, this property will always be present.720* When setting a text editor's options, this property is optional.721*/722cursorStyle?: TextEditorCursorStyle;723724/**725* Render relative line numbers w.r.t. the current line number.726* When getting a text editor's options, this property will always be present.727* When setting a text editor's options, this property is optional.728*/729lineNumbers?: TextEditorLineNumbersStyle;730}731732/**733* Represents a handle to a set of decorations734* sharing the same {@link DecorationRenderOptions styling options} in a {@link TextEditor text editor}.735*736* To get an instance of a `TextEditorDecorationType` use737* {@link window.createTextEditorDecorationType createTextEditorDecorationType}.738*/739export interface TextEditorDecorationType {740741/**742* Internal representation of the handle.743*/744readonly key: string;745746/**747* Remove this decoration type and all decorations on all text editors using it.748*/749dispose(): void;750}751752/**753* Represents different {@link TextEditor.revealRange reveal} strategies in a text editor.754*/755export enum TextEditorRevealType {756/**757* The range will be revealed with as little scrolling as possible.758*/759Default = 0,760/**761* The range will always be revealed in the center of the viewport.762*/763InCenter = 1,764/**765* If the range is outside the viewport, it will be revealed in the center of the viewport.766* Otherwise, it will be revealed with as little scrolling as possible.767*/768InCenterIfOutsideViewport = 2,769/**770* The range will always be revealed at the top of the viewport.771*/772AtTop = 3773}774775/**776* Represents different positions for rendering a decoration in an {@link DecorationRenderOptions.overviewRulerLane overview ruler}.777* The overview ruler supports three lanes.778*/779export enum OverviewRulerLane {780/**781* The left lane of the overview ruler.782*/783Left = 1,784/**785* The center lane of the overview ruler.786*/787Center = 2,788/**789* The right lane of the overview ruler.790*/791Right = 4,792/**793* All lanes of the overview ruler.794*/795Full = 7796}797798/**799* Describes the behavior of decorations when typing/editing at their edges.800*/801export enum DecorationRangeBehavior {802/**803* The decoration's range will widen when edits occur at the start or end.804*/805OpenOpen = 0,806/**807* The decoration's range will not widen when edits occur at the start or end.808*/809ClosedClosed = 1,810/**811* The decoration's range will widen when edits occur at the start, but not at the end.812*/813OpenClosed = 2,814/**815* The decoration's range will widen when edits occur at the end, but not at the start.816*/817ClosedOpen = 3818}819820/**821* Represents options to configure the behavior of showing a {@link TextDocument document} in an {@link TextEditor editor}.822*/823export interface TextDocumentShowOptions {824/**825* An optional view column in which the {@link TextEditor editor} should be shown.826* The default is the {@link ViewColumn.Active active}. Columns that do not exist827* will be created as needed up to the maximum of {@linkcode ViewColumn.Nine}.828* Use {@linkcode ViewColumn.Beside} to open the editor to the side of the currently829* active one.830*/831viewColumn?: ViewColumn;832833/**834* An optional flag that when `true` will stop the {@link TextEditor editor} from taking focus.835*/836preserveFocus?: boolean;837838/**839* An optional flag that controls if an {@link TextEditor editor}-tab shows as preview. Preview tabs will840* be replaced and reused until set to stay - either explicitly or through editing.841*842* *Note* that the flag is ignored if a user has disabled preview editors in settings.843*/844preview?: boolean;845846/**847* An optional selection to apply for the document in the {@link TextEditor editor}.848*/849selection?: Range;850}851852/**853* Represents an event describing the change in a {@link NotebookEditor.selections notebook editor's selections}.854*/855export interface NotebookEditorSelectionChangeEvent {856/**857* The {@link NotebookEditor notebook editor} for which the selections have changed.858*/859readonly notebookEditor: NotebookEditor;860861/**862* The new value for the {@link NotebookEditor.selections notebook editor's selections}.863*/864readonly selections: readonly NotebookRange[];865}866867/**868* Represents an event describing the change in a {@link NotebookEditor.visibleRanges notebook editor's visibleRanges}.869*/870export interface NotebookEditorVisibleRangesChangeEvent {871/**872* The {@link NotebookEditor notebook editor} for which the visible ranges have changed.873*/874readonly notebookEditor: NotebookEditor;875876/**877* The new value for the {@link NotebookEditor.visibleRanges notebook editor's visibleRanges}.878*/879readonly visibleRanges: readonly NotebookRange[];880}881882/**883* Represents options to configure the behavior of showing a {@link NotebookDocument notebook document} in an {@link NotebookEditor notebook editor}.884*/885export interface NotebookDocumentShowOptions {886/**887* An optional view column in which the {@link NotebookEditor notebook editor} should be shown.888* The default is the {@link ViewColumn.Active active}. Columns that do not exist889* will be created as needed up to the maximum of {@linkcode ViewColumn.Nine}.890* Use {@linkcode ViewColumn.Beside} to open the editor to the side of the currently891* active one.892*/893readonly viewColumn?: ViewColumn;894895/**896* An optional flag that when `true` will stop the {@link NotebookEditor notebook editor} from taking focus.897*/898readonly preserveFocus?: boolean;899900/**901* An optional flag that controls if an {@link NotebookEditor notebook editor}-tab shows as preview. Preview tabs will902* be replaced and reused until set to stay - either explicitly or through editing. The default behaviour depends903* on the `workbench.editor.enablePreview`-setting.904*/905readonly preview?: boolean;906907/**908* An optional selection to apply for the document in the {@link NotebookEditor notebook editor}.909*/910readonly selections?: readonly NotebookRange[];911}912913/**914* A reference to one of the workbench colors as defined in https://code.visualstudio.com/api/references/theme-color.915* Using a theme color is preferred over a custom color as it gives theme authors and users the possibility to change the color.916*/917export class ThemeColor {918919/**920* The id of this color.921*/922readonly id: string;923924/**925* Creates a reference to a theme color.926* @param id of the color. The available colors are listed in https://code.visualstudio.com/api/references/theme-color.927*/928constructor(id: string);929}930931/**932* A reference to a named icon. Currently, {@link ThemeIcon.File File}, {@link ThemeIcon.Folder Folder},933* and [ThemeIcon ids](https://code.visualstudio.com/api/references/icons-in-labels#icon-listing) are supported.934* Using a theme icon is preferred over a custom icon as it gives product theme authors the possibility to change the icons.935*936* *Note* that theme icons can also be rendered inside labels and descriptions. Places that support theme icons spell this out937* and they use the `$(<name>)`-syntax, for instance `quickPick.label = "Hello World $(globe)"`.938*/939export class ThemeIcon {940/**941* Reference to an icon representing a file. The icon is taken from the current file icon theme or a placeholder icon is used.942*/943static readonly File: ThemeIcon;944945/**946* Reference to an icon representing a folder. The icon is taken from the current file icon theme or a placeholder icon is used.947*/948static readonly Folder: ThemeIcon;949950/**951* The id of the icon. The available icons are listed in https://code.visualstudio.com/api/references/icons-in-labels#icon-listing.952*/953readonly id: string;954955/**956* The optional ThemeColor of the icon. The color is currently only used in {@link TreeItem}.957*/958readonly color?: ThemeColor | undefined;959960/**961* Creates a reference to a theme icon.962* @param id id of the icon. The available icons are listed in https://code.visualstudio.com/api/references/icons-in-labels#icon-listing.963* @param color optional `ThemeColor` for the icon. The color is currently only used in {@link TreeItem}.964*/965constructor(id: string, color?: ThemeColor);966}967968/**969* Represents an icon in the UI. This is either an uri, separate uris for the light- and dark-themes,970* or a {@link ThemeIcon theme icon}.971*/972export type IconPath = Uri | {973/**974* The icon path for the light theme.975*/976light: Uri;977/**978* The icon path for the dark theme.979*/980dark: Uri;981} | ThemeIcon;982983/**984* Represents theme specific rendering styles for a {@link TextEditorDecorationType text editor decoration}.985*/986export interface ThemableDecorationRenderOptions {987/**988* Background color of the decoration. Use rgba() and define transparent background colors to play well with other decorations.989* Alternatively a color from the color registry can be {@link ThemeColor referenced}.990*/991backgroundColor?: string | ThemeColor;992993/**994* CSS styling property that will be applied to text enclosed by a decoration.995*/996outline?: string;997998/**999* CSS styling property that will be applied to text enclosed by a decoration.1000* Better use 'outline' for setting one or more of the individual outline properties.1001*/1002outlineColor?: string | ThemeColor;10031004/**1005* CSS styling property that will be applied to text enclosed by a decoration.1006* Better use 'outline' for setting one or more of the individual outline properties.1007*/1008outlineStyle?: string;10091010/**1011* CSS styling property that will be applied to text enclosed by a decoration.1012* Better use 'outline' for setting one or more of the individual outline properties.1013*/1014outlineWidth?: string;10151016/**1017* CSS styling property that will be applied to text enclosed by a decoration.1018*/1019border?: string;10201021/**1022* CSS styling property that will be applied to text enclosed by a decoration.1023* Better use 'border' for setting one or more of the individual border properties.1024*/1025borderColor?: string | ThemeColor;10261027/**1028* CSS styling property that will be applied to text enclosed by a decoration.1029* Better use 'border' for setting one or more of the individual border properties.1030*/1031borderRadius?: string;10321033/**1034* CSS styling property that will be applied to text enclosed by a decoration.1035* Better use 'border' for setting one or more of the individual border properties.1036*/1037borderSpacing?: string;10381039/**1040* CSS styling property that will be applied to text enclosed by a decoration.1041* Better use 'border' for setting one or more of the individual border properties.1042*/1043borderStyle?: string;10441045/**1046* CSS styling property that will be applied to text enclosed by a decoration.1047* Better use 'border' for setting one or more of the individual border properties.1048*/1049borderWidth?: string;10501051/**1052* CSS styling property that will be applied to text enclosed by a decoration.1053*/1054fontStyle?: string;10551056/**1057* CSS styling property that will be applied to text enclosed by a decoration.1058*/1059fontWeight?: string;10601061/**1062* CSS styling property that will be applied to text enclosed by a decoration.1063*/1064textDecoration?: string;10651066/**1067* CSS styling property that will be applied to text enclosed by a decoration.1068*/1069cursor?: string;10701071/**1072* CSS styling property that will be applied to text enclosed by a decoration.1073*/1074color?: string | ThemeColor;10751076/**1077* CSS styling property that will be applied to text enclosed by a decoration.1078*/1079opacity?: string;10801081/**1082* CSS styling property that will be applied to text enclosed by a decoration.1083*/1084letterSpacing?: string;10851086/**1087* An **absolute path** or an URI to an image to be rendered in the gutter.1088*/1089gutterIconPath?: string | Uri;10901091/**1092* Specifies the size of the gutter icon.1093* Available values are 'auto', 'contain', 'cover' and any percentage value.1094* For further information: https://msdn.microsoft.com/en-us/library/jj127316(v=vs.85).aspx1095*/1096gutterIconSize?: string;10971098/**1099* The color of the decoration in the overview ruler. Use rgba() and define transparent colors to play well with other decorations.1100*/1101overviewRulerColor?: string | ThemeColor;11021103/**1104* Defines the rendering options of the attachment that is inserted before the decorated text.1105*/1106before?: ThemableDecorationAttachmentRenderOptions;11071108/**1109* Defines the rendering options of the attachment that is inserted after the decorated text.1110*/1111after?: ThemableDecorationAttachmentRenderOptions;1112}11131114/**1115* Represents theme specific rendering styles for {@link ThemableDecorationRenderOptions.before before} and1116* {@link ThemableDecorationRenderOptions.after after} the content of text decorations.1117*/1118export interface ThemableDecorationAttachmentRenderOptions {1119/**1120* Defines a text content that is shown in the attachment. Either an icon or a text can be shown, but not both.1121*/1122contentText?: string;1123/**1124* An **absolute path** or an URI to an image to be rendered in the attachment. Either an icon1125* or a text can be shown, but not both.1126*/1127contentIconPath?: string | Uri;1128/**1129* CSS styling property that will be applied to the decoration attachment.1130*/1131border?: string;1132/**1133* CSS styling property that will be applied to text enclosed by a decoration.1134*/1135borderColor?: string | ThemeColor;1136/**1137* CSS styling property that will be applied to the decoration attachment.1138*/1139fontStyle?: string;1140/**1141* CSS styling property that will be applied to the decoration attachment.1142*/1143fontWeight?: string;1144/**1145* CSS styling property that will be applied to the decoration attachment.1146*/1147textDecoration?: string;1148/**1149* CSS styling property that will be applied to the decoration attachment.1150*/1151color?: string | ThemeColor;1152/**1153* CSS styling property that will be applied to the decoration attachment.1154*/1155backgroundColor?: string | ThemeColor;1156/**1157* CSS styling property that will be applied to the decoration attachment.1158*/1159margin?: string;1160/**1161* CSS styling property that will be applied to the decoration attachment.1162*/1163width?: string;1164/**1165* CSS styling property that will be applied to the decoration attachment.1166*/1167height?: string;1168}11691170/**1171* Represents rendering styles for a {@link TextEditorDecorationType text editor decoration}.1172*/1173export interface DecorationRenderOptions extends ThemableDecorationRenderOptions {1174/**1175* Should the decoration be rendered also on the whitespace after the line text.1176* Defaults to `false`.1177*/1178isWholeLine?: boolean;11791180/**1181* Customize the growing behavior of the decoration when edits occur at the edges of the decoration's range.1182* Defaults to `DecorationRangeBehavior.OpenOpen`.1183*/1184rangeBehavior?: DecorationRangeBehavior;11851186/**1187* The position in the overview ruler where the decoration should be rendered.1188*/1189overviewRulerLane?: OverviewRulerLane;11901191/**1192* Overwrite options for light themes.1193*/1194light?: ThemableDecorationRenderOptions;11951196/**1197* Overwrite options for dark themes.1198*/1199dark?: ThemableDecorationRenderOptions;1200}12011202/**1203* Represents options for a specific decoration in a {@link TextEditorDecorationType decoration set}.1204*/1205export interface DecorationOptions {12061207/**1208* Range to which this decoration is applied. The range must not be empty.1209*/1210range: Range;12111212/**1213* A message that should be rendered when hovering over the decoration.1214*/1215hoverMessage?: MarkdownString | MarkedString | Array<MarkdownString | MarkedString>;12161217/**1218* Render options applied to the current decoration. For performance reasons, keep the1219* number of decoration specific options small, and use decoration types wherever possible.1220*/1221renderOptions?: DecorationInstanceRenderOptions;1222}12231224/**1225* Represents themable render options for decoration instances.1226*/1227export interface ThemableDecorationInstanceRenderOptions {1228/**1229* Defines the rendering options of the attachment that is inserted before the decorated text.1230*/1231before?: ThemableDecorationAttachmentRenderOptions;12321233/**1234* Defines the rendering options of the attachment that is inserted after the decorated text.1235*/1236after?: ThemableDecorationAttachmentRenderOptions;1237}12381239/**1240* Represents render options for decoration instances. See {@link DecorationOptions.renderOptions}.1241*/1242export interface DecorationInstanceRenderOptions extends ThemableDecorationInstanceRenderOptions {1243/**1244* Overwrite options for light themes.1245*/1246light?: ThemableDecorationInstanceRenderOptions;12471248/**1249* Overwrite options for dark themes.1250*/1251dark?: ThemableDecorationInstanceRenderOptions;1252}12531254/**1255* Represents an editor that is attached to a {@link TextDocument document}.1256*/1257export interface TextEditor {12581259/**1260* The document associated with this text editor. The document will be the same for the entire lifetime of this text editor.1261*/1262readonly document: TextDocument;12631264/**1265* The primary selection on this text editor. Shorthand for `TextEditor.selections[0]`.1266*/1267selection: Selection;12681269/**1270* The selections in this text editor. The primary selection is always at index 0.1271*/1272selections: readonly Selection[];12731274/**1275* The current visible ranges in the editor (vertically).1276* This accounts only for vertical scrolling, and not for horizontal scrolling.1277*/1278readonly visibleRanges: readonly Range[];12791280/**1281* Text editor options.1282*/1283options: TextEditorOptions;12841285/**1286* The column in which this editor shows. Will be `undefined` in case this1287* isn't one of the main editors, e.g. an embedded editor, or when the editor1288* column is larger than three.1289*/1290readonly viewColumn: ViewColumn | undefined;12911292/**1293* Perform an edit on the document associated with this text editor.1294*1295* The given callback-function is invoked with an {@link TextEditorEdit edit-builder} which must1296* be used to make edits. Note that the edit-builder is only valid while the1297* callback executes.1298*1299* @param callback A function which can create edits using an {@link TextEditorEdit edit-builder}.1300* @param options The undo/redo behavior around this edit. By default, undo stops will be created before and after this edit.1301* @returns A promise that resolves with a value indicating if the edits could be applied.1302*/1303edit(callback: (editBuilder: TextEditorEdit) => void, options?: {1304/**1305* Add undo stop before making the edits.1306*/1307readonly undoStopBefore: boolean;1308/**1309* Add undo stop after making the edits.1310*/1311readonly undoStopAfter: boolean;1312}): Thenable<boolean>;13131314/**1315* Insert a {@link SnippetString snippet} and put the editor into snippet mode. "Snippet mode"1316* means the editor adds placeholders and additional cursors so that the user can complete1317* or accept the snippet.1318*1319* @param snippet The snippet to insert in this edit.1320* @param location Position or range at which to insert the snippet, defaults to the current editor selection or selections.1321* @param options The undo/redo behavior around this edit. By default, undo stops will be created before and after this edit.1322* @returns A promise that resolves with a value indicating if the snippet could be inserted. Note that the promise does not signal1323* that the snippet is completely filled-in or accepted.1324*/1325insertSnippet(snippet: SnippetString, location?: Position | Range | readonly Position[] | readonly Range[], options?: {1326/**1327* Add undo stop before making the edits.1328*/1329readonly undoStopBefore: boolean;1330/**1331* Add undo stop after making the edits.1332*/1333readonly undoStopAfter: boolean;1334/**1335* Keep whitespace of the {@link SnippetString.value} as is.1336*/1337readonly keepWhitespace?: boolean;1338}): Thenable<boolean>;13391340/**1341* Adds a set of decorations to the text editor. If a set of decorations already exists with1342* the given {@link TextEditorDecorationType decoration type}, they will be replaced. If1343* `rangesOrOptions` is empty, the existing decorations with the given {@link TextEditorDecorationType decoration type}1344* will be removed.1345*1346* @see {@link window.createTextEditorDecorationType createTextEditorDecorationType}.1347*1348* @param decorationType A decoration type.1349* @param rangesOrOptions Either {@link Range ranges} or more detailed {@link DecorationOptions options}.1350*/1351setDecorations(decorationType: TextEditorDecorationType, rangesOrOptions: readonly Range[] | readonly DecorationOptions[]): void;13521353/**1354* Scroll as indicated by `revealType` in order to reveal the given range.1355*1356* @param range A range.1357* @param revealType The scrolling strategy for revealing `range`.1358*/1359revealRange(range: Range, revealType?: TextEditorRevealType): void;13601361/**1362* Show the text editor.1363*1364* @deprecated Use {@link window.showTextDocument} instead.1365*1366* @param column The {@link ViewColumn column} in which to show this editor.1367* This method shows unexpected behavior and will be removed in the next major update.1368*/1369show(column?: ViewColumn): void;13701371/**1372* Hide the text editor.1373*1374* @deprecated Use the command `workbench.action.closeActiveEditor` instead.1375* This method shows unexpected behavior and will be removed in the next major update.1376*/1377hide(): void;1378}13791380/**1381* Represents an end of line character sequence in a {@link TextDocument document}.1382*/1383export enum EndOfLine {1384/**1385* The line feed `\n` character.1386*/1387LF = 1,1388/**1389* The carriage return line feed `\r\n` sequence.1390*/1391CRLF = 21392}13931394/**1395* A complex edit that will be applied in one transaction on a TextEditor.1396* This holds a description of the edits and if the edits are valid (i.e. no overlapping regions, document was not changed in the meantime, etc.)1397* they can be applied on a {@link TextDocument document} associated with a {@link TextEditor text editor}.1398*/1399export interface TextEditorEdit {1400/**1401* Replace a certain text region with a new value.1402* You can use `\r\n` or `\n` in `value` and they will be normalized to the current {@link TextDocument document}.1403*1404* @param location The range this operation should remove.1405* @param value The new text this operation should insert after removing `location`.1406*/1407replace(location: Position | Range | Selection, value: string): void;14081409/**1410* Insert text at a location.1411* You can use `\r\n` or `\n` in `value` and they will be normalized to the current {@link TextDocument document}.1412* Although the equivalent text edit can be made with {@link TextEditorEdit.replace replace}, `insert` will produce a different resulting selection (it will get moved).1413*1414* @param location The position where the new text should be inserted.1415* @param value The new text this operation should insert.1416*/1417insert(location: Position, value: string): void;14181419/**1420* Delete a certain text region.1421*1422* @param location The range this operation should remove.1423*/1424delete(location: Range | Selection): void;14251426/**1427* Set the end of line sequence.1428*1429* @param endOfLine The new end of line for the {@link TextDocument document}.1430*/1431setEndOfLine(endOfLine: EndOfLine): void;1432}14331434/**1435* A universal resource identifier representing either a file on disk1436* or another resource, like untitled resources.1437*/1438export class Uri {14391440/**1441* Create an URI from a string, e.g. `http://www.example.com/some/path`,1442* `file:///usr/home`, or `scheme:with/path`.1443*1444* *Note* that for a while uris without a `scheme` were accepted. That is not correct1445* as all uris should have a scheme. To avoid breakage of existing code the optional1446* `strict`-argument has been added. We *strongly* advise to use it, e.g. `Uri.parse('my:uri', true)`1447*1448* @see {@link Uri.toString}1449* @param value The string value of an Uri.1450* @param strict Throw an error when `value` is empty or when no `scheme` can be parsed.1451* @returns A new Uri instance.1452*/1453static parse(value: string, strict?: boolean): Uri;14541455/**1456* Create an URI from a file system path. The {@link Uri.scheme scheme}1457* will be `file`.1458*1459* The *difference* between {@link Uri.parse} and {@link Uri.file} is that the latter treats the argument1460* as path, not as stringified-uri. E.g. `Uri.file(path)` is *not* the same as1461* `Uri.parse('file://' + path)` because the path might contain characters that are1462* interpreted (# and ?). See the following sample:1463* ```ts1464* const good = URI.file('/coding/c#/project1');1465* good.scheme === 'file';1466* good.path === '/coding/c#/project1';1467* good.fragment === '';1468*1469* const bad = URI.parse('file://' + '/coding/c#/project1');1470* bad.scheme === 'file';1471* bad.path === '/coding/c'; // path is now broken1472* bad.fragment === '/project1';1473* ```1474*1475* @param path A file system or UNC path.1476* @returns A new Uri instance.1477*/1478static file(path: string): Uri;14791480/**1481* Create a new uri which path is the result of joining1482* the path of the base uri with the provided path segments.1483*1484* - Note 1: `joinPath` only affects the path component1485* and all other components (scheme, authority, query, and fragment) are1486* left as they are.1487* - Note 2: The base uri must have a path; an error is thrown otherwise.1488*1489* The path segments are normalized in the following ways:1490* - sequences of path separators (`/` or `\`) are replaced with a single separator1491* - for `file`-uris on windows, the backslash-character (`\`) is considered a path-separator1492* - the `..`-segment denotes the parent segment, the `.` denotes the current segment1493* - paths have a root which always remains, for instance on windows drive-letters are roots1494* so that is true: `joinPath(Uri.file('file:///c:/root'), '../../other').fsPath === 'c:/other'`1495*1496* @param base An uri. Must have a path.1497* @param pathSegments One more more path fragments1498* @returns A new uri which path is joined with the given fragments1499*/1500static joinPath(base: Uri, ...pathSegments: string[]): Uri;15011502/**1503* Create an URI from its component parts1504*1505* @see {@link Uri.toString}1506* @param components The component parts of an Uri.1507* @returns A new Uri instance.1508*/1509static from(components: {1510/**1511* The scheme of the uri1512*/1513readonly scheme: string;1514/**1515* The authority of the uri1516*/1517readonly authority?: string;1518/**1519* The path of the uri1520*/1521readonly path?: string;1522/**1523* The query string of the uri1524*/1525readonly query?: string;1526/**1527* The fragment identifier of the uri1528*/1529readonly fragment?: string;1530}): Uri;15311532/**1533* Use the `file` and `parse` factory functions to create new `Uri` objects.1534*/1535private constructor(scheme: string, authority: string, path: string, query: string, fragment: string);15361537/**1538* Scheme is the `http` part of `http://www.example.com/some/path?query#fragment`.1539* The part before the first colon.1540*/1541readonly scheme: string;15421543/**1544* Authority is the `www.example.com` part of `http://www.example.com/some/path?query#fragment`.1545* The part between the first double slashes and the next slash.1546*/1547readonly authority: string;15481549/**1550* Path is the `/some/path` part of `http://www.example.com/some/path?query#fragment`.1551*/1552readonly path: string;15531554/**1555* Query is the `query` part of `http://www.example.com/some/path?query#fragment`.1556*/1557readonly query: string;15581559/**1560* Fragment is the `fragment` part of `http://www.example.com/some/path?query#fragment`.1561*/1562readonly fragment: string;15631564/**1565* The string representing the corresponding file system path of this Uri.1566*1567* Will handle UNC paths and normalize windows drive letters to lower-case. Also1568* uses the platform specific path separator.1569*1570* * Will *not* validate the path for invalid characters and semantics.1571* * Will *not* look at the scheme of this Uri.1572* * The resulting string shall *not* be used for display purposes but1573* for disk operations, like `readFile` et al.1574*1575* The *difference* to the {@linkcode Uri.path path}-property is the use of the platform specific1576* path separator and the handling of UNC paths. The sample below outlines the difference:1577* ```ts1578* const u = URI.parse('file://server/c$/folder/file.txt')1579* u.authority === 'server'1580* u.path === '/c$/folder/file.txt'1581* u.fsPath === '\\server\c$\folder\file.txt'1582* ```1583*/1584readonly fsPath: string;15851586/**1587* Derive a new Uri from this Uri.1588*1589* ```ts1590* let file = Uri.parse('before:some/file/path');1591* let other = file.with({ scheme: 'after' });1592* assert.ok(other.toString() === 'after:some/file/path');1593* ```1594*1595* @param change An object that describes a change to this Uri. To unset components use `null` or1596* the empty string.1597* @returns A new Uri that reflects the given change. Will return `this` Uri if the change1598* is not changing anything.1599*/1600with(change: {1601/**1602* The new scheme, defaults to this Uri's scheme.1603*/1604scheme?: string;1605/**1606* The new authority, defaults to this Uri's authority.1607*/1608authority?: string;1609/**1610* The new path, defaults to this Uri's path.1611*/1612path?: string;1613/**1614* The new query, defaults to this Uri's query.1615*/1616query?: string;1617/**1618* The new fragment, defaults to this Uri's fragment.1619*/1620fragment?: string;1621}): Uri;16221623/**1624* Returns a string representation of this Uri. The representation and normalization1625* of a URI depends on the scheme.1626*1627* * The resulting string can be safely used with {@link Uri.parse}.1628* * The resulting string shall *not* be used for display purposes.1629*1630* *Note* that the implementation will encode _aggressive_ which often leads to unexpected,1631* but not incorrect, results. For instance, colons are encoded to `%3A` which might be unexpected1632* in file-uri. Also `&` and `=` will be encoded which might be unexpected for http-uris. For stability1633* reasons this cannot be changed anymore. If you suffer from too aggressive encoding you should use1634* the `skipEncoding`-argument: `uri.toString(true)`.1635*1636* @param skipEncoding Do not percentage-encode the result, defaults to `false`. Note that1637* the `#` and `?` characters occurring in the path will always be encoded.1638* @returns A string representation of this Uri.1639*/1640toString(skipEncoding?: boolean): string;16411642/**1643* Returns a JSON representation of this Uri.1644*1645* @returns An object.1646*/1647toJSON(): any;1648}16491650/**1651* A cancellation token is passed to an asynchronous or long running1652* operation to request cancellation, like cancelling a request1653* for completion items because the user continued to type.1654*1655* To get an instance of a `CancellationToken` use a1656* {@link CancellationTokenSource}.1657*/1658export interface CancellationToken {16591660/**1661* Is `true` when the token has been cancelled, `false` otherwise.1662*/1663isCancellationRequested: boolean;16641665/**1666* An {@link Event} which fires upon cancellation.1667*/1668readonly onCancellationRequested: Event<any>;1669}16701671/**1672* A cancellation source creates and controls a {@link CancellationToken cancellation token}.1673*/1674export class CancellationTokenSource {16751676/**1677* The cancellation token of this source.1678*/1679token: CancellationToken;16801681/**1682* Signal cancellation on the token.1683*/1684cancel(): void;16851686/**1687* Dispose object and free resources.1688*/1689dispose(): void;1690}16911692/**1693* An error type that should be used to signal cancellation of an operation.1694*1695* This type can be used in response to a {@link CancellationToken cancellation token}1696* being cancelled or when an operation is being cancelled by the1697* executor of that operation.1698*/1699export class CancellationError extends Error {17001701/**1702* Creates a new cancellation error.1703*/1704constructor();1705}17061707/**1708* Represents a type which can release resources, such1709* as event listening or a timer.1710*/1711export class Disposable {17121713/**1714* Combine many disposable-likes into one. You can use this method when having objects with1715* a dispose function which aren't instances of `Disposable`.1716*1717* @param disposableLikes Objects that have at least a `dispose`-function member. Note that asynchronous1718* dispose-functions aren't awaited.1719* @returns Returns a new disposable which, upon dispose, will1720* dispose all provided disposables.1721*/1722static from(...disposableLikes: {1723/**1724* Function to clean up resources.1725*/1726dispose: () => any;1727}[]): Disposable;17281729/**1730* Creates a new disposable that calls the provided function1731* on dispose.1732*1733* *Note* that an asynchronous function is not awaited.1734*1735* @param callOnDispose Function that disposes something.1736*/1737constructor(callOnDispose: () => any);17381739/**1740* Dispose this object.1741*/1742dispose(): any;1743}17441745/**1746* Represents a typed event.1747*1748* A function that represents an event to which you subscribe by calling it with1749* a listener function as argument.1750*1751* @example1752* item.onDidChange(function(event) { console.log("Event happened: " + event); });1753*/1754export interface Event<T> {17551756/**1757* A function that represents an event to which you subscribe by calling it with1758* a listener function as argument.1759*1760* @param listener The listener function will be called when the event happens.1761* @param thisArgs The `this`-argument which will be used when calling the event listener.1762* @param disposables An array to which a {@link Disposable} will be added.1763* @returns A disposable which unsubscribes the event listener.1764*/1765(listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable;1766}17671768/**1769* An event emitter can be used to create and manage an {@link Event} for others1770* to subscribe to. One emitter always owns one event.1771*1772* Use this class if you want to provide event from within your extension, for instance1773* inside a {@link TextDocumentContentProvider} or when providing1774* API to other extensions.1775*/1776export class EventEmitter<T> {17771778/**1779* The event listeners can subscribe to.1780*/1781event: Event<T>;17821783/**1784* Notify all subscribers of the {@link EventEmitter.event event}. Failure1785* of one or more listener will not fail this function call.1786*1787* @param data The event object.1788*/1789fire(data: T): void;17901791/**1792* Dispose this object and free resources.1793*/1794dispose(): void;1795}17961797/**1798* A file system watcher notifies about changes to files and folders1799* on disk or from other {@link FileSystemProvider FileSystemProviders}.1800*1801* To get an instance of a `FileSystemWatcher` use1802* {@link workspace.createFileSystemWatcher createFileSystemWatcher}.1803*/1804export interface FileSystemWatcher extends Disposable {18051806/**1807* true if this file system watcher has been created such that1808* it ignores creation file system events.1809*/1810readonly ignoreCreateEvents: boolean;18111812/**1813* true if this file system watcher has been created such that1814* it ignores change file system events.1815*/1816readonly ignoreChangeEvents: boolean;18171818/**1819* true if this file system watcher has been created such that1820* it ignores delete file system events.1821*/1822readonly ignoreDeleteEvents: boolean;18231824/**1825* An event which fires on file/folder creation.1826*/1827readonly onDidCreate: Event<Uri>;18281829/**1830* An event which fires on file/folder change.1831*/1832readonly onDidChange: Event<Uri>;18331834/**1835* An event which fires on file/folder deletion.1836*/1837readonly onDidDelete: Event<Uri>;1838}18391840/**1841* A text document content provider allows to add readonly documents1842* to the editor, such as source from a dll or generated html from md.1843*1844* Content providers are {@link workspace.registerTextDocumentContentProvider registered}1845* for a {@link Uri.scheme uri-scheme}. When a uri with that scheme is to1846* be {@link workspace.openTextDocument loaded} the content provider is1847* asked.1848*/1849export interface TextDocumentContentProvider {18501851/**1852* An event to signal a resource has changed.1853*/1854onDidChange?: Event<Uri>;18551856/**1857* Provide textual content for a given uri.1858*1859* The editor will use the returned string-content to create a readonly1860* {@link TextDocument document}. Resources allocated should be released when1861* the corresponding document has been {@link workspace.onDidCloseTextDocument closed}.1862*1863* **Note**: The contents of the created {@link TextDocument document} might not be1864* identical to the provided text due to end-of-line-sequence normalization.1865*1866* @param uri An uri which scheme matches the scheme this provider was {@link workspace.registerTextDocumentContentProvider registered} for.1867* @param token A cancellation token.1868* @returns A string or a thenable that resolves to such.1869*/1870provideTextDocumentContent(uri: Uri, token: CancellationToken): ProviderResult<string>;1871}18721873/**1874* Defines the kind of {@link QuickPickItem quick pick item}.1875*/1876export enum QuickPickItemKind {1877/**1878* A separator item that provides a visual grouping.1879*1880* When a {@link QuickPickItem} has a kind of {@link Separator}, the item is just a visual separator1881* and does not represent a selectable item. The only property that applies is1882* {@link QuickPickItem.label label}. All other properties on {@link QuickPickItem} will be ignored1883* and have no effect.1884*/1885Separator = -1,1886/**1887* The default kind for an item that can be selected in the quick pick.1888*/1889Default = 0,1890}18911892/**1893* Represents an item that can be selected from a list of items.1894*/1895export interface QuickPickItem {18961897/**1898* A human-readable string which is rendered prominently.1899*1900* Supports rendering of {@link ThemeIcon theme icons} via the `$(<name>)`-syntax.1901*1902* **Note:** When {@link QuickPickItem.kind kind} is set to {@link QuickPickItemKind.Default} (so a regular1903* item instead of a separator), it supports rendering of {@link ThemeIcon theme icons} via the1904* `$(<name>)`-syntax.1905*/1906label: string;19071908/**1909* The kind of this item that determines how it is rendered in the quick pick.1910*1911* When not specified, the default is {@link QuickPickItemKind.Default}.1912*/1913kind?: QuickPickItemKind;19141915/**1916* The icon for the item.1917*/1918iconPath?: IconPath;19191920/**1921* A human-readable string which is rendered less prominently in the same line.1922*1923* Supports rendering of {@link ThemeIcon theme icons} via the `$(<name>)`-syntax.1924*1925* **Note:** This property is ignored when {@link QuickPickItem.kind kind} is set to1926* {@link QuickPickItemKind.Separator}.1927*/1928description?: string;19291930/**1931* A human-readable string which is rendered less prominently in a separate line.1932*1933* Supports rendering of {@link ThemeIcon theme icons} via the `$(<name>)`-syntax.1934*1935* **Note:** This property is ignored when {@link QuickPickItem.kind kind} is set to1936* {@link QuickPickItemKind.Separator}.1937*/1938detail?: string;19391940/**1941* A {@link Uri} representing the resource associated with this item.1942*1943* When set, this property is used to automatically derive several item properties if they are not explicitly provided:1944* - **Label**: Derived from the resource's file name when {@link QuickPickItem.label label} is not provided or is empty.1945* - **Description**: Derived from the resource's path when {@link QuickPickItem.description description} is not provided or is empty.1946* - **Icon**: Derived from the current file icon theme when {@link QuickPickItem.iconPath iconPath} is set to1947* {@link ThemeIcon.File} or {@link ThemeIcon.Folder}.1948*/1949resourceUri?: Uri;19501951/**1952* Optional flag indicating if this item is initially selected.1953*1954* This is only honored when using the {@link window.showQuickPick showQuickPick} API. To do the same1955* thing with the {@link window.createQuickPick createQuickPick} API, simply set the1956* {@link QuickPick.selectedItems selectedItems} to the items you want selected initially.1957*1958* **Note:** This is only honored when the picker allows multiple selections.1959*1960* @see {@link QuickPickOptions.canPickMany}1961*1962* **Note:** This property is ignored when {@link QuickPickItem.kind kind} is set to1963* {@link QuickPickItemKind.Separator}.1964*/1965picked?: boolean;19661967/**1968* Determines if this item is always shown, even when filtered out by the user's input.1969*1970* **Note:** This property is ignored when {@link QuickPickItem.kind kind} is set to1971* {@link QuickPickItemKind.Separator}.1972*/1973alwaysShow?: boolean;19741975/**1976* Optional buttons that will be rendered on this particular item.1977*1978* These buttons will trigger an {@link QuickPickItemButtonEvent} when pressed. Buttons are only rendered1979* when using a quick pick created by the {@link window.createQuickPick createQuickPick} API. Buttons are1980* not rendered when using the {@link window.showQuickPick showQuickPick} API.1981*1982* **Note:** This property is ignored when {@link QuickPickItem.kind kind} is set to1983* {@link QuickPickItemKind.Separator}.1984*/1985buttons?: readonly QuickInputButton[];1986}19871988/**1989* Options to configure the behavior of the quick pick UI.1990*/1991export interface QuickPickOptions {19921993/**1994* An optional title for the quick pick.1995*/1996title?: string;19971998/**1999* Determines if the {@link QuickPickItem.description description} should be included when filtering items. Defaults to `false`.2000*/2001matchOnDescription?: boolean;20022003/**2004* Determines if the {@link QuickPickItem.detail detail} should be included when filtering items. Defaults to `false`.2005*/2006matchOnDetail?: boolean;20072008/**2009* An optional string to show as placeholder in the input box to guide the user.2010*/2011placeHolder?: string;20122013/**2014* Optional text that provides instructions or context to the user.2015*2016* The prompt is displayed below the input box and above the list of items.2017*/2018prompt?: string;20192020/**2021* Set to `true` to keep the picker open when focus moves to another part of the editor or to another window.2022* This setting is ignored on iPad and is always `false`.2023*/2024ignoreFocusOut?: boolean;20252026/**2027* Determines if the picker allows multiple selections. When `true`, the result is an array of picks.2028*/2029canPickMany?: boolean;20302031/**2032* An optional function that is invoked whenever an item is selected.2033*/2034onDidSelectItem?(item: QuickPickItem | string): any;2035}20362037/**2038* Options to configure the behavior of the {@link WorkspaceFolder workspace folder} pick UI.2039*/2040export interface WorkspaceFolderPickOptions {20412042/**2043* An optional string to show as placeholder in the input box to guide the user.2044*/2045placeHolder?: string;20462047/**2048* Set to `true` to keep the picker open when focus moves to another part of the editor or to another window.2049* This setting is ignored on iPad and is always `false`.2050*/2051ignoreFocusOut?: boolean;2052}20532054/**2055* Options to configure the behavior of a file open dialog.2056*2057* * Note 1: On Windows and Linux, a file dialog cannot be both a file selector and a folder selector, so if you2058* set both `canSelectFiles` and `canSelectFolders` to `true` on these platforms, a folder selector will be shown.2059* * Note 2: Explicitly setting `canSelectFiles` and `canSelectFolders` to `false` is futile2060* and the editor then silently adjusts the options to select files.2061*/2062export interface OpenDialogOptions {2063/**2064* The resource the dialog shows when opened.2065*/2066defaultUri?: Uri;20672068/**2069* A human-readable string for the open button.2070*/2071openLabel?: string;20722073/**2074* Allow to select files, defaults to `true`.2075*/2076canSelectFiles?: boolean;20772078/**2079* Allow to select folders, defaults to `false`.2080*/2081canSelectFolders?: boolean;20822083/**2084* Allow to select many files or folders.2085*/2086canSelectMany?: boolean;20872088/**2089* A set of file filters that are used by the dialog. Each entry is a human-readable label,2090* like "TypeScript", and an array of extensions, for example:2091* ```ts2092* {2093* 'Images': ['png', 'jpg'],2094* 'TypeScript': ['ts', 'tsx']2095* }2096* ```2097*/2098filters?: { [name: string]: string[] };20992100/**2101* Dialog title.2102*2103* This parameter might be ignored, as not all operating systems display a title on open dialogs2104* (for example, macOS).2105*/2106title?: string;2107}21082109/**2110* Options to configure the behaviour of a file save dialog.2111*/2112export interface SaveDialogOptions {2113/**2114* The resource the dialog shows when opened.2115*/2116defaultUri?: Uri;21172118/**2119* A human-readable string for the save button.2120*/2121saveLabel?: string;21222123/**2124* A set of file filters that are used by the dialog. Each entry is a human-readable label,2125* like "TypeScript", and an array of extensions, for example:2126* ```ts2127* {2128* 'Images': ['png', 'jpg'],2129* 'TypeScript': ['ts', 'tsx']2130* }2131* ```2132*/2133filters?: { [name: string]: string[] };21342135/**2136* Dialog title.2137*2138* This parameter might be ignored, as not all operating systems display a title on save dialogs2139* (for example, macOS).2140*/2141title?: string;2142}21432144/**2145* Represents an action that is shown with an information, warning, or2146* error message.2147*2148* @see {@link window.showInformationMessage showInformationMessage}2149* @see {@link window.showWarningMessage showWarningMessage}2150* @see {@link window.showErrorMessage showErrorMessage}2151*/2152export interface MessageItem {21532154/**2155* A short title like 'Retry', 'Open Log' etc.2156*/2157title: string;21582159/**2160* A hint for modal dialogs that the item should be triggered2161* when the user cancels the dialog (e.g. by pressing the ESC2162* key).2163*2164* Note: this option is ignored for non-modal messages.2165*/2166isCloseAffordance?: boolean;2167}21682169/**2170* Options to configure the behavior of the message.2171*2172* @see {@link window.showInformationMessage showInformationMessage}2173* @see {@link window.showWarningMessage showWarningMessage}2174* @see {@link window.showErrorMessage showErrorMessage}2175*/2176export interface MessageOptions {21772178/**2179* Indicates that this message should be modal.2180*/2181modal?: boolean;21822183/**2184* Human-readable detail message that is rendered less prominent. _Note_ that detail2185* is only shown for {@link MessageOptions.modal modal} messages.2186*/2187detail?: string;2188}21892190/**2191* Severity levels for input box validation messages.2192*/2193export enum InputBoxValidationSeverity {2194/**2195* Indicates an informational message that does not prevent input acceptance.2196*/2197Info = 1,2198/**2199* Indicates a warning message that does not prevent input acceptance.2200*/2201Warning = 2,2202/**2203* Indicates an error message that prevents the user from accepting the input.2204*/2205Error = 32206}22072208/**2209* Represents a validation message for an {@link InputBox}.2210*/2211export interface InputBoxValidationMessage {2212/**2213* The validation message to display to the user.2214*/2215readonly message: string;22162217/**2218* The severity level of the validation message.2219*2220* **Note:** When using {@link InputBoxValidationSeverity.Error}, the user will not be able to accept2221* the input (e.g., by pressing Enter). {@link InputBoxValidationSeverity.Info Info} and2222* {@link InputBoxValidationSeverity.Warning Warning} severities will still allow the input to be accepted.2223*/2224readonly severity: InputBoxValidationSeverity;2225}22262227/**2228* Options to configure the behavior of the input box UI.2229*/2230export interface InputBoxOptions {22312232/**2233* An optional string that represents the title of the input box.2234*/2235title?: string;22362237/**2238* The value to pre-fill in the input box.2239*/2240value?: string;22412242/**2243* Selection of the pre-filled {@linkcode InputBoxOptions.value value}. Defined as tuple of two number where the2244* first is the inclusive start index and the second the exclusive end index. When `undefined` the whole2245* pre-filled value will be selected, when empty (start equals end) only the cursor will be set,2246* otherwise the defined range will be selected.2247*/2248valueSelection?: [number, number];22492250/**2251* The text to display underneath the input box.2252*/2253prompt?: string;22542255/**2256* An optional string to show as placeholder in the input box to guide the user what to type.2257*/2258placeHolder?: string;22592260/**2261* Controls if a password input is shown. Password input hides the typed text.2262*/2263password?: boolean;22642265/**2266* Set to `true` to keep the input box open when focus moves to another part of the editor or to another window.2267* This setting is ignored on iPad and is always false.2268*/2269ignoreFocusOut?: boolean;22702271/**2272* An optional function that will be called to validate input and to give a hint2273* to the user.2274*2275* @param value The current value of the input box.2276* @returns Either a human-readable string which is presented as an error message or an {@link InputBoxValidationMessage}2277* which can provide a specific message severity. Return `undefined`, `null`, or the empty string when 'value' is valid.2278*/2279validateInput?(value: string): string | InputBoxValidationMessage | undefined | null |2280Thenable<string | InputBoxValidationMessage | undefined | null>;2281}22822283/**2284* A relative pattern is a helper to construct glob patterns that are matched2285* relatively to a base file path. The base path can either be an absolute file2286* path as string or uri or a {@link WorkspaceFolder workspace folder}, which is the2287* preferred way of creating the relative pattern.2288*/2289export class RelativePattern {22902291/**2292* A base file path to which this pattern will be matched against relatively. The2293* file path must be absolute, should not have any trailing path separators and2294* not include any relative segments (`.` or `..`).2295*/2296baseUri: Uri;22972298/**2299* A base file path to which this pattern will be matched against relatively.2300*2301* This matches the `fsPath` value of {@link RelativePattern.baseUri}.2302*2303* *Note:* updating this value will update {@link RelativePattern.baseUri} to2304* be a uri with `file` scheme.2305*2306* @deprecated This property is deprecated, please use {@link RelativePattern.baseUri} instead.2307*/2308base: string;23092310/**2311* A file glob pattern like `*.{ts,js}` that will be matched on file paths2312* relative to the base path.2313*2314* Example: Given a base of `/home/work/folder` and a file path of `/home/work/folder/index.js`,2315* the file glob pattern will match on `index.js`.2316*/2317pattern: string;23182319/**2320* Creates a new relative pattern object with a base file path and pattern to match. This pattern2321* will be matched on file paths relative to the base.2322*2323* Example:2324* ```ts2325* const folder = vscode.workspace.workspaceFolders?.[0];2326* if (folder) {2327*2328* // Match any TypeScript file in the root of this workspace folder2329* const pattern1 = new vscode.RelativePattern(folder, '*.ts');2330*2331* // Match any TypeScript file in `someFolder` inside this workspace folder2332* const pattern2 = new vscode.RelativePattern(folder, 'someFolder/*.ts');2333* }2334* ```2335*2336* @param base A base to which this pattern will be matched against relatively. It is recommended2337* to pass in a {@link WorkspaceFolder workspace folder} if the pattern should match inside the workspace.2338* Otherwise, a uri or string should only be used if the pattern is for a file path outside the workspace.2339* @param pattern A file glob pattern like `*.{ts,js}` that will be matched on paths relative to the base.2340*/2341constructor(base: WorkspaceFolder | Uri | string, pattern: string);2342}23432344/**2345* A file glob pattern to match file paths against. This can either be a glob pattern string2346* (like `**​/*.{ts,js}` or `*.{ts,js}`) or a {@link RelativePattern relative pattern}.2347*2348* Glob patterns can have the following syntax:2349* * `*` to match zero or more characters in a path segment2350* * `?` to match on one character in a path segment2351* * `**` to match any number of path segments, including none2352* * `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)2353* * `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)2354* * `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)2355*2356* Note: a backslash (`\`) is not valid within a glob pattern. If you have an existing file2357* path to match against, consider to use the {@link RelativePattern relative pattern} support2358* that takes care of converting any backslash into slash. Otherwise, make sure to convert2359* any backslash to slash when creating the glob pattern.2360*/2361export type GlobPattern = string | RelativePattern;23622363/**2364* A document filter denotes a document by different properties like2365* the {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of2366* its resource, or a glob-pattern that is applied to the {@link TextDocument.fileName path}.2367*2368* @example <caption>A language filter that applies to typescript files on disk</caption>2369* { language: 'typescript', scheme: 'file' }2370*2371* @example <caption>A language filter that applies to all package.json paths</caption>2372* { language: 'json', pattern: '**​/package.json' }2373*/2374export interface DocumentFilter {23752376/**2377* A language id, like `typescript`.2378*/2379readonly language?: string;23802381/**2382* The {@link NotebookDocument.notebookType type} of a notebook, like `jupyter-notebook`. This allows2383* to narrow down on the type of a notebook that a {@link NotebookCell.document cell document} belongs to.2384*2385* *Note* that setting the `notebookType`-property changes how `scheme` and `pattern` are interpreted. When set2386* they are evaluated against the {@link NotebookDocument.uri notebook uri}, not the document uri.2387*2388* @example <caption>Match python document inside jupyter notebook that aren't stored yet (`untitled`)</caption>2389* { language: 'python', notebookType: 'jupyter-notebook', scheme: 'untitled' }2390*/2391readonly notebookType?: string;23922393/**2394* A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.2395*/2396readonly scheme?: string;23972398/**2399* A {@link GlobPattern glob pattern} that is matched on the absolute path of the document. Use a {@link RelativePattern relative pattern}2400* to filter documents to a {@link WorkspaceFolder workspace folder}.2401*/2402readonly pattern?: GlobPattern;2403}24042405/**2406* A language selector is the combination of one or many language identifiers2407* and {@link DocumentFilter language filters}.2408*2409* *Note* that a document selector that is just a language identifier selects *all*2410* documents, even those that are not saved on disk. Only use such selectors when2411* a feature works without further context, e.g. without the need to resolve related2412* 'files'.2413*2414* @example2415* let sel:DocumentSelector = { scheme: 'file', language: 'typescript' };2416*/2417export type DocumentSelector = DocumentFilter | string | ReadonlyArray<DocumentFilter | string>;24182419/**2420* A provider result represents the values a provider, like the {@linkcode HoverProvider},2421* may return. For once this is the actual result type `T`, like `Hover`, or a thenable that resolves2422* to that type `T`. In addition, `null` and `undefined` can be returned - either directly or from a2423* thenable.2424*2425* The snippets below are all valid implementations of the {@linkcode HoverProvider}:2426*2427* ```ts2428* let a: HoverProvider = {2429* provideHover(doc, pos, token): ProviderResult<Hover> {2430* return new Hover('Hello World');2431* }2432* }2433*2434* let b: HoverProvider = {2435* provideHover(doc, pos, token): ProviderResult<Hover> {2436* return new Promise(resolve => {2437* resolve(new Hover('Hello World'));2438* });2439* }2440* }2441*2442* let c: HoverProvider = {2443* provideHover(doc, pos, token): ProviderResult<Hover> {2444* return; // undefined2445* }2446* }2447* ```2448*/2449export type ProviderResult<T> = T | undefined | null | Thenable<T | undefined | null>;24502451/**2452* Kind of a code action.2453*2454* Kinds are a hierarchical list of identifiers separated by `.`, e.g. `"refactor.extract.function"`.2455*2456* Code action kinds are used by the editor for UI elements such as the refactoring context menu. Users2457* can also trigger code actions with a specific kind with the `editor.action.codeAction` command.2458*/2459export class CodeActionKind {2460/**2461* Empty kind.2462*/2463static readonly Empty: CodeActionKind;24642465/**2466* Base kind for quickfix actions: `quickfix`.2467*2468* Quick fix actions address a problem in the code and are shown in the normal code action context menu.2469*/2470static readonly QuickFix: CodeActionKind;24712472/**2473* Base kind for refactoring actions: `refactor`2474*2475* Refactoring actions are shown in the refactoring context menu.2476*/2477static readonly Refactor: CodeActionKind;24782479/**2480* Base kind for refactoring extraction actions: `refactor.extract`2481*2482* Example extract actions:2483*2484* - Extract method2485* - Extract function2486* - Extract variable2487* - Extract interface from class2488* - ...2489*/2490static readonly RefactorExtract: CodeActionKind;24912492/**2493* Base kind for refactoring inline actions: `refactor.inline`2494*2495* Example inline actions:2496*2497* - Inline function2498* - Inline variable2499* - Inline constant2500* - ...2501*/2502static readonly RefactorInline: CodeActionKind;25032504/**2505* Base kind for refactoring move actions: `refactor.move`2506*2507* Example move actions:2508*2509* - Move a function to a new file2510* - Move a property between classes2511* - Move method to base class2512* - ...2513*/2514static readonly RefactorMove: CodeActionKind;25152516/**2517* Base kind for refactoring rewrite actions: `refactor.rewrite`2518*2519* Example rewrite actions:2520*2521* - Convert JavaScript function to class2522* - Add or remove parameter2523* - Encapsulate field2524* - Make method static2525* - ...2526*/2527static readonly RefactorRewrite: CodeActionKind;25282529/**2530* Base kind for source actions: `source`2531*2532* Source code actions apply to the entire file. They must be explicitly requested and will not show in the2533* normal [lightbulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) menu. Source actions2534* can be run on save using `editor.codeActionsOnSave` and are also shown in the `source` context menu.2535*/2536static readonly Source: CodeActionKind;25372538/**2539* Base kind for an organize imports source action: `source.organizeImports`.2540*/2541static readonly SourceOrganizeImports: CodeActionKind;25422543/**2544* Base kind for auto-fix source actions: `source.fixAll`.2545*2546* Fix all actions automatically fix errors that have a clear fix that do not require user input.2547* They should not suppress errors or perform unsafe fixes such as generating new types or classes.2548*/2549static readonly SourceFixAll: CodeActionKind;25502551/**2552* Base kind for all code actions applying to the entire notebook's scope. CodeActionKinds using2553* this should always begin with `notebook.`2554*2555* This requires that new CodeActions be created for it and contributed via extensions.2556* Pre-existing kinds can not just have the new `notebook.` prefix added to them, as the functionality2557* is unique to the full-notebook scope.2558*2559* Notebook CodeActionKinds can be initialized as either of the following (both resulting in `notebook.source.xyz`):2560* - `const newKind = CodeActionKind.Notebook.append(CodeActionKind.Source.append('xyz').value)`2561* - `const newKind = CodeActionKind.Notebook.append('source.xyz')`2562*2563* Example Kinds/Actions:2564* - `notebook.source.organizeImports` (might move all imports to a new top cell)2565* - `notebook.source.normalizeVariableNames` (might rename all variables to a standardized casing format)2566*/2567static readonly Notebook: CodeActionKind;25682569/**2570* Private constructor, use static `CodeActionKind.XYZ` to derive from an existing code action kind.2571*2572* @param value The value of the kind, such as `refactor.extract.function`.2573*/2574private constructor(value: string);25752576/**2577* String value of the kind, e.g. `"refactor.extract.function"`.2578*/2579readonly value: string;25802581/**2582* Create a new kind by appending a more specific selector to the current kind.2583*2584* Does not modify the current kind.2585*/2586append(parts: string): CodeActionKind;25872588/**2589* Checks if this code action kind intersects `other`.2590*2591* The kind `"refactor.extract"` for example intersects `refactor`, `"refactor.extract"` and `"refactor.extract.function"`,2592* but not `"unicorn.refactor.extract"`, or `"refactor.extractAll"`.2593*2594* @param other Kind to check.2595*/2596intersects(other: CodeActionKind): boolean;25972598/**2599* Checks if `other` is a sub-kind of this `CodeActionKind`.2600*2601* The kind `"refactor.extract"` for example contains `"refactor.extract"` and ``"refactor.extract.function"`,2602* but not `"unicorn.refactor.extract"`, or `"refactor.extractAll"` or `refactor`.2603*2604* @param other Kind to check.2605*/2606contains(other: CodeActionKind): boolean;2607}26082609/**2610* The reason why code actions were requested.2611*/2612export enum CodeActionTriggerKind {2613/**2614* Code actions were explicitly requested by the user or by an extension.2615*/2616Invoke = 1,26172618/**2619* Code actions were requested automatically.2620*2621* This typically happens when current selection in a file changes, but can2622* also be triggered when file content changes.2623*/2624Automatic = 2,2625}26262627/**2628* Contains additional diagnostic information about the context in which2629* a {@link CodeActionProvider.provideCodeActions code action} is run.2630*/2631export interface CodeActionContext {2632/**2633* The reason why code actions were requested.2634*/2635readonly triggerKind: CodeActionTriggerKind;26362637/**2638* An array of diagnostics.2639*/2640readonly diagnostics: readonly Diagnostic[];26412642/**2643* Requested kind of actions to return.2644*2645* Actions not of this kind are filtered out before being shown by the [lightbulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action).2646*/2647readonly only: CodeActionKind | undefined;2648}26492650/**2651* A code action represents a change that can be performed in code, e.g. to fix a problem or2652* to refactor code.2653*2654* A CodeAction must set either {@linkcode CodeAction.edit edit} and/or a {@linkcode CodeAction.command command}. If both are supplied, the `edit` is applied first, then the command is executed.2655*/2656export class CodeAction {26572658/**2659* A short, human-readable, title for this code action.2660*/2661title: string;26622663/**2664* A {@link WorkspaceEdit workspace edit} this code action performs.2665*/2666edit?: WorkspaceEdit;26672668/**2669* {@link Diagnostic Diagnostics} that this code action resolves.2670*/2671diagnostics?: Diagnostic[];26722673/**2674* A {@link Command} this code action executes.2675*2676* If this command throws an exception, the editor displays the exception message to users in the editor at the2677* current cursor position.2678*/2679command?: Command;26802681/**2682* {@link CodeActionKind Kind} of the code action.2683*2684* Used to filter code actions.2685*/2686kind?: CodeActionKind;26872688/**2689* Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted2690* by keybindings.2691*2692* A quick fix should be marked preferred if it properly addresses the underlying error.2693* A refactoring should be marked preferred if it is the most reasonable choice of actions to take.2694*/2695isPreferred?: boolean;26962697/**2698* Marks that the code action cannot currently be applied.2699*2700* - Disabled code actions are not shown in automatic [lightbulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action)2701* code action menu.2702*2703* - Disabled actions are shown as faded out in the code action menu when the user request a more specific type2704* of code action, such as refactorings.2705*2706* - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions)2707* that auto applies a code action and only a disabled code actions are returned, the editor will show the user an2708* error message with `reason` in the editor.2709*/2710disabled?: {2711/**2712* Human readable description of why the code action is currently disabled.2713*2714* This is displayed in the code actions UI.2715*/2716readonly reason: string;2717};27182719/**2720* Creates a new code action.2721*2722* A code action must have at least a {@link CodeAction.title title} and {@link CodeAction.edit edits}2723* and/or a {@link CodeAction.command command}.2724*2725* @param title The title of the code action.2726* @param kind The kind of the code action.2727*/2728constructor(title: string, kind?: CodeActionKind);2729}27302731/**2732* Provides contextual actions for code. Code actions typically either fix problems or beautify/refactor code.2733*2734* Code actions are surfaced to users in a few different ways:2735*2736* - The [lightbulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) feature, which shows2737* a list of code actions at the current cursor position. The lightbulb's list of actions includes both quick fixes2738* and refactorings.2739* - As commands that users can run, such as `Refactor`. Users can run these from the command palette or with keybindings.2740* - As source actions, such `Organize Imports`.2741* - {@link CodeActionKind.QuickFix Quick fixes} are shown in the problems view.2742* - Change applied on save by the `editor.codeActionsOnSave` setting.2743*/2744export interface CodeActionProvider<T extends CodeAction = CodeAction> {2745/**2746* Get code actions for a given range in a document.2747*2748* Only return code actions that are relevant to user for the requested range. Also keep in mind how the2749* returned code actions will appear in the UI. The lightbulb widget and `Refactor` commands for instance show2750* returned code actions as a list, so do not return a large number of code actions that will overwhelm the user.2751*2752* @param document The document in which the command was invoked.2753* @param range The selector or range for which the command was invoked. This will always be a2754* {@link Selection selection} if the actions are being requested in the currently active editor.2755* @param context Provides additional information about what code actions are being requested. You can use this2756* to see what specific type of code actions are being requested by the editor in order to return more relevant2757* actions and avoid returning irrelevant code actions that the editor will discard.2758* @param token A cancellation token.2759*2760* @returns An array of code actions, such as quick fixes or refactorings. The lack of a result can be signaled2761* by returning `undefined`, `null`, or an empty array.2762*2763* We also support returning `Command` for legacy reasons, however all new extensions should return2764* `CodeAction` object instead.2765*/2766provideCodeActions(document: TextDocument, range: Range | Selection, context: CodeActionContext, token: CancellationToken): ProviderResult<Array<Command | T>>;27672768/**2769* Given a code action fill in its {@linkcode CodeAction.edit edit}-property. Changes to2770* all other properties, like title, are ignored. A code action that has an edit2771* will not be resolved.2772*2773* *Note* that a code action provider that returns commands, not code actions, cannot successfully2774* implement this function. Returning commands is deprecated and instead code actions should be2775* returned.2776*2777* @param codeAction A code action.2778* @param token A cancellation token.2779* @returns The resolved code action or a thenable that resolves to such. It is OK to return the given2780* `item`. When no result is returned, the given `item` will be used.2781*/2782resolveCodeAction?(codeAction: T, token: CancellationToken): ProviderResult<T>;2783}27842785/**2786* Metadata about the type of code actions that a {@link CodeActionProvider} provides.2787*/2788export interface CodeActionProviderMetadata {2789/**2790* List of {@link CodeActionKind CodeActionKinds} that a {@link CodeActionProvider} may return.2791*2792* This list is used to determine if a given `CodeActionProvider` should be invoked or not.2793* To avoid unnecessary computation, every `CodeActionProvider` should list use `providedCodeActionKinds`. The2794* list of kinds may either be generic, such as `[CodeActionKind.Refactor]`, or list out every kind provided,2795* such as `[CodeActionKind.Refactor.Extract.append('function'), CodeActionKind.Refactor.Extract.append('constant'), ...]`.2796*/2797readonly providedCodeActionKinds?: readonly CodeActionKind[];27982799/**2800* Static documentation for a class of code actions.2801*2802* Documentation from the provider is shown in the code actions menu if either:2803*2804* - Code actions of `kind` are requested by the editor. In this case, the editor will show the documentation that2805* most closely matches the requested code action kind. For example, if a provider has documentation for2806* both `Refactor` and `RefactorExtract`, when the user requests code actions for `RefactorExtract`,2807* the editor will use the documentation for `RefactorExtract` instead of the documentation for `Refactor`.2808*2809* - Any code actions of `kind` are returned by the provider.2810*2811* At most one documentation entry will be shown per provider.2812*/2813readonly documentation?: ReadonlyArray<{2814/**2815* The kind of the code action being documented.2816*2817* If the kind is generic, such as `CodeActionKind.Refactor`, the documentation will be shown whenever any2818* refactorings are returned. If the kind if more specific, such as `CodeActionKind.RefactorExtract`, the2819* documentation will only be shown when extract refactoring code actions are returned.2820*/2821readonly kind: CodeActionKind;28222823/**2824* Command that displays the documentation to the user.2825*2826* This can display the documentation directly in the editor or open a website using {@linkcode env.openExternal};2827*2828* The title of this documentation code action is taken from {@linkcode Command.title}2829*/2830readonly command: Command;2831}>;2832}28332834/**2835* A code lens represents a {@link Command} that should be shown along with2836* source text, like the number of references, a way to run tests, etc.2837*2838* A code lens is _unresolved_ when no command is associated to it. For performance2839* reasons the creation of a code lens and resolving should be done to two stages.2840*2841* @see {@link CodeLensProvider.provideCodeLenses}2842* @see {@link CodeLensProvider.resolveCodeLens}2843*/2844export class CodeLens {28452846/**2847* The range in which this code lens is valid. Should only span a single line.2848*/2849range: Range;28502851/**2852* The command this code lens represents.2853*/2854command?: Command;28552856/**2857* `true` when there is a command associated.2858*/2859readonly isResolved: boolean;28602861/**2862* Creates a new code lens object.2863*2864* @param range The range to which this code lens applies.2865* @param command The command associated to this code lens.2866*/2867constructor(range: Range, command?: Command);2868}28692870/**2871* A code lens provider adds {@link Command commands} to source text. The commands will be shown2872* as dedicated horizontal lines in between the source text.2873*/2874export interface CodeLensProvider<T extends CodeLens = CodeLens> {28752876/**2877* An optional event to signal that the code lenses from this provider have changed.2878*/2879onDidChangeCodeLenses?: Event<void>;28802881/**2882* Compute a list of {@link CodeLens lenses}. This call should return as fast as possible and if2883* computing the commands is expensive implementors should only return code lens objects with the2884* range set and implement {@link CodeLensProvider.resolveCodeLens resolve}.2885*2886* @param document The document in which the command was invoked.2887* @param token A cancellation token.2888* @returns An array of code lenses or a thenable that resolves to such. The lack of a result can be2889* signaled by returning `undefined`, `null`, or an empty array.2890*/2891provideCodeLenses(document: TextDocument, token: CancellationToken): ProviderResult<T[]>;28922893/**2894* This function will be called for each visible code lens, usually when scrolling and after2895* calls to {@link CodeLensProvider.provideCodeLenses compute}-lenses.2896*2897* @param codeLens Code lens that must be resolved.2898* @param token A cancellation token.2899* @returns The given, resolved code lens or thenable that resolves to such.2900*/2901resolveCodeLens?(codeLens: T, token: CancellationToken): ProviderResult<T>;2902}29032904/**2905* Information about where a symbol is defined.2906*2907* Provides additional metadata over normal {@link Location} definitions, including the range of2908* the defining symbol2909*/2910export type DefinitionLink = LocationLink;29112912/**2913* The definition of a symbol represented as one or many {@link Location locations}.2914* For most programming languages there is only one location at which a symbol is2915* defined.2916*/2917export type Definition = Location | Location[];29182919/**2920* The definition provider interface defines the contract between extensions and2921* the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition)2922* and peek definition features.2923*/2924export interface DefinitionProvider {29252926/**2927* Provide the definition of the symbol at the given position and document.2928*2929* @param document The document in which the command was invoked.2930* @param position The position at which the command was invoked.2931* @param token A cancellation token.2932* @returns A definition or a thenable that resolves to such. The lack of a result can be2933* signaled by returning `undefined` or `null`.2934*/2935provideDefinition(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;2936}29372938/**2939* The implementation provider interface defines the contract between extensions and2940* the go to implementation feature.2941*/2942export interface ImplementationProvider {29432944/**2945* Provide the implementations of the symbol at the given position and document.2946*2947* @param document The document in which the command was invoked.2948* @param position The position at which the command was invoked.2949* @param token A cancellation token.2950* @returns A definition or a thenable that resolves to such. The lack of a result can be2951* signaled by returning `undefined` or `null`.2952*/2953provideImplementation(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;2954}29552956/**2957* The type definition provider defines the contract between extensions and2958* the go to type definition feature.2959*/2960export interface TypeDefinitionProvider {29612962/**2963* Provide the type definition of the symbol at the given position and document.2964*2965* @param document The document in which the command was invoked.2966* @param position The position at which the command was invoked.2967* @param token A cancellation token.2968* @returns A definition or a thenable that resolves to such. The lack of a result can be2969* signaled by returning `undefined` or `null`.2970*/2971provideTypeDefinition(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;2972}29732974/**2975* The declaration of a symbol representation as one or many {@link Location locations}2976* or {@link LocationLink location links}.2977*/2978export type Declaration = Location | Location[] | LocationLink[];29792980/**2981* The declaration provider interface defines the contract between extensions and2982* the go to declaration feature.2983*/2984export interface DeclarationProvider {29852986/**2987* Provide the declaration of the symbol at the given position and document.2988*2989* @param document The document in which the command was invoked.2990* @param position The position at which the command was invoked.2991* @param token A cancellation token.2992* @returns A declaration or a thenable that resolves to such. The lack of a result can be2993* signaled by returning `undefined` or `null`.2994*/2995provideDeclaration(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Declaration>;2996}29972998/**2999* Human-readable text that supports formatting via the [markdown syntax](https://commonmark.org).3000*3001* Rendering of {@link ThemeIcon theme icons} via the `$(<name>)`-syntax is supported3002* when the {@linkcode supportThemeIcons} is set to `true`.3003*3004* Rendering of embedded html is supported when {@linkcode supportHtml} is set to `true`.3005*/3006export class MarkdownString {30073008/**3009* The markdown string.3010*/3011value: string;30123013/**3014* Indicates that this markdown string is from a trusted source. Only *trusted*3015* markdown supports links that execute commands, e.g. `[Run it](command:myCommandId)`.3016*3017* Defaults to `false` (commands are disabled).3018*/3019isTrusted?: boolean | {3020/**3021* A set of commend ids that are allowed to be executed by this markdown string.3022*/3023readonly enabledCommands: readonly string[];3024};30253026/**3027* Indicates that this markdown string can contain {@link ThemeIcon ThemeIcons}, e.g. `$(zap)`.3028*/3029supportThemeIcons?: boolean;30303031/**3032* Indicates that this markdown string can contain raw html tags. Defaults to `false`.3033*3034* When `supportHtml` is false, the markdown renderer will strip out any raw html tags3035* that appear in the markdown text. This means you can only use markdown syntax for rendering.3036*3037* When `supportHtml` is true, the markdown render will also allow a safe subset of html tags3038* and attributes to be rendered. See https://github.com/microsoft/vscode/blob/6d2920473c6f13759c978dd89104c4270a83422d/src/vs/base/browser/markdownRenderer.ts#L2963039* for a list of all supported tags and attributes.3040*/3041supportHtml?: boolean;30423043/**3044* Uri that relative paths are resolved relative to.3045*3046* If the `baseUri` ends with `/`, it is considered a directory and relative paths in the markdown are resolved relative to that directory:3047*3048* ```ts3049* const md = new vscode.MarkdownString(`[link](./file.js)`);3050* md.baseUri = vscode.Uri.file('/path/to/dir/');3051* // Here 'link' in the rendered markdown resolves to '/path/to/dir/file.js'3052* ```3053*3054* If the `baseUri` is a file, relative paths in the markdown are resolved relative to the parent dir of that file:3055*3056* ```ts3057* const md = new vscode.MarkdownString(`[link](./file.js)`);3058* md.baseUri = vscode.Uri.file('/path/to/otherFile.js');3059* // Here 'link' in the rendered markdown resolves to '/path/to/file.js'3060* ```3061*/3062baseUri?: Uri;30633064/**3065* Creates a new markdown string with the given value.3066*3067* @param value Optional, initial value.3068* @param supportThemeIcons Optional, Specifies whether {@link ThemeIcon ThemeIcons} are supported within the {@linkcode MarkdownString}.3069*/3070constructor(value?: string, supportThemeIcons?: boolean);30713072/**3073* Appends and escapes the given string to this markdown string.3074* @param value Plain text.3075*/3076appendText(value: string): MarkdownString;30773078/**3079* Appends the given string 'as is' to this markdown string. When {@linkcode MarkdownString.supportThemeIcons supportThemeIcons} is `true`, {@link ThemeIcon ThemeIcons} in the `value` will be iconified.3080* @param value Markdown string.3081*/3082appendMarkdown(value: string): MarkdownString;30833084/**3085* Appends the given string as codeblock using the provided language.3086* @param value A code snippet.3087* @param language An optional {@link languages.getLanguages language identifier}.3088*/3089appendCodeblock(value: string, language?: string): MarkdownString;3090}30913092/**3093* MarkedString can be used to render human-readable text. It is either a markdown string3094* or a code-block that provides a language and a code snippet. Note that3095* markdown strings will be sanitized - that means html will be escaped.3096*3097* @deprecated This type is deprecated, please use {@linkcode MarkdownString} instead.3098*/3099export type MarkedString = string | {3100/**3101* The language of a markdown code block3102* @deprecated please use {@linkcode MarkdownString} instead3103*/3104language: string;3105/**3106* The code snippet of a markdown code block.3107* @deprecated please use {@linkcode MarkdownString} instead3108*/3109value: string;3110};31113112/**3113* A hover represents additional information for a symbol or word. Hovers are3114* rendered in a tooltip-like widget.3115*/3116export class Hover {31173118/**3119* The contents of this hover.3120*/3121contents: Array<MarkdownString | MarkedString>;31223123/**3124* The range to which this hover applies. When missing, the3125* editor will use the range at the current position or the3126* current position itself.3127*/3128range?: Range;31293130/**3131* Creates a new hover object.3132*3133* @param contents The contents of the hover.3134* @param range The range to which the hover applies.3135*/3136constructor(contents: MarkdownString | MarkedString | Array<MarkdownString | MarkedString>, range?: Range);3137}31383139/**3140* The hover provider interface defines the contract between extensions and3141* the [hover](https://code.visualstudio.com/docs/editor/intellisense)-feature.3142*/3143export interface HoverProvider {31443145/**3146* Provide a hover for the given position and document. Multiple hovers at the same3147* position will be merged by the editor. A hover can have a range which defaults3148* to the word range at the position when omitted.3149*3150* @param document The document in which the command was invoked.3151* @param position The position at which the command was invoked.3152* @param token A cancellation token.3153* @returns A hover or a thenable that resolves to such. The lack of a result can be3154* signaled by returning `undefined` or `null`.3155*/3156provideHover(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Hover>;3157}31583159/**3160* An EvaluatableExpression represents an expression in a document that can be evaluated by an active debugger or runtime.3161* The result of this evaluation is shown in a tooltip-like widget.3162* If only a range is specified, the expression will be extracted from the underlying document.3163* An optional expression can be used to override the extracted expression.3164* In this case the range is still used to highlight the range in the document.3165*/3166export class EvaluatableExpression {31673168/**3169* The range is used to extract the evaluatable expression from the underlying document and to highlight it.3170*/3171readonly range: Range;31723173/**3174* If specified the expression overrides the extracted expression.3175*/3176readonly expression?: string | undefined;31773178/**3179* Creates a new evaluatable expression object.3180*3181* @param range The range in the underlying document from which the evaluatable expression is extracted.3182* @param expression If specified overrides the extracted expression.3183*/3184constructor(range: Range, expression?: string);3185}31863187/**3188* The evaluatable expression provider interface defines the contract between extensions and3189* the debug hover. In this contract the provider returns an evaluatable expression for a given position3190* in a document and the editor evaluates this expression in the active debug session and shows the result in a debug hover.3191*/3192export interface EvaluatableExpressionProvider {31933194/**3195* Provide an evaluatable expression for the given document and position.3196* The editor will evaluate this expression in the active debug session and will show the result in the debug hover.3197* The expression can be implicitly specified by the range in the underlying document or by explicitly returning an expression.3198*3199* @param document The document for which the debug hover is about to appear.3200* @param position The line and character position in the document where the debug hover is about to appear.3201* @param token A cancellation token.3202* @returns An EvaluatableExpression or a thenable that resolves to such. The lack of a result can be3203* signaled by returning `undefined` or `null`.3204*/3205provideEvaluatableExpression(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<EvaluatableExpression>;3206}32073208/**3209* Provide inline value as text.3210*/3211export class InlineValueText {3212/**3213* The document range for which the inline value applies.3214*/3215readonly range: Range;3216/**3217* The text of the inline value.3218*/3219readonly text: string;3220/**3221* Creates a new InlineValueText object.3222*3223* @param range The document line where to show the inline value.3224* @param text The value to be shown for the line.3225*/3226constructor(range: Range, text: string);3227}32283229/**3230* Provide inline value through a variable lookup.3231* If only a range is specified, the variable name will be extracted from the underlying document.3232* An optional variable name can be used to override the extracted name.3233*/3234export class InlineValueVariableLookup {3235/**3236* The document range for which the inline value applies.3237* The range is used to extract the variable name from the underlying document.3238*/3239readonly range: Range;3240/**3241* If specified the name of the variable to look up.3242*/3243readonly variableName?: string | undefined;3244/**3245* How to perform the lookup.3246*/3247readonly caseSensitiveLookup: boolean;3248/**3249* Creates a new InlineValueVariableLookup object.3250*3251* @param range The document line where to show the inline value.3252* @param variableName The name of the variable to look up.3253* @param caseSensitiveLookup How to perform the lookup. If missing lookup is case sensitive.3254*/3255constructor(range: Range, variableName?: string, caseSensitiveLookup?: boolean);3256}32573258/**3259* Provide an inline value through an expression evaluation.3260* If only a range is specified, the expression will be extracted from the underlying document.3261* An optional expression can be used to override the extracted expression.3262*/3263export class InlineValueEvaluatableExpression {3264/**3265* The document range for which the inline value applies.3266* The range is used to extract the evaluatable expression from the underlying document.3267*/3268readonly range: Range;3269/**3270* If specified the expression overrides the extracted expression.3271*/3272readonly expression?: string | undefined;3273/**3274* Creates a new InlineValueEvaluatableExpression object.3275*3276* @param range The range in the underlying document from which the evaluatable expression is extracted.3277* @param expression If specified overrides the extracted expression.3278*/3279constructor(range: Range, expression?: string);3280}32813282/**3283* Inline value information can be provided by different means:3284* - directly as a text value (class InlineValueText).3285* - as a name to use for a variable lookup (class InlineValueVariableLookup)3286* - as an evaluatable expression (class InlineValueEvaluatableExpression)3287* The InlineValue types combines all inline value types into one type.3288*/3289export type InlineValue = InlineValueText | InlineValueVariableLookup | InlineValueEvaluatableExpression;32903291/**3292* A value-object that contains contextual information when requesting inline values from a InlineValuesProvider.3293*/3294export interface InlineValueContext {32953296/**3297* The stack frame (as a DAP Id) where the execution has stopped.3298*/3299readonly frameId: number;33003301/**3302* The document range where execution has stopped.3303* Typically the end position of the range denotes the line where the inline values are shown.3304*/3305readonly stoppedLocation: Range;3306}33073308/**3309* The inline values provider interface defines the contract between extensions and the editor's debugger inline values feature.3310* In this contract the provider returns inline value information for a given document range3311* and the editor shows this information in the editor at the end of lines.3312*/3313export interface InlineValuesProvider {33143315/**3316* An optional event to signal that inline values have changed.3317* @see {@link EventEmitter}3318*/3319onDidChangeInlineValues?: Event<void> | undefined;33203321/**3322* Provide "inline value" information for a given document and range.3323* The editor calls this method whenever debugging stops in the given document.3324* The returned inline values information is rendered in the editor at the end of lines.3325*3326* @param document The document for which the inline values information is needed.3327* @param viewPort The visible document range for which inline values should be computed.3328* @param context A bag containing contextual information like the current location.3329* @param token A cancellation token.3330* @returns An array of InlineValueDescriptors or a thenable that resolves to such. The lack of a result can be3331* signaled by returning `undefined` or `null`.3332*/3333provideInlineValues(document: TextDocument, viewPort: Range, context: InlineValueContext, token: CancellationToken): ProviderResult<InlineValue[]>;3334}33353336/**3337* A document highlight kind.3338*/3339export enum DocumentHighlightKind {33403341/**3342* A textual occurrence.3343*/3344Text = 0,33453346/**3347* Read-access of a symbol, like reading a variable.3348*/3349Read = 1,33503351/**3352* Write-access of a symbol, like writing to a variable.3353*/3354Write = 23355}33563357/**3358* A document highlight is a range inside a text document which deserves3359* special attention. Usually a document highlight is visualized by changing3360* the background color of its range.3361*/3362export class DocumentHighlight {33633364/**3365* The range this highlight applies to.3366*/3367range: Range;33683369/**3370* The highlight kind, default is {@link DocumentHighlightKind.Text text}.3371*/3372kind?: DocumentHighlightKind;33733374/**3375* Creates a new document highlight object.3376*3377* @param range The range the highlight applies to.3378* @param kind The highlight kind, default is {@link DocumentHighlightKind.Text text}.3379*/3380constructor(range: Range, kind?: DocumentHighlightKind);3381}33823383/**3384* The document highlight provider interface defines the contract between extensions and3385* the word-highlight-feature.3386*/3387export interface DocumentHighlightProvider {33883389/**3390* Provide a set of document highlights, like all occurrences of a variable or3391* all exit-points of a function.3392*3393* @param document The document in which the command was invoked.3394* @param position The position at which the command was invoked.3395* @param token A cancellation token.3396* @returns An array of document highlights or a thenable that resolves to such. The lack of a result can be3397* signaled by returning `undefined`, `null`, or an empty array.3398*/3399provideDocumentHighlights(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<DocumentHighlight[]>;3400}34013402/**3403* A symbol kind.3404*/3405export enum SymbolKind {3406/**3407* The `File` symbol kind.3408*/3409File = 0,3410/**3411* The `Module` symbol kind.3412*/3413Module = 1,3414/**3415* The `Namespace` symbol kind.3416*/3417Namespace = 2,3418/**3419* The `Package` symbol kind.3420*/3421Package = 3,3422/**3423* The `Class` symbol kind.3424*/3425Class = 4,3426/**3427* The `Method` symbol kind.3428*/3429Method = 5,3430/**3431* The `Property` symbol kind.3432*/3433Property = 6,3434/**3435* The `Field` symbol kind.3436*/3437Field = 7,3438/**3439* The `Constructor` symbol kind.3440*/3441Constructor = 8,3442/**3443* The `Enum` symbol kind.3444*/3445Enum = 9,3446/**3447* The `Interface` symbol kind.3448*/3449Interface = 10,3450/**3451* The `Function` symbol kind.3452*/3453Function = 11,3454/**3455* The `Variable` symbol kind.3456*/3457Variable = 12,3458/**3459* The `Constant` symbol kind.3460*/3461Constant = 13,3462/**3463* The `String` symbol kind.3464*/3465String = 14,3466/**3467* The `Number` symbol kind.3468*/3469Number = 15,3470/**3471* The `Boolean` symbol kind.3472*/3473Boolean = 16,3474/**3475* The `Array` symbol kind.3476*/3477Array = 17,3478/**3479* The `Object` symbol kind.3480*/3481Object = 18,3482/**3483* The `Key` symbol kind.3484*/3485Key = 19,3486/**3487* The `Null` symbol kind.3488*/3489Null = 20,3490/**3491* The `EnumMember` symbol kind.3492*/3493EnumMember = 21,3494/**3495* The `Struct` symbol kind.3496*/3497Struct = 22,3498/**3499* The `Event` symbol kind.3500*/3501Event = 23,3502/**3503* The `Operator` symbol kind.3504*/3505Operator = 24,3506/**3507* The `TypeParameter` symbol kind.3508*/3509TypeParameter = 253510}35113512/**3513* Symbol tags are extra annotations that tweak the rendering of a symbol.3514*/3515export enum SymbolTag {35163517/**3518* Render a symbol as obsolete, usually using a strike-out.3519*/3520Deprecated = 13521}35223523/**3524* Represents information about programming constructs like variables, classes,3525* interfaces etc.3526*/3527export class SymbolInformation {35283529/**3530* The name of this symbol.3531*/3532name: string;35333534/**3535* The name of the symbol containing this symbol.3536*/3537containerName: string;35383539/**3540* The kind of this symbol.3541*/3542kind: SymbolKind;35433544/**3545* Tags for this symbol.3546*/3547tags?: readonly SymbolTag[];35483549/**3550* The location of this symbol.3551*/3552location: Location;35533554/**3555* Creates a new symbol information object.3556*3557* @param name The name of the symbol.3558* @param kind The kind of the symbol.3559* @param containerName The name of the symbol containing the symbol.3560* @param location The location of the symbol.3561*/3562constructor(name: string, kind: SymbolKind, containerName: string, location: Location);35633564/**3565* Creates a new symbol information object.3566*3567* @deprecated Please use the constructor taking a {@link Location} object.3568*3569* @param name The name of the symbol.3570* @param kind The kind of the symbol.3571* @param range The range of the location of the symbol.3572* @param uri The resource of the location of symbol, defaults to the current document.3573* @param containerName The name of the symbol containing the symbol.3574*/3575constructor(name: string, kind: SymbolKind, range: Range, uri?: Uri, containerName?: string);3576}35773578/**3579* Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document3580* symbols can be hierarchical and they have two ranges: one that encloses its definition and one that points to3581* its most interesting range, e.g. the range of an identifier.3582*/3583export class DocumentSymbol {35843585/**3586* The name of this symbol.3587*/3588name: string;35893590/**3591* More detail for this symbol, e.g. the signature of a function.3592*/3593detail: string;35943595/**3596* The kind of this symbol.3597*/3598kind: SymbolKind;35993600/**3601* Tags for this symbol.3602*/3603tags?: readonly SymbolTag[];36043605/**3606* The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.3607*/3608range: Range;36093610/**3611* The range that should be selected and reveal when this symbol is being picked, e.g. the name of a function.3612* Must be contained by the {@linkcode DocumentSymbol.range range}.3613*/3614selectionRange: Range;36153616/**3617* Children of this symbol, e.g. properties of a class.3618*/3619children: DocumentSymbol[];36203621/**3622* Creates a new document symbol.3623*3624* @param name The name of the symbol.3625* @param detail Details for the symbol.3626* @param kind The kind of the symbol.3627* @param range The full range of the symbol.3628* @param selectionRange The range that should be reveal.3629*/3630constructor(name: string, detail: string, kind: SymbolKind, range: Range, selectionRange: Range);3631}36323633/**3634* The document symbol provider interface defines the contract between extensions and3635* the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-symbol)-feature.3636*/3637export interface DocumentSymbolProvider {36383639/**3640* Provide symbol information for the given document.3641*3642* @param document The document in which the command was invoked.3643* @param token A cancellation token.3644* @returns An array of document highlights or a thenable that resolves to such. The lack of a result can be3645* signaled by returning `undefined`, `null`, or an empty array.3646*/3647provideDocumentSymbols(document: TextDocument, token: CancellationToken): ProviderResult<SymbolInformation[] | DocumentSymbol[]>;3648}36493650/**3651* Metadata about a document symbol provider.3652*/3653export interface DocumentSymbolProviderMetadata {3654/**3655* A human-readable string that is shown when multiple outlines trees show for one document.3656*/3657label?: string;3658}36593660/**3661* The workspace symbol provider interface defines the contract between extensions and3662* the [symbol search](https://code.visualstudio.com/docs/editor/editingevolved#_open-symbol-by-name)-feature.3663*/3664export interface WorkspaceSymbolProvider<T extends SymbolInformation = SymbolInformation> {36653666/**3667* Project-wide search for a symbol matching the given query string.3668*3669* The `query`-parameter should be interpreted in a *relaxed way* as the editor will apply its own highlighting3670* and scoring on the results. A good rule of thumb is to match case-insensitive and to simply check that the3671* characters of *query* appear in their order in a candidate symbol. Don't use prefix, substring, or similar3672* strict matching.3673*3674* To improve performance implementors can implement `resolveWorkspaceSymbol` and then provide symbols with partial3675* {@link SymbolInformation.location location}-objects, without a `range` defined. The editor will then call3676* `resolveWorkspaceSymbol` for selected symbols only, e.g. when opening a workspace symbol.3677*3678* @param query A query string, can be the empty string in which case all symbols should be returned.3679* @param token A cancellation token.3680* @returns An array of document highlights or a thenable that resolves to such. The lack of a result can be3681* signaled by returning `undefined`, `null`, or an empty array.3682*/3683provideWorkspaceSymbols(query: string, token: CancellationToken): ProviderResult<T[]>;36843685/**3686* Given a symbol fill in its {@link SymbolInformation.location location}. This method is called whenever a symbol3687* is selected in the UI. Providers can implement this method and return incomplete symbols from3688* {@linkcode WorkspaceSymbolProvider.provideWorkspaceSymbols provideWorkspaceSymbols} which often helps to improve3689* performance.3690*3691* @param symbol The symbol that is to be resolved. Guaranteed to be an instance of an object returned from an3692* earlier call to `provideWorkspaceSymbols`.3693* @param token A cancellation token.3694* @returns The resolved symbol or a thenable that resolves to that. When no result is returned,3695* the given `symbol` is used.3696*/3697resolveWorkspaceSymbol?(symbol: T, token: CancellationToken): ProviderResult<T>;3698}36993700/**3701* Value-object that contains additional information when3702* requesting references.3703*/3704export interface ReferenceContext {37053706/**3707* Include the declaration of the current symbol.3708*/3709readonly includeDeclaration: boolean;3710}37113712/**3713* The reference provider interface defines the contract between extensions and3714* the [find references](https://code.visualstudio.com/docs/editor/editingevolved#_peek)-feature.3715*/3716export interface ReferenceProvider {37173718/**3719* Provide a set of project-wide references for the given position and document.3720*3721* @param document The document in which the command was invoked.3722* @param position The position at which the command was invoked.3723* @param context Additional information about the references request.3724* @param token A cancellation token.3725*3726* @returns An array of locations or a thenable that resolves to such. The lack of a result can be3727* signaled by returning `undefined`, `null`, or an empty array.3728*/3729provideReferences(document: TextDocument, position: Position, context: ReferenceContext, token: CancellationToken): ProviderResult<Location[]>;3730}37313732/**3733* A text edit represents edits that should be applied3734* to a document.3735*/3736export class TextEdit {37373738/**3739* Utility to create a replace edit.3740*3741* @param range A range.3742* @param newText A string.3743* @returns A new text edit object.3744*/3745static replace(range: Range, newText: string): TextEdit;37463747/**3748* Utility to create an insert edit.3749*3750* @param position A position, will become an empty range.3751* @param newText A string.3752* @returns A new text edit object.3753*/3754static insert(position: Position, newText: string): TextEdit;37553756/**3757* Utility to create a delete edit.3758*3759* @param range A range.3760* @returns A new text edit object.3761*/3762static delete(range: Range): TextEdit;37633764/**3765* Utility to create an eol-edit.3766*3767* @param eol An eol-sequence3768* @returns A new text edit object.3769*/3770static setEndOfLine(eol: EndOfLine): TextEdit;37713772/**3773* The range this edit applies to.3774*/3775range: Range;37763777/**3778* The string this edit will insert.3779*/3780newText: string;37813782/**3783* The eol-sequence used in the document.3784*3785* *Note* that the eol-sequence will be applied to the3786* whole document.3787*/3788newEol?: EndOfLine;37893790/**3791* Create a new TextEdit.3792*3793* @param range A range.3794* @param newText A string.3795*/3796constructor(range: Range, newText: string);3797}37983799/**3800* A snippet edit represents an interactive edit that is performed by3801* the editor.3802*3803* *Note* that a snippet edit can always be performed as a normal {@link TextEdit text edit}.3804* This will happen when no matching editor is open or when a {@link WorkspaceEdit workspace edit}3805* contains snippet edits for multiple files. In that case only those that match the active editor3806* will be performed as snippet edits and the others as normal text edits.3807*/3808export class SnippetTextEdit {38093810/**3811* Utility to create a replace snippet edit.3812*3813* @param range A range.3814* @param snippet A snippet string.3815* @returns A new snippet edit object.3816*/3817static replace(range: Range, snippet: SnippetString): SnippetTextEdit;38183819/**3820* Utility to create an insert snippet edit.3821*3822* @param position A position, will become an empty range.3823* @param snippet A snippet string.3824* @returns A new snippet edit object.3825*/3826static insert(position: Position, snippet: SnippetString): SnippetTextEdit;38273828/**3829* The range this edit applies to.3830*/3831range: Range;38323833/**3834* The {@link SnippetString snippet} this edit will perform.3835*/3836snippet: SnippetString;38373838/**3839* Whether the snippet edit should be applied with existing whitespace preserved.3840*/3841keepWhitespace?: boolean;38423843/**3844* Create a new snippet edit.3845*3846* @param range A range.3847* @param snippet A snippet string.3848*/3849constructor(range: Range, snippet: SnippetString);3850}38513852/**3853* A notebook edit represents edits that should be applied to the contents of a notebook.3854*/3855export class NotebookEdit {38563857/**3858* Utility to create a edit that replaces cells in a notebook.3859*3860* @param range The range of cells to replace3861* @param newCells The new notebook cells.3862*/3863static replaceCells(range: NotebookRange, newCells: NotebookCellData[]): NotebookEdit;38643865/**3866* Utility to create an edit that replaces cells in a notebook.3867*3868* @param index The index to insert cells at.3869* @param newCells The new notebook cells.3870*/3871static insertCells(index: number, newCells: NotebookCellData[]): NotebookEdit;38723873/**3874* Utility to create an edit that deletes cells in a notebook.3875*3876* @param range The range of cells to delete.3877*/3878static deleteCells(range: NotebookRange): NotebookEdit;38793880/**3881* Utility to create an edit that update a cell's metadata.3882*3883* @param index The index of the cell to update.3884* @param newCellMetadata The new metadata for the cell.3885*/3886static updateCellMetadata(index: number, newCellMetadata: { [key: string]: any }): NotebookEdit;38873888/**3889* Utility to create an edit that updates the notebook's metadata.3890*3891* @param newNotebookMetadata The new metadata for the notebook.3892*/3893static updateNotebookMetadata(newNotebookMetadata: { [key: string]: any }): NotebookEdit;38943895/**3896* Range of the cells being edited. May be empty.3897*/3898range: NotebookRange;38993900/**3901* New cells being inserted. May be empty.3902*/3903newCells: NotebookCellData[];39043905/**3906* Optional new metadata for the cells.3907*/3908newCellMetadata?: { [key: string]: any };39093910/**3911* Optional new metadata for the notebook.3912*/3913newNotebookMetadata?: { [key: string]: any };39143915/**3916* Create a new notebook edit.3917*3918* @param range A notebook range.3919* @param newCells An array of new cell data.3920*/3921constructor(range: NotebookRange, newCells: NotebookCellData[]);3922}39233924/**3925* Additional data for entries of a workspace edit. Supports to label entries and marks entries3926* as needing confirmation by the user. The editor groups edits with equal labels into tree nodes,3927* for instance all edits labelled with "Changes in Strings" would be a tree node.3928*/3929export interface WorkspaceEditEntryMetadata {39303931/**3932* A flag which indicates that user confirmation is needed.3933*/3934needsConfirmation: boolean;39353936/**3937* A human-readable string which is rendered prominent.3938*/3939label: string;39403941/**3942* A human-readable string which is rendered less prominent on the same line.3943*/3944description?: string;39453946/**3947* The icon path or {@link ThemeIcon} for the edit.3948*/3949iconPath?: IconPath;3950}39513952/**3953* Additional data about a workspace edit.3954*/3955export interface WorkspaceEditMetadata {3956/**3957* Signal to the editor that this edit is a refactoring.3958*/3959isRefactoring?: boolean;3960}39613962/**3963* A workspace edit is a collection of textual and files changes for3964* multiple resources and documents.3965*3966* Use the {@link workspace.applyEdit applyEdit}-function to apply a workspace edit.3967*/3968export class WorkspaceEdit {39693970/**3971* The number of affected resources of textual or resource changes.3972*/3973readonly size: number;39743975/**3976* Replace the given range with given text for the given resource.3977*3978* @param uri A resource identifier.3979* @param range A range.3980* @param newText A string.3981* @param metadata Optional metadata for the entry.3982*/3983replace(uri: Uri, range: Range, newText: string, metadata?: WorkspaceEditEntryMetadata): void;39843985/**3986* Insert the given text at the given position.3987*3988* @param uri A resource identifier.3989* @param position A position.3990* @param newText A string.3991* @param metadata Optional metadata for the entry.3992*/3993insert(uri: Uri, position: Position, newText: string, metadata?: WorkspaceEditEntryMetadata): void;39943995/**3996* Delete the text at the given range.3997*3998* @param uri A resource identifier.3999* @param range A range.4000* @param metadata Optional metadata for the entry.4001*/4002delete(uri: Uri, range: Range, metadata?: WorkspaceEditEntryMetadata): void;40034004/**4005* Check if a text edit for a resource exists.4006*4007* @param uri A resource identifier.4008* @returns `true` if the given resource will be touched by this edit.4009*/4010has(uri: Uri): boolean;40114012/**4013* Set (and replace) text edits or snippet edits for a resource.4014*4015* @param uri A resource identifier.4016* @param edits An array of edits.4017*/4018set(uri: Uri, edits: ReadonlyArray<TextEdit | SnippetTextEdit>): void;40194020/**4021* Set (and replace) text edits or snippet edits with metadata for a resource.4022*4023* @param uri A resource identifier.4024* @param edits An array of edits.4025*/4026set(uri: Uri, edits: ReadonlyArray<[TextEdit | SnippetTextEdit, WorkspaceEditEntryMetadata | undefined]>): void;40274028/**4029* Set (and replace) notebook edits for a resource.4030*4031* @param uri A resource identifier.4032* @param edits An array of edits.4033*/4034set(uri: Uri, edits: readonly NotebookEdit[]): void;40354036/**4037* Set (and replace) notebook edits with metadata for a resource.4038*4039* @param uri A resource identifier.4040* @param edits An array of edits.4041*/4042set(uri: Uri, edits: ReadonlyArray<[NotebookEdit, WorkspaceEditEntryMetadata | undefined]>): void;40434044/**4045* Get the text edits for a resource.4046*4047* @param uri A resource identifier.4048* @returns An array of text edits.4049*/4050get(uri: Uri): TextEdit[];40514052/**4053* Create a regular file.4054*4055* @param uri Uri of the new file.4056* @param options Defines if an existing file should be overwritten or be4057* ignored. When `overwrite` and `ignoreIfExists` are both set `overwrite` wins.4058* When both are unset and when the file already exists then the edit cannot4059* be applied successfully. The `content`-property allows to set the initial contents4060* the file is being created with.4061* @param metadata Optional metadata for the entry.4062*/4063createFile(uri: Uri, options?: {4064/**4065* Overwrite existing file. Overwrite wins over `ignoreIfExists`4066*/4067readonly overwrite?: boolean;4068/**4069* Do nothing if a file with `uri` exists already.4070*/4071readonly ignoreIfExists?: boolean;4072/**4073* The initial contents of the new file.4074*4075* If creating a file from a {@link DocumentDropEditProvider drop operation}, you can4076* pass in a {@link DataTransferFile} to improve performance by avoiding extra data copying.4077*/4078readonly contents?: Uint8Array | DataTransferFile;4079}, metadata?: WorkspaceEditEntryMetadata): void;40804081/**4082* Delete a file or folder.4083*4084* @param uri The uri of the file that is to be deleted.4085* @param metadata Optional metadata for the entry.4086*/4087deleteFile(uri: Uri, options?: {4088/**4089* Delete the content recursively if a folder is denoted.4090*/4091readonly recursive?: boolean;4092/**4093* Do nothing if a file with `uri` exists already.4094*/4095readonly ignoreIfNotExists?: boolean;4096}, metadata?: WorkspaceEditEntryMetadata): void;40974098/**4099* Rename a file or folder.4100*4101* @param oldUri The existing file.4102* @param newUri The new location.4103* @param options Defines if existing files should be overwritten or be4104* ignored. When overwrite and ignoreIfExists are both set overwrite wins.4105* @param metadata Optional metadata for the entry.4106*/4107renameFile(oldUri: Uri, newUri: Uri, options?: {4108/**4109* Overwrite existing file. Overwrite wins over `ignoreIfExists`4110*/4111readonly overwrite?: boolean;4112/**4113* Do nothing if a file with `uri` exists already.4114*/4115readonly ignoreIfExists?: boolean;4116}, metadata?: WorkspaceEditEntryMetadata): void;41174118/**4119* Get all text edits grouped by resource.4120*4121* @returns A shallow copy of `[Uri, TextEdit[]]`-tuples.4122*/4123entries(): [Uri, TextEdit[]][];4124}41254126/**4127* A snippet string is a template which allows to insert text4128* and to control the editor cursor when insertion happens.4129*4130* A snippet can define tab stops and placeholders with `$1`, `$2`4131* and `${3:foo}`. `$0` defines the final tab stop, it defaults to4132* the end of the snippet. Variables are defined with `$name` and4133* `${name:default value}`. Also see4134* [the full snippet syntax](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets).4135*/4136export class SnippetString {41374138/**4139* The snippet string.4140*/4141value: string;41424143/**4144* Create a new snippet string.4145*4146* @param value A snippet string.4147*/4148constructor(value?: string);41494150/**4151* Builder-function that appends the given string to4152* the {@linkcode SnippetString.value value} of this snippet string.4153*4154* @param string A value to append 'as given'. The string will be escaped.4155* @returns This snippet string.4156*/4157appendText(string: string): SnippetString;41584159/**4160* Builder-function that appends a tabstop (`$1`, `$2` etc) to4161* the {@linkcode SnippetString.value value} of this snippet string.4162*4163* @param number The number of this tabstop, defaults to an auto-increment4164* value starting at 1.4165* @returns This snippet string.4166*/4167appendTabstop(number?: number): SnippetString;41684169/**4170* Builder-function that appends a placeholder (`${1:value}`) to4171* the {@linkcode SnippetString.value value} of this snippet string.4172*4173* @param value The value of this placeholder - either a string or a function4174* with which a nested snippet can be created.4175* @param number The number of this tabstop, defaults to an auto-increment4176* value starting at 1.4177* @returns This snippet string.4178*/4179appendPlaceholder(value: string | ((snippet: SnippetString) => any), number?: number): SnippetString;41804181/**4182* Builder-function that appends a choice (`${1|a,b,c|}`) to4183* the {@linkcode SnippetString.value value} of this snippet string.4184*4185* @param values The values for choices - the array of strings4186* @param number The number of this tabstop, defaults to an auto-increment4187* value starting at 1.4188* @returns This snippet string.4189*/4190appendChoice(values: readonly string[], number?: number): SnippetString;41914192/**4193* Builder-function that appends a variable (`${VAR}`) to4194* the {@linkcode SnippetString.value value} of this snippet string.4195*4196* @param name The name of the variable - excluding the `$`.4197* @param defaultValue The default value which is used when the variable name cannot4198* be resolved - either a string or a function with which a nested snippet can be created.4199* @returns This snippet string.4200*/4201appendVariable(name: string, defaultValue: string | ((snippet: SnippetString) => any)): SnippetString;4202}42034204/**4205* The rename provider interface defines the contract between extensions and4206* the [rename](https://code.visualstudio.com/docs/editor/editingevolved#_rename-symbol)-feature.4207*/4208export interface RenameProvider {42094210/**4211* Provide an edit that describes changes that have to be made to one4212* or many resources to rename a symbol to a different name.4213*4214* @param document The document in which the command was invoked.4215* @param position The position at which the command was invoked.4216* @param newName The new name of the symbol. If the given name is not valid, the provider must return a rejected promise.4217* @param token A cancellation token.4218* @returns A workspace edit or a thenable that resolves to such. The lack of a result can be4219* signaled by returning `undefined` or `null`.4220*/4221provideRenameEdits(document: TextDocument, position: Position, newName: string, token: CancellationToken): ProviderResult<WorkspaceEdit>;42224223/**4224* Optional function for resolving and validating a position *before* running rename. The result can4225* be a range or a range and a placeholder text. The placeholder text should be the identifier of the symbol4226* which is being renamed - when omitted the text in the returned range is used.4227*4228* *Note:* This function should throw an error or return a rejected thenable when the provided location4229* doesn't allow for a rename.4230*4231* @param document The document in which rename will be invoked.4232* @param position The position at which rename will be invoked.4233* @param token A cancellation token.4234* @returns The range or range and placeholder text of the identifier that is to be renamed. The lack of a result can signaled by returning `undefined` or `null`.4235*/4236prepareRename?(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Range | {4237/**4238* The range of the identifier that can be renamed.4239*/4240range: Range;4241/**4242* The placeholder of the editors rename input box.4243*/4244placeholder: string;4245}>;4246}42474248/**4249* A semantic tokens legend contains the needed information to decipher4250* the integer encoded representation of semantic tokens.4251*/4252export class SemanticTokensLegend {4253/**4254* The possible token types.4255*/4256readonly tokenTypes: string[];4257/**4258* The possible token modifiers.4259*/4260readonly tokenModifiers: string[];42614262/**4263* Creates a semantic tokens legend.4264*4265* @param tokenTypes An array of token types.4266* @param tokenModifiers An array of token modifiers.4267*/4268constructor(tokenTypes: string[], tokenModifiers?: string[]);4269}42704271/**4272* A semantic tokens builder can help with creating a `SemanticTokens` instance4273* which contains delta encoded semantic tokens.4274*/4275export class SemanticTokensBuilder {42764277/**4278* Creates a semantic tokens builder.4279*4280* @param legend A semantic tokens legend.4281*/4282constructor(legend?: SemanticTokensLegend);42834284/**4285* Add another token.4286*4287* @param line The token start line number (absolute value).4288* @param char The token start character (absolute value).4289* @param length The token length in characters.4290* @param tokenType The encoded token type.4291* @param tokenModifiers The encoded token modifiers.4292*/4293push(line: number, char: number, length: number, tokenType: number, tokenModifiers?: number): void;42944295/**4296* Add another token. Use only when providing a legend.4297*4298* @param range The range of the token. Must be single-line.4299* @param tokenType The token type.4300* @param tokenModifiers The token modifiers.4301*/4302push(range: Range, tokenType: string, tokenModifiers?: readonly string[]): void;43034304/**4305* Finish and create a `SemanticTokens` instance.4306*/4307build(resultId?: string): SemanticTokens;4308}43094310/**4311* Represents semantic tokens, either in a range or in an entire document.4312* @see {@link DocumentSemanticTokensProvider.provideDocumentSemanticTokens provideDocumentSemanticTokens} for an explanation of the format.4313* @see {@link SemanticTokensBuilder} for a helper to create an instance.4314*/4315export class SemanticTokens {4316/**4317* The result id of the tokens.4318*4319* This is the id that will be passed to `DocumentSemanticTokensProvider.provideDocumentSemanticTokensEdits` (if implemented).4320*/4321readonly resultId: string | undefined;4322/**4323* The actual tokens data.4324* @see {@link DocumentSemanticTokensProvider.provideDocumentSemanticTokens provideDocumentSemanticTokens} for an explanation of the format.4325*/4326readonly data: Uint32Array;43274328/**4329* Create new semantic tokens.4330*4331* @param data Token data.4332* @param resultId Result identifier.4333*/4334constructor(data: Uint32Array, resultId?: string);4335}43364337/**4338* Represents edits to semantic tokens.4339* @see {@link DocumentSemanticTokensProvider.provideDocumentSemanticTokensEdits provideDocumentSemanticTokensEdits} for an explanation of the format.4340*/4341export class SemanticTokensEdits {4342/**4343* The result id of the tokens.4344*4345* This is the id that will be passed to `DocumentSemanticTokensProvider.provideDocumentSemanticTokensEdits` (if implemented).4346*/4347readonly resultId: string | undefined;4348/**4349* The edits to the tokens data.4350* All edits refer to the initial data state.4351*/4352readonly edits: SemanticTokensEdit[];43534354/**4355* Create new semantic tokens edits.4356*4357* @param edits An array of semantic token edits4358* @param resultId Result identifier.4359*/4360constructor(edits: SemanticTokensEdit[], resultId?: string);4361}43624363/**4364* Represents an edit to semantic tokens.4365* @see {@link DocumentSemanticTokensProvider.provideDocumentSemanticTokensEdits provideDocumentSemanticTokensEdits} for an explanation of the format.4366*/4367export class SemanticTokensEdit {4368/**4369* The start offset of the edit.4370*/4371readonly start: number;4372/**4373* The count of elements to remove.4374*/4375readonly deleteCount: number;4376/**4377* The elements to insert.4378*/4379readonly data: Uint32Array | undefined;43804381/**4382* Create a semantic token edit.4383*4384* @param start Start offset4385* @param deleteCount Number of elements to remove.4386* @param data Elements to insert4387*/4388constructor(start: number, deleteCount: number, data?: Uint32Array);4389}43904391/**4392* The document semantic tokens provider interface defines the contract between extensions and4393* semantic tokens.4394*/4395export interface DocumentSemanticTokensProvider {4396/**4397* An optional event to signal that the semantic tokens from this provider have changed.4398*/4399onDidChangeSemanticTokens?: Event<void>;44004401/**4402* Tokens in a file are represented as an array of integers. The position of each token is expressed relative to4403* the token before it, because most tokens remain stable relative to each other when edits are made in a file.4404*4405* ---4406* In short, each token takes 5 integers to represent, so a specific token `i` in the file consists of the following array indices:4407* - at index `5*i` - `deltaLine`: token line number, relative to the previous token4408* - at index `5*i+1` - `deltaStart`: token start character, relative to the previous token (relative to 0 or the previous token's start if they are on the same line)4409* - at index `5*i+2` - `length`: the length of the token. A token cannot be multiline.4410* - at index `5*i+3` - `tokenType`: will be looked up in `SemanticTokensLegend.tokenTypes`. We currently ask that `tokenType` < 65536.4411* - at index `5*i+4` - `tokenModifiers`: each set bit will be looked up in `SemanticTokensLegend.tokenModifiers`4412*4413* ---4414* ### How to encode tokens4415*4416* Here is an example for encoding a file with 3 tokens in a uint32 array:4417* ```4418* { line: 2, startChar: 5, length: 3, tokenType: "property", tokenModifiers: ["private", "static"] },4419* { line: 2, startChar: 10, length: 4, tokenType: "type", tokenModifiers: [] },4420* { line: 5, startChar: 2, length: 7, tokenType: "class", tokenModifiers: [] }4421* ```4422*4423* 1. First of all, a legend must be devised. This legend must be provided up-front and capture all possible token types.4424* For this example, we will choose the following legend which must be passed in when registering the provider:4425* ```4426* tokenTypes: ['property', 'type', 'class'],4427* tokenModifiers: ['private', 'static']4428* ```4429*4430* 2. The first transformation step is to encode `tokenType` and `tokenModifiers` as integers using the legend. Token types are looked4431* up by index, so a `tokenType` value of `1` means `tokenTypes[1]`. Multiple token modifiers can be set by using bit flags,4432* so a `tokenModifier` value of `3` is first viewed as binary `0b00000011`, which means `[tokenModifiers[0], tokenModifiers[1]]` because4433* bits 0 and 1 are set. Using this legend, the tokens now are:4434* ```4435* { line: 2, startChar: 5, length: 3, tokenType: 0, tokenModifiers: 3 },4436* { line: 2, startChar: 10, length: 4, tokenType: 1, tokenModifiers: 0 },4437* { line: 5, startChar: 2, length: 7, tokenType: 2, tokenModifiers: 0 }4438* ```4439*4440* 3. The next step is to represent each token relative to the previous token in the file. In this case, the second token4441* is on the same line as the first token, so the `startChar` of the second token is made relative to the `startChar`4442* of the first token, so it will be `10 - 5`. The third token is on a different line than the second token, so the4443* `startChar` of the third token will not be altered:4444* ```4445* { deltaLine: 2, deltaStartChar: 5, length: 3, tokenType: 0, tokenModifiers: 3 },4446* { deltaLine: 0, deltaStartChar: 5, length: 4, tokenType: 1, tokenModifiers: 0 },4447* { deltaLine: 3, deltaStartChar: 2, length: 7, tokenType: 2, tokenModifiers: 0 }4448* ```4449*4450* 4. Finally, the last step is to inline each of the 5 fields for a token in a single array, which is a memory friendly representation:4451* ```4452* // 1st token, 2nd token, 3rd token4453* [ 2,5,3,0,3, 0,5,4,1,0, 3,2,7,2,0 ]4454* ```4455*4456* @see {@link SemanticTokensBuilder} for a helper to encode tokens as integers.4457* *NOTE*: When doing edits, it is possible that multiple edits occur until the editor decides to invoke the semantic tokens provider.4458* *NOTE*: If the provider cannot temporarily compute semantic tokens, it can indicate this by throwing an error with the message 'Busy'.4459*/4460provideDocumentSemanticTokens(document: TextDocument, token: CancellationToken): ProviderResult<SemanticTokens>;44614462/**4463* Instead of always returning all the tokens in a file, it is possible for a `DocumentSemanticTokensProvider` to implement4464* this method (`provideDocumentSemanticTokensEdits`) and then return incremental updates to the previously provided semantic tokens.4465*4466* ---4467* ### How tokens change when the document changes4468*4469* Suppose that `provideDocumentSemanticTokens` has previously returned the following semantic tokens:4470* ```4471* // 1st token, 2nd token, 3rd token4472* [ 2,5,3,0,3, 0,5,4,1,0, 3,2,7,2,0 ]4473* ```4474*4475* Also suppose that after some edits, the new semantic tokens in a file are:4476* ```4477* // 1st token, 2nd token, 3rd token4478* [ 3,5,3,0,3, 0,5,4,1,0, 3,2,7,2,0 ]4479* ```4480* It is possible to express these new tokens in terms of an edit applied to the previous tokens:4481* ```4482* [ 2,5,3,0,3, 0,5,4,1,0, 3,2,7,2,0 ] // old tokens4483* [ 3,5,3,0,3, 0,5,4,1,0, 3,2,7,2,0 ] // new tokens4484*4485* edit: { start: 0, deleteCount: 1, data: [3] } // replace integer at offset 0 with 34486* ```4487*4488* *NOTE*: If the provider cannot compute `SemanticTokensEdits`, it can "give up" and return all the tokens in the document again.4489* *NOTE*: All edits in `SemanticTokensEdits` contain indices in the old integers array, so they all refer to the previous result state.4490*/4491provideDocumentSemanticTokensEdits?(document: TextDocument, previousResultId: string, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensEdits>;4492}44934494/**4495* The document range semantic tokens provider interface defines the contract between extensions and4496* semantic tokens.4497*/4498export interface DocumentRangeSemanticTokensProvider {44994500/**4501* An optional event to signal that the semantic tokens from this provider have changed.4502*/4503onDidChangeSemanticTokens?: Event<void>;45044505/**4506* @see {@link DocumentSemanticTokensProvider.provideDocumentSemanticTokens provideDocumentSemanticTokens}.4507*/4508provideDocumentRangeSemanticTokens(document: TextDocument, range: Range, token: CancellationToken): ProviderResult<SemanticTokens>;4509}45104511/**4512* Value-object describing what options formatting should use.4513*/4514export interface FormattingOptions {45154516/**4517* Size of a tab in spaces.4518*/4519tabSize: number;45204521/**4522* Prefer spaces over tabs.4523*/4524insertSpaces: boolean;45254526/**4527* Signature for further properties.4528*/4529[key: string]: boolean | number | string;4530}45314532/**4533* The document formatting provider interface defines the contract between extensions and4534* the formatting-feature.4535*/4536export interface DocumentFormattingEditProvider {45374538/**4539* Provide formatting edits for a whole document.4540*4541* @param document The document in which the command was invoked.4542* @param options Options controlling formatting.4543* @param token A cancellation token.4544* @returns A set of text edits or a thenable that resolves to such. The lack of a result can be4545* signaled by returning `undefined`, `null`, or an empty array.4546*/4547provideDocumentFormattingEdits(document: TextDocument, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;4548}45494550/**4551* The document formatting provider interface defines the contract between extensions and4552* the formatting-feature.4553*/4554export interface DocumentRangeFormattingEditProvider {45554556/**4557* Provide formatting edits for a range in a document.4558*4559* The given range is a hint and providers can decide to format a smaller4560* or larger range. Often this is done by adjusting the start and end4561* of the range to full syntax nodes.4562*4563* @param document The document in which the command was invoked.4564* @param range The range which should be formatted.4565* @param options Options controlling formatting.4566* @param token A cancellation token.4567* @returns A set of text edits or a thenable that resolves to such. The lack of a result can be4568* signaled by returning `undefined`, `null`, or an empty array.4569*/4570provideDocumentRangeFormattingEdits(document: TextDocument, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;457145724573/**4574* Provide formatting edits for multiple ranges in a document.4575*4576* This function is optional but allows a formatter to perform faster when formatting only modified ranges or when4577* formatting a large number of selections.4578*4579* The given ranges are hints and providers can decide to format a smaller4580* or larger range. Often this is done by adjusting the start and end4581* of the range to full syntax nodes.4582*4583* @param document The document in which the command was invoked.4584* @param ranges The ranges which should be formatted.4585* @param options Options controlling formatting.4586* @param token A cancellation token.4587* @returns A set of text edits or a thenable that resolves to such. The lack of a result can be4588* signaled by returning `undefined`, `null`, or an empty array.4589*/4590provideDocumentRangesFormattingEdits?(document: TextDocument, ranges: Range[], options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;4591}45924593/**4594* The document formatting provider interface defines the contract between extensions and4595* the formatting-feature.4596*/4597export interface OnTypeFormattingEditProvider {45984599/**4600* Provide formatting edits after a character has been typed.4601*4602* The given position and character should hint to the provider4603* what range the position to expand to, like find the matching `{`4604* when `}` has been entered.4605*4606* @param document The document in which the command was invoked.4607* @param position The position at which the command was invoked.4608* @param ch The character that has been typed.4609* @param options Options controlling formatting.4610* @param token A cancellation token.4611* @returns A set of text edits or a thenable that resolves to such. The lack of a result can be4612* signaled by returning `undefined`, `null`, or an empty array.4613*/4614provideOnTypeFormattingEdits(document: TextDocument, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;4615}46164617/**4618* Represents a parameter of a callable-signature. A parameter can4619* have a label and a doc-comment.4620*/4621export class ParameterInformation {46224623/**4624* The label of this signature.4625*4626* Either a string or inclusive start and exclusive end offsets within its containing4627* {@link SignatureInformation.label signature label}. *Note*: A label of type string must be4628* a substring of its containing signature information's {@link SignatureInformation.label label}.4629*/4630label: string | [number, number];46314632/**4633* The human-readable doc-comment of this signature. Will be shown4634* in the UI but can be omitted.4635*/4636documentation?: string | MarkdownString;46374638/**4639* Creates a new parameter information object.4640*4641* @param label A label string or inclusive start and exclusive end offsets within its containing signature label.4642* @param documentation A doc string.4643*/4644constructor(label: string | [number, number], documentation?: string | MarkdownString);4645}46464647/**4648* Represents the signature of something callable. A signature4649* can have a label, like a function-name, a doc-comment, and4650* a set of parameters.4651*/4652export class SignatureInformation {46534654/**4655* The label of this signature. Will be shown in4656* the UI.4657*/4658label: string;46594660/**4661* The human-readable doc-comment of this signature. Will be shown4662* in the UI but can be omitted.4663*/4664documentation?: string | MarkdownString;46654666/**4667* The parameters of this signature.4668*/4669parameters: ParameterInformation[];46704671/**4672* The index of the active parameter.4673*4674* If provided, this is used in place of {@linkcode SignatureHelp.activeParameter}.4675*/4676activeParameter?: number;46774678/**4679* Creates a new signature information object.4680*4681* @param label A label string.4682* @param documentation A doc string.4683*/4684constructor(label: string, documentation?: string | MarkdownString);4685}46864687/**4688* Signature help represents the signature of something4689* callable. There can be multiple signatures but only one4690* active and only one active parameter.4691*/4692export class SignatureHelp {46934694/**4695* One or more signatures.4696*/4697signatures: SignatureInformation[];46984699/**4700* The active signature.4701*/4702activeSignature: number;47034704/**4705* The active parameter of the active signature.4706*/4707activeParameter: number;4708}47094710/**4711* How a {@linkcode SignatureHelpProvider} was triggered.4712*/4713export enum SignatureHelpTriggerKind {4714/**4715* Signature help was invoked manually by the user or by a command.4716*/4717Invoke = 1,47184719/**4720* Signature help was triggered by a trigger character.4721*/4722TriggerCharacter = 2,47234724/**4725* Signature help was triggered by the cursor moving or by the document content changing.4726*/4727ContentChange = 3,4728}47294730/**4731* Additional information about the context in which a4732* {@linkcode SignatureHelpProvider.provideSignatureHelp SignatureHelpProvider} was triggered.4733*/4734export interface SignatureHelpContext {4735/**4736* Action that caused signature help to be triggered.4737*/4738readonly triggerKind: SignatureHelpTriggerKind;47394740/**4741* Character that caused signature help to be triggered.4742*4743* This is `undefined` when signature help is not triggered by typing, such as when manually invoking4744* signature help or when moving the cursor.4745*/4746readonly triggerCharacter: string | undefined;47474748/**4749* `true` if signature help was already showing when it was triggered.4750*4751* Retriggers occur when the signature help is already active and can be caused by actions such as4752* typing a trigger character, a cursor move, or document content changes.4753*/4754readonly isRetrigger: boolean;47554756/**4757* The currently active {@linkcode SignatureHelp}.4758*4759* The `activeSignatureHelp` has its {@linkcode SignatureHelp.activeSignature activeSignature} field updated based on4760* the user arrowing through available signatures.4761*/4762readonly activeSignatureHelp: SignatureHelp | undefined;4763}47644765/**4766* The signature help provider interface defines the contract between extensions and4767* the [parameter hints](https://code.visualstudio.com/docs/editor/intellisense)-feature.4768*/4769export interface SignatureHelpProvider {47704771/**4772* Provide help for the signature at the given position and document.4773*4774* @param document The document in which the command was invoked.4775* @param position The position at which the command was invoked.4776* @param token A cancellation token.4777* @param context Information about how signature help was triggered.4778*4779* @returns Signature help or a thenable that resolves to such. The lack of a result can be4780* signaled by returning `undefined` or `null`.4781*/4782provideSignatureHelp(document: TextDocument, position: Position, token: CancellationToken, context: SignatureHelpContext): ProviderResult<SignatureHelp>;4783}47844785/**4786* Metadata about a registered {@linkcode SignatureHelpProvider}.4787*/4788export interface SignatureHelpProviderMetadata {4789/**4790* List of characters that trigger signature help.4791*/4792readonly triggerCharacters: readonly string[];47934794/**4795* List of characters that re-trigger signature help.4796*4797* These trigger characters are only active when signature help is already showing. All trigger characters4798* are also counted as re-trigger characters.4799*/4800readonly retriggerCharacters: readonly string[];4801}48024803/**4804* A structured label for a {@link CompletionItem completion item}.4805*/4806export interface CompletionItemLabel {48074808/**4809* The label of this completion item.4810*4811* By default this is also the text that is inserted when this completion is selected.4812*/4813label: string;48144815/**4816* An optional string which is rendered less prominently directly after {@link CompletionItemLabel.label label},4817* without any spacing. Should be used for function signatures or type annotations.4818*/4819detail?: string;48204821/**4822* An optional string which is rendered less prominently after {@link CompletionItemLabel.detail}. Should be used4823* for fully qualified names or file path.4824*/4825description?: string;4826}48274828/**4829* Completion item kinds.4830*/4831export enum CompletionItemKind {4832/**4833* The `Text` completion item kind.4834*/4835Text = 0,4836/**4837* The `Method` completion item kind.4838*/4839Method = 1,4840/**4841* The `Function` completion item kind.4842*/4843Function = 2,4844/**4845* The `Constructor` completion item kind.4846*/4847Constructor = 3,4848/**4849* The `Field` completion item kind.4850*/4851Field = 4,4852/**4853* The `Variable` completion item kind.4854*/4855Variable = 5,4856/**4857* The `Class` completion item kind.4858*/4859Class = 6,4860/**4861* The `Interface` completion item kind.4862*/4863Interface = 7,4864/**4865* The `Module` completion item kind.4866*/4867Module = 8,4868/**4869* The `Property` completion item kind.4870*/4871Property = 9,4872/**4873* The `Unit` completion item kind.4874*/4875Unit = 10,4876/**4877* The `Value` completion item kind.4878*/4879Value = 11,4880/**4881* The `Enum` completion item kind.4882*/4883Enum = 12,4884/**4885* The `Keyword` completion item kind.4886*/4887Keyword = 13,4888/**4889* The `Snippet` completion item kind.4890*/4891Snippet = 14,4892/**4893* The `Color` completion item kind.4894*/4895Color = 15,4896/**4897* The `Reference` completion item kind.4898*/4899Reference = 17,4900/**4901* The `File` completion item kind.4902*/4903File = 16,4904/**4905* The `Folder` completion item kind.4906*/4907Folder = 18,4908/**4909* The `EnumMember` completion item kind.4910*/4911EnumMember = 19,4912/**4913* The `Constant` completion item kind.4914*/4915Constant = 20,4916/**4917* The `Struct` completion item kind.4918*/4919Struct = 21,4920/**4921* The `Event` completion item kind.4922*/4923Event = 22,4924/**4925* The `Operator` completion item kind.4926*/4927Operator = 23,4928/**4929* The `TypeParameter` completion item kind.4930*/4931TypeParameter = 24,4932/**4933* The `User` completion item kind.4934*/4935User = 25,4936/**4937* The `Issue` completion item kind.4938*/4939Issue = 26,4940}49414942/**4943* Completion item tags are extra annotations that tweak the rendering of a completion4944* item.4945*/4946export enum CompletionItemTag {4947/**4948* Render a completion as obsolete, usually using a strike-out.4949*/4950Deprecated = 14951}49524953/**4954* A completion item represents a text snippet that is proposed to complete text that is being typed.4955*4956* It is sufficient to create a completion item from just a {@link CompletionItem.label label}. In that4957* case the completion item will replace the {@link TextDocument.getWordRangeAtPosition word}4958* until the cursor with the given label or {@link CompletionItem.insertText insertText}. Otherwise the4959* given {@link CompletionItem.textEdit edit} is used.4960*4961* When selecting a completion item in the editor its defined or synthesized text edit will be applied4962* to *all* cursors/selections whereas {@link CompletionItem.additionalTextEdits additionalTextEdits} will be4963* applied as provided.4964*4965* @see {@link CompletionItemProvider.provideCompletionItems}4966* @see {@link CompletionItemProvider.resolveCompletionItem}4967*/4968export class CompletionItem {49694970/**4971* The label of this completion item. By default4972* this is also the text that is inserted when selecting4973* this completion.4974*/4975label: string | CompletionItemLabel;49764977/**4978* The kind of this completion item. Based on the kind4979* an icon is chosen by the editor.4980*/4981kind?: CompletionItemKind;49824983/**4984* Tags for this completion item.4985*/4986tags?: readonly CompletionItemTag[];49874988/**4989* A human-readable string with additional information4990* about this item, like type or symbol information.4991*/4992detail?: string;49934994/**4995* A human-readable string that represents a doc-comment.4996*/4997documentation?: string | MarkdownString;49984999/**5000* A string that should be used when comparing this item5001* with other items. When `falsy` the {@link CompletionItem.label label}5002* is used.5003*5004* Note that `sortText` is only used for the initial ordering of completion5005* items. When having a leading word (prefix) ordering is based on how5006* well completions match that prefix and the initial ordering is only used5007* when completions match equally well. The prefix is defined by the5008* {@linkcode CompletionItem.range range}-property and can therefore be different5009* for each completion.5010*/5011sortText?: string;50125013/**5014* A string that should be used when filtering a set of5015* completion items. When `falsy` the {@link CompletionItem.label label}5016* is used.5017*5018* Note that the filter text is matched against the leading word (prefix) which is defined5019* by the {@linkcode CompletionItem.range range}-property.5020*/5021filterText?: string;50225023/**5024* Select this item when showing. *Note* that only one completion item can be selected and5025* that the editor decides which item that is. The rule is that the *first* item of those5026* that match best is selected.5027*/5028preselect?: boolean;50295030/**5031* A string or snippet that should be inserted in a document when selecting5032* this completion. When `falsy` the {@link CompletionItem.label label}5033* is used.5034*/5035insertText?: string | SnippetString;50365037/**5038* A range or a insert and replace range selecting the text that should be replaced by this completion item.5039*5040* When omitted, the range of the {@link TextDocument.getWordRangeAtPosition current word} is used as replace-range5041* and as insert-range the start of the {@link TextDocument.getWordRangeAtPosition current word} to the5042* current position is used.5043*5044* *Note 1:* A range must be a {@link Range.isSingleLine single line} and it must5045* {@link Range.contains contain} the position at which completion has been {@link CompletionItemProvider.provideCompletionItems requested}.5046* *Note 2:* A insert range must be a prefix of a replace range, that means it must be contained and starting at the same position.5047*/5048range?: Range | {5049/**5050* The range that should be used when insert-accepting a completion. Must be a prefix of `replaceRange`.5051*/5052inserting: Range;5053/**5054* The range that should be used when replace-accepting a completion.5055*/5056replacing: Range;5057};50585059/**5060* An optional set of characters that when pressed while this completion is active will accept it first and5061* then type that character. *Note* that all commit characters should have `length=1` and that superfluous5062* characters will be ignored.5063*/5064commitCharacters?: string[];50655066/**5067* Keep whitespace of the {@link CompletionItem.insertText insertText} as is. By default, the editor adjusts leading5068* whitespace of new lines so that they match the indentation of the line for which the item is accepted - setting5069* this to `true` will prevent that.5070*/5071keepWhitespace?: boolean;50725073/**5074* @deprecated Use `CompletionItem.insertText` and `CompletionItem.range` instead.5075*5076* An {@link TextEdit edit} which is applied to a document when selecting5077* this completion. When an edit is provided the value of5078* {@link CompletionItem.insertText insertText} is ignored.5079*5080* The {@link Range} of the edit must be single-line and on the same5081* line completions were {@link CompletionItemProvider.provideCompletionItems requested} at.5082*/5083textEdit?: TextEdit;50845085/**5086* An optional array of additional {@link TextEdit text edits} that are applied when5087* selecting this completion. Edits must not overlap with the main {@link CompletionItem.textEdit edit}5088* nor with themselves.5089*/5090additionalTextEdits?: TextEdit[];50915092/**5093* An optional {@link Command} that is executed *after* inserting this completion. *Note* that5094* additional modifications to the current document should be described with the5095* {@link CompletionItem.additionalTextEdits additionalTextEdits}-property.5096*/5097command?: Command;50985099/**5100* Creates a new completion item.5101*5102* Completion items must have at least a {@link CompletionItem.label label} which then5103* will be used as insert text as well as for sorting and filtering.5104*5105* @param label The label of the completion.5106* @param kind The {@link CompletionItemKind kind} of the completion.5107*/5108constructor(label: string | CompletionItemLabel, kind?: CompletionItemKind);5109}51105111/**5112* Represents a collection of {@link CompletionItem completion items} to be presented5113* in the editor.5114*/5115export class CompletionList<T extends CompletionItem = CompletionItem> {51165117/**5118* This list is not complete. Further typing should result in recomputing5119* this list.5120*/5121isIncomplete?: boolean;51225123/**5124* The completion items.5125*/5126items: T[];51275128/**5129* Creates a new completion list.5130*5131* @param items The completion items.5132* @param isIncomplete The list is not complete.5133*/5134constructor(items?: T[], isIncomplete?: boolean);5135}51365137/**5138* How a {@link CompletionItemProvider completion provider} was triggered5139*/5140export enum CompletionTriggerKind {5141/**5142* Completion was triggered normally.5143*/5144Invoke = 0,5145/**5146* Completion was triggered by a trigger character.5147*/5148TriggerCharacter = 1,5149/**5150* Completion was re-triggered as current completion list is incomplete5151*/5152TriggerForIncompleteCompletions = 25153}51545155/**5156* Contains additional information about the context in which5157* {@link CompletionItemProvider.provideCompletionItems completion provider} is triggered.5158*/5159export interface CompletionContext {5160/**5161* How the completion was triggered.5162*/5163readonly triggerKind: CompletionTriggerKind;51645165/**5166* Character that triggered the completion item provider.5167*5168* `undefined` if the provider was not triggered by a character.5169*5170* The trigger character is already in the document when the completion provider is triggered.5171*/5172readonly triggerCharacter: string | undefined;5173}51745175/**5176* The completion item provider interface defines the contract between extensions and5177* [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense).5178*5179* Providers can delay the computation of the {@linkcode CompletionItem.detail detail}5180* and {@linkcode CompletionItem.documentation documentation} properties by implementing the5181* {@linkcode CompletionItemProvider.resolveCompletionItem resolveCompletionItem}-function. However, properties that5182* are needed for the initial sorting and filtering, like `sortText`, `filterText`, `insertText`, and `range`, must5183* not be changed during resolve.5184*5185* Providers are asked for completions either explicitly by a user gesture or -depending on the configuration-5186* implicitly when typing words or trigger characters.5187*/5188export interface CompletionItemProvider<T extends CompletionItem = CompletionItem> {51895190/**5191* Provide completion items for the given position and document.5192*5193* @param document The document in which the command was invoked.5194* @param position The position at which the command was invoked.5195* @param token A cancellation token.5196* @param context How the completion was triggered.5197*5198* @returns An array of completions, a {@link CompletionList completion list}, or a thenable that resolves to either.5199* The lack of a result can be signaled by returning `undefined`, `null`, or an empty array.5200*/5201provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken, context: CompletionContext): ProviderResult<T[] | CompletionList<T>>;52025203/**5204* Given a completion item fill in more data, like {@link CompletionItem.documentation doc-comment}5205* or {@link CompletionItem.detail details}.5206*5207* The editor will only resolve a completion item once.5208*5209* *Note* that this function is called when completion items are already showing in the UI or when an item has been5210* selected for insertion. Because of that, no property that changes the presentation (label, sorting, filtering etc)5211* or the (primary) insert behaviour ({@link CompletionItem.insertText insertText}) can be changed.5212*5213* This function may fill in {@link CompletionItem.additionalTextEdits additionalTextEdits}. However, that means an item might be5214* inserted *before* resolving is done and in that case the editor will do a best effort to still apply those additional5215* text edits.5216*5217* @param item A completion item currently active in the UI.5218* @param token A cancellation token.5219* @returns The resolved completion item or a thenable that resolves to of such. It is OK to return the given5220* `item`. When no result is returned, the given `item` will be used.5221*/5222resolveCompletionItem?(item: T, token: CancellationToken): ProviderResult<T>;5223}522452255226/**5227* The inline completion item provider interface defines the contract between extensions and5228* the inline completion feature.5229*5230* Providers are asked for completions either explicitly by a user gesture or implicitly when typing.5231*/5232export interface InlineCompletionItemProvider {52335234/**5235* Provides inline completion items for the given position and document.5236* If inline completions are enabled, this method will be called whenever the user stopped typing.5237* It will also be called when the user explicitly triggers inline completions or explicitly asks for the next or previous inline completion.5238* In that case, all available inline completions should be returned.5239* `context.triggerKind` can be used to distinguish between these scenarios.5240*5241* @param document The document inline completions are requested for.5242* @param position The position inline completions are requested for.5243* @param context A context object with additional information.5244* @param token A cancellation token.5245* @returns An array of completion items or a thenable that resolves to an array of completion items.5246*/5247provideInlineCompletionItems(document: TextDocument, position: Position, context: InlineCompletionContext, token: CancellationToken): ProviderResult<InlineCompletionItem[] | InlineCompletionList>;5248}52495250/**5251* Represents a collection of {@link InlineCompletionItem inline completion items} to be presented5252* in the editor.5253*/5254export class InlineCompletionList {5255/**5256* The inline completion items.5257*/5258items: InlineCompletionItem[];52595260/**5261* Creates a new list of inline completion items.5262*/5263constructor(items: InlineCompletionItem[]);5264}52655266/**5267* Provides information about the context in which an inline completion was requested.5268*/5269export interface InlineCompletionContext {5270/**5271* Describes how the inline completion was triggered.5272*/5273readonly triggerKind: InlineCompletionTriggerKind;52745275/**5276* Provides information about the currently selected item in the autocomplete widget if it is visible.5277*5278* If set, provided inline completions must extend the text of the selected item5279* and use the same range, otherwise they are not shown as preview.5280* As an example, if the document text is `console.` and the selected item is `.log` replacing the `.` in the document,5281* the inline completion must also replace `.` and start with `.log`, for example `.log()`.5282*5283* Inline completion providers are requested again whenever the selected item changes.5284*/5285readonly selectedCompletionInfo: SelectedCompletionInfo | undefined;5286}52875288/**5289* Describes the currently selected completion item.5290*/5291export interface SelectedCompletionInfo {5292/**5293* The range that will be replaced if this completion item is accepted.5294*/5295readonly range: Range;52965297/**5298* The text the range will be replaced with if this completion is accepted.5299*/5300readonly text: string;5301}53025303/**5304* Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.5305*/5306export enum InlineCompletionTriggerKind {5307/**5308* Completion was triggered explicitly by a user gesture.5309* Return multiple completion items to enable cycling through them.5310*/5311Invoke = 0,53125313/**5314* Completion was triggered automatically while editing.5315* It is sufficient to return a single completion item in this case.5316*/5317Automatic = 1,5318}53195320/**5321* An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.5322*5323* @see {@link InlineCompletionItemProvider.provideInlineCompletionItems}5324*/5325export class InlineCompletionItem {5326/**5327* The text to replace the range with. Must be set.5328* Is used both for the preview and the accept operation.5329*/5330insertText: string | SnippetString;53315332/**5333* A text that is used to decide if this inline completion should be shown. When `falsy`5334* the {@link InlineCompletionItem.insertText} is used.5335*5336* An inline completion is shown if the text to replace is a prefix of the filter text.5337*/5338filterText?: string;53395340/**5341* The range to replace.5342* Must begin and end on the same line.5343*5344* Prefer replacements over insertions to provide a better experience when the user deletes typed text.5345*/5346range?: Range;53475348/**5349* An optional {@link Command} that is executed *after* inserting this completion.5350*/5351command?: Command;53525353/**5354* Creates a new inline completion item.5355*5356* @param insertText The text to replace the range with.5357* @param range The range to replace. If not set, the word at the requested position will be used.5358* @param command An optional {@link Command} that is executed *after* inserting this completion.5359*/5360constructor(insertText: string | SnippetString, range?: Range, command?: Command);5361}53625363/**5364* A document link is a range in a text document that links to an internal or external resource, like another5365* text document or a web site.5366*/5367export class DocumentLink {53685369/**5370* The range this link applies to.5371*/5372range: Range;53735374/**5375* The uri this link points to.5376*/5377target?: Uri;53785379/**5380* The tooltip text when you hover over this link.5381*5382* If a tooltip is provided, is will be displayed in a string that includes instructions on how to5383* trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS,5384* user settings, and localization.5385*/5386tooltip?: string;53875388/**5389* Creates a new document link.5390*5391* @param range The range the document link applies to. Must not be empty.5392* @param target The uri the document link points to.5393*/5394constructor(range: Range, target?: Uri);5395}53965397/**5398* The document link provider defines the contract between extensions and feature of showing5399* links in the editor.5400*/5401export interface DocumentLinkProvider<T extends DocumentLink = DocumentLink> {54025403/**5404* Provide links for the given document. Note that the editor ships with a default provider that detects5405* `http(s)` and `file` links.5406*5407* @param document The document in which the command was invoked.5408* @param token A cancellation token.5409* @returns An array of {@link DocumentLink document links} or a thenable that resolves to such. The lack of a result5410* can be signaled by returning `undefined`, `null`, or an empty array.5411*/5412provideDocumentLinks(document: TextDocument, token: CancellationToken): ProviderResult<T[]>;54135414/**5415* Given a link fill in its {@link DocumentLink.target target}. This method is called when an incomplete5416* link is selected in the UI. Providers can implement this method and return incomplete links5417* (without target) from the {@linkcode DocumentLinkProvider.provideDocumentLinks provideDocumentLinks} method which5418* often helps to improve performance.5419*5420* @param link The link that is to be resolved.5421* @param token A cancellation token.5422*/5423resolveDocumentLink?(link: T, token: CancellationToken): ProviderResult<T>;5424}54255426/**5427* Represents a color in RGBA space.5428*/5429export class Color {54305431/**5432* The red component of this color in the range `[0-1]`.5433*/5434readonly red: number;54355436/**5437* The green component of this color in the range `[0-1]`.5438*/5439readonly green: number;54405441/**5442* The blue component of this color in the range `[0-1]`.5443*/5444readonly blue: number;54455446/**5447* The alpha component of this color in the range `[0-1]`.5448*/5449readonly alpha: number;54505451/**5452* Creates a new color instance.5453*5454* @param red The red component.5455* @param green The green component.5456* @param blue The blue component.5457* @param alpha The alpha component.5458*/5459constructor(red: number, green: number, blue: number, alpha: number);5460}54615462/**5463* Represents a color range from a document.5464*/5465export class ColorInformation {54665467/**5468* The range in the document where this color appears.5469*/5470range: Range;54715472/**5473* The actual color value for this color range.5474*/5475color: Color;54765477/**5478* Creates a new color range.5479*5480* @param range The range the color appears in. Must not be empty.5481* @param color The value of the color.5482*/5483constructor(range: Range, color: Color);5484}54855486/**5487* A color presentation object describes how a {@linkcode Color} should be represented as text and what5488* edits are required to refer to it from source code.5489*5490* For some languages one color can have multiple presentations, e.g. css can represent the color red with5491* the constant `Red`, the hex-value `#ff0000`, or in rgba and hsla forms. In csharp other representations5492* apply, e.g. `System.Drawing.Color.Red`.5493*/5494export class ColorPresentation {54955496/**5497* The label of this color presentation. It will be shown on the color5498* picker header. By default this is also the text that is inserted when selecting5499* this color presentation.5500*/5501label: string;55025503/**5504* An {@link TextEdit edit} which is applied to a document when selecting5505* this presentation for the color. When `falsy` the {@link ColorPresentation.label label}5506* is used.5507*/5508textEdit?: TextEdit;55095510/**5511* An optional array of additional {@link TextEdit text edits} that are applied when5512* selecting this color presentation. Edits must not overlap with the main {@link ColorPresentation.textEdit edit} nor with themselves.5513*/5514additionalTextEdits?: TextEdit[];55155516/**5517* Creates a new color presentation.5518*5519* @param label The label of this color presentation.5520*/5521constructor(label: string);5522}55235524/**5525* The document color provider defines the contract between extensions and feature of5526* picking and modifying colors in the editor.5527*/5528export interface DocumentColorProvider {55295530/**5531* Provide colors for the given document.5532*5533* @param document The document in which the command was invoked.5534* @param token A cancellation token.5535* @returns An array of {@link ColorInformation color information} or a thenable that resolves to such. The lack of a result5536* can be signaled by returning `undefined`, `null`, or an empty array.5537*/5538provideDocumentColors(document: TextDocument, token: CancellationToken): ProviderResult<ColorInformation[]>;55395540/**5541* Provide {@link ColorPresentation representations} for a color.5542*5543* @param color The color to show and insert.5544* @param context A context object with additional information5545* @param token A cancellation token.5546* @returns An array of color presentations or a thenable that resolves to such. The lack of a result5547* can be signaled by returning `undefined`, `null`, or an empty array.5548*/5549provideColorPresentations(color: Color, context: {5550/**5551* The text document that contains the color5552*/5553readonly document: TextDocument;5554/**5555* The range in the document where the color is located.5556*/5557readonly range: Range;5558}, token: CancellationToken): ProviderResult<ColorPresentation[]>;5559}55605561/**5562* Inlay hint kinds.5563*5564* The kind of an inline hint defines its appearance, e.g the corresponding foreground and background colors are being5565* used.5566*/5567export enum InlayHintKind {5568/**5569* An inlay hint that is for a type annotation.5570*/5571Type = 1,5572/**5573* An inlay hint that is for a parameter.5574*/5575Parameter = 2,5576}55775578/**5579* An inlay hint label part allows for interactive and composite labels of inlay hints.5580*/5581export class InlayHintLabelPart {55825583/**5584* The value of this label part.5585*/5586value: string;55875588/**5589* The tooltip text when you hover over this label part.5590*5591* *Note* that this property can be set late during5592* {@link InlayHintsProvider.resolveInlayHint resolving} of inlay hints.5593*/5594tooltip?: string | MarkdownString | undefined;55955596/**5597* An optional {@link Location source code location} that represents this label5598* part.5599*5600* The editor will use this location for the hover and for code navigation features: This5601* part will become a clickable link that resolves to the definition of the symbol at the5602* given location (not necessarily the location itself), it shows the hover that shows at5603* the given location, and it shows a context menu with further code navigation commands.5604*5605* *Note* that this property can be set late during5606* {@link InlayHintsProvider.resolveInlayHint resolving} of inlay hints.5607*/5608location?: Location | undefined;56095610/**5611* An optional command for this label part.5612*5613* The editor renders parts with commands as clickable links. The command is added to the context menu5614* when a label part defines {@link InlayHintLabelPart.location location} and {@link InlayHintLabelPart.command command} .5615*5616* *Note* that this property can be set late during5617* {@link InlayHintsProvider.resolveInlayHint resolving} of inlay hints.5618*/5619command?: Command | undefined;56205621/**5622* Creates a new inlay hint label part.5623*5624* @param value The value of the part.5625*/5626constructor(value: string);5627}56285629/**5630* Inlay hint information.5631*/5632export class InlayHint {56335634/**5635* The position of this hint.5636*/5637position: Position;56385639/**5640* The label of this hint. A human readable string or an array of {@link InlayHintLabelPart label parts}.5641*5642* *Note* that neither the string nor the label part can be empty.5643*/5644label: string | InlayHintLabelPart[];56455646/**5647* The tooltip text when you hover over this item.5648*5649* *Note* that this property can be set late during5650* {@link InlayHintsProvider.resolveInlayHint resolving} of inlay hints.5651*/5652tooltip?: string | MarkdownString | undefined;56535654/**5655* The kind of this hint. The inlay hint kind defines the appearance of this inlay hint.5656*/5657kind?: InlayHintKind;56585659/**5660* Optional {@link TextEdit text edits} that are performed when accepting this inlay hint. The default5661* gesture for accepting an inlay hint is the double click.5662*5663* *Note* that edits are expected to change the document so that the inlay hint (or its nearest variant) is5664* now part of the document and the inlay hint itself is now obsolete.5665*5666* *Note* that this property can be set late during5667* {@link InlayHintsProvider.resolveInlayHint resolving} of inlay hints.5668*/5669textEdits?: TextEdit[];56705671/**5672* Render padding before the hint. Padding will use the editor's background color,5673* not the background color of the hint itself. That means padding can be used to visually5674* align/separate an inlay hint.5675*/5676paddingLeft?: boolean;56775678/**5679* Render padding after the hint. Padding will use the editor's background color,5680* not the background color of the hint itself. That means padding can be used to visually5681* align/separate an inlay hint.5682*/5683paddingRight?: boolean;56845685/**5686* Creates a new inlay hint.5687*5688* @param position The position of the hint.5689* @param label The label of the hint.5690* @param kind The {@link InlayHintKind kind} of the hint.5691*/5692constructor(position: Position, label: string | InlayHintLabelPart[], kind?: InlayHintKind);5693}56945695/**5696* The inlay hints provider interface defines the contract between extensions and5697* the inlay hints feature.5698*/5699export interface InlayHintsProvider<T extends InlayHint = InlayHint> {57005701/**5702* An optional event to signal that inlay hints from this provider have changed.5703*/5704onDidChangeInlayHints?: Event<void>;57055706/**5707* Provide inlay hints for the given range and document.5708*5709* *Note* that inlay hints that are not {@link Range.contains contained} by the given range are ignored.5710*5711* @param document The document in which the command was invoked.5712* @param range The range for which inlay hints should be computed.5713* @param token A cancellation token.5714* @returns An array of inlay hints or a thenable that resolves to such.5715*/5716provideInlayHints(document: TextDocument, range: Range, token: CancellationToken): ProviderResult<T[]>;57175718/**5719* Given an inlay hint fill in {@link InlayHint.tooltip tooltip}, {@link InlayHint.textEdits text edits},5720* or complete label {@link InlayHintLabelPart parts}.5721*5722* *Note* that the editor will resolve an inlay hint at most once.5723*5724* @param hint An inlay hint.5725* @param token A cancellation token.5726* @returns The resolved inlay hint or a thenable that resolves to such. It is OK to return the given `item`. When no result is returned, the given `item` will be used.5727*/5728resolveInlayHint?(hint: T, token: CancellationToken): ProviderResult<T>;5729}57305731/**5732* A line based folding range. To be valid, start and end line must be bigger than zero and smaller than the number of lines in the document.5733* Invalid ranges will be ignored.5734*/5735export class FoldingRange {57365737/**5738* The zero-based start line of the range to fold. The folded area starts after the line's last character.5739* To be valid, the end must be zero or larger and smaller than the number of lines in the document.5740*/5741start: number;57425743/**5744* The zero-based end line of the range to fold. The folded area ends with the line's last character.5745* To be valid, the end must be zero or larger and smaller than the number of lines in the document.5746*/5747end: number;57485749/**5750* Describes the {@link FoldingRangeKind Kind} of the folding range such as {@link FoldingRangeKind.Comment Comment} or5751* {@link FoldingRangeKind.Region Region}. The kind is used to categorize folding ranges and used by commands5752* like 'Fold all comments'. See5753* {@link FoldingRangeKind} for an enumeration of all kinds.5754* If not set, the range is originated from a syntax element.5755*/5756kind?: FoldingRangeKind;57575758/**5759* Creates a new folding range.5760*5761* @param start The start line of the folded range.5762* @param end The end line of the folded range.5763* @param kind The kind of the folding range.5764*/5765constructor(start: number, end: number, kind?: FoldingRangeKind);5766}57675768/**5769* An enumeration of specific folding range kinds. The kind is an optional field of a {@link FoldingRange}5770* and is used to distinguish specific folding ranges such as ranges originated from comments. The kind is used by commands like5771* `Fold all comments` or `Fold all regions`.5772* If the kind is not set on the range, the range originated from a syntax element other than comments, imports or region markers.5773*/5774export enum FoldingRangeKind {5775/**5776* Kind for folding range representing a comment.5777*/5778Comment = 1,5779/**5780* Kind for folding range representing a import.5781*/5782Imports = 2,5783/**5784* Kind for folding range representing regions originating from folding markers like `#region` and `#endregion`.5785*/5786Region = 35787}57885789/**5790* Folding context (for future use)5791*/5792export interface FoldingContext {5793}57945795/**5796* The folding range provider interface defines the contract between extensions and5797* [Folding](https://code.visualstudio.com/docs/editor/codebasics#_folding) in the editor.5798*/5799export interface FoldingRangeProvider {58005801/**5802* An optional event to signal that the folding ranges from this provider have changed.5803*/5804onDidChangeFoldingRanges?: Event<void>;58055806/**5807* Returns a list of folding ranges or null and undefined if the provider5808* does not want to participate or was cancelled.5809* @param document The document in which the command was invoked.5810* @param context Additional context information (for future use)5811* @param token A cancellation token.5812*/5813provideFoldingRanges(document: TextDocument, context: FoldingContext, token: CancellationToken): ProviderResult<FoldingRange[]>;5814}58155816/**5817* A selection range represents a part of a selection hierarchy. A selection range5818* may have a parent selection range that contains it.5819*/5820export class SelectionRange {58215822/**5823* The {@link Range} of this selection range.5824*/5825range: Range;58265827/**5828* The parent selection range containing this range.5829*/5830parent?: SelectionRange;58315832/**5833* Creates a new selection range.5834*5835* @param range The range of the selection range.5836* @param parent The parent of the selection range.5837*/5838constructor(range: Range, parent?: SelectionRange);5839}58405841/**5842* The selection range provider interface defines the contract between extensions and the "Expand and Shrink Selection" feature.5843*/5844export interface SelectionRangeProvider {5845/**5846* Provide selection ranges for the given positions.5847*5848* Selection ranges should be computed individually and independent for each position. The editor will merge5849* and deduplicate ranges but providers must return hierarchies of selection ranges so that a range5850* is {@link Range.contains contained} by its parent.5851*5852* @param document The document in which the command was invoked.5853* @param positions The positions at which the command was invoked.5854* @param token A cancellation token.5855* @returns Selection ranges or a thenable that resolves to such. The lack of a result can be5856* signaled by returning `undefined` or `null`.5857*/5858provideSelectionRanges(document: TextDocument, positions: readonly Position[], token: CancellationToken): ProviderResult<SelectionRange[]>;5859}58605861/**5862* Represents programming constructs like functions or constructors in the context5863* of call hierarchy.5864*/5865export class CallHierarchyItem {5866/**5867* The name of this item.5868*/5869name: string;58705871/**5872* The kind of this item.5873*/5874kind: SymbolKind;58755876/**5877* Tags for this item.5878*/5879tags?: readonly SymbolTag[];58805881/**5882* More detail for this item, e.g. the signature of a function.5883*/5884detail?: string;58855886/**5887* The resource identifier of this item.5888*/5889uri: Uri;58905891/**5892* The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.5893*/5894range: Range;58955896/**5897* The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function.5898* Must be contained by the {@linkcode CallHierarchyItem.range range}.5899*/5900selectionRange: Range;59015902/**5903* Creates a new call hierarchy item.5904*/5905constructor(kind: SymbolKind, name: string, detail: string, uri: Uri, range: Range, selectionRange: Range);5906}59075908/**5909* Represents an incoming call, e.g. a caller of a method or constructor.5910*/5911export class CallHierarchyIncomingCall {59125913/**5914* The item that makes the call.5915*/5916from: CallHierarchyItem;59175918/**5919* The range at which at which the calls appears. This is relative to the caller5920* denoted by {@linkcode CallHierarchyIncomingCall.from this.from}.5921*/5922fromRanges: Range[];59235924/**5925* Create a new call object.5926*5927* @param item The item making the call.5928* @param fromRanges The ranges at which the calls appear.5929*/5930constructor(item: CallHierarchyItem, fromRanges: Range[]);5931}59325933/**5934* Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc.5935*/5936export class CallHierarchyOutgoingCall {59375938/**5939* The item that is called.5940*/5941to: CallHierarchyItem;59425943/**5944* The range at which this item is called. This is the range relative to the caller, e.g the item5945* passed to {@linkcode CallHierarchyProvider.provideCallHierarchyOutgoingCalls provideCallHierarchyOutgoingCalls}5946* and not {@linkcode CallHierarchyOutgoingCall.to this.to}.5947*/5948fromRanges: Range[];59495950/**5951* Create a new call object.5952*5953* @param item The item being called5954* @param fromRanges The ranges at which the calls appear.5955*/5956constructor(item: CallHierarchyItem, fromRanges: Range[]);5957}59585959/**5960* The call hierarchy provider interface describes the contract between extensions5961* and the call hierarchy feature which allows to browse calls and caller of function,5962* methods, constructor etc.5963*/5964export interface CallHierarchyProvider {59655966/**5967* Bootstraps call hierarchy by returning the item that is denoted by the given document5968* and position. This item will be used as entry into the call graph. Providers should5969* return `undefined` or `null` when there is no item at the given location.5970*5971* @param document The document in which the command was invoked.5972* @param position The position at which the command was invoked.5973* @param token A cancellation token.5974* @returns One or multiple call hierarchy items or a thenable that resolves to such. The lack of a result can be5975* signaled by returning `undefined`, `null`, or an empty array.5976*/5977prepareCallHierarchy(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<CallHierarchyItem | CallHierarchyItem[]>;59785979/**5980* Provide all incoming calls for an item, e.g all callers for a method. In graph terms this describes directed5981* and annotated edges inside the call graph, e.g the given item is the starting node and the result is the nodes5982* that can be reached.5983*5984* @param item The hierarchy item for which incoming calls should be computed.5985* @param token A cancellation token.5986* @returns A set of incoming calls or a thenable that resolves to such. The lack of a result can be5987* signaled by returning `undefined` or `null`.5988*/5989provideCallHierarchyIncomingCalls(item: CallHierarchyItem, token: CancellationToken): ProviderResult<CallHierarchyIncomingCall[]>;59905991/**5992* Provide all outgoing calls for an item, e.g call calls to functions, methods, or constructors from the given item. In5993* graph terms this describes directed and annotated edges inside the call graph, e.g the given item is the starting5994* node and the result is the nodes that can be reached.5995*5996* @param item The hierarchy item for which outgoing calls should be computed.5997* @param token A cancellation token.5998* @returns A set of outgoing calls or a thenable that resolves to such. The lack of a result can be5999* signaled by returning `undefined` or `null`.6000*/6001provideCallHierarchyOutgoingCalls(item: CallHierarchyItem, token: CancellationToken): ProviderResult<CallHierarchyOutgoingCall[]>;6002}60036004/**6005* Represents an item of a type hierarchy, like a class or an interface.6006*/6007export class TypeHierarchyItem {6008/**6009* The name of this item.6010*/6011name: string;60126013/**6014* The kind of this item.6015*/6016kind: SymbolKind;60176018/**6019* Tags for this item.6020*/6021tags?: ReadonlyArray<SymbolTag>;60226023/**6024* More detail for this item, e.g. the signature of a function.6025*/6026detail?: string;60276028/**6029* The resource identifier of this item.6030*/6031uri: Uri;60326033/**6034* The range enclosing this symbol not including leading/trailing whitespace6035* but everything else, e.g. comments and code.6036*/6037range: Range;60386039/**6040* The range that should be selected and revealed when this symbol is being6041* picked, e.g. the name of a class. Must be contained by the {@link TypeHierarchyItem.range range}-property.6042*/6043selectionRange: Range;60446045/**6046* Creates a new type hierarchy item.6047*6048* @param kind The kind of the item.6049* @param name The name of the item.6050* @param detail The details of the item.6051* @param uri The Uri of the item.6052* @param range The whole range of the item.6053* @param selectionRange The selection range of the item.6054*/6055constructor(kind: SymbolKind, name: string, detail: string, uri: Uri, range: Range, selectionRange: Range);6056}60576058/**6059* The type hierarchy provider interface describes the contract between extensions6060* and the type hierarchy feature.6061*/6062export interface TypeHierarchyProvider {60636064/**6065* Bootstraps type hierarchy by returning the item that is denoted by the given document6066* and position. This item will be used as entry into the type graph. Providers should6067* return `undefined` or `null` when there is no item at the given location.6068*6069* @param document The document in which the command was invoked.6070* @param position The position at which the command was invoked.6071* @param token A cancellation token.6072* @returns One or multiple type hierarchy items or a thenable that resolves to such. The lack of a result can be6073* signaled by returning `undefined`, `null`, or an empty array.6074*/6075prepareTypeHierarchy(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<TypeHierarchyItem | TypeHierarchyItem[]>;60766077/**6078* Provide all supertypes for an item, e.g all types from which a type is derived/inherited. In graph terms this describes directed6079* and annotated edges inside the type graph, e.g the given item is the starting node and the result is the nodes6080* that can be reached.6081*6082* @param item The hierarchy item for which super types should be computed.6083* @param token A cancellation token.6084* @returns A set of direct supertypes or a thenable that resolves to such. The lack of a result can be6085* signaled by returning `undefined` or `null`.6086*/6087provideTypeHierarchySupertypes(item: TypeHierarchyItem, token: CancellationToken): ProviderResult<TypeHierarchyItem[]>;60886089/**6090* Provide all subtypes for an item, e.g all types which are derived/inherited from the given item. In6091* graph terms this describes directed and annotated edges inside the type graph, e.g the given item is the starting6092* node and the result is the nodes that can be reached.6093*6094* @param item The hierarchy item for which subtypes should be computed.6095* @param token A cancellation token.6096* @returns A set of direct subtypes or a thenable that resolves to such. The lack of a result can be6097* signaled by returning `undefined` or `null`.6098*/6099provideTypeHierarchySubtypes(item: TypeHierarchyItem, token: CancellationToken): ProviderResult<TypeHierarchyItem[]>;6100}61016102/**6103* Represents a list of ranges that can be edited together along with a word pattern to describe valid range contents.6104*/6105export class LinkedEditingRanges {6106/**6107* Create a new linked editing ranges object.6108*6109* @param ranges A list of ranges that can be edited together6110* @param wordPattern An optional word pattern that describes valid contents for the given ranges6111*/6112constructor(ranges: Range[], wordPattern?: RegExp);61136114/**6115* A list of ranges that can be edited together. The ranges must have6116* identical length and text content. The ranges cannot overlap.6117*/6118readonly ranges: Range[];61196120/**6121* An optional word pattern that describes valid contents for the given ranges.6122* If no pattern is provided, the language configuration's word pattern will be used.6123*/6124readonly wordPattern: RegExp | undefined;6125}61266127/**6128* The linked editing range provider interface defines the contract between extensions and6129* the linked editing feature.6130*/6131export interface LinkedEditingRangeProvider {6132/**6133* For a given position in a document, returns the range of the symbol at the position and all ranges6134* that have the same content. A change to one of the ranges can be applied to all other ranges if the new content6135* is valid. An optional word pattern can be returned with the result to describe valid contents.6136* If no result-specific word pattern is provided, the word pattern from the language configuration is used.6137*6138* @param document The document in which the provider was invoked.6139* @param position The position at which the provider was invoked.6140* @param token A cancellation token.6141* @returns A list of ranges that can be edited together6142*/6143provideLinkedEditingRanges(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<LinkedEditingRanges>;6144}61456146/**6147* Identifies a {@linkcode DocumentDropEdit} or {@linkcode DocumentPasteEdit}6148*/6149export class DocumentDropOrPasteEditKind {6150static readonly Empty: DocumentDropOrPasteEditKind;61516152/**6153* The root kind for basic text edits.6154*6155* This kind should be used for edits that insert basic text into the document. A good example of this is6156* an edit that pastes the clipboard text while also updating imports in the file based on the pasted text.6157* For this we could use a kind such as `text.updateImports.someLanguageId`.6158*6159* Even though most drop/paste edits ultimately insert text, you should not use {@linkcode Text} as the base kind6160* for every edit as this is redundant. Instead a more specific kind that describes the type of content being6161* inserted should be used instead. For example, if the edit adds a Markdown link, use `markdown.link` since even6162* though the content being inserted is text, it's more important to know that the edit inserts Markdown syntax.6163*/6164static readonly Text: DocumentDropOrPasteEditKind;61656166/**6167* Root kind for edits that update imports in a document in addition to inserting text.6168*/6169static readonly TextUpdateImports: DocumentDropOrPasteEditKind;61706171/**6172* Use {@linkcode DocumentDropOrPasteEditKind.Empty} instead.6173*/6174private constructor(value: string);61756176/**6177* The raw string value of the kind.6178*/6179readonly value: string;61806181/**6182* Create a new kind by appending additional scopes to the current kind.6183*6184* Does not modify the current kind.6185*/6186append(...parts: string[]): DocumentDropOrPasteEditKind;61876188/**6189* Checks if this kind intersects `other`.6190*6191* The kind `"text.plain"` for example intersects `text`, `"text.plain"` and `"text.plain.list"`,6192* but not `"unicorn"`, or `"textUnicorn.plain"`.6193*6194* @param other Kind to check.6195*/6196intersects(other: DocumentDropOrPasteEditKind): boolean;61976198/**6199* Checks if `other` is a sub-kind of this `DocumentDropOrPasteEditKind`.6200*6201* The kind `"text.plain"` for example contains `"text.plain"` and `"text.plain.list"`,6202* but not `"text"` or `"unicorn.text.plain"`.6203*6204* @param other Kind to check.6205*/6206contains(other: DocumentDropOrPasteEditKind): boolean;6207}62086209/**6210* An edit operation applied {@link DocumentDropEditProvider on drop}.6211*/6212export class DocumentDropEdit {6213/**6214* Human readable label that describes the edit.6215*/6216title?: string;62176218/**6219* {@link DocumentDropOrPasteEditKind Kind} of the edit.6220*/6221kind?: DocumentDropOrPasteEditKind;62226223/**6224* Controls the ordering or multiple edits. If this provider yield to edits, it will be shown lower in the list.6225*/6226yieldTo?: readonly DocumentDropOrPasteEditKind[];62276228/**6229* The text or snippet to insert at the drop location.6230*/6231insertText: string | SnippetString;62326233/**6234* An optional additional edit to apply on drop.6235*/6236additionalEdit?: WorkspaceEdit;62376238/**6239* @param insertText The text or snippet to insert at the drop location.6240* @param title Human readable label that describes the edit.6241* @param kind {@link DocumentDropOrPasteEditKind Kind} of the edit.6242*/6243constructor(insertText: string | SnippetString, title?: string, kind?: DocumentDropOrPasteEditKind);6244}62456246/**6247* Provider which handles dropping of resources into a text editor.6248*6249* This allows users to drag and drop resources (including resources from external apps) into the editor. While dragging6250* and dropping files, users can hold down `shift` to drop the file into the editor instead of opening it.6251* Requires `editor.dropIntoEditor.enabled` to be on.6252*/6253export interface DocumentDropEditProvider<T extends DocumentDropEdit = DocumentDropEdit> {6254/**6255* Provide edits which inserts the content being dragged and dropped into the document.6256*6257* @param document The document in which the drop occurred.6258* @param position The position in the document where the drop occurred.6259* @param dataTransfer A {@link DataTransfer} object that holds data about what is being dragged and dropped.6260* @param token A cancellation token.6261*6262* @returns A {@link DocumentDropEdit} or a thenable that resolves to such. The lack of a result can be6263* signaled by returning `undefined` or `null`.6264*/6265provideDocumentDropEdits(document: TextDocument, position: Position, dataTransfer: DataTransfer, token: CancellationToken): ProviderResult<T | T[]>;62666267/**6268* Optional method which fills in the {@linkcode DocumentDropEdit.additionalEdit} before the edit is applied.6269*6270* This is called once per edit and should be used if generating the complete edit may take a long time.6271* Resolve can only be used to change {@link DocumentDropEdit.additionalEdit}.6272*6273* @param edit The {@linkcode DocumentDropEdit} to resolve.6274* @param token A cancellation token.6275*6276* @returns The resolved edit or a thenable that resolves to such. It is OK to return the given6277* `edit`. If no result is returned, the given `edit` is used.6278*/6279resolveDocumentDropEdit?(edit: T, token: CancellationToken): ProviderResult<T>;6280}62816282/**6283* Provides additional metadata about how a {@linkcode DocumentDropEditProvider} works.6284*/6285export interface DocumentDropEditProviderMetadata {6286/**6287* List of {@link DocumentDropOrPasteEditKind kinds} that the provider may return in {@linkcode DocumentDropEditProvider.provideDocumentDropEdits provideDocumentDropEdits}.6288*6289* This is used to filter out providers when a specific {@link DocumentDropOrPasteEditKind kind} of edit is requested.6290*/6291readonly providedDropEditKinds?: readonly DocumentDropOrPasteEditKind[];62926293/**6294* List of {@link DataTransfer} mime types that the provider can handle.6295*6296* This can either be an exact mime type such as `image/png`, or a wildcard pattern such as `image/*`.6297*6298* Use `text/uri-list` for resources dropped from the explorer or other tree views in the workbench.6299*6300* Use `files` to indicate that the provider should be invoked if any {@link DataTransferFile files} are present in the {@link DataTransfer}.6301* Note that {@link DataTransferFile} entries are only created when dropping content from outside the editor, such as6302* from the operating system.6303*/6304readonly dropMimeTypes: readonly string[];6305}630663076308/**6309* The reason why paste edits were requested.6310*/6311export enum DocumentPasteTriggerKind {6312/**6313* Pasting was requested as part of a normal paste operation.6314*/6315Automatic = 0,63166317/**6318* Pasting was requested by the user with the `paste as` command.6319*/6320PasteAs = 1,6321}63226323/**6324* Additional information about the paste operation.6325*/6326export interface DocumentPasteEditContext {63276328/**6329* Requested kind of paste edits to return.6330*6331* When a explicit kind if requested by {@linkcode DocumentPasteTriggerKind.PasteAs PasteAs}, providers are6332* encourage to be more flexible when generating an edit of the requested kind.6333*/6334readonly only: DocumentDropOrPasteEditKind | undefined;63356336/**6337* The reason why paste edits were requested.6338*/6339readonly triggerKind: DocumentPasteTriggerKind;6340}63416342/**6343* Provider invoked when the user copies or pastes in a {@linkcode TextDocument}.6344*/6345export interface DocumentPasteEditProvider<T extends DocumentPasteEdit = DocumentPasteEdit> {63466347/**6348* Optional method invoked after the user copies from a {@link TextEditor text editor}.6349*6350* This allows the provider to attach metadata about the copied text to the {@link DataTransfer}. This data6351* transfer is then passed back to providers in {@linkcode provideDocumentPasteEdits}.6352*6353* Note that currently any changes to the {@linkcode DataTransfer} are isolated to the current editor window.6354* This means that any added metadata cannot be seen by other editor windows or by other applications.6355*6356* @param document Text document where the copy took place.6357* @param ranges Ranges being copied in {@linkcode document}.6358* @param dataTransfer The data transfer associated with the copy. You can store additional values on this for6359* later use in {@linkcode provideDocumentPasteEdits}. This object is only valid for the duration of this method.6360* @param token A cancellation token.6361*6362* @return Optional thenable that resolves when all changes to the `dataTransfer` are complete.6363*/6364prepareDocumentPaste?(document: TextDocument, ranges: readonly Range[], dataTransfer: DataTransfer, token: CancellationToken): void | Thenable<void>;63656366/**6367* Invoked before the user pastes into a {@link TextEditor text editor}.6368*6369* Returned edits can replace the standard pasting behavior.6370*6371* @param document Document being pasted into6372* @param ranges Range in the {@linkcode document} to paste into.6373* @param dataTransfer The {@link DataTransfer data transfer} associated with the paste. This object is only6374* valid for the duration of the paste operation.6375* @param context Additional context for the paste.6376* @param token A cancellation token.6377*6378* @return Set of potential {@link DocumentPasteEdit edits} that can apply the paste. Only a single returned6379* {@linkcode DocumentPasteEdit} is applied at a time. If multiple edits are returned from all providers, then6380* the first is automatically applied and a widget is shown that lets the user switch to the other edits.6381*/6382provideDocumentPasteEdits?(document: TextDocument, ranges: readonly Range[], dataTransfer: DataTransfer, context: DocumentPasteEditContext, token: CancellationToken): ProviderResult<T[]>;63836384/**6385* Optional method which fills in the {@linkcode DocumentPasteEdit.additionalEdit} before the edit is applied.6386*6387* This is called once per edit and should be used if generating the complete edit may take a long time.6388* Resolve can only be used to change {@linkcode DocumentPasteEdit.insertText} or {@linkcode DocumentPasteEdit.additionalEdit}.6389*6390* @param pasteEdit The {@linkcode DocumentPasteEdit} to resolve.6391* @param token A cancellation token.6392*6393* @returns The resolved paste edit or a thenable that resolves to such. It is OK to return the given6394* `pasteEdit`. If no result is returned, the given `pasteEdit` is used.6395*/6396resolveDocumentPasteEdit?(pasteEdit: T, token: CancellationToken): ProviderResult<T>;6397}63986399/**6400* An edit the applies a paste operation.6401*/6402export class DocumentPasteEdit {64036404/**6405* Human readable label that describes the edit.6406*/6407title: string;64086409/**6410* {@link DocumentDropOrPasteEditKind Kind} of the edit.6411*/6412kind: DocumentDropOrPasteEditKind;64136414/**6415* The text or snippet to insert at the pasted locations.6416*6417* If your edit requires more advanced insertion logic, set this to an empty string and provide an {@link DocumentPasteEdit.additionalEdit additional edit} instead.6418*/6419insertText: string | SnippetString;64206421/**6422* An optional additional edit to apply on paste.6423*/6424additionalEdit?: WorkspaceEdit;64256426/**6427* Controls ordering when multiple paste edits can potentially be applied.6428*6429* If this edit yields to another, it will be shown lower in the list of possible paste edits shown to the user.6430*/6431yieldTo?: readonly DocumentDropOrPasteEditKind[];64326433/**6434* Create a new paste edit.6435*6436* @param insertText The text or snippet to insert at the pasted locations.6437* @param title Human readable label that describes the edit.6438* @param kind {@link DocumentDropOrPasteEditKind Kind} of the edit.6439*/6440constructor(insertText: string | SnippetString, title: string, kind: DocumentDropOrPasteEditKind);6441}64426443/**6444* Provides additional metadata about how a {@linkcode DocumentPasteEditProvider} works.6445*/6446export interface DocumentPasteProviderMetadata {6447/**6448* List of {@link DocumentDropOrPasteEditKind kinds} that the provider may return in {@linkcode DocumentPasteEditProvider.provideDocumentPasteEdits provideDocumentPasteEdits}.6449*6450* This is used to filter out providers when a specific {@link DocumentDropOrPasteEditKind kind} of edit is requested.6451*/6452readonly providedPasteEditKinds: readonly DocumentDropOrPasteEditKind[];64536454/**6455* Mime types that {@linkcode DocumentPasteEditProvider.prepareDocumentPaste prepareDocumentPaste} may add on copy.6456*/6457readonly copyMimeTypes?: readonly string[];64586459/**6460* Mime types that {@linkcode DocumentPasteEditProvider.provideDocumentPasteEdits provideDocumentPasteEdits} should be invoked for.6461*6462* This can either be an exact mime type such as `image/png`, or a wildcard pattern such as `image/*`.6463*6464* Use `text/uri-list` for resources dropped from the explorer or other tree views in the workbench.6465*6466* Use `files` to indicate that the provider should be invoked if any {@link DataTransferFile files} are present in the {@linkcode DataTransfer}.6467* Note that {@linkcode DataTransferFile} entries are only created when pasting content from outside the editor, such as6468* from the operating system.6469*/6470readonly pasteMimeTypes?: readonly string[];6471}64726473/**6474* A tuple of two characters, like a pair of6475* opening and closing brackets.6476*/6477export type CharacterPair = [string, string];64786479/**6480* Configuration for line comments.6481*/6482export interface LineCommentRule {6483/**6484* The line comment token, like `//`6485*/6486comment: string;6487/**6488* Whether the comment token should not be indented and placed at the first column.6489* Defaults to false.6490*/6491noIndent?: boolean;6492}64936494/**6495* Describes how comments for a language work.6496*/6497export interface CommentRule {64986499/**6500* The line comment token, like `// this is a comment`6501*/6502lineComment?: string | LineCommentRule;65036504/**6505* The block comment character pair, like `/* block comment */`6506*/6507blockComment?: CharacterPair;6508}65096510/**6511* Describes indentation rules for a language.6512*/6513export interface IndentationRule {6514/**6515* If a line matches this pattern, then all the lines after it should be unindented once (until another rule matches).6516*/6517decreaseIndentPattern: RegExp;6518/**6519* If a line matches this pattern, then all the lines after it should be indented once (until another rule matches).6520*/6521increaseIndentPattern: RegExp;6522/**6523* If a line matches this pattern, then **only the next line** after it should be indented once.6524*/6525indentNextLinePattern?: RegExp;6526/**6527* If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules.6528*/6529unIndentedLinePattern?: RegExp;6530}65316532/**6533* Describes what to do with the indentation when pressing Enter.6534*/6535export enum IndentAction {6536/**6537* Insert new line and copy the previous line's indentation.6538*/6539None = 0,6540/**6541* Insert new line and indent once (relative to the previous line's indentation).6542*/6543Indent = 1,6544/**6545* Insert two new lines:6546* - the first one indented which will hold the cursor6547* - the second one at the same indentation level6548*/6549IndentOutdent = 2,6550/**6551* Insert new line and outdent once (relative to the previous line's indentation).6552*/6553Outdent = 36554}65556556/**6557* Describes what to do when pressing Enter.6558*/6559export interface EnterAction {6560/**6561* Describe what to do with the indentation.6562*/6563indentAction: IndentAction;6564/**6565* Describes text to be appended after the new line and after the indentation.6566*/6567appendText?: string;6568/**6569* Describes the number of characters to remove from the new line's indentation.6570*/6571removeText?: number;6572}65736574/**6575* Describes a rule to be evaluated when pressing Enter.6576*/6577export interface OnEnterRule {6578/**6579* This rule will only execute if the text before the cursor matches this regular expression.6580*/6581beforeText: RegExp;6582/**6583* This rule will only execute if the text after the cursor matches this regular expression.6584*/6585afterText?: RegExp;6586/**6587* This rule will only execute if the text above the current line matches this regular expression.6588*/6589previousLineText?: RegExp;6590/**6591* The action to execute.6592*/6593action: EnterAction;6594}65956596/**6597* Enumeration of commonly encountered syntax token types.6598*/6599export enum SyntaxTokenType {6600/**6601* Everything except tokens that are part of comments, string literals and regular expressions.6602*/6603Other = 0,6604/**6605* A comment.6606*/6607Comment = 1,6608/**6609* A string literal.6610*/6611String = 2,6612/**6613* A regular expression.6614*/6615RegEx = 36616}66176618/**6619* Describes pairs of strings where the close string will be automatically inserted when typing the opening string.6620*/6621export interface AutoClosingPair {6622/**6623* The string that will trigger the automatic insertion of the closing string.6624*/6625open: string;6626/**6627* The closing string that will be automatically inserted when typing the opening string.6628*/6629close: string;6630/**6631* A set of tokens where the pair should not be auto closed.6632*/6633notIn?: SyntaxTokenType[];6634}66356636/**6637* The language configuration interfaces defines the contract between extensions6638* and various editor features, like automatic bracket insertion, automatic indentation etc.6639*/6640export interface LanguageConfiguration {6641/**6642* The language's comment settings.6643*/6644comments?: CommentRule;6645/**6646* The language's brackets.6647* This configuration implicitly affects pressing Enter around these brackets.6648*/6649brackets?: CharacterPair[];6650/**6651* The language's word definition.6652* If the language supports Unicode identifiers (e.g. JavaScript), it is preferable6653* to provide a word definition that uses exclusion of known separators.6654* e.g.: A regex that matches anything except known separators (and dot is allowed to occur in a floating point number):6655* ```6656* /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g6657* ```6658*/6659wordPattern?: RegExp;6660/**6661* The language's indentation settings.6662*/6663indentationRules?: IndentationRule;6664/**6665* The language's rules to be evaluated when pressing Enter.6666*/6667onEnterRules?: OnEnterRule[];6668/**6669* The language's auto closing pairs.6670*/6671autoClosingPairs?: AutoClosingPair[];66726673/**6674* **Deprecated** Do not use.6675*6676* @deprecated Will be replaced by a better API soon.6677*/6678__electricCharacterSupport?: {6679/**6680* This property is deprecated and will be **ignored** from6681* the editor.6682* @deprecated6683*/6684brackets?: any;6685/**6686* This property is deprecated and not fully supported anymore by6687* the editor (scope and lineStart are ignored).6688* Use the autoClosingPairs property in the language configuration file instead.6689* @deprecated6690*/6691docComment?: {6692/**6693* @deprecated6694*/6695scope: string;6696/**6697* @deprecated6698*/6699open: string;6700/**6701* @deprecated6702*/6703lineStart: string;6704/**6705* @deprecated6706*/6707close?: string;6708};6709};67106711/**6712* **Deprecated** Do not use.6713*6714* @deprecated * Use the autoClosingPairs property in the language configuration file instead.6715*/6716__characterPairSupport?: {6717/**6718* @deprecated6719*/6720autoClosingPairs: {6721/**6722* @deprecated6723*/6724open: string;6725/**6726* @deprecated6727*/6728close: string;6729/**6730* @deprecated6731*/6732notIn?: string[];6733}[];6734};6735}67366737/**6738* The configuration target6739*/6740export enum ConfigurationTarget {6741/**6742* Global configuration6743*/6744Global = 1,67456746/**6747* Workspace configuration6748*/6749Workspace = 2,67506751/**6752* Workspace folder configuration6753*/6754WorkspaceFolder = 36755}67566757/**6758* Represents the configuration. It is a merged view of6759*6760* - *Default Settings*6761* - *Global (User) Settings*6762* - *Workspace settings*6763* - *Workspace Folder settings* - From one of the {@link workspace.workspaceFolders Workspace Folders} under which requested resource belongs to.6764* - *Language settings* - Settings defined under requested language.6765*6766* The *effective* value (returned by {@linkcode WorkspaceConfiguration.get get}) is computed by overriding or merging the values in the following order:6767*6768* 1. `defaultValue` (if defined in `package.json` otherwise derived from the value's type)6769* 1. `globalValue` (if defined)6770* 1. `workspaceValue` (if defined)6771* 1. `workspaceFolderValue` (if defined)6772* 1. `defaultLanguageValue` (if defined)6773* 1. `globalLanguageValue` (if defined)6774* 1. `workspaceLanguageValue` (if defined)6775* 1. `workspaceFolderLanguageValue` (if defined)6776*6777* **Note:** Only `object` value types are merged and all other value types are overridden.6778*6779* Example 1: Overriding6780*6781* ```ts6782* defaultValue = 'on';6783* globalValue = 'relative'6784* workspaceFolderValue = 'off'6785* value = 'off'6786* ```6787*6788* Example 2: Language Values6789*6790* ```ts6791* defaultValue = 'on';6792* globalValue = 'relative'6793* workspaceFolderValue = 'off'6794* globalLanguageValue = 'on'6795* value = 'on'6796* ```6797*6798* Example 3: Object Values6799*6800* ```ts6801* defaultValue = { "a": 1, "b": 2 };6802* globalValue = { "b": 3, "c": 4 };6803* value = { "a": 1, "b": 3, "c": 4 };6804* ```6805*6806* *Note:* Workspace and Workspace Folder configurations contains `launch` and `tasks` settings. Their basename will be6807* part of the section identifier. The following snippets shows how to retrieve all configurations6808* from `launch.json`:6809*6810* ```ts6811* // launch.json configuration6812* const config = workspace.getConfiguration('launch', vscode.workspace.workspaceFolders[0].uri);6813*6814* // retrieve values6815* const values = config.get('configurations');6816* ```6817*6818* Refer to [Settings](https://code.visualstudio.com/docs/getstarted/settings) for more information.6819*/6820export interface WorkspaceConfiguration {68216822/**6823* Return a value from this configuration.6824*6825* @param section Configuration name, supports _dotted_ names.6826* @returns The value `section` denotes or `undefined`.6827*/6828get<T>(section: string): T | undefined;68296830/**6831* Return a value from this configuration.6832*6833* @param section Configuration name, supports _dotted_ names.6834* @param defaultValue A value should be returned when no value could be found, is `undefined`.6835* @returns The value `section` denotes or the default.6836*/6837get<T>(section: string, defaultValue: T): T;68386839/**6840* Check if this configuration has a certain value.6841*6842* @param section Configuration name, supports _dotted_ names.6843* @returns `true` if the section doesn't resolve to `undefined`.6844*/6845has(section: string): boolean;68466847/**6848* Retrieve all information about a configuration setting. A configuration value6849* often consists of a *default* value, a global or installation-wide value,6850* a workspace-specific value, folder-specific value6851* and language-specific values (if {@link WorkspaceConfiguration} is scoped to a language).6852*6853* Also provides all language ids under which the given configuration setting is defined.6854*6855* *Note:* The configuration name must denote a leaf in the configuration tree6856* (`editor.fontSize` vs `editor`) otherwise no result is returned.6857*6858* @param section Configuration name, supports _dotted_ names.6859* @returns Information about a configuration setting or `undefined`.6860*/6861inspect<T>(section: string): {68626863/**6864* The fully qualified key of the configuration value6865*/6866key: string;68676868/**6869* The default value which is used when no other value is defined6870*/6871defaultValue?: T;68726873/**6874* The global or installation-wide value.6875*/6876globalValue?: T;68776878/**6879* The workspace-specific value.6880*/6881workspaceValue?: T;68826883/**6884* The workspace-folder-specific value.6885*/6886workspaceFolderValue?: T;68876888/**6889* Language specific default value when this configuration value is created for a {@link ConfigurationScope language scope}.6890*/6891defaultLanguageValue?: T;68926893/**6894* Language specific global value when this configuration value is created for a {@link ConfigurationScope language scope}.6895*/6896globalLanguageValue?: T;68976898/**6899* Language specific workspace value when this configuration value is created for a {@link ConfigurationScope language scope}.6900*/6901workspaceLanguageValue?: T;69026903/**6904* Language specific workspace-folder value when this configuration value is created for a {@link ConfigurationScope language scope}.6905*/6906workspaceFolderLanguageValue?: T;69076908/**6909* All language identifiers for which this configuration is defined.6910*/6911languageIds?: string[];69126913} | undefined;69146915/**6916* Update a configuration value. The updated configuration values are persisted.6917*6918* A value can be changed in6919*6920* - {@link ConfigurationTarget.Global Global settings}: Changes the value for all instances of the editor.6921* - {@link ConfigurationTarget.Workspace Workspace settings}: Changes the value for current workspace, if available.6922* - {@link ConfigurationTarget.WorkspaceFolder Workspace folder settings}: Changes the value for settings from one of the {@link workspace.workspaceFolders Workspace Folders} under which the requested resource belongs to.6923* - Language settings: Changes the value for the requested languageId.6924*6925* *Note:* To remove a configuration value use `undefined`, like so: `config.update('somekey', undefined)`6926*6927* @param section Configuration name, supports _dotted_ names.6928* @param value The new value.6929* @param configurationTarget The {@link ConfigurationTarget configuration target} or a boolean value.6930* - If `true` updates {@link ConfigurationTarget.Global Global settings}.6931* - If `false` updates {@link ConfigurationTarget.Workspace Workspace settings}.6932* - If `undefined` or `null` updates to {@link ConfigurationTarget.WorkspaceFolder Workspace folder settings} if configuration is resource specific,6933* otherwise to {@link ConfigurationTarget.Workspace Workspace settings}.6934* @param overrideInLanguage Whether to update the value in the scope of requested languageId or not.6935* - If `true` updates the value under the requested languageId.6936* - If `undefined` updates the value under the requested languageId only if the configuration is defined for the language.6937* @throws error while updating6938* - configuration which is not registered.6939* - window configuration to workspace folder6940* - configuration to workspace or workspace folder when no workspace is opened.6941* - configuration to workspace folder when there is no workspace folder settings.6942* - configuration to workspace folder when {@link WorkspaceConfiguration} is not scoped to a resource.6943*/6944update(section: string, value: any, configurationTarget?: ConfigurationTarget | boolean | null, overrideInLanguage?: boolean): Thenable<void>;69456946/**6947* Readable dictionary that backs this configuration.6948*/6949readonly [key: string]: any;6950}69516952/**6953* Represents a location inside a resource, such as a line6954* inside a text file.6955*/6956export class Location {69576958/**6959* The resource identifier of this location.6960*/6961uri: Uri;69626963/**6964* The document range of this location.6965*/6966range: Range;69676968/**6969* Creates a new location object.6970*6971* @param uri The resource identifier.6972* @param rangeOrPosition The range or position. Positions will be converted to an empty range.6973*/6974constructor(uri: Uri, rangeOrPosition: Range | Position);6975}69766977/**6978* Represents the connection of two locations. Provides additional metadata over normal {@link Location locations},6979* including an origin range.6980*/6981export interface LocationLink {6982/**6983* Span of the origin of this link.6984*6985* Used as the underlined span for mouse definition hover. Defaults to the word range at6986* the definition position.6987*/6988originSelectionRange?: Range;69896990/**6991* The target resource identifier of this link.6992*/6993targetUri: Uri;69946995/**6996* The full target range of this link.6997*/6998targetRange: Range;69997000/**7001* The span of this link.7002*/7003targetSelectionRange?: Range;7004}70057006/**7007* The event that is fired when diagnostics change.7008*/7009export interface DiagnosticChangeEvent {70107011/**7012* An array of resources for which diagnostics have changed.7013*/7014readonly uris: readonly Uri[];7015}70167017/**7018* Represents the severity of diagnostics.7019*/7020export enum DiagnosticSeverity {70217022/**7023* Something not allowed by the rules of a language or other means.7024*/7025Error = 0,70267027/**7028* Something suspicious but allowed.7029*/7030Warning = 1,70317032/**7033* Something to inform about but not a problem.7034*/7035Information = 2,70367037/**7038* Something to hint to a better way of doing it, like proposing7039* a refactoring.7040*/7041Hint = 37042}70437044/**7045* Represents a related message and source code location for a diagnostic. This should be7046* used to point to code locations that cause or related to a diagnostics, e.g. when duplicating7047* a symbol in a scope.7048*/7049export class DiagnosticRelatedInformation {70507051/**7052* The location of this related diagnostic information.7053*/7054location: Location;70557056/**7057* The message of this related diagnostic information.7058*/7059message: string;70607061/**7062* Creates a new related diagnostic information object.7063*7064* @param location The location.7065* @param message The message.7066*/7067constructor(location: Location, message: string);7068}70697070/**7071* Additional metadata about the type of a diagnostic.7072*/7073export enum DiagnosticTag {7074/**7075* Unused or unnecessary code.7076*7077* Diagnostics with this tag are rendered faded out. The amount of fading7078* is controlled by the `"editorUnnecessaryCode.opacity"` theme color. For7079* example, `"editorUnnecessaryCode.opacity": "#000000c0"` will render the7080* code with 75% opacity. For high contrast themes, use the7081* `"editorUnnecessaryCode.border"` theme color to underline unnecessary code7082* instead of fading it out.7083*/7084Unnecessary = 1,70857086/**7087* Deprecated or obsolete code.7088*7089* Diagnostics with this tag are rendered with a strike through.7090*/7091Deprecated = 2,7092}70937094/**7095* Represents a diagnostic, such as a compiler error or warning. Diagnostic objects7096* are only valid in the scope of a file.7097*/7098export class Diagnostic {70997100/**7101* The range to which this diagnostic applies.7102*/7103range: Range;71047105/**7106* The human-readable message.7107*/7108message: string;71097110/**7111* The severity, default is {@link DiagnosticSeverity.Error error}.7112*/7113severity: DiagnosticSeverity;71147115/**7116* A human-readable string describing the source of this7117* diagnostic, e.g. 'typescript' or 'super lint'.7118*/7119source?: string;71207121/**7122* A code or identifier for this diagnostic.7123* Should be used for later processing, e.g. when providing {@link CodeActionContext code actions}.7124*/7125code?: string | number | {7126/**7127* A code or identifier for this diagnostic.7128* Should be used for later processing, e.g. when providing {@link CodeActionContext code actions}.7129*/7130value: string | number;71317132/**7133* A target URI to open with more information about the diagnostic error.7134*/7135target: Uri;7136};71377138/**7139* An array of related diagnostic information, e.g. when symbol-names within7140* a scope collide all definitions can be marked via this property.7141*/7142relatedInformation?: DiagnosticRelatedInformation[];71437144/**7145* Additional metadata about the diagnostic.7146*/7147tags?: DiagnosticTag[];71487149/**7150* Creates a new diagnostic object.7151*7152* @param range The range to which this diagnostic applies.7153* @param message The human-readable message.7154* @param severity The severity, default is {@link DiagnosticSeverity.Error error}.7155*/7156constructor(range: Range, message: string, severity?: DiagnosticSeverity);7157}71587159/**7160* A diagnostics collection is a container that manages a set of7161* {@link Diagnostic diagnostics}. Diagnostics are always scopes to a7162* diagnostics collection and a resource.7163*7164* To get an instance of a `DiagnosticCollection` use7165* {@link languages.createDiagnosticCollection createDiagnosticCollection}.7166*/7167export interface DiagnosticCollection extends Iterable<[uri: Uri, diagnostics: readonly Diagnostic[]]> {71687169/**7170* The name of this diagnostic collection, for instance `typescript`. Every diagnostic7171* from this collection will be associated with this name. Also, the task framework uses this7172* name when defining [problem matchers](https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher).7173*/7174readonly name: string;71757176/**7177* Assign diagnostics for given resource. Will replace7178* existing diagnostics for that resource.7179*7180* @param uri A resource identifier.7181* @param diagnostics Array of diagnostics or `undefined`7182*/7183set(uri: Uri, diagnostics: readonly Diagnostic[] | undefined): void;71847185/**7186* Replace diagnostics for multiple resources in this collection.7187*7188* _Note_ that multiple tuples of the same uri will be merged, e.g7189* `[[file1, [d1]], [file1, [d2]]]` is equivalent to `[[file1, [d1, d2]]]`.7190* If a diagnostics item is `undefined` as in `[file1, undefined]`7191* all previous but not subsequent diagnostics are removed.7192*7193* @param entries An array of tuples, like `[[file1, [d1, d2]], [file2, [d3, d4, d5]]]`, or `undefined`.7194*/7195set(entries: ReadonlyArray<[Uri, readonly Diagnostic[] | undefined]>): void;71967197/**7198* Remove all diagnostics from this collection that belong7199* to the provided `uri`. The same as `#set(uri, undefined)`.7200*7201* @param uri A resource identifier.7202*/7203delete(uri: Uri): void;72047205/**7206* Remove all diagnostics from this collection. The same7207* as calling `#set(undefined)`;7208*/7209clear(): void;72107211/**7212* Iterate over each entry in this collection.7213*7214* @param callback Function to execute for each entry.7215* @param thisArg The `this` context used when invoking the handler function.7216*/7217forEach(callback: (uri: Uri, diagnostics: readonly Diagnostic[], collection: DiagnosticCollection) => any, thisArg?: any): void;72187219/**7220* Get the diagnostics for a given resource. *Note* that you cannot7221* modify the diagnostics-array returned from this call.7222*7223* @param uri A resource identifier.7224* @returns An immutable array of {@link Diagnostic diagnostics} or `undefined`.7225*/7226get(uri: Uri): readonly Diagnostic[] | undefined;72277228/**7229* Check if this collection contains diagnostics for a7230* given resource.7231*7232* @param uri A resource identifier.7233* @returns `true` if this collection has diagnostic for the given resource.7234*/7235has(uri: Uri): boolean;72367237/**7238* Dispose and free associated resources. Calls7239* {@link DiagnosticCollection.clear clear}.7240*/7241dispose(): void;7242}72437244/**7245* Represents the severity of a language status item.7246*/7247/**7248* Represents the severity level of a language status.7249*/7250export enum LanguageStatusSeverity {7251/**7252* Informational severity level.7253*/7254Information = 0,7255/**7256* Warning severity level.7257*/7258Warning = 1,7259/**7260* Error severity level.7261*/7262Error = 27263}72647265/**7266* A language status item is the preferred way to present language status reports for the active text editors,7267* such as selected linter or notifying about a configuration problem.7268*/7269export interface LanguageStatusItem {72707271/**7272* The identifier of this item.7273*/7274readonly id: string;72757276/**7277* The short name of this item, like 'Java Language Status', etc.7278*/7279name: string | undefined;72807281/**7282* A {@link DocumentSelector selector} that defines for what editors7283* this item shows.7284*/7285selector: DocumentSelector;72867287/**7288* The severity of this item.7289*7290* Defaults to {@link LanguageStatusSeverity.Information information}. You can use this property to7291* signal to users that there is a problem that needs attention, like a missing executable or an7292* invalid configuration.7293*/7294severity: LanguageStatusSeverity;72957296/**7297* The text to show for the entry. You can embed icons in the text by leveraging the syntax:7298*7299* `My text $(icon-name) contains icons like $(icon-name) this one.`7300*7301* Where the icon-name is taken from the ThemeIcon [icon set](https://code.visualstudio.com/api/references/icons-in-labels#icon-listing), e.g.7302* `light-bulb`, `thumbsup`, `zap` etc.7303*/7304text: string;73057306/**7307* Optional, human-readable details for this item.7308*/7309detail?: string;73107311/**7312* Controls whether the item is shown as "busy". Defaults to `false`.7313*/7314busy: boolean;73157316/**7317* A {@linkcode Command command} for this item.7318*/7319command: Command | undefined;73207321/**7322* Accessibility information used when a screen reader interacts with this item7323*/7324accessibilityInformation?: AccessibilityInformation;73257326/**7327* Dispose and free associated resources.7328*/7329dispose(): void;7330}73317332/**7333* Denotes a location of an editor in the window. Editors can be arranged in a grid7334* and each column represents one editor location in that grid by counting the editors7335* in order of their appearance.7336*/7337export enum ViewColumn {7338/**7339* A *symbolic* editor column representing the currently active column. This value7340* can be used when opening editors, but the *resolved* {@link TextEditor.viewColumn viewColumn}-value7341* of editors will always be `One`, `Two`, `Three`,... or `undefined` but never `Active`.7342*/7343Active = -1,7344/**7345* A *symbolic* editor column representing the column to the side of the active one. This value7346* can be used when opening editors, but the *resolved* {@link TextEditor.viewColumn viewColumn}-value7347* of editors will always be `One`, `Two`, `Three`,... or `undefined` but never `Beside`.7348*/7349Beside = -2,7350/**7351* The first editor column.7352*/7353One = 1,7354/**7355* The second editor column.7356*/7357Two = 2,7358/**7359* The third editor column.7360*/7361Three = 3,7362/**7363* The fourth editor column.7364*/7365Four = 4,7366/**7367* The fifth editor column.7368*/7369Five = 5,7370/**7371* The sixth editor column.7372*/7373Six = 6,7374/**7375* The seventh editor column.7376*/7377Seven = 7,7378/**7379* The eighth editor column.7380*/7381Eight = 8,7382/**7383* The ninth editor column.7384*/7385Nine = 97386}73877388/**7389* An output channel is a container for readonly textual information.7390*7391* To get an instance of an `OutputChannel` use7392* {@link window.createOutputChannel createOutputChannel}.7393*/7394export interface OutputChannel {73957396/**7397* The human-readable name of this output channel.7398*/7399readonly name: string;74007401/**7402* Append the given value to the channel.7403*7404* @param value A string, falsy values will not be printed.7405*/7406append(value: string): void;74077408/**7409* Append the given value and a line feed character7410* to the channel.7411*7412* @param value A string, falsy values will be printed.7413*/7414appendLine(value: string): void;74157416/**7417* Replaces all output from the channel with the given value.7418*7419* @param value A string, falsy values will not be printed.7420*/7421replace(value: string): void;74227423/**7424* Removes all output from the channel.7425*/7426clear(): void;74277428/**7429* Reveal this channel in the UI.7430*7431* @param preserveFocus When `true` the channel will not take focus.7432*/7433show(preserveFocus?: boolean): void;74347435/**7436* Reveal this channel in the UI.7437*7438* @deprecated Use the overload with just one parameter (`show(preserveFocus?: boolean): void`).7439*7440* @param column This argument is **deprecated** and will be ignored.7441* @param preserveFocus When `true` the channel will not take focus.7442*/7443show(column?: ViewColumn, preserveFocus?: boolean): void;74447445/**7446* Hide this channel from the UI.7447*/7448hide(): void;74497450/**7451* Dispose and free associated resources.7452*/7453dispose(): void;7454}74557456/**7457* A channel for containing log output.7458*7459* To get an instance of a `LogOutputChannel` use7460* {@link window.createOutputChannel createOutputChannel}.7461*/7462export interface LogOutputChannel extends OutputChannel {74637464/**7465* The current log level of the channel. Defaults to {@link env.logLevel editor log level}.7466*/7467readonly logLevel: LogLevel;74687469/**7470* An {@link Event} which fires when the log level of the channel changes.7471*/7472readonly onDidChangeLogLevel: Event<LogLevel>;74737474/**7475* Outputs the given trace message to the channel. Use this method to log verbose information.7476*7477* The message is only logged if the channel is configured to display {@link LogLevel.Trace trace} log level.7478*7479* @param message trace message to log7480*/7481trace(message: string, ...args: any[]): void;74827483/**7484* Outputs the given debug message to the channel.7485*7486* The message is only logged if the channel is configured to display {@link LogLevel.Debug debug} log level or lower.7487*7488* @param message debug message to log7489*/7490debug(message: string, ...args: any[]): void;74917492/**7493* Outputs the given information message to the channel.7494*7495* The message is only logged if the channel is configured to display {@link LogLevel.Info info} log level or lower.7496*7497* @param message info message to log7498*/7499info(message: string, ...args: any[]): void;75007501/**7502* Outputs the given warning message to the channel.7503*7504* The message is only logged if the channel is configured to display {@link LogLevel.Warning warning} log level or lower.7505*7506* @param message warning message to log7507*/7508warn(message: string, ...args: any[]): void;75097510/**7511* Outputs the given error or error message to the channel.7512*7513* The message is only logged if the channel is configured to display {@link LogLevel.Error error} log level or lower.7514*7515* @param error Error or error message to log7516*/7517error(error: string | Error, ...args: any[]): void;7518}75197520/**7521* Accessibility information which controls screen reader behavior.7522*/7523export interface AccessibilityInformation {7524/**7525* Label to be read out by a screen reader once the item has focus.7526*/7527readonly label: string;75287529/**7530* Role of the widget which defines how a screen reader interacts with it.7531* The role should be set in special cases when for example a tree-like element behaves like a checkbox.7532* If role is not specified the editor will pick the appropriate role automatically.7533* More about aria roles can be found here https://w3c.github.io/aria/#widget_roles7534*/7535readonly role?: string;7536}75377538/**7539* Represents the alignment of status bar items.7540*/7541export enum StatusBarAlignment {75427543/**7544* Aligned to the left side.7545*/7546Left = 1,75477548/**7549* Aligned to the right side.7550*/7551Right = 27552}75537554/**7555* A status bar item is a status bar contribution that can7556* show text and icons and run a command on click.7557*/7558export interface StatusBarItem {75597560/**7561* The identifier of this item.7562*7563* *Note*: if no identifier was provided by the {@linkcode window.createStatusBarItem}7564* method, the identifier will match the {@link Extension.id extension identifier}.7565*/7566readonly id: string;75677568/**7569* The alignment of this item.7570*/7571readonly alignment: StatusBarAlignment;75727573/**7574* The priority of this item. Higher value means the item should7575* be shown more to the left.7576*/7577readonly priority: number | undefined;75787579/**7580* The name of the entry, like 'Python Language Indicator', 'Git Status' etc.7581* Try to keep the length of the name short, yet descriptive enough that7582* users can understand what the status bar item is about.7583*/7584name: string | undefined;75857586/**7587* The text to show for the entry. You can embed icons in the text by leveraging the syntax:7588*7589* `My text $(icon-name) contains icons like $(icon-name) this one.`7590*7591* Where the icon-name is taken from the ThemeIcon [icon set](https://code.visualstudio.com/api/references/icons-in-labels#icon-listing), e.g.7592* `light-bulb`, `thumbsup`, `zap` etc.7593*/7594text: string;75957596/**7597* The tooltip text when you hover over this entry.7598*/7599tooltip: string | MarkdownString | undefined;76007601/**7602* The foreground color for this entry.7603*/7604color: string | ThemeColor | undefined;76057606/**7607* The background color for this entry.7608*7609* *Note*: only the following colors are supported:7610* * `new ThemeColor('statusBarItem.errorBackground')`7611* * `new ThemeColor('statusBarItem.warningBackground')`7612*7613* More background colors may be supported in the future.7614*7615* *Note*: when a background color is set, the statusbar may override7616* the `color` choice to ensure the entry is readable in all themes.7617*/7618backgroundColor: ThemeColor | undefined;76197620/**7621* {@linkcode Command} or identifier of a command to run on click.7622*7623* The command must be {@link commands.getCommands known}.7624*7625* Note that if this is a {@linkcode Command} object, only the {@linkcode Command.command command} and {@linkcode Command.arguments arguments}7626* are used by the editor.7627*/7628command: string | Command | undefined;76297630/**7631* Accessibility information used when a screen reader interacts with this StatusBar item7632*/7633accessibilityInformation: AccessibilityInformation | undefined;76347635/**7636* Shows the entry in the status bar.7637*/7638show(): void;76397640/**7641* Hide the entry in the status bar.7642*/7643hide(): void;76447645/**7646* Dispose and free associated resources. Call7647* {@link StatusBarItem.hide hide}.7648*/7649dispose(): void;7650}76517652/**7653* Defines a generalized way of reporting progress updates.7654*/7655export interface Progress<T> {76567657/**7658* Report a progress update.7659* @param value A progress item, like a message and/or an7660* report on how much work finished7661*/7662report(value: T): void;7663}76647665/**7666* An individual terminal instance within the integrated terminal.7667*/7668export interface Terminal {76697670/**7671* The name of the terminal.7672*/7673readonly name: string;76747675/**7676* The process ID of the shell process.7677*/7678readonly processId: Thenable<number | undefined>;76797680/**7681* The object used to initialize the terminal, this is useful for example to detecting the7682* shell type of when the terminal was not launched by this extension or for detecting what7683* folder the shell was launched in.7684*/7685readonly creationOptions: Readonly<TerminalOptions | ExtensionTerminalOptions>;76867687/**7688* The exit status of the terminal, this will be undefined while the terminal is active.7689*7690* **Example:** Show a notification with the exit code when the terminal exits with a7691* non-zero exit code.7692* ```typescript7693* window.onDidCloseTerminal(t => {7694* if (t.exitStatus && t.exitStatus.code) {7695* vscode.window.showInformationMessage(`Exit code: ${t.exitStatus.code}`);7696* }7697* });7698* ```7699*/7700readonly exitStatus: TerminalExitStatus | undefined;77017702/**7703* The current state of the {@link Terminal}.7704*/7705readonly state: TerminalState;77067707/**7708* An object that contains [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration)-powered7709* features for the terminal. This will always be `undefined` immediately after the terminal7710* is created. Listen to {@link window.onDidChangeTerminalShellIntegration} to be notified7711* when shell integration is activated for a terminal.7712*7713* Note that this object may remain undefined if shell integration never activates. For7714* example Command Prompt does not support shell integration and a user's shell setup could7715* conflict with the automatic shell integration activation.7716*/7717readonly shellIntegration: TerminalShellIntegration | undefined;77187719/**7720* Send text to the terminal. The text is written to the stdin of the underlying pty process7721* (shell) of the terminal.7722*7723* @param text The text to send.7724* @param shouldExecute Indicates that the text being sent should be executed rather than just inserted in the terminal.7725* The character(s) added are `\n` or `\r\n`, depending on the platform. This defaults to `true`.7726*/7727sendText(text: string, shouldExecute?: boolean): void;77287729/**7730* Show the terminal panel and reveal this terminal in the UI.7731*7732* @param preserveFocus When `true` the terminal will not take focus.7733*/7734show(preserveFocus?: boolean): void;77357736/**7737* Hide the terminal panel if this terminal is currently showing.7738*/7739hide(): void;77407741/**7742* Dispose and free associated resources.7743*/7744dispose(): void;7745}77467747/**7748* The location of the terminal.7749*/7750export enum TerminalLocation {7751/**7752* In the terminal view7753*/7754Panel = 1,7755/**7756* In the editor area7757*/7758Editor = 2,7759}77607761/**7762* Assumes a {@link TerminalLocation} of editor and allows specifying a {@link ViewColumn} and7763* {@link TerminalEditorLocationOptions.preserveFocus preserveFocus } property7764*/7765export interface TerminalEditorLocationOptions {7766/**7767* A view column in which the {@link Terminal terminal} should be shown in the editor area.7768* The default is the {@link ViewColumn.Active active}. Columns that do not exist7769* will be created as needed up to the maximum of {@linkcode ViewColumn.Nine}.7770* Use {@linkcode ViewColumn.Beside} to open the editor to the side of the currently7771* active one.7772*/7773viewColumn: ViewColumn;7774/**7775* An optional flag that when `true` will stop the {@link Terminal} from taking focus.7776*/7777preserveFocus?: boolean;7778}77797780/**7781* Uses the parent {@link Terminal}'s location for the terminal7782*/7783export interface TerminalSplitLocationOptions {7784/**7785* The parent terminal to split this terminal beside. This works whether the parent terminal7786* is in the panel or the editor area.7787*/7788parentTerminal: Terminal;7789}77907791/**7792* Represents the state of a {@link Terminal}.7793*/7794export interface TerminalState {7795/**7796* Whether the {@link Terminal} has been interacted with. Interaction means that the7797* terminal has sent data to the process which depending on the terminal's _mode_. By7798* default input is sent when a key is pressed or when a command or extension sends text,7799* but based on the terminal's mode it can also happen on:7800*7801* - a pointer click event7802* - a pointer scroll event7803* - a pointer move event7804* - terminal focus in/out7805*7806* For more information on events that can send data see "DEC Private Mode Set (DECSET)" on7807* https://invisible-island.net/xterm/ctlseqs/ctlseqs.html7808*/7809readonly isInteractedWith: boolean;78107811/**7812* The detected shell type of the {@link Terminal}. This will be `undefined` when there is7813* not a clear signal as to what the shell is, or the shell is not supported yet. This7814* value should change to the shell type of a sub-shell when launched (for example, running7815* `bash` inside `zsh`).7816*7817* Note that the possible values are currently defined as any of the following:7818* 'bash', 'cmd', 'csh', 'fish', 'gitbash', 'julia', 'ksh', 'node', 'nu', 'pwsh', 'python',7819* 'sh', 'wsl', 'xonsh', 'zsh'.7820*/7821readonly shell: string | undefined;7822}78237824/**7825* [Shell integration](https://code.visualstudio.com/docs/terminal/shell-integration)-powered capabilities owned by a terminal.7826*/7827export interface TerminalShellIntegration {7828/**7829* The current working directory of the terminal. This {@link Uri} may represent a file on7830* another machine (eg. ssh into another machine). This requires the shell integration to7831* support working directory reporting.7832*/7833readonly cwd: Uri | undefined;78347835/**7836* Execute a command, sending ^C as necessary to interrupt any running command if needed.7837*7838* @param commandLine The command line to execute, this is the exact text that will be sent7839* to the terminal.7840*7841* @throws When run on a terminal doesn't support this API, such as task terminals.7842*7843* @example7844* // Execute a command in a terminal immediately after being created7845* const myTerm = window.createTerminal();7846* window.onDidChangeTerminalShellIntegration(async ({ terminal, shellIntegration }) => {7847* if (terminal === myTerm) {7848* const execution = shellIntegration.executeCommand('echo "Hello world"');7849* window.onDidEndTerminalShellExecution(event => {7850* if (event.execution === execution) {7851* console.log(`Command exited with code ${event.exitCode}`);7852* }7853* });7854* }7855* }));7856* // Fallback to sendText if there is no shell integration within 3 seconds of launching7857* setTimeout(() => {7858* if (!myTerm.shellIntegration) {7859* myTerm.sendText('echo "Hello world"');7860* // Without shell integration, we can't know when the command has finished or what the7861* // exit code was.7862* }7863* }, 3000);7864*7865* @example7866* // Send command to terminal that has been alive for a while7867* const commandLine = 'echo "Hello world"';7868* if (term.shellIntegration) {7869* const execution = shellIntegration.executeCommand({ commandLine });7870* window.onDidEndTerminalShellExecution(event => {7871* if (event.execution === execution) {7872* console.log(`Command exited with code ${event.exitCode}`);7873* }7874* });7875* } else {7876* term.sendText(commandLine);7877* // Without shell integration, we can't know when the command has finished or what the7878* // exit code was.7879* }7880*/7881executeCommand(commandLine: string): TerminalShellExecution;78827883/**7884* Execute a command, sending ^C as necessary to interrupt any running command if needed.7885*7886* *Note* This is not guaranteed to work as [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration)7887* must be activated. Check whether {@link TerminalShellExecution.exitCode} is rejected to7888* verify whether it was successful.7889*7890* @param executable A command to run.7891* @param args Arguments to launch the executable with. The arguments will be escaped such7892* that they are interpreted as single arguments when the argument both contains whitespace7893* and does not include any single quote, double quote or backtick characters.7894*7895* Note that this escaping is not intended to be a security measure, be careful when passing7896* untrusted data to this API as strings like `$(...)` can often be used in shells to7897* execute code within a string.7898*7899* @example7900* // Execute a command in a terminal immediately after being created7901* const myTerm = window.createTerminal();7902* window.onDidChangeTerminalShellIntegration(async ({ terminal, shellIntegration }) => {7903* if (terminal === myTerm) {7904* const command = shellIntegration.executeCommand({7905* command: 'echo',7906* args: ['Hello world']7907* });7908* const code = await command.exitCode;7909* console.log(`Command exited with code ${code}`);7910* }7911* }));7912* // Fallback to sendText if there is no shell integration within 3 seconds of launching7913* setTimeout(() => {7914* if (!myTerm.shellIntegration) {7915* myTerm.sendText('echo "Hello world"');7916* // Without shell integration, we can't know when the command has finished or what the7917* // exit code was.7918* }7919* }, 3000);7920*7921* @example7922* // Send command to terminal that has been alive for a while7923* const commandLine = 'echo "Hello world"';7924* if (term.shellIntegration) {7925* const command = term.shellIntegration.executeCommand({7926* command: 'echo',7927* args: ['Hello world']7928* });7929* const code = await command.exitCode;7930* console.log(`Command exited with code ${code}`);7931* } else {7932* term.sendText(commandLine);7933* // Without shell integration, we can't know when the command has finished or what the7934* // exit code was.7935* }7936*/7937executeCommand(executable: string, args: string[]): TerminalShellExecution;7938}79397940/**7941* A command that was executed in a terminal.7942*/7943export interface TerminalShellExecution {7944/**7945* The command line that was executed. The {@link TerminalShellExecutionCommandLineConfidence confidence}7946* of this value depends on the specific shell's shell integration implementation. This7947* value may become more accurate after {@link window.onDidEndTerminalShellExecution} is7948* fired.7949*7950* @example7951* // Log the details of the command line on start and end7952* window.onDidStartTerminalShellExecution(event => {7953* const commandLine = event.execution.commandLine;7954* console.log(`Command started\n${summarizeCommandLine(commandLine)}`);7955* });7956* window.onDidEndTerminalShellExecution(event => {7957* const commandLine = event.execution.commandLine;7958* console.log(`Command ended\n${summarizeCommandLine(commandLine)}`);7959* });7960* function summarizeCommandLine(commandLine: TerminalShellExecutionCommandLine) {7961* return [7962* ` Command line: ${command.commandLine.value}`,7963* ` Confidence: ${command.commandLine.confidence}`,7964* ` Trusted: ${command.commandLine.isTrusted}7965* ].join('\n');7966* }7967*/7968readonly commandLine: TerminalShellExecutionCommandLine;79697970/**7971* The working directory that was reported by the shell when this command executed. This7972* {@link Uri} may represent a file on another machine (eg. ssh into another machine). This7973* requires the shell integration to support working directory reporting.7974*/7975readonly cwd: Uri | undefined;79767977/**7978* Creates a stream of raw data (including escape sequences) that is written to the7979* terminal. This will only include data that was written after `read` was called for7980* the first time, ie. you must call `read` immediately after the command is executed via7981* {@link TerminalShellIntegration.executeCommand} or7982* {@link window.onDidStartTerminalShellExecution} to not miss any data.7983*7984* @example7985* // Log all data written to the terminal for a command7986* const command = term.shellIntegration.executeCommand({ commandLine: 'echo "Hello world"' });7987* const stream = command.read();7988* for await (const data of stream) {7989* console.log(data);7990* }7991*/7992read(): AsyncIterable<string>;7993}79947995/**7996* A command line that was executed in a terminal.7997*/7998export interface TerminalShellExecutionCommandLine {7999/**8000* The full command line that was executed, including both the command and its arguments.8001*/8002readonly value: string;80038004/**8005* Whether the command line value came from a trusted source and is therefore safe to8006* execute without user additional confirmation, such as a notification that asks "Do you8007* want to execute (command)?". This verification is likely only needed if you are going to8008* execute the command again.8009*8010* This is `true` only when the command line was reported explicitly by the shell8011* integration script (ie. {@link TerminalShellExecutionCommandLineConfidence.High high confidence})8012* and it used a nonce for verification.8013*/8014readonly isTrusted: boolean;80158016/**8017* The confidence of the command line value which is determined by how the value was8018* obtained. This depends upon the implementation of the shell integration script.8019*/8020readonly confidence: TerminalShellExecutionCommandLineConfidence;8021}80228023/**8024* The confidence of a {@link TerminalShellExecutionCommandLine} value.8025*/8026export enum TerminalShellExecutionCommandLineConfidence {8027/**8028* The command line value confidence is low. This means that the value was read from the8029* terminal buffer using markers reported by the shell integration script. Additionally one8030* of the following conditions will be met:8031*8032* - The command started on the very left-most column which is unusual, or8033* - The command is multi-line which is more difficult to accurately detect due to line8034* continuation characters and right prompts.8035* - Command line markers were not reported by the shell integration script.8036*/8037Low = 0,80388039/**8040* The command line value confidence is medium. This means that the value was read from the8041* terminal buffer using markers reported by the shell integration script. The command is8042* single-line and does not start on the very left-most column (which is unusual).8043*/8044Medium = 1,80458046/**8047* The command line value confidence is high. This means that the value was explicitly sent8048* from the shell integration script or the command was executed via the8049* {@link TerminalShellIntegration.executeCommand} API.8050*/8051High = 28052}80538054/**8055* An event signalling that a terminal's shell integration has changed.8056*/8057export interface TerminalShellIntegrationChangeEvent {8058/**8059* The terminal that shell integration has been activated in.8060*/8061readonly terminal: Terminal;80628063/**8064* The shell integration object.8065*/8066readonly shellIntegration: TerminalShellIntegration;8067}80688069/**8070* An event signalling that an execution has started in a terminal.8071*/8072export interface TerminalShellExecutionStartEvent {8073/**8074* The terminal that shell integration has been activated in.8075*/8076readonly terminal: Terminal;80778078/**8079* The shell integration object.8080*/8081readonly shellIntegration: TerminalShellIntegration;80828083/**8084* The terminal shell execution that has ended.8085*/8086readonly execution: TerminalShellExecution;8087}80888089/**8090* An event signalling that an execution has ended in a terminal.8091*/8092export interface TerminalShellExecutionEndEvent {8093/**8094* The terminal that shell integration has been activated in.8095*/8096readonly terminal: Terminal;80978098/**8099* The shell integration object.8100*/8101readonly shellIntegration: TerminalShellIntegration;81028103/**8104* The terminal shell execution that has ended.8105*/8106readonly execution: TerminalShellExecution;81078108/**8109* The exit code reported by the shell.8110*8111* When this is `undefined` it can mean several things:8112*8113* - The shell either did not report an exit code (ie. the shell integration script is8114* misbehaving)8115* - The shell reported a command started before the command finished (eg. a sub-shell was8116* opened).8117* - The user canceled the command via ctrl+c.8118* - The user pressed enter when there was no input.8119*8120* Generally this should not happen. Depending on the use case, it may be best to treat this8121* as a failure.8122*8123* @example8124* const execution = shellIntegration.executeCommand({8125* command: 'echo',8126* args: ['Hello world']8127* });8128* window.onDidEndTerminalShellExecution(event => {8129* if (event.execution === execution) {8130* if (event.exitCode === undefined) {8131* console.log('Command finished but exit code is unknown');8132* } else if (event.exitCode === 0) {8133* console.log('Command succeeded');8134* } else {8135* console.log('Command failed');8136* }8137* }8138* });8139*/8140readonly exitCode: number | undefined;8141}81428143/**8144* Provides information on a line in a terminal in order to provide links for it.8145*/8146export interface TerminalLinkContext {8147/**8148* This is the text from the unwrapped line in the terminal.8149*/8150line: string;81518152/**8153* The terminal the link belongs to.8154*/8155terminal: Terminal;8156}81578158/**8159* A provider that enables detection and handling of links within terminals.8160*/8161export interface TerminalLinkProvider<T extends TerminalLink = TerminalLink> {8162/**8163* Provide terminal links for the given context. Note that this can be called multiple times8164* even before previous calls resolve, make sure to not share global objects (eg. `RegExp`)8165* that could have problems when asynchronous usage may overlap.8166* @param context Information about what links are being provided for.8167* @param token A cancellation token.8168* @returns A list of terminal links for the given line.8169*/8170provideTerminalLinks(context: TerminalLinkContext, token: CancellationToken): ProviderResult<T[]>;81718172/**8173* Handle an activated terminal link.8174* @param link The link to handle.8175*/8176handleTerminalLink(link: T): ProviderResult<void>;8177}81788179/**8180* A link on a terminal line.8181*/8182export class TerminalLink {8183/**8184* The start index of the link on {@link TerminalLinkContext.line}.8185*/8186startIndex: number;81878188/**8189* The length of the link on {@link TerminalLinkContext.line}.8190*/8191length: number;81928193/**8194* The tooltip text when you hover over this link.8195*8196* If a tooltip is provided, is will be displayed in a string that includes instructions on8197* how to trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary8198* depending on OS, user settings, and localization.8199*/8200tooltip?: string;82018202/**8203* Creates a new terminal link.8204* @param startIndex The start index of the link on {@link TerminalLinkContext.line}.8205* @param length The length of the link on {@link TerminalLinkContext.line}.8206* @param tooltip The tooltip text when you hover over this link.8207*8208* If a tooltip is provided, is will be displayed in a string that includes instructions on8209* how to trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary8210* depending on OS, user settings, and localization.8211*/8212constructor(startIndex: number, length: number, tooltip?: string);8213}82148215/**8216* Provides a terminal profile for the contributed terminal profile when launched via the UI or8217* command.8218*/8219export interface TerminalProfileProvider {8220/**8221* Provide the terminal profile.8222* @param token A cancellation token that indicates the result is no longer needed.8223* @returns The terminal profile.8224*/8225provideTerminalProfile(token: CancellationToken): ProviderResult<TerminalProfile>;8226}82278228/**8229* A terminal profile defines how a terminal will be launched.8230*/8231export class TerminalProfile {8232/**8233* The options that the terminal will launch with.8234*/8235options: TerminalOptions | ExtensionTerminalOptions;82368237/**8238* Creates a new terminal profile.8239* @param options The options that the terminal will launch with.8240*/8241constructor(options: TerminalOptions | ExtensionTerminalOptions);8242}82438244/**8245* A file decoration represents metadata that can be rendered with a file.8246*/8247export class FileDecoration {82488249/**8250* A very short string that represents this decoration.8251*/8252badge?: string;82538254/**8255* A human-readable tooltip for this decoration.8256*/8257tooltip?: string;82588259/**8260* The color of this decoration.8261*/8262color?: ThemeColor;82638264/**8265* A flag expressing that this decoration should be8266* propagated to its parents.8267*/8268propagate?: boolean;82698270/**8271* Creates a new decoration.8272*8273* @param badge A letter that represents the decoration.8274* @param tooltip The tooltip of the decoration.8275* @param color The color of the decoration.8276*/8277constructor(badge?: string, tooltip?: string, color?: ThemeColor);8278}82798280/**8281* The decoration provider interfaces defines the contract between extensions and8282* file decorations.8283*/8284export interface FileDecorationProvider {82858286/**8287* An optional event to signal that decorations for one or many files have changed.8288*8289* *Note* that this event should be used to propagate information about children.8290*8291* @see {@link EventEmitter}8292*/8293onDidChangeFileDecorations?: Event<undefined | Uri | Uri[]>;82948295/**8296* Provide decorations for a given uri.8297*8298* *Note* that this function is only called when a file gets rendered in the UI.8299* This means a decoration from a descendent that propagates upwards must be signaled8300* to the editor via the {@link FileDecorationProvider.onDidChangeFileDecorations onDidChangeFileDecorations}-event.8301*8302* @param uri The uri of the file to provide a decoration for.8303* @param token A cancellation token.8304* @returns A decoration or a thenable that resolves to such.8305*/8306provideFileDecoration(uri: Uri, token: CancellationToken): ProviderResult<FileDecoration>;8307}830883098310/**8311* In a remote window the extension kind describes if an extension8312* runs where the UI (window) runs or if an extension runs remotely.8313*/8314export enum ExtensionKind {83158316/**8317* Extension runs where the UI runs.8318*/8319UI = 1,83208321/**8322* Extension runs where the remote extension host runs.8323*/8324Workspace = 28325}83268327/**8328* Represents an extension.8329*8330* To get an instance of an `Extension` use {@link extensions.getExtension getExtension}.8331*/8332export interface Extension<T> {83338334/**8335* The canonical extension identifier in the form of: `publisher.name`.8336*/8337readonly id: string;83388339/**8340* The uri of the directory containing the extension.8341*/8342readonly extensionUri: Uri;83438344/**8345* The absolute file path of the directory containing this extension. Shorthand8346* notation for {@link Extension.extensionUri Extension.extensionUri.fsPath} (independent of the uri scheme).8347*/8348readonly extensionPath: string;83498350/**8351* `true` if the extension has been activated.8352*/8353readonly isActive: boolean;83548355/**8356* The parsed contents of the extension's package.json.8357*/8358readonly packageJSON: any;83598360/**8361* The extension kind describes if an extension runs where the UI runs8362* or if an extension runs where the remote extension host runs. The extension kind8363* is defined in the `package.json`-file of extensions but can also be refined8364* via the `remote.extensionKind`-setting. When no remote extension host exists,8365* the value is {@linkcode ExtensionKind.UI}.8366*/8367extensionKind: ExtensionKind;83688369/**8370* The public API exported by this extension (return value of `activate`).8371* It is an invalid action to access this field before this extension has been activated.8372*/8373readonly exports: T;83748375/**8376* Activates this extension and returns its public API.8377*8378* @returns A promise that will resolve when this extension has been activated.8379*/8380activate(): Thenable<T>;8381}83828383/**8384* The ExtensionMode is provided on the `ExtensionContext` and indicates the8385* mode the specific extension is running in.8386*/8387export enum ExtensionMode {8388/**8389* The extension is installed normally (for example, from the marketplace8390* or VSIX) in the editor.8391*/8392Production = 1,83938394/**8395* The extension is running from an `--extensionDevelopmentPath` provided8396* when launching the editor.8397*/8398Development = 2,83998400/**8401* The extension is running from an `--extensionTestsPath` and8402* the extension host is running unit tests.8403*/8404Test = 3,8405}84068407/**8408* An extension context is a collection of utilities private to an8409* extension.8410*8411* An instance of an `ExtensionContext` is provided as the first8412* parameter to the `activate`-call of an extension.8413*/8414export interface ExtensionContext {84158416/**8417* An array to which disposables can be added. When this8418* extension is deactivated the disposables will be disposed.8419*8420* *Note* that asynchronous dispose-functions aren't awaited.8421*/8422readonly subscriptions: {8423/**8424* Function to clean up resources.8425*/8426dispose(): any;8427}[];84288429/**8430* A memento object that stores state in the context8431* of the currently opened {@link workspace.workspaceFolders workspace}.8432*/8433readonly workspaceState: Memento;84348435/**8436* A memento object that stores state independent8437* of the current opened {@link workspace.workspaceFolders workspace}.8438*/8439readonly globalState: Memento & {8440/**8441* Set the keys whose values should be synchronized across devices when synchronizing user-data8442* like configuration, extensions, and mementos.8443*8444* Note that this function defines the whole set of keys whose values are synchronized:8445* - calling it with an empty array stops synchronization for this memento8446* - calling it with a non-empty array replaces all keys whose values are synchronized8447*8448* For any given set of keys this function needs to be called only once but there is no harm in8449* repeatedly calling it.8450*8451* @param keys The set of keys whose values are synced.8452*/8453setKeysForSync(keys: readonly string[]): void;8454};84558456/**8457* A secret storage object that stores state independent8458* of the current opened {@link workspace.workspaceFolders workspace}.8459*/8460readonly secrets: SecretStorage;84618462/**8463* The uri of the directory containing the extension.8464*/8465readonly extensionUri: Uri;84668467/**8468* The absolute file path of the directory containing the extension. Shorthand8469* notation for {@link TextDocument.uri ExtensionContext.extensionUri.fsPath} (independent of the uri scheme).8470*/8471readonly extensionPath: string;84728473/**8474* Gets the extension's global environment variable collection for this workspace, enabling changes to be8475* applied to terminal environment variables.8476*/8477readonly environmentVariableCollection: GlobalEnvironmentVariableCollection;84788479/**8480* Get the absolute path of a resource contained in the extension.8481*8482* *Note* that an absolute uri can be constructed via {@linkcode Uri.joinPath} and8483* {@linkcode ExtensionContext.extensionUri extensionUri}, e.g. `vscode.Uri.joinPath(context.extensionUri, relativePath);`8484*8485* @param relativePath A relative path to a resource contained in the extension.8486* @returns The absolute path of the resource.8487*/8488asAbsolutePath(relativePath: string): string;84898490/**8491* The uri of a workspace specific directory in which the extension8492* can store private state. The directory might not exist and creation is8493* up to the extension. However, the parent directory is guaranteed to be existent.8494* The value is `undefined` when no workspace nor folder has been opened.8495*8496* Use {@linkcode ExtensionContext.workspaceState workspaceState} or8497* {@linkcode ExtensionContext.globalState globalState} to store key value data.8498*8499* @see {@linkcode FileSystem workspace.fs} for how to read and write files and folders from8500* a uri.8501*/8502readonly storageUri: Uri | undefined;85038504/**8505* An absolute file path of a workspace specific directory in which the extension8506* can store private state. The directory might not exist on disk and creation is8507* up to the extension. However, the parent directory is guaranteed to be existent.8508*8509* Use {@linkcode ExtensionContext.workspaceState workspaceState} or8510* {@linkcode ExtensionContext.globalState globalState} to store key value data.8511*8512* @deprecated Use {@link ExtensionContext.storageUri storageUri} instead.8513*/8514readonly storagePath: string | undefined;85158516/**8517* The uri of a directory in which the extension can store global state.8518* The directory might not exist on disk and creation is8519* up to the extension. However, the parent directory is guaranteed to be existent.8520*8521* Use {@linkcode ExtensionContext.globalState globalState} to store key value data.8522*8523* @see {@linkcode FileSystem workspace.fs} for how to read and write files and folders from8524* an uri.8525*/8526readonly globalStorageUri: Uri;85278528/**8529* An absolute file path in which the extension can store global state.8530* The directory might not exist on disk and creation is8531* up to the extension. However, the parent directory is guaranteed to be existent.8532*8533* Use {@linkcode ExtensionContext.globalState globalState} to store key value data.8534*8535* @deprecated Use {@link ExtensionContext.globalStorageUri globalStorageUri} instead.8536*/8537readonly globalStoragePath: string;85388539/**8540* The uri of a directory in which the extension can create log files.8541* The directory might not exist on disk and creation is up to the extension. However,8542* the parent directory is guaranteed to be existent.8543*8544* @see {@linkcode FileSystem workspace.fs} for how to read and write files and folders from8545* an uri.8546*/8547readonly logUri: Uri;85488549/**8550* An absolute file path of a directory in which the extension can create log files.8551* The directory might not exist on disk and creation is up to the extension. However,8552* the parent directory is guaranteed to be existent.8553*8554* @deprecated Use {@link ExtensionContext.logUri logUri} instead.8555*/8556readonly logPath: string;85578558/**8559* The mode the extension is running in. See {@link ExtensionMode}8560* for possible values and scenarios.8561*/8562readonly extensionMode: ExtensionMode;85638564/**8565* The current `Extension` instance.8566*/8567readonly extension: Extension<any>;85688569/**8570* An object that keeps information about how this extension can use language models.8571*8572* @see {@link LanguageModelChat.sendRequest}8573*/8574readonly languageModelAccessInformation: LanguageModelAccessInformation;8575}85768577/**8578* A memento represents a storage utility. It can store and retrieve8579* values.8580*/8581export interface Memento {85828583/**8584* Returns the stored keys.8585*8586* @returns The stored keys.8587*/8588keys(): readonly string[];85898590/**8591* Return a value.8592*8593* @param key A string.8594* @returns The stored value or `undefined`.8595*/8596get<T>(key: string): T | undefined;85978598/**8599* Return a value.8600*8601* @param key A string.8602* @param defaultValue A value that should be returned when there is no8603* value (`undefined`) with the given key.8604* @returns The stored value or the defaultValue.8605*/8606get<T>(key: string, defaultValue: T): T;86078608/**8609* Store a value. The value must be JSON-stringifyable.8610*8611* *Note* that using `undefined` as value removes the key from the underlying8612* storage.8613*8614* @param key A string.8615* @param value A value. MUST not contain cyclic references.8616*/8617update(key: string, value: any): Thenable<void>;8618}86198620/**8621* The event data that is fired when a secret is added or removed.8622*/8623export interface SecretStorageChangeEvent {8624/**8625* The key of the secret that has changed.8626*/8627readonly key: string;8628}86298630/**8631* Represents a storage utility for secrets (or any information that is sensitive)8632* that will be stored encrypted. The implementation of the secret storage will8633* be different on each platform and the secrets will not be synced across8634* machines.8635*/8636export interface SecretStorage {8637/**8638* Retrieve the keys of all the secrets stored by this extension.8639*/8640keys(): Thenable<string[]>;86418642/**8643* Retrieve a secret that was stored with key. Returns undefined if there8644* is no password matching that key.8645* @param key The key the secret was stored under.8646* @returns The stored value or `undefined`.8647*/8648get(key: string): Thenable<string | undefined>;86498650/**8651* Store a secret under a given key.8652* @param key The key to store the secret under.8653* @param value The secret.8654*/8655store(key: string, value: string): Thenable<void>;86568657/**8658* Remove a secret from storage.8659* @param key The key the secret was stored under.8660*/8661delete(key: string): Thenable<void>;86628663/**8664* Fires when a secret is stored or deleted.8665*/8666readonly onDidChange: Event<SecretStorageChangeEvent>;8667}86688669/**8670* Represents a color theme kind.8671*/8672export enum ColorThemeKind {8673/**8674* A light color theme.8675*/8676Light = 1,8677/**8678* A dark color theme.8679*/8680Dark = 2,8681/**8682* A dark high contrast color theme.8683*/8684HighContrast = 3,8685/**8686* A light high contrast color theme.8687*/8688HighContrastLight = 48689}86908691/**8692* Represents a color theme.8693*/8694export interface ColorTheme {86958696/**8697* The kind of this color theme: light, dark, high contrast dark and high contrast light.8698*/8699readonly kind: ColorThemeKind;8700}87018702/**8703* Controls the behaviour of the terminal's visibility.8704*/8705export enum TaskRevealKind {8706/**8707* Always brings the terminal to front if the task is executed.8708*/8709Always = 1,87108711/**8712* Only brings the terminal to front if a problem is detected executing the task8713* (e.g. the task couldn't be started because).8714*/8715Silent = 2,87168717/**8718* The terminal never comes to front when the task is executed.8719*/8720Never = 38721}87228723/**8724* Controls how the task channel is used between tasks8725*/8726export enum TaskPanelKind {87278728/**8729* Shares a panel with other tasks. This is the default.8730*/8731Shared = 1,87328733/**8734* Uses a dedicated panel for this tasks. The panel is not8735* shared with other tasks.8736*/8737Dedicated = 2,87388739/**8740* Creates a new panel whenever this task is executed.8741*/8742New = 38743}87448745/**8746* Controls how the task is presented in the UI.8747*/8748export interface TaskPresentationOptions {8749/**8750* Controls whether the task output is reveal in the user interface.8751* Defaults to `RevealKind.Always`.8752*/8753reveal?: TaskRevealKind;87548755/**8756* Controls whether the command associated with the task is echoed8757* in the user interface.8758*/8759echo?: boolean;87608761/**8762* Controls whether the panel showing the task output is taking focus.8763*/8764focus?: boolean;87658766/**8767* Controls if the task panel is used for this task only (dedicated),8768* shared between tasks (shared) or if a new panel is created on8769* every task execution (new). Defaults to `TaskInstanceKind.Shared`8770*/8771panel?: TaskPanelKind;87728773/**8774* Controls whether to show the "Terminal will be reused by tasks, press any key to close it" message.8775*/8776showReuseMessage?: boolean;87778778/**8779* Controls whether the terminal is cleared before executing the task.8780*/8781clear?: boolean;87828783/**8784* Controls whether the terminal is closed after executing the task.8785*/8786close?: boolean;8787}87888789/**8790* A grouping for tasks. The editor by default supports the8791* 'Clean', 'Build', 'RebuildAll' and 'Test' group.8792*/8793export class TaskGroup {87948795/**8796* The clean task group;8797*/8798static Clean: TaskGroup;87998800/**8801* The build task group;8802*/8803static Build: TaskGroup;88048805/**8806* The rebuild all task group;8807*/8808static Rebuild: TaskGroup;88098810/**8811* The test all task group;8812*/8813static Test: TaskGroup;88148815/**8816* Whether the task that is part of this group is the default for the group.8817* This property cannot be set through API, and is controlled by a user's task configurations.8818*/8819readonly isDefault: boolean | undefined;88208821/**8822* The ID of the task group. Is one of TaskGroup.Clean.id, TaskGroup.Build.id, TaskGroup.Rebuild.id, or TaskGroup.Test.id.8823*/8824readonly id: string;88258826/**8827* Private constructor8828*8829* @param id Identifier of a task group.8830* @param label The human-readable name of a task group.8831*/8832private constructor(id: string, label: string);8833}88348835/**8836* A structure that defines a task kind in the system.8837* The value must be JSON-stringifyable.8838*/8839export interface TaskDefinition {8840/**8841* The task definition describing the task provided by an extension.8842* Usually a task provider defines more properties to identify8843* a task. They need to be defined in the package.json of the8844* extension under the 'taskDefinitions' extension point. The npm8845* task definition for example looks like this8846* ```typescript8847* interface NpmTaskDefinition extends TaskDefinition {8848* script: string;8849* }8850* ```8851*8852* Note that type identifier starting with a '$' are reserved for internal8853* usages and shouldn't be used by extensions.8854*/8855readonly type: string;88568857/**8858* Additional attributes of a concrete task definition.8859*/8860[name: string]: any;8861}88628863/**8864* Options for a process execution8865*/8866export interface ProcessExecutionOptions {8867/**8868* The current working directory of the executed program or shell.8869* If omitted the tools current workspace root is used.8870*/8871cwd?: string;88728873/**8874* The additional environment of the executed program or shell. If omitted8875* the parent process' environment is used. If provided it is merged with8876* the parent process' environment.8877*/8878env?: { [key: string]: string };8879}88808881/**8882* The execution of a task happens as an external process8883* without shell interaction.8884*/8885export class ProcessExecution {88868887/**8888* Creates a process execution.8889*8890* @param process The process to start.8891* @param options Optional options for the started process.8892*/8893constructor(process: string, options?: ProcessExecutionOptions);88948895/**8896* Creates a process execution.8897*8898* @param process The process to start.8899* @param args Arguments to be passed to the process.8900* @param options Optional options for the started process.8901*/8902constructor(process: string, args: string[], options?: ProcessExecutionOptions);89038904/**8905* The process to be executed.8906*/8907process: string;89088909/**8910* The arguments passed to the process. Defaults to an empty array.8911*/8912args: string[];89138914/**8915* The process options used when the process is executed.8916* Defaults to undefined.8917*/8918options?: ProcessExecutionOptions;8919}89208921/**8922* The shell quoting options.8923*/8924export interface ShellQuotingOptions {89258926/**8927* The character used to do character escaping. If a string is provided only spaces8928* are escaped. If a `{ escapeChar, charsToEscape }` literal is provide all characters8929* in `charsToEscape` are escaped using the `escapeChar`.8930*/8931escape?: string | {8932/**8933* The escape character.8934*/8935escapeChar: string;8936/**8937* The characters to escape.8938*/8939charsToEscape: string;8940};89418942/**8943* The character used for strong quoting. The string's length must be 1.8944*/8945strong?: string;89468947/**8948* The character used for weak quoting. The string's length must be 1.8949*/8950weak?: string;8951}89528953/**8954* Options for a shell execution8955*/8956export interface ShellExecutionOptions {8957/**8958* The shell executable.8959*/8960executable?: string;89618962/**8963* The arguments to be passed to the shell executable used to run the task. Most shells8964* require special arguments to execute a command. For example `bash` requires the `-c`8965* argument to execute a command, `PowerShell` requires `-Command` and `cmd` requires both8966* `/d` and `/c`.8967*/8968shellArgs?: string[];89698970/**8971* The shell quotes supported by this shell.8972*/8973shellQuoting?: ShellQuotingOptions;89748975/**8976* The current working directory of the executed shell.8977* If omitted the tools current workspace root is used.8978*/8979cwd?: string;89808981/**8982* The additional environment of the executed shell. If omitted8983* the parent process' environment is used. If provided it is merged with8984* the parent process' environment.8985*/8986env?: { [key: string]: string };8987}89888989/**8990* Defines how an argument should be quoted if it contains8991* spaces or unsupported characters.8992*/8993export enum ShellQuoting {89948995/**8996* Character escaping should be used. This for example8997* uses \ on bash and ` on PowerShell.8998*/8999Escape = 1,90009001/**9002* Strong string quoting should be used. This for example9003* uses " for Windows cmd and ' for bash and PowerShell.9004* Strong quoting treats arguments as literal strings.9005* Under PowerShell echo 'The value is $(2 * 3)' will9006* print `The value is $(2 * 3)`9007*/9008Strong = 2,90099010/**9011* Weak string quoting should be used. This for example9012* uses " for Windows cmd, bash and PowerShell. Weak quoting9013* still performs some kind of evaluation inside the quoted9014* string. Under PowerShell echo "The value is $(2 * 3)"9015* will print `The value is 6`9016*/9017Weak = 39018}90199020/**9021* A string that will be quoted depending on the used shell.9022*/9023export interface ShellQuotedString {9024/**9025* The actual string value.9026*/9027value: string;90289029/**9030* The quoting style to use.9031*/9032quoting: ShellQuoting;9033}90349035/**9036* Represents a task execution that happens inside a shell.9037*/9038export class ShellExecution {9039/**9040* Creates a shell execution with a full command line.9041*9042* @param commandLine The command line to execute.9043* @param options Optional options for the started the shell.9044*/9045constructor(commandLine: string, options?: ShellExecutionOptions);90469047/**9048* Creates a shell execution with a command and arguments. For the real execution the editor will9049* construct a command line from the command and the arguments. This is subject to interpretation9050* especially when it comes to quoting. If full control over the command line is needed please9051* use the constructor that creates a `ShellExecution` with the full command line.9052*9053* @param command The command to execute.9054* @param args The command arguments.9055* @param options Optional options for the started the shell.9056*/9057constructor(command: string | ShellQuotedString, args: Array<string | ShellQuotedString>, options?: ShellExecutionOptions);90589059/**9060* The shell command line. Is `undefined` if created with a command and arguments.9061*/9062commandLine: string | undefined;90639064/**9065* The shell command. Is `undefined` if created with a full command line.9066*/9067command: string | ShellQuotedString | undefined;90689069/**9070* The shell args. Is `undefined` if created with a full command line.9071*/9072args: Array<string | ShellQuotedString> | undefined;90739074/**9075* The shell options used when the command line is executed in a shell.9076* Defaults to undefined.9077*/9078options?: ShellExecutionOptions;9079}90809081/**9082* Class used to execute an extension callback as a task.9083*/9084export class CustomExecution {9085/**9086* Constructs a CustomExecution task object. The callback will be executed when the task is run, at which point the9087* extension should return the Pseudoterminal it will "run in". The task should wait to do further execution until9088* {@link Pseudoterminal.open} is called. Task cancellation should be handled using9089* {@link Pseudoterminal.close}. When the task is complete fire9090* {@link Pseudoterminal.onDidClose}.9091* @param callback The callback that will be called when the task is started by a user. Any ${} style variables that9092* were in the task definition will be resolved and passed into the callback as `resolvedDefinition`.9093*/9094constructor(callback: (resolvedDefinition: TaskDefinition) => Thenable<Pseudoterminal>);9095}90969097/**9098* The scope of a task.9099*/9100export enum TaskScope {9101/**9102* The task is a global task. Global tasks are currently not supported.9103*/9104Global = 1,91059106/**9107* The task is a workspace task9108*/9109Workspace = 29110}91119112/**9113* Run options for a task.9114*/9115export interface RunOptions {9116/**9117* Controls whether task variables are re-evaluated on rerun.9118*/9119reevaluateOnRerun?: boolean;9120}91219122/**9123* A task to execute9124*/9125export class Task {91269127/**9128* Creates a new task.9129*9130* @param taskDefinition The task definition as defined in the taskDefinitions extension point.9131* @param scope Specifies the task's scope. It is either a global or a workspace task or a task for a specific workspace folder. Global tasks are currently not supported.9132* @param name The task's name. Is presented in the user interface.9133* @param source The task's source (e.g. 'gulp', 'npm', ...). Is presented in the user interface.9134* @param execution The process or shell execution.9135* @param problemMatchers the names of problem matchers to use, like '$tsc'9136* or '$eslint'. Problem matchers can be contributed by an extension using9137* the `problemMatchers` extension point.9138*/9139constructor(taskDefinition: TaskDefinition, scope: WorkspaceFolder | TaskScope.Global | TaskScope.Workspace, name: string, source: string, execution?: ProcessExecution | ShellExecution | CustomExecution, problemMatchers?: string | string[]);91409141/**9142* Creates a new task.9143*9144* @deprecated Use the new constructors that allow specifying a scope for the task.9145*9146* @param taskDefinition The task definition as defined in the taskDefinitions extension point.9147* @param name The task's name. Is presented in the user interface.9148* @param source The task's source (e.g. 'gulp', 'npm', ...). Is presented in the user interface.9149* @param execution The process or shell execution.9150* @param problemMatchers the names of problem matchers to use, like '$tsc'9151* or '$eslint'. Problem matchers can be contributed by an extension using9152* the `problemMatchers` extension point.9153*/9154constructor(taskDefinition: TaskDefinition, name: string, source: string, execution?: ProcessExecution | ShellExecution, problemMatchers?: string | string[]);91559156/**9157* The task's definition.9158*/9159definition: TaskDefinition;91609161/**9162* The task's scope.9163*/9164readonly scope: TaskScope.Global | TaskScope.Workspace | WorkspaceFolder | undefined;91659166/**9167* The task's name9168*/9169name: string;91709171/**9172* A human-readable string which is rendered less prominently on a separate line in places9173* where the task's name is displayed. Supports rendering of {@link ThemeIcon theme icons}9174* via the `$(<name>)`-syntax.9175*/9176detail?: string;91779178/**9179* The task's execution engine9180*/9181execution?: ProcessExecution | ShellExecution | CustomExecution;91829183/**9184* Whether the task is a background task or not.9185*/9186isBackground: boolean;91879188/**9189* A human-readable string describing the source of this shell task, e.g. 'gulp'9190* or 'npm'. Supports rendering of {@link ThemeIcon theme icons} via the `$(<name>)`-syntax.9191*/9192source: string;91939194/**9195* The task group this tasks belongs to. See TaskGroup9196* for a predefined set of available groups.9197* Defaults to undefined meaning that the task doesn't9198* belong to any special group.9199*/9200group?: TaskGroup;92019202/**9203* The presentation options. Defaults to an empty literal.9204*/9205presentationOptions: TaskPresentationOptions;92069207/**9208* The problem matchers attached to the task. Defaults to an empty9209* array.9210*/9211problemMatchers: string[];92129213/**9214* Run options for the task9215*/9216runOptions: RunOptions;9217}92189219/**9220* A task provider allows to add tasks to the task service.9221* A task provider is registered via {@link tasks.registerTaskProvider}.9222*/9223export interface TaskProvider<T extends Task = Task> {9224/**9225* Provides tasks.9226* @param token A cancellation token.9227* @returns an array of tasks9228*/9229provideTasks(token: CancellationToken): ProviderResult<T[]>;92309231/**9232* Resolves a task that has no {@linkcode Task.execution execution} set. Tasks are9233* often created from information found in the `tasks.json`-file. Such tasks miss9234* the information on how to execute them and a task provider must fill in9235* the missing information in the `resolveTask`-method. This method will not be9236* called for tasks returned from the above `provideTasks` method since those9237* tasks are always fully resolved. A valid default implementation for the9238* `resolveTask` method is to return `undefined`.9239*9240* Note that when filling in the properties of `task`, you _must_ be sure to9241* use the exact same `TaskDefinition` and not create a new one. Other properties9242* may be changed.9243*9244* @param task The task to resolve.9245* @param token A cancellation token.9246* @returns The resolved task9247*/9248resolveTask(task: T, token: CancellationToken): ProviderResult<T>;9249}92509251/**9252* An object representing an executed Task. It can be used9253* to terminate a task.9254*9255* This interface is not intended to be implemented.9256*/9257export interface TaskExecution {9258/**9259* The task that got started.9260*/9261task: Task;92629263/**9264* Terminates the task execution.9265*/9266terminate(): void;9267}92689269/**9270* An event signaling the start of a task execution.9271*9272* This interface is not intended to be implemented.9273*/9274export interface TaskStartEvent {9275/**9276* The task item representing the task that got started.9277*/9278readonly execution: TaskExecution;9279}92809281/**9282* An event signaling the end of an executed task.9283*9284* This interface is not intended to be implemented.9285*/9286export interface TaskEndEvent {9287/**9288* The task item representing the task that finished.9289*/9290readonly execution: TaskExecution;9291}92929293/**9294* An event signaling the start of a process execution9295* triggered through a task9296*/9297export interface TaskProcessStartEvent {92989299/**9300* The task execution for which the process got started.9301*/9302readonly execution: TaskExecution;93039304/**9305* The underlying process id.9306*/9307readonly processId: number;9308}93099310/**9311* An event signaling the end of a process execution9312* triggered through a task9313*/9314export interface TaskProcessEndEvent {93159316/**9317* The task execution for which the process got started.9318*/9319readonly execution: TaskExecution;93209321/**9322* The process's exit code. Will be `undefined` when the task is terminated.9323*/9324readonly exitCode: number | undefined;9325}93269327/**9328* A task filter denotes tasks by their version and types9329*/9330export interface TaskFilter {9331/**9332* The task version as used in the tasks.json file.9333* The string support the package.json semver notation.9334*/9335version?: string;93369337/**9338* The task type to return;9339*/9340type?: string;9341}93429343/**9344* Namespace for tasks functionality.9345*/9346export namespace tasks {93479348/**9349* Register a task provider.9350*9351* @param type The task kind type this provider is registered for.9352* @param provider A task provider.9353* @returns A {@link Disposable} that unregisters this provider when being disposed.9354*/9355export function registerTaskProvider(type: string, provider: TaskProvider): Disposable;93569357/**9358* Fetches all tasks available in the systems. This includes tasks9359* from `tasks.json` files as well as tasks from task providers9360* contributed through extensions.9361*9362* @param filter Optional filter to select tasks of a certain type or version.9363* @returns A thenable that resolves to an array of tasks.9364*/9365export function fetchTasks(filter?: TaskFilter): Thenable<Task[]>;93669367/**9368* Executes a task that is managed by the editor. The returned9369* task execution can be used to terminate the task.9370*9371* @throws When running a ShellExecution or a ProcessExecution9372* task in an environment where a new process cannot be started.9373* In such an environment, only CustomExecution tasks can be run.9374*9375* @param task the task to execute9376* @returns A thenable that resolves to a task execution.9377*/9378export function executeTask(task: Task): Thenable<TaskExecution>;93799380/**9381* The currently active task executions or an empty array.9382*/9383export const taskExecutions: readonly TaskExecution[];93849385/**9386* Fires when a task starts.9387*/9388export const onDidStartTask: Event<TaskStartEvent>;93899390/**9391* Fires when a task ends.9392*/9393export const onDidEndTask: Event<TaskEndEvent>;93949395/**9396* Fires when the underlying process has been started.9397* This event will not fire for tasks that don't9398* execute an underlying process.9399*/9400export const onDidStartTaskProcess: Event<TaskProcessStartEvent>;94019402/**9403* Fires when the underlying process has ended.9404* This event will not fire for tasks that don't9405* execute an underlying process.9406*/9407export const onDidEndTaskProcess: Event<TaskProcessEndEvent>;9408}94099410/**9411* Enumeration of file types. The types `File` and `Directory` can also be9412* a symbolic links, in that case use `FileType.File | FileType.SymbolicLink` and9413* `FileType.Directory | FileType.SymbolicLink`.9414*/9415export enum FileType {9416/**9417* The file type is unknown.9418*/9419Unknown = 0,9420/**9421* A regular file.9422*/9423File = 1,9424/**9425* A directory.9426*/9427Directory = 2,9428/**9429* A symbolic link to a file.9430*/9431SymbolicLink = 649432}94339434/**9435* Permissions of a file.9436*/9437export enum FilePermission {9438/**9439* The file is readonly.9440*9441* *Note:* All `FileStat` from a `FileSystemProvider` that is registered with9442* the option `isReadonly: true` will be implicitly handled as if `FilePermission.Readonly`9443* is set. As a consequence, it is not possible to have a readonly file system provider9444* registered where some `FileStat` are not readonly.9445*/9446Readonly = 19447}94489449/**9450* The `FileStat`-type represents metadata about a file9451*/9452export interface FileStat {9453/**9454* The type of the file, e.g. is a regular file, a directory, or symbolic link9455* to a file.9456*9457* *Note:* This value might be a bitmask, e.g. `FileType.File | FileType.SymbolicLink`.9458*/9459type: FileType;9460/**9461* The creation timestamp in milliseconds elapsed since January 1, 1970 00:00:00 UTC.9462*/9463ctime: number;9464/**9465* The modification timestamp in milliseconds elapsed since January 1, 1970 00:00:00 UTC.9466*9467* *Note:* If the file changed, it is important to provide an updated `mtime` that advanced9468* from the previous value. Otherwise there may be optimizations in place that will not show9469* the updated file contents in an editor for example.9470*/9471mtime: number;9472/**9473* The size in bytes.9474*9475* *Note:* If the file changed, it is important to provide an updated `size`. Otherwise there9476* may be optimizations in place that will not show the updated file contents in an editor for9477* example.9478*/9479size: number;9480/**9481* The permissions of the file, e.g. whether the file is readonly.9482*9483* *Note:* This value might be a bitmask, e.g. `FilePermission.Readonly | FilePermission.Other`.9484*/9485permissions?: FilePermission;9486}94879488/**9489* A type that filesystem providers should use to signal errors.9490*9491* This class has factory methods for common error-cases, like `FileNotFound` when9492* a file or folder doesn't exist, use them like so: `throw vscode.FileSystemError.FileNotFound(someUri);`9493*/9494export class FileSystemError extends Error {94959496/**9497* Create an error to signal that a file or folder wasn't found.9498* @param messageOrUri Message or uri.9499*/9500static FileNotFound(messageOrUri?: string | Uri): FileSystemError;95019502/**9503* Create an error to signal that a file or folder already exists, e.g. when9504* creating but not overwriting a file.9505* @param messageOrUri Message or uri.9506*/9507static FileExists(messageOrUri?: string | Uri): FileSystemError;95089509/**9510* Create an error to signal that a file is not a folder.9511* @param messageOrUri Message or uri.9512*/9513static FileNotADirectory(messageOrUri?: string | Uri): FileSystemError;95149515/**9516* Create an error to signal that a file is a folder.9517* @param messageOrUri Message or uri.9518*/9519static FileIsADirectory(messageOrUri?: string | Uri): FileSystemError;95209521/**9522* Create an error to signal that an operation lacks required permissions.9523* @param messageOrUri Message or uri.9524*/9525static NoPermissions(messageOrUri?: string | Uri): FileSystemError;95269527/**9528* Create an error to signal that the file system is unavailable or too busy to9529* complete a request.9530* @param messageOrUri Message or uri.9531*/9532static Unavailable(messageOrUri?: string | Uri): FileSystemError;95339534/**9535* Creates a new filesystem error.9536*9537* @param messageOrUri Message or uri.9538*/9539constructor(messageOrUri?: string | Uri);95409541/**9542* A code that identifies this error.9543*9544* Possible values are names of errors, like {@linkcode FileSystemError.FileNotFound FileNotFound},9545* or `Unknown` for unspecified errors.9546*/9547readonly code: string;9548}95499550/**9551* Enumeration of file change types.9552*/9553export enum FileChangeType {95549555/**9556* The contents or metadata of a file have changed.9557*/9558Changed = 1,95599560/**9561* A file has been created.9562*/9563Created = 2,95649565/**9566* A file has been deleted.9567*/9568Deleted = 3,9569}95709571/**9572* The event filesystem providers must use to signal a file change.9573*/9574export interface FileChangeEvent {95759576/**9577* The type of change.9578*/9579readonly type: FileChangeType;95809581/**9582* The uri of the file that has changed.9583*/9584readonly uri: Uri;9585}95869587/**9588* The filesystem provider defines what the editor needs to read, write, discover,9589* and to manage files and folders. It allows extensions to serve files from remote places,9590* like ftp-servers, and to seamlessly integrate those into the editor.9591*9592* * *Note 1:* The filesystem provider API works with {@link Uri uris} and assumes hierarchical9593* paths, e.g. `foo:/my/path` is a child of `foo:/my/` and a parent of `foo:/my/path/deeper`.9594* * *Note 2:* There is an activation event `onFileSystem:<scheme>` that fires when a file9595* or folder is being accessed.9596* * *Note 3:* The word 'file' is often used to denote all {@link FileType kinds} of files, e.g.9597* folders, symbolic links, and regular files.9598*/9599export interface FileSystemProvider {96009601/**9602* An event to signal that a resource has been created, changed, or deleted. This9603* event should fire for resources that are being {@link FileSystemProvider.watch watched}9604* by clients of this provider.9605*9606* *Note:* It is important that the metadata of the file that changed provides an9607* updated `mtime` that advanced from the previous value in the {@link FileStat stat} and a9608* correct `size` value. Otherwise there may be optimizations in place that will not show9609* the change in an editor for example.9610*/9611readonly onDidChangeFile: Event<FileChangeEvent[]>;96129613/**9614* Subscribes to file change events in the file or folder denoted by `uri`. For folders,9615* the option `recursive` indicates whether subfolders, sub-subfolders, etc. should9616* be watched for file changes as well. With `recursive: false`, only changes to the9617* files that are direct children of the folder should trigger an event.9618*9619* The `excludes` array is used to indicate paths that should be excluded from file9620* watching. It is typically derived from the `files.watcherExclude` setting that9621* is configurable by the user. Each entry can be be:9622* - the absolute path to exclude9623* - a relative path to exclude (for example `build/output`)9624* - a simple glob pattern (for example `**​/build`, `output/**`)9625*9626* *Note* that case-sensitivity of the {@link excludes} patterns for built-in file system providers9627* will depend on the underlying file system: on Windows and macOS the matching will be case-insensitive and9628* on Linux it will be case-sensitive.9629*9630* It is the file system provider's job to call {@linkcode FileSystemProvider.onDidChangeFile onDidChangeFile}9631* for every change given these rules. No event should be emitted for files that match any of the provided9632* excludes.9633*9634* @param uri The uri of the file or folder to be watched.9635* @param options Configures the watch.9636* @returns A disposable that tells the provider to stop watching the `uri`.9637*/9638watch(uri: Uri, options: {9639/**9640* When enabled also watch subfolders.9641*/9642readonly recursive: boolean;9643/**9644* A list of paths and pattern to exclude from watching.9645*/9646readonly excludes: readonly string[];9647}): Disposable;96489649/**9650* Retrieve metadata about a file.9651*9652* Note that the metadata for symbolic links should be the metadata of the file they refer to.9653* Still, the {@link FileType.SymbolicLink SymbolicLink}-type must be used in addition to the actual type, e.g.9654* `FileType.SymbolicLink | FileType.Directory`.9655*9656* @param uri The uri of the file to retrieve metadata about.9657* @returns The file metadata about the file.9658* @throws {@linkcode FileSystemError.FileNotFound FileNotFound} when `uri` doesn't exist.9659*/9660stat(uri: Uri): FileStat | Thenable<FileStat>;96619662/**9663* Retrieve all entries of a {@link FileType.Directory directory}.9664*9665* @param uri The uri of the folder.9666* @returns An array of name/type-tuples or a thenable that resolves to such.9667* @throws {@linkcode FileSystemError.FileNotFound FileNotFound} when `uri` doesn't exist.9668*/9669readDirectory(uri: Uri): [string, FileType][] | Thenable<[string, FileType][]>;96709671/**9672* Create a new directory (Note, that new files are created via `write`-calls).9673*9674* @param uri The uri of the new folder.9675* @throws {@linkcode FileSystemError.FileNotFound FileNotFound} when the parent of `uri` doesn't exist, e.g. no mkdirp-logic required.9676* @throws {@linkcode FileSystemError.FileExists FileExists} when `uri` already exists.9677* @throws {@linkcode FileSystemError.NoPermissions NoPermissions} when permissions aren't sufficient.9678*/9679createDirectory(uri: Uri): void | Thenable<void>;96809681/**9682* Read the entire contents of a file.9683*9684* @param uri The uri of the file.9685* @returns An array of bytes or a thenable that resolves to such.9686* @throws {@linkcode FileSystemError.FileNotFound FileNotFound} when `uri` doesn't exist.9687*/9688readFile(uri: Uri): Uint8Array | Thenable<Uint8Array>;96899690/**9691* Write data to a file, replacing its entire contents.9692*9693* @param uri The uri of the file.9694* @param content The new content of the file.9695* @param options Defines if missing files should or must be created.9696* @throws {@linkcode FileSystemError.FileNotFound FileNotFound} when `uri` doesn't exist and `create` is not set.9697* @throws {@linkcode FileSystemError.FileNotFound FileNotFound} when the parent of `uri` doesn't exist and `create` is set, e.g. no mkdirp-logic required.9698* @throws {@linkcode FileSystemError.FileExists FileExists} when `uri` already exists, `create` is set but `overwrite` is not set.9699* @throws {@linkcode FileSystemError.NoPermissions NoPermissions} when permissions aren't sufficient.9700*/9701writeFile(uri: Uri, content: Uint8Array, options: {9702/**9703* Create the file if it does not exist already.9704*/9705readonly create: boolean;9706/**9707* Overwrite the file if it does exist.9708*/9709readonly overwrite: boolean;9710}): void | Thenable<void>;97119712/**9713* Delete a file.9714*9715* @param uri The resource that is to be deleted.9716* @param options Defines if deletion of folders is recursive.9717* @throws {@linkcode FileSystemError.FileNotFound FileNotFound} when `uri` doesn't exist.9718* @throws {@linkcode FileSystemError.NoPermissions NoPermissions} when permissions aren't sufficient.9719*/9720delete(uri: Uri, options: {9721/**9722* Delete the content recursively if a folder is denoted.9723*/9724readonly recursive: boolean;9725}): void | Thenable<void>;97269727/**9728* Rename a file or folder.9729*9730* @param oldUri The existing file.9731* @param newUri The new location.9732* @param options Defines if existing files should be overwritten.9733* @throws {@linkcode FileSystemError.FileNotFound FileNotFound} when `oldUri` doesn't exist.9734* @throws {@linkcode FileSystemError.FileNotFound FileNotFound} when parent of `newUri` doesn't exist, e.g. no mkdirp-logic required.9735* @throws {@linkcode FileSystemError.FileExists FileExists} when `newUri` exists and when the `overwrite` option is not `true`.9736* @throws {@linkcode FileSystemError.NoPermissions NoPermissions} when permissions aren't sufficient.9737*/9738rename(oldUri: Uri, newUri: Uri, options: {9739/**9740* Overwrite the file if it does exist.9741*/9742readonly overwrite: boolean;9743}): void | Thenable<void>;97449745/**9746* Copy files or folders. Implementing this function is optional but it will speedup9747* the copy operation.9748*9749* @param source The existing file.9750* @param destination The destination location.9751* @param options Defines if existing files should be overwritten.9752* @throws {@linkcode FileSystemError.FileNotFound FileNotFound} when `source` doesn't exist.9753* @throws {@linkcode FileSystemError.FileNotFound FileNotFound} when parent of `destination` doesn't exist, e.g. no mkdirp-logic required.9754* @throws {@linkcode FileSystemError.FileExists FileExists} when `destination` exists and when the `overwrite` option is not `true`.9755* @throws {@linkcode FileSystemError.NoPermissions NoPermissions} when permissions aren't sufficient.9756*/9757copy?(source: Uri, destination: Uri, options: {9758/**9759* Overwrite the file if it does exist.9760*/9761readonly overwrite: boolean;9762}): void | Thenable<void>;9763}97649765/**9766* The file system interface exposes the editor's built-in and contributed9767* {@link FileSystemProvider file system providers}. It allows extensions to work9768* with files from the local disk as well as files from remote places, like the9769* remote extension host or ftp-servers.9770*9771* *Note* that an instance of this interface is available as {@linkcode workspace.fs}.9772*/9773export interface FileSystem {97749775/**9776* Retrieve metadata about a file.9777*9778* @param uri The uri of the file to retrieve metadata about.9779* @returns The file metadata about the file.9780*/9781stat(uri: Uri): Thenable<FileStat>;97829783/**9784* Retrieve all entries of a {@link FileType.Directory directory}.9785*9786* @param uri The uri of the folder.9787* @returns An array of name/type-tuples or a thenable that resolves to such.9788*/9789readDirectory(uri: Uri): Thenable<[string, FileType][]>;97909791/**9792* Create a new directory (Note, that new files are created via `write`-calls).9793*9794* *Note* that missing directories are created automatically, e.g this call has9795* `mkdirp` semantics.9796*9797* @param uri The uri of the new folder.9798*/9799createDirectory(uri: Uri): Thenable<void>;98009801/**9802* Read the entire contents of a file.9803*9804* @param uri The uri of the file.9805* @returns An array of bytes or a thenable that resolves to such.9806*/9807readFile(uri: Uri): Thenable<Uint8Array>;98089809/**9810* Write data to a file, replacing its entire contents.9811*9812* @param uri The uri of the file.9813* @param content The new content of the file.9814*/9815writeFile(uri: Uri, content: Uint8Array): Thenable<void>;98169817/**9818* Delete a file.9819*9820* @param uri The resource that is to be deleted.9821* @param options Defines if trash can should be used and if deletion of folders is recursive9822*/9823delete(uri: Uri, options?: {9824/**9825* Delete the content recursively if a folder is denoted.9826*/9827recursive?: boolean;9828/**9829* Use the os's trashcan instead of permanently deleting files whenever possible.9830*/9831useTrash?: boolean;9832}): Thenable<void>;98339834/**9835* Rename a file or folder.9836*9837* @param source The existing file.9838* @param target The new location.9839* @param options Defines if existing files should be overwritten.9840*/9841rename(source: Uri, target: Uri, options?: {9842/**9843* Overwrite the file if it does exist.9844*/9845overwrite?: boolean;9846}): Thenable<void>;98479848/**9849* Copy files or folders.9850*9851* @param source The existing file.9852* @param target The destination location.9853* @param options Defines if existing files should be overwritten.9854*/9855copy(source: Uri, target: Uri, options?: {9856/**9857* Overwrite the file if it does exist.9858*/9859overwrite?: boolean;9860}): Thenable<void>;98619862/**9863* Check if a given file system supports writing files.9864*9865* Keep in mind that just because a file system supports writing, that does9866* not mean that writes will always succeed. There may be permissions issues9867* or other errors that prevent writing a file.9868*9869* @param scheme The scheme of the filesystem, for example `file` or `git`.9870*9871* @returns `true` if the file system supports writing, `false` if it does not9872* support writing (i.e. it is readonly), and `undefined` if the editor does not9873* know about the filesystem.9874*/9875isWritableFileSystem(scheme: string): boolean | undefined;9876}98779878/**9879* Defines a port mapping used for localhost inside the webview.9880*/9881export interface WebviewPortMapping {9882/**9883* Localhost port to remap inside the webview.9884*/9885readonly webviewPort: number;98869887/**9888* Destination port. The `webviewPort` is resolved to this port.9889*/9890readonly extensionHostPort: number;9891}98929893/**9894* Content settings for a webview.9895*/9896export interface WebviewOptions {9897/**9898* Controls whether scripts are enabled in the webview content or not.9899*9900* Defaults to false (scripts-disabled).9901*/9902readonly enableScripts?: boolean;99039904/**9905* Controls whether forms are enabled in the webview content or not.9906*9907* Defaults to true if {@link WebviewOptions.enableScripts scripts are enabled}. Otherwise defaults to false.9908* Explicitly setting this property to either true or false overrides the default.9909*/9910readonly enableForms?: boolean;99119912/**9913* Controls whether command uris are enabled in webview content or not.9914*9915* Defaults to `false` (command uris are disabled).9916*9917* If you pass in an array, only the commands in the array are allowed.9918*/9919readonly enableCommandUris?: boolean | readonly string[];99209921/**9922* Root paths from which the webview can load local (filesystem) resources using uris from `asWebviewUri`9923*9924* Default to the root folders of the current workspace plus the extension's install directory.9925*9926* Pass in an empty array to disallow access to any local resources.9927*/9928readonly localResourceRoots?: readonly Uri[];99299930/**9931* Mappings of localhost ports used inside the webview.9932*9933* Port mapping allow webviews to transparently define how localhost ports are resolved. This can be used9934* to allow using a static localhost port inside the webview that is resolved to random port that a service is9935* running on.9936*9937* If a webview accesses localhost content, we recommend that you specify port mappings even if9938* the `webviewPort` and `extensionHostPort` ports are the same.9939*9940* *Note* that port mappings only work for `http` or `https` urls. Websocket urls (e.g. `ws://localhost:3000`)9941* cannot be mapped to another port.9942*/9943readonly portMapping?: readonly WebviewPortMapping[];9944}99459946/**9947* Displays html content, similarly to an iframe.9948*/9949export interface Webview {9950/**9951* Content settings for the webview.9952*/9953options: WebviewOptions;99549955/**9956* HTML contents of the webview.9957*9958* This should be a complete, valid html document. Changing this property causes the webview to be reloaded.9959*9960* Webviews are sandboxed from normal extension process, so all communication with the webview must use9961* message passing. To send a message from the extension to the webview, use {@linkcode Webview.postMessage postMessage}.9962* To send message from the webview back to an extension, use the `acquireVsCodeApi` function inside the webview9963* to get a handle to the editor's api and then call `.postMessage()`:9964*9965* ```html9966* <script>9967* const vscode = acquireVsCodeApi(); // acquireVsCodeApi can only be invoked once9968* vscode.postMessage({ message: 'hello!' });9969* </script>9970* ```9971*9972* To load a resources from the workspace inside a webview, use the {@linkcode Webview.asWebviewUri asWebviewUri} method9973* and ensure the resource's directory is listed in {@linkcode WebviewOptions.localResourceRoots}.9974*9975* Keep in mind that even though webviews are sandboxed, they still allow running scripts and loading arbitrary content,9976* so extensions must follow all standard web security best practices when working with webviews. This includes9977* properly sanitizing all untrusted input (including content from the workspace) and9978* setting a [content security policy](https://aka.ms/vscode-api-webview-csp).9979*/9980html: string;99819982/**9983* Fired when the webview content posts a message.9984*9985* Webview content can post strings or json serializable objects back to an extension. They cannot9986* post `Blob`, `File`, `ImageData` and other DOM specific objects since the extension that receives the9987* message does not run in a browser environment.9988*/9989readonly onDidReceiveMessage: Event<any>;99909991/**9992* Post a message to the webview content.9993*9994* Messages are only delivered if the webview is live (either visible or in the9995* background with `retainContextWhenHidden`).9996*9997* @param message Body of the message. This must be a string or other json serializable object.9998*9999* For older versions of vscode, if an `ArrayBuffer` is included in `message`,10000* it will not be serialized properly and will not be received by the webview.10001* Similarly any TypedArrays, such as a `Uint8Array`, will be very inefficiently10002* serialized and will also not be recreated as a typed array inside the webview.10003*10004* However if your extension targets vscode 1.57+ in the `engines` field of its10005* `package.json`, any `ArrayBuffer` values that appear in `message` will be more10006* efficiently transferred to the webview and will also be correctly recreated inside10007* of the webview.10008*10009* @returns A promise that resolves when the message is posted to a webview or when it is10010* dropped because the message was not deliverable.10011*10012* Returns `true` if the message was posted to the webview. Messages can only be posted to10013* live webviews (i.e. either visible webviews or hidden webviews that set `retainContextWhenHidden`).10014*10015* A response of `true` does not mean that the message was actually received by the webview.10016* For example, no message listeners may be have been hooked up inside the webview or the webview may10017* have been destroyed after the message was posted but before it was received.10018*10019* If you want confirm that a message as actually received, you can try having your webview posting a10020* confirmation message back to your extension.10021*/10022postMessage(message: any): Thenable<boolean>;1002310024/**10025* Convert a uri for the local file system to one that can be used inside webviews.10026*10027* Webviews cannot directly load resources from the workspace or local file system using `file:` uris. The10028* `asWebviewUri` function takes a local `file:` uri and converts it into a uri that can be used inside of10029* a webview to load the same resource:10030*10031* ```ts10032* webview.html = `<img src="${webview.asWebviewUri(vscode.Uri.file('/Users/codey/workspace/cat.gif'))}">`10033* ```10034*/10035asWebviewUri(localResource: Uri): Uri;1003610037/**10038* Content security policy source for webview resources.10039*10040* This is the origin that should be used in a content security policy rule:10041*10042* ```ts10043* `img-src https: ${webview.cspSource} ...;`10044* ```10045*/10046readonly cspSource: string;10047}1004810049/**10050* Content settings for a webview panel.10051*/10052export interface WebviewPanelOptions {10053/**10054* Controls if the find widget is enabled in the panel.10055*10056* Defaults to `false`.10057*/10058readonly enableFindWidget?: boolean;1005910060/**10061* Controls if the webview panel's content (iframe) is kept around even when the panel10062* is no longer visible.10063*10064* Normally the webview panel's html context is created when the panel becomes visible10065* and destroyed when it is hidden. Extensions that have complex state10066* or UI can set the `retainContextWhenHidden` to make the editor keep the webview10067* context around, even when the webview moves to a background tab. When a webview using10068* `retainContextWhenHidden` becomes hidden, its scripts and other dynamic content are suspended.10069* When the panel becomes visible again, the context is automatically restored10070* in the exact same state it was in originally. You cannot send messages to a10071* hidden webview, even with `retainContextWhenHidden` enabled.10072*10073* `retainContextWhenHidden` has a high memory overhead and should only be used if10074* your panel's context cannot be quickly saved and restored.10075*/10076readonly retainContextWhenHidden?: boolean;10077}1007810079/**10080* A panel that contains a {@linkcode Webview}.10081*/10082export interface WebviewPanel {10083/**10084* Identifies the type of the webview panel, such as `'markdown.preview'`.10085*/10086readonly viewType: string;1008710088/**10089* Title of the panel shown in UI.10090*/10091title: string;1009210093/**10094* Icon for the panel shown in UI.10095*/10096iconPath?: IconPath;1009710098/**10099* {@linkcode Webview} belonging to the panel.10100*/10101readonly webview: Webview;1010210103/**10104* Content settings for the webview panel.10105*/10106readonly options: WebviewPanelOptions;1010710108/**10109* Editor position of the panel. This property is only set if the webview is in10110* one of the editor view columns.10111*/10112readonly viewColumn: ViewColumn | undefined;1011310114/**10115* Whether the panel is active (focused by the user).10116*/10117readonly active: boolean;1011810119/**10120* Whether the panel is visible.10121*/10122readonly visible: boolean;1012310124/**10125* Fired when the panel's view state changes.10126*/10127readonly onDidChangeViewState: Event<WebviewPanelOnDidChangeViewStateEvent>;1012810129/**10130* Fired when the panel is disposed.10131*10132* This may be because the user closed the panel or because {@linkcode WebviewPanel.dispose dispose} was10133* called on it.10134*10135* Trying to use the panel after it has been disposed throws an exception.10136*/10137readonly onDidDispose: Event<void>;1013810139/**10140* Show the webview panel in a given column.10141*10142* A webview panel may only show in a single column at a time. If it is already showing, this10143* method moves it to a new column.10144*10145* @param viewColumn View column to show the panel in. Shows in the current {@linkcode WebviewPanel.viewColumn} if undefined.10146* @param preserveFocus When `true`, the webview will not take focus.10147*/10148reveal(viewColumn?: ViewColumn, preserveFocus?: boolean): void;1014910150/**10151* Dispose of the webview panel.10152*10153* This closes the panel if it showing and disposes of the resources owned by the webview.10154* Webview panels are also disposed when the user closes the webview panel. Both cases10155* fire the {@linkcode onDidDispose} event.10156*/10157dispose(): any;10158}1015910160/**10161* Event fired when a {@linkcode WebviewPanel webview panel's} view state changes.10162*/10163export interface WebviewPanelOnDidChangeViewStateEvent {10164/**10165* {@linkcode WebviewPanel} whose view state changed.10166*/10167readonly webviewPanel: WebviewPanel;10168}1016910170/**10171* Restore webview panels that have been persisted when vscode shuts down.10172*10173* There are two types of webview persistence:10174*10175* - Persistence within a session.10176* - Persistence across sessions (across restarts of the editor).10177*10178* A `WebviewPanelSerializer` is only required for the second case: persisting a webview across sessions.10179*10180* Persistence within a session allows a webview to save its state when it becomes hidden10181* and restore its content from this state when it becomes visible again. It is powered entirely10182* by the webview content itself. To save off a persisted state, call `acquireVsCodeApi().setState()` with10183* any json serializable object. To restore the state again, call `getState()`10184*10185* ```js10186* // Within the webview10187* const vscode = acquireVsCodeApi();10188*10189* // Get existing state10190* const oldState = vscode.getState() || { value: 0 };10191*10192* // Update state10193* setState({ value: oldState.value + 1 })10194* ```10195*10196* A `WebviewPanelSerializer` extends this persistence across restarts of the editor. When the editor is shutdown,10197* it will save off the state from `setState` of all webviews that have a serializer. When the10198* webview first becomes visible after the restart, this state is passed to `deserializeWebviewPanel`.10199* The extension can then restore the old `WebviewPanel` from this state.10200*10201* @param T Type of the webview's state.10202*/10203export interface WebviewPanelSerializer<T = unknown> {10204/**10205* Restore a webview panel from its serialized `state`.10206*10207* Called when a serialized webview first becomes visible.10208*10209* @param webviewPanel Webview panel to restore. The serializer should take ownership of this panel. The10210* serializer must restore the webview's `.html` and hook up all webview events.10211* @param state Persisted state from the webview content.10212*10213* @returns Thenable indicating that the webview has been fully restored.10214*/10215deserializeWebviewPanel(webviewPanel: WebviewPanel, state: T): Thenable<void>;10216}1021710218/**10219* A webview based view.10220*/10221export interface WebviewView {10222/**10223* Identifies the type of the webview view, such as `'hexEditor.dataView'`.10224*/10225readonly viewType: string;1022610227/**10228* The underlying webview for the view.10229*/10230readonly webview: Webview;1023110232/**10233* View title displayed in the UI.10234*10235* The view title is initially taken from the extension `package.json` contribution.10236*/10237title?: string;1023810239/**10240* Human-readable string which is rendered less prominently in the title.10241*/10242description?: string;1024310244/**10245* The badge to display for this webview view.10246* To remove the badge, set to undefined.10247*/10248badge?: ViewBadge | undefined;1024910250/**10251* Event fired when the view is disposed.10252*10253* Views are disposed when they are explicitly hidden by a user (this happens when a user10254* right clicks in a view and unchecks the webview view).10255*10256* Trying to use the view after it has been disposed throws an exception.10257*/10258readonly onDidDispose: Event<void>;1025910260/**10261* Tracks if the webview is currently visible.10262*10263* Views are visible when they are on the screen and expanded.10264*/10265readonly visible: boolean;1026610267/**10268* Event fired when the visibility of the view changes.10269*10270* Actions that trigger a visibility change:10271*10272* - The view is collapsed or expanded.10273* - The user switches to a different view group in the sidebar or panel.10274*10275* Note that hiding a view using the context menu instead disposes of the view and fires `onDidDispose`.10276*/10277readonly onDidChangeVisibility: Event<void>;1027810279/**10280* Reveal the view in the UI.10281*10282* If the view is collapsed, this will expand it.10283*10284* @param preserveFocus When `true` the view will not take focus.10285*/10286show(preserveFocus?: boolean): void;10287}1028810289/**10290* Additional information the webview view being resolved.10291*10292* @param T Type of the webview's state.10293*/10294export interface WebviewViewResolveContext<T = unknown> {10295/**10296* Persisted state from the webview content.10297*10298* To save resources, the editor normally deallocates webview documents (the iframe content) that are not visible.10299* For example, when the user collapse a view or switches to another top level activity in the sidebar, the10300* {@linkcode WebviewView} itself is kept alive but the webview's underlying document is deallocated. It is recreated when10301* the view becomes visible again.10302*10303* You can prevent this behavior by setting {@linkcode WebviewOptions.retainContextWhenHidden retainContextWhenHidden} in the {@linkcode WebviewOptions}.10304* However this increases resource usage and should be avoided wherever possible. Instead, you can use10305* persisted state to save off a webview's state so that it can be quickly recreated as needed.10306*10307* To save off a persisted state, inside the webview call `acquireVsCodeApi().setState()` with10308* any json serializable object. To restore the state again, call `getState()`. For example:10309*10310* ```js10311* // Within the webview10312* const vscode = acquireVsCodeApi();10313*10314* // Get existing state10315* const oldState = vscode.getState() || { value: 0 };10316*10317* // Update state10318* setState({ value: oldState.value + 1 })10319* ```10320*10321* The editor ensures that the persisted state is saved correctly when a webview is hidden and across10322* editor restarts.10323*/10324readonly state: T | undefined;10325}1032610327/**10328* Provider for creating {@linkcode WebviewView} elements.10329*/10330export interface WebviewViewProvider {10331/**10332* Resolves a webview view.10333*10334* `resolveWebviewView` is called when a view first becomes visible. This may happen when the view is10335* first loaded or when the user hides and then shows a view again.10336*10337* @param webviewView Webview view to restore. The provider should take ownership of this view. The10338* provider must set the webview's `.html` and hook up all webview events it is interested in.10339* @param context Additional metadata about the view being resolved.10340* @param token Cancellation token indicating that the view being provided is no longer needed.10341*10342* @returns Optional thenable indicating that the view has been fully resolved.10343*/10344resolveWebviewView(webviewView: WebviewView, context: WebviewViewResolveContext, token: CancellationToken): Thenable<void> | void;10345}1034610347/**10348* Provider for text based custom editors.10349*10350* Text based custom editors use a {@linkcode TextDocument} as their data model. This considerably simplifies10351* implementing a custom editor as it allows the editor to handle many common operations such as10352* undo and backup. The provider is responsible for synchronizing text changes between the webview and the {@linkcode TextDocument}.10353*/10354export interface CustomTextEditorProvider {1035510356/**10357* Resolve a custom editor for a given text resource.10358*10359* This is called when a user first opens a resource for a `CustomTextEditorProvider`, or if they reopen an10360* existing editor using this `CustomTextEditorProvider`.10361*10362* @param document Document for the resource to resolve.10363*10364* @param webviewPanel The webview panel used to display the editor UI for this resource.10365*10366* During resolve, the provider must fill in the initial html for the content webview panel and hook up all10367* the event listeners on it that it is interested in. The provider can also hold onto the {@linkcode WebviewPanel} to10368* use later for example in a command. See {@linkcode WebviewPanel} for additional details.10369*10370* @param token A cancellation token that indicates the result is no longer needed.10371*10372* @returns Thenable indicating that the custom editor has been resolved.10373*/10374resolveCustomTextEditor(document: TextDocument, webviewPanel: WebviewPanel, token: CancellationToken): Thenable<void> | void;10375}1037610377/**10378* Represents a custom document used by a {@linkcode CustomEditorProvider}.10379*10380* Custom documents are only used within a given `CustomEditorProvider`. The lifecycle of a `CustomDocument` is10381* managed by the editor. When no more references remain to a `CustomDocument`, it is disposed of.10382*/10383export interface CustomDocument {10384/**10385* The associated uri for this document.10386*/10387readonly uri: Uri;1038810389/**10390* Dispose of the custom document.10391*10392* This is invoked by the editor when there are no more references to a given `CustomDocument` (for example when10393* all editors associated with the document have been closed.)10394*/10395dispose(): void;10396}1039710398/**10399* Event triggered by extensions to signal to the editor that an edit has occurred on an {@linkcode CustomDocument}.10400*10401* @see {@linkcode CustomEditorProvider.onDidChangeCustomDocument}.10402*/10403export interface CustomDocumentEditEvent<T extends CustomDocument = CustomDocument> {1040410405/**10406* The document that the edit is for.10407*/10408readonly document: T;1040910410/**10411* Undo the edit operation.10412*10413* This is invoked by the editor when the user undoes this edit. To implement `undo`, your10414* extension should restore the document and editor to the state they were in just before this10415* edit was added to the editor's internal edit stack by {@linkcode CustomEditorProvider.onDidChangeCustomDocument}.10416*/10417undo(): Thenable<void> | void;1041810419/**10420* Redo the edit operation.10421*10422* This is invoked by the editor when the user redoes this edit. To implement `redo`, your10423* extension should restore the document and editor to the state they were in just after this10424* edit was added to the editor's internal edit stack by {@linkcode CustomEditorProvider.onDidChangeCustomDocument}.10425*/10426redo(): Thenable<void> | void;1042710428/**10429* Display name describing the edit.10430*10431* This will be shown to users in the UI for undo/redo operations.10432*/10433readonly label?: string;10434}1043510436/**10437* Event triggered by extensions to signal to the editor that the content of a {@linkcode CustomDocument}10438* has changed.10439*10440* @see {@linkcode CustomEditorProvider.onDidChangeCustomDocument}.10441*/10442export interface CustomDocumentContentChangeEvent<T extends CustomDocument = CustomDocument> {10443/**10444* The document that the change is for.10445*/10446readonly document: T;10447}1044810449/**10450* A backup for an {@linkcode CustomDocument}.10451*/10452export interface CustomDocumentBackup {10453/**10454* Unique identifier for the backup.10455*10456* This id is passed back to your extension in {@linkcode CustomReadonlyEditorProvider.openCustomDocument openCustomDocument} when opening a custom editor from a backup.10457*/10458readonly id: string;1045910460/**10461* Delete the current backup.10462*10463* This is called by the editor when it is clear the current backup is no longer needed, such as when a new backup10464* is made or when the file is saved.10465*/10466delete(): void;10467}1046810469/**10470* Additional information used to implement {@linkcode CustomDocumentBackup}.10471*/10472export interface CustomDocumentBackupContext {10473/**10474* Suggested file location to write the new backup.10475*10476* Note that your extension is free to ignore this and use its own strategy for backup.10477*10478* If the editor is for a resource from the current workspace, `destination` will point to a file inside10479* `ExtensionContext.storagePath`. The parent folder of `destination` may not exist, so make sure to created it10480* before writing the backup to this location.10481*/10482readonly destination: Uri;10483}1048410485/**10486* Additional information about the opening custom document.10487*/10488export interface CustomDocumentOpenContext {10489/**10490* The id of the backup to restore the document from or `undefined` if there is no backup.10491*10492* If this is provided, your extension should restore the editor from the backup instead of reading the file10493* from the user's workspace.10494*/10495readonly backupId: string | undefined;1049610497/**10498* If the URI is an untitled file, this will be populated with the byte data of that file10499*10500* If this is provided, your extension should utilize this byte data rather than executing fs APIs on the URI passed in10501*/10502readonly untitledDocumentData: Uint8Array | undefined;10503}1050410505/**10506* Provider for readonly custom editors that use a custom document model.10507*10508* Custom editors use {@linkcode CustomDocument} as their document model instead of a {@linkcode TextDocument}.10509*10510* You should use this type of custom editor when dealing with binary files or more complex scenarios. For simple10511* text based documents, use {@linkcode CustomTextEditorProvider} instead.10512*10513* @param T Type of the custom document returned by this provider.10514*/10515export interface CustomReadonlyEditorProvider<T extends CustomDocument = CustomDocument> {1051610517/**10518* Create a new document for a given resource.10519*10520* `openCustomDocument` is called when the first time an editor for a given resource is opened. The opened10521* document is then passed to {@link resolveCustomEditor} so that the editor can be shown to the user.10522*10523* Already opened {@linkcode CustomDocument CustomDocuments} are re-used if the user opened additional editors. When all editors for a10524* given resource are closed, the {@linkcode CustomDocument CustomDocuments} is disposed of. Opening an editor at this point will10525* trigger another call to `openCustomDocument`.10526*10527* @param uri Uri of the document to open.10528* @param openContext Additional information about the opening custom document.10529* @param token A cancellation token that indicates the result is no longer needed.10530*10531* @returns The custom document.10532*/10533openCustomDocument(uri: Uri, openContext: CustomDocumentOpenContext, token: CancellationToken): Thenable<T> | T;1053410535/**10536* Resolve a custom editor for a given resource.10537*10538* This is called whenever the user opens a new editor for this `CustomEditorProvider`.10539*10540* @param document Document for the resource being resolved.10541*10542* @param webviewPanel The webview panel used to display the editor UI for this resource.10543*10544* During resolve, the provider must fill in the initial html for the content webview panel and hook up all10545* the event listeners on it that it is interested in. The provider can also hold onto the `WebviewPanel` to10546* use later for example in a command. See {@linkcode WebviewPanel} for additional details.10547*10548* @param token A cancellation token that indicates the result is no longer needed.10549*10550* @returns Optional thenable indicating that the custom editor has been resolved.10551*/10552resolveCustomEditor(document: T, webviewPanel: WebviewPanel, token: CancellationToken): Thenable<void> | void;10553}1055410555/**10556* Provider for editable custom editors that use a custom document model.10557*10558* Custom editors use {@linkcode CustomDocument} as their document model instead of a {@linkcode TextDocument}.10559* This gives extensions full control over actions such as edit, save, and backup.10560*10561* You should use this type of custom editor when dealing with binary files or more complex scenarios. For simple10562* text based documents, use {@linkcode CustomTextEditorProvider} instead.10563*10564* @param T Type of the custom document returned by this provider.10565*/10566export interface CustomEditorProvider<T extends CustomDocument = CustomDocument> extends CustomReadonlyEditorProvider<T> {10567/**10568* Signal that an edit has occurred inside a custom editor.10569*10570* This event must be fired by your extension whenever an edit happens in a custom editor. An edit can be10571* anything from changing some text, to cropping an image, to reordering a list. Your extension is free to10572* define what an edit is and what data is stored on each edit.10573*10574* Firing {@linkcode CustomEditorProvider.onDidChangeCustomDocument onDidChangeCustomDocument} causes the10575* editors to be marked as being dirty. This is cleared when the user either saves or reverts the file.10576*10577* Editors that support undo/redo must fire a {@linkcode CustomDocumentEditEvent} whenever an edit happens. This allows10578* users to undo and redo the edit using the editor's standard keyboard shortcuts. The editor will also mark10579* the editor as no longer being dirty if the user undoes all edits to the last saved state.10580*10581* Editors that support editing but cannot use the editor's standard undo/redo mechanism must fire a {@linkcode CustomDocumentContentChangeEvent}.10582* The only way for a user to clear the dirty state of an editor that does not support undo/redo is to either10583* `save` or `revert` the file.10584*10585* An editor should only ever fire {@linkcode CustomDocumentEditEvent} events, or only ever fire {@linkcode CustomDocumentContentChangeEvent} events.10586*/10587readonly onDidChangeCustomDocument: Event<CustomDocumentEditEvent<T>> | Event<CustomDocumentContentChangeEvent<T>>;1058810589/**10590* Save a custom document.10591*10592* This method is invoked by the editor when the user saves a custom editor. This can happen when the user10593* triggers save while the custom editor is active, by commands such as `save all`, or by auto save if enabled.10594*10595* The implementer must persist the custom editor. This usually means writing the10596* file data for the custom document to disk. After {@linkcode saveCustomDocument} completes, any associated10597* editor instances will no longer be marked as dirty.10598*10599* @param document Document to save.10600* @param cancellation Token that signals the save is no longer required (for example, if another save was triggered).10601*10602* @returns A {@linkcode Thenable} that saving has completed.10603*/10604saveCustomDocument(document: T, cancellation: CancellationToken): Thenable<void>;1060510606/**10607* Save a custom document to a different location.10608*10609* This method is invoked by the editor when the user triggers 'save as' on a custom editor. The implementer must10610* persist the custom editor to {@linkcode destination}.10611*10612* When the user accepts save as, the current editor is be replaced by an non-dirty editor for the newly saved file.10613*10614* @param document Document to save.10615* @param destination Location to save to.10616* @param cancellation Token that signals the save is no longer required.10617*10618* @returns A {@linkcode Thenable} signaling that saving has completed.10619*/10620saveCustomDocumentAs(document: T, destination: Uri, cancellation: CancellationToken): Thenable<void>;1062110622/**10623* Revert a custom document to its last saved state.10624*10625* This method is invoked by the editor when the user triggers `File: Revert File` in a custom editor. (Note that10626* this is only used using the editor's `File: Revert File` command and not on a `git revert` of the file).10627*10628* The implementer must make sure all editor instances (webviews) for {@linkcode document}10629* are displaying the document in the same state is saved in. This usually means reloading the file from the10630* workspace.10631*10632* @param document Document to revert.10633* @param cancellation Token that signals the revert is no longer required.10634*10635* @returns A {@linkcode Thenable} signaling that the revert has completed.10636*/10637revertCustomDocument(document: T, cancellation: CancellationToken): Thenable<void>;1063810639/**10640* Back up a dirty custom document.10641*10642* Backups are used for hot exit and to prevent data loss. Your {@linkcode backupCustomDocument} method should persist the resource in10643* its current state, i.e. with the edits applied. Most commonly this means saving the resource to disk in10644* the `ExtensionContext.storagePath`. When the editor reloads and your custom editor is opened for a resource,10645* your extension should first check to see if any backups exist for the resource. If there is a backup, your10646* extension should load the file contents from there instead of from the resource in the workspace.10647*10648* {@linkcode backupCustomDocument} is triggered approximately one second after the user stops editing the document. If the user10649* rapidly edits the document, {@linkcode backupCustomDocument} will not be invoked until the editing stops.10650*10651* {@linkcode backupCustomDocument} is not invoked when `auto save` is enabled (since auto save already persists the resource).10652*10653* @param document Document to backup.10654* @param context Information that can be used to backup the document.10655* @param cancellation Token that signals the current backup since a new backup is coming in. It is up to your10656* extension to decided how to respond to cancellation. If for example your extension is backing up a large file10657* in an operation that takes time to complete, your extension may decide to finish the ongoing backup rather10658* than cancelling it to ensure that the editor has some valid backup.10659*10660* @returns A {@linkcode Thenable} signaling that the backup has completed.10661*/10662backupCustomDocument(document: T, context: CustomDocumentBackupContext, cancellation: CancellationToken): Thenable<CustomDocumentBackup>;10663}1066410665/**10666* The clipboard provides read and write access to the system's clipboard.10667*/10668export interface Clipboard {1066910670/**10671* Read the current clipboard contents as text.10672* @returns A thenable that resolves to a string.10673*/10674readText(): Thenable<string>;1067510676/**10677* Writes text into the clipboard.10678* @returns A thenable that resolves when writing happened.10679*/10680writeText(value: string): Thenable<void>;10681}1068210683/**10684* Possible kinds of UI that can use extensions.10685*/10686export enum UIKind {1068710688/**10689* Extensions are accessed from a desktop application.10690*/10691Desktop = 1,1069210693/**10694* Extensions are accessed from a web browser.10695*/10696Web = 210697}1069810699/**10700* Log levels10701*/10702export enum LogLevel {1070310704/**10705* No messages are logged with this level.10706*/10707Off = 0,1070810709/**10710* All messages are logged with this level.10711*/10712Trace = 1,1071310714/**10715* Messages with debug and higher log level are logged with this level.10716*/10717Debug = 2,1071810719/**10720* Messages with info and higher log level are logged with this level.10721*/10722Info = 3,1072310724/**10725* Messages with warning and higher log level are logged with this level.10726*/10727Warning = 4,1072810729/**10730* Only error messages are logged with this level.10731*/10732Error = 510733}1073410735/**10736* Namespace describing the environment the editor runs in.10737*/10738export namespace env {1073910740/**10741* The application name of the editor, like 'VS Code'.10742*/10743export const appName: string;1074410745/**10746* The application root folder from which the editor is running.10747*10748* *Note* that the value is the empty string when running in an10749* environment that has no representation of an application root folder.10750*/10751export const appRoot: string;1075210753/**10754* The hosted location of the application10755* On desktop this is 'desktop'10756* In the web this is the specified embedder i.e. 'github.dev', 'codespaces', or 'web' if the embedder10757* does not provide that information10758*/10759export const appHost: string;1076010761/**10762* The custom uri scheme the editor registers to in the operating system.10763*/10764export const uriScheme: string;1076510766/**10767* Represents the preferred user-language, like `de-CH`, `fr`, or `en-US`.10768*/10769export const language: string;1077010771/**10772* The system clipboard.10773*/10774export const clipboard: Clipboard;1077510776/**10777* A unique identifier for the computer.10778*/10779export const machineId: string;1078010781/**10782* A unique identifier for the current session.10783* Changes each time the editor is started.10784*/10785export const sessionId: string;1078610787/**10788* Indicates that this is a fresh install of the application.10789* `true` if within the first day of installation otherwise `false`.10790*/10791export const isNewAppInstall: boolean;1079210793/**10794* Indicates whether the users has telemetry enabled.10795* Can be observed to determine if the extension should send telemetry.10796*/10797export const isTelemetryEnabled: boolean;1079810799/**10800* An {@link Event} which fires when the user enabled or disables telemetry.10801* `true` if the user has enabled telemetry or `false` if the user has disabled telemetry.10802*/10803export const onDidChangeTelemetryEnabled: Event<boolean>;1080410805/**10806* An {@link Event} which fires when the default shell changes. This fires with the new10807* shell path.10808*/10809export const onDidChangeShell: Event<string>;1081010811/**10812* Creates a new {@link TelemetryLogger telemetry logger}.10813*10814* @param sender The telemetry sender that is used by the telemetry logger.10815* @param options Options for the telemetry logger.10816* @returns A new telemetry logger10817*/10818export function createTelemetryLogger(sender: TelemetrySender, options?: TelemetryLoggerOptions): TelemetryLogger;1081910820/**10821* The name of a remote. Defined by extensions, popular samples are `wsl` for the Windows10822* Subsystem for Linux or `ssh-remote` for remotes using a secure shell.10823*10824* *Note* that the value is `undefined` when there is no remote extension host but that the10825* value is defined in all extension hosts (local and remote) in case a remote extension host10826* exists. Use {@link Extension.extensionKind} to know if10827* a specific extension runs remote or not.10828*/10829export const remoteName: string | undefined;1083010831/**10832* The detected default shell for the extension host, this is overridden by the10833* `terminal.integrated.defaultProfile` setting for the extension host's platform. Note that in10834* environments that do not support a shell the value is the empty string.10835*/10836export const shell: string;1083710838/**10839* The UI kind property indicates from which UI extensions10840* are accessed from. For example, extensions could be accessed10841* from a desktop application or a web browser.10842*/10843export const uiKind: UIKind;1084410845/**10846* Opens a link externally using the default application. Depending on the10847* used scheme this can be:10848* * a browser (`http:`, `https:`)10849* * a mail client (`mailto:`)10850* * VSCode itself (`vscode:` from `vscode.env.uriScheme`)10851*10852* *Note* that {@linkcode window.showTextDocument showTextDocument} is the right10853* way to open a text document inside the editor, not this function.10854*10855* @param target The uri that should be opened.10856* @returns A promise indicating if open was successful.10857*/10858export function openExternal(target: Uri): Thenable<boolean>;1085910860/**10861* Resolves a uri to a form that is accessible externally.10862*10863* #### `http:` or `https:` scheme10864*10865* Resolves an *external* uri, such as a `http:` or `https:` link, from where the extension is running to a10866* uri to the same resource on the client machine.10867*10868* This is a no-op if the extension is running on the client machine.10869*10870* If the extension is running remotely, this function automatically establishes a port forwarding tunnel10871* from the local machine to `target` on the remote and returns a local uri to the tunnel. The lifetime of10872* the port forwarding tunnel is managed by the editor and the tunnel can be closed by the user.10873*10874* *Note* that uris passed through `openExternal` are automatically resolved and you should not call `asExternalUri` on them.10875*10876* #### `vscode.env.uriScheme`10877*10878* Creates a uri that - if opened in a browser (e.g. via `openExternal`) - will result in a registered {@link UriHandler}10879* to trigger.10880*10881* Extensions should not make any assumptions about the resulting uri and should not alter it in any way.10882* Rather, extensions can e.g. use this uri in an authentication flow, by adding the uri as callback query10883* argument to the server to authenticate to.10884*10885* *Note* that if the server decides to add additional query parameters to the uri (e.g. a token or secret), it10886* will appear in the uri that is passed to the {@link UriHandler}.10887*10888* **Example** of an authentication flow:10889* ```typescript10890* vscode.window.registerUriHandler({10891* handleUri(uri: vscode.Uri): vscode.ProviderResult<void> {10892* if (uri.path === '/did-authenticate') {10893* console.log(uri.toString());10894* }10895* }10896* });10897*10898* const callableUri = await vscode.env.asExternalUri(vscode.Uri.parse(vscode.env.uriScheme + '://my.extension/did-authenticate'));10899* await vscode.env.openExternal(callableUri);10900* ```10901*10902* *Note* that extensions should not cache the result of `asExternalUri` as the resolved uri may become invalid due to10903* a system or user action — for example, in remote cases, a user may close a port forwarding tunnel that was opened by10904* `asExternalUri`.10905*10906* #### Any other scheme10907*10908* Any other scheme will be handled as if the provided URI is a workspace URI. In that case, the method will return10909* a URI which, when handled, will make the editor open the workspace.10910*10911* @returns A uri that can be used on the client machine.10912*/10913export function asExternalUri(target: Uri): Thenable<Uri>;1091410915/**10916* The current log level of the editor.10917*/10918export const logLevel: LogLevel;1091910920/**10921* An {@link Event} which fires when the log level of the editor changes.10922*/10923export const onDidChangeLogLevel: Event<LogLevel>;10924}1092510926/**10927* Namespace for dealing with commands. In short, a command is a function with a10928* unique identifier. The function is sometimes also called _command handler_.10929*10930* Commands can be added to the editor using the {@link commands.registerCommand registerCommand}10931* and {@link commands.registerTextEditorCommand registerTextEditorCommand} functions. Commands10932* can be executed {@link commands.executeCommand manually} or from a UI gesture. Those are:10933*10934* * palette - Use the `commands`-section in `package.json` to make a command show in10935* the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette).10936* * keybinding - Use the `keybindings`-section in `package.json` to enable10937* [keybindings](https://code.visualstudio.com/docs/getstarted/keybindings#_advanced-customization)10938* for your extension.10939*10940* Commands from other extensions and from the editor itself are accessible to an extension. However,10941* when invoking an editor command not all argument types are supported.10942*10943* This is a sample that registers a command handler and adds an entry for that command to the palette. First10944* register a command handler with the identifier `extension.sayHello`.10945* ```javascript10946* commands.registerCommand('extension.sayHello', () => {10947* window.showInformationMessage('Hello World!');10948* });10949* ```10950* Second, bind the command identifier to a title under which it will show in the palette (`package.json`).10951* ```json10952* {10953* "contributes": {10954* "commands": [{10955* "command": "extension.sayHello",10956* "title": "Hello World"10957* }]10958* }10959* }10960* ```10961*/10962export namespace commands {1096310964/**10965* Registers a command that can be invoked via a keyboard shortcut,10966* a menu item, an action, or directly.10967*10968* Registering a command with an existing command identifier twice10969* will cause an error.10970*10971* @param command A unique identifier for the command.10972* @param callback A command handler function.10973* @param thisArg The `this` context used when invoking the handler function.10974* @returns Disposable which unregisters this command on disposal.10975*/10976export function registerCommand(command: string, callback: (...args: any[]) => any, thisArg?: any): Disposable;1097710978/**10979* Registers a text editor command that can be invoked via a keyboard shortcut,10980* a menu item, an action, or directly.10981*10982* Text editor commands are different from ordinary {@link commands.registerCommand commands} as10983* they only execute when there is an active editor when the command is called. Also, the10984* command handler of an editor command has access to the active editor and to an10985* {@link TextEditorEdit edit}-builder. Note that the edit-builder is only valid while the10986* callback executes.10987*10988* @param command A unique identifier for the command.10989* @param callback A command handler function with access to an {@link TextEditor editor} and an {@link TextEditorEdit edit}.10990* @param thisArg The `this` context used when invoking the handler function.10991* @returns Disposable which unregisters this command on disposal.10992*/10993export function registerTextEditorCommand(command: string, callback: (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => void, thisArg?: any): Disposable;1099410995/**10996* Executes the command denoted by the given command identifier.10997*10998* * *Note 1:* When executing an editor command not all types are allowed to10999* be passed as arguments. Allowed are the primitive types `string`, `boolean`,11000* `number`, `undefined`, and `null`, as well as {@linkcode Position}, {@linkcode Range}, {@linkcode Uri} and {@linkcode Location}.11001* * *Note 2:* There are no restrictions when executing commands that have been contributed11002* by extensions.11003*11004* @param command Identifier of the command to execute.11005* @param rest Parameters passed to the command function.11006* @returns A thenable that resolves to the returned value of the given command. Returns `undefined` when11007* the command handler function doesn't return anything.11008*/11009export function executeCommand<T = unknown>(command: string, ...rest: any[]): Thenable<T>;1101011011/**11012* Retrieve the list of all available commands. Commands starting with an underscore are11013* treated as internal commands.11014*11015* @param filterInternal Set `true` to not see internal commands (starting with an underscore)11016* @returns Thenable that resolves to a list of command ids.11017*/11018export function getCommands(filterInternal?: boolean): Thenable<string[]>;11019}1102011021/**11022* Represents the state of a window.11023*/11024export interface WindowState {1102511026/**11027* Whether the current window is focused.11028*/11029readonly focused: boolean;1103011031/**11032* Whether the window has been interacted with recently. This will change11033* immediately on activity, or after a short time of user inactivity.11034*/11035readonly active: boolean;11036}1103711038/**11039* A uri handler is responsible for handling system-wide {@link Uri uris}.11040*11041* @see {@link window.registerUriHandler}.11042*/11043export interface UriHandler {1104411045/**11046* Handle the provided system-wide {@link Uri}.11047*11048* @see {@link window.registerUriHandler}.11049*/11050handleUri(uri: Uri): ProviderResult<void>;11051}1105211053/**11054* Namespace for dealing with the current window of the editor. That is visible11055* and active editors, as well as, UI elements to show messages, selections, and11056* asking for user input.11057*/11058export namespace window {1105911060/**11061* Represents the grid widget within the main editor area11062*/11063export const tabGroups: TabGroups;1106411065/**11066* The currently active editor or `undefined`. The active editor is the one11067* that currently has focus or, when none has focus, the one that has changed11068* input most recently.11069*/11070export let activeTextEditor: TextEditor | undefined;1107111072/**11073* The currently visible editors or an empty array.11074*/11075export let visibleTextEditors: readonly TextEditor[];1107611077/**11078* An {@link Event} which fires when the {@link window.activeTextEditor active editor}11079* has changed. *Note* that the event also fires when the active editor changes11080* to `undefined`.11081*/11082export const onDidChangeActiveTextEditor: Event<TextEditor | undefined>;1108311084/**11085* An {@link Event} which fires when the array of {@link window.visibleTextEditors visible editors}11086* has changed.11087*/11088export const onDidChangeVisibleTextEditors: Event<readonly TextEditor[]>;1108911090/**11091* An {@link Event} which fires when the selection in an editor has changed.11092*/11093export const onDidChangeTextEditorSelection: Event<TextEditorSelectionChangeEvent>;1109411095/**11096* An {@link Event} which fires when the visible ranges of an editor has changed.11097*/11098export const onDidChangeTextEditorVisibleRanges: Event<TextEditorVisibleRangesChangeEvent>;1109911100/**11101* An {@link Event} which fires when the options of an editor have changed.11102*/11103export const onDidChangeTextEditorOptions: Event<TextEditorOptionsChangeEvent>;1110411105/**11106* An {@link Event} which fires when the view column of an editor has changed.11107*/11108export const onDidChangeTextEditorViewColumn: Event<TextEditorViewColumnChangeEvent>;1110911110/**11111* The currently visible {@link NotebookEditor notebook editors} or an empty array.11112*/11113export const visibleNotebookEditors: readonly NotebookEditor[];1111411115/**11116* An {@link Event} which fires when the {@link window.visibleNotebookEditors visible notebook editors}11117* has changed.11118*/11119export const onDidChangeVisibleNotebookEditors: Event<readonly NotebookEditor[]>;1112011121/**11122* The currently active {@link NotebookEditor notebook editor} or `undefined`. The active editor is the one11123* that currently has focus or, when none has focus, the one that has changed11124* input most recently.11125*/11126export const activeNotebookEditor: NotebookEditor | undefined;1112711128/**11129* An {@link Event} which fires when the {@link window.activeNotebookEditor active notebook editor}11130* has changed. *Note* that the event also fires when the active editor changes11131* to `undefined`.11132*/11133export const onDidChangeActiveNotebookEditor: Event<NotebookEditor | undefined>;1113411135/**11136* An {@link Event} which fires when the {@link NotebookEditor.selections notebook editor selections}11137* have changed.11138*/11139export const onDidChangeNotebookEditorSelection: Event<NotebookEditorSelectionChangeEvent>;1114011141/**11142* An {@link Event} which fires when the {@link NotebookEditor.visibleRanges notebook editor visible ranges}11143* have changed.11144*/11145export const onDidChangeNotebookEditorVisibleRanges: Event<NotebookEditorVisibleRangesChangeEvent>;1114611147/**11148* The currently opened terminals or an empty array.11149*/11150export const terminals: readonly Terminal[];1115111152/**11153* The currently active terminal or `undefined`. The active terminal is the one that11154* currently has focus or most recently had focus.11155*/11156export const activeTerminal: Terminal | undefined;1115711158/**11159* An {@link Event} which fires when the {@link window.activeTerminal active terminal}11160* has changed. *Note* that the event also fires when the active terminal changes11161* to `undefined`.11162*/11163export const onDidChangeActiveTerminal: Event<Terminal | undefined>;1116411165/**11166* An {@link Event} which fires when a terminal has been created, either through the11167* {@link window.createTerminal createTerminal} API or commands.11168*/11169export const onDidOpenTerminal: Event<Terminal>;1117011171/**11172* An {@link Event} which fires when a terminal is disposed.11173*/11174export const onDidCloseTerminal: Event<Terminal>;1117511176/**11177* An {@link Event} which fires when a {@link Terminal.state terminal's state} has changed.11178*/11179export const onDidChangeTerminalState: Event<Terminal>;1118011181/**11182* Fires when shell integration activates or one of its properties changes in a terminal.11183*/11184export const onDidChangeTerminalShellIntegration: Event<TerminalShellIntegrationChangeEvent>;1118511186/**11187* This will be fired when a terminal command is started. This event will fire only when11188* [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration) is11189* activated for the terminal.11190*/11191export const onDidStartTerminalShellExecution: Event<TerminalShellExecutionStartEvent>;1119211193/**11194* This will be fired when a terminal command is ended. This event will fire only when11195* [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration) is11196* activated for the terminal.11197*/11198export const onDidEndTerminalShellExecution: Event<TerminalShellExecutionEndEvent>;1119911200/**11201* Represents the current window's state.11202*/11203export const state: WindowState;1120411205/**11206* An {@link Event} which fires when the focus or activity state of the current window11207* changes. The value of the event represents whether the window is focused.11208*/11209export const onDidChangeWindowState: Event<WindowState>;1121011211/**11212* Show the given document in a text editor. A {@link ViewColumn column} can be provided11213* to control where the editor is being shown. Might change the {@link window.activeTextEditor active editor}.11214*11215* @param document A text document to be shown.11216* @param column A view column in which the {@link TextEditor editor} should be shown. The default is the {@link ViewColumn.Active active}.11217* Columns that do not exist will be created as needed up to the maximum of {@linkcode ViewColumn.Nine}. Use {@linkcode ViewColumn.Beside}11218* to open the editor to the side of the currently active one.11219* @param preserveFocus When `true` the editor will not take focus.11220* @returns A promise that resolves to an {@link TextEditor editor}.11221*/11222export function showTextDocument(document: TextDocument, column?: ViewColumn, preserveFocus?: boolean): Thenable<TextEditor>;1122311224/**11225* Show the given document in a text editor. {@link TextDocumentShowOptions Options} can be provided11226* to control options of the editor is being shown. Might change the {@link window.activeTextEditor active editor}.11227*11228* @param document A text document to be shown.11229* @param options {@link TextDocumentShowOptions Editor options} to configure the behavior of showing the {@link TextEditor editor}.11230* @returns A promise that resolves to an {@link TextEditor editor}.11231*/11232export function showTextDocument(document: TextDocument, options?: TextDocumentShowOptions): Thenable<TextEditor>;1123311234/**11235* A short-hand for `openTextDocument(uri).then(document => showTextDocument(document, options))`.11236*11237* @see {@link workspace.openTextDocument}11238*11239* @param uri A resource identifier.11240* @param options {@link TextDocumentShowOptions Editor options} to configure the behavior of showing the {@link TextEditor editor}.11241* @returns A promise that resolves to an {@link TextEditor editor}.11242*/11243export function showTextDocument(uri: Uri, options?: TextDocumentShowOptions): Thenable<TextEditor>;1124411245/**11246* Show the given {@link NotebookDocument} in a {@link NotebookEditor notebook editor}.11247*11248* @param document A text document to be shown.11249* @param options {@link NotebookDocumentShowOptions Editor options} to configure the behavior of showing the {@link NotebookEditor notebook editor}.11250*11251* @returns A promise that resolves to an {@link NotebookEditor notebook editor}.11252*/11253export function showNotebookDocument(document: NotebookDocument, options?: NotebookDocumentShowOptions): Thenable<NotebookEditor>;1125411255/**11256* Create a TextEditorDecorationType that can be used to add decorations to text editors.11257*11258* @param options Rendering options for the decoration type.11259* @returns A new decoration type instance.11260*/11261export function createTextEditorDecorationType(options: DecorationRenderOptions): TextEditorDecorationType;1126211263/**11264* Show an information message to users. Optionally provide an array of items which will be presented as11265* clickable buttons.11266*11267* @param message The message to show.11268* @param items A set of items that will be rendered as actions in the message.11269* @returns A thenable that resolves to the selected item or `undefined` when being dismissed.11270*/11271export function showInformationMessage<T extends string>(message: string, ...items: T[]): Thenable<T | undefined>;1127211273/**11274* Show an information message to users. Optionally provide an array of items which will be presented as11275* clickable buttons.11276*11277* @param message The message to show.11278* @param options Configures the behaviour of the message.11279* @param items A set of items that will be rendered as actions in the message.11280* @returns A thenable that resolves to the selected item or `undefined` when being dismissed.11281*/11282export function showInformationMessage<T extends string>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>;1128311284/**11285* Show an information message.11286*11287* @see {@link window.showInformationMessage showInformationMessage}11288*11289* @param message The message to show.11290* @param items A set of items that will be rendered as actions in the message.11291* @returns A thenable that resolves to the selected item or `undefined` when being dismissed.11292*/11293export function showInformationMessage<T extends MessageItem>(message: string, ...items: T[]): Thenable<T | undefined>;1129411295/**11296* Show an information message.11297*11298* @see {@link window.showInformationMessage showInformationMessage}11299*11300* @param message The message to show.11301* @param options Configures the behaviour of the message.11302* @param items A set of items that will be rendered as actions in the message.11303* @returns A thenable that resolves to the selected item or `undefined` when being dismissed.11304*/11305export function showInformationMessage<T extends MessageItem>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>;1130611307/**11308* Show a warning message.11309*11310* @see {@link window.showInformationMessage showInformationMessage}11311*11312* @param message The message to show.11313* @param items A set of items that will be rendered as actions in the message.11314* @returns A thenable that resolves to the selected item or `undefined` when being dismissed.11315*/11316export function showWarningMessage<T extends string>(message: string, ...items: T[]): Thenable<T | undefined>;1131711318/**11319* Show a warning message.11320*11321* @see {@link window.showInformationMessage showInformationMessage}11322*11323* @param message The message to show.11324* @param options Configures the behaviour of the message.11325* @param items A set of items that will be rendered as actions in the message.11326* @returns A thenable that resolves to the selected item or `undefined` when being dismissed.11327*/11328export function showWarningMessage<T extends string>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>;1132911330/**11331* Show a warning message.11332*11333* @see {@link window.showInformationMessage showInformationMessage}11334*11335* @param message The message to show.11336* @param items A set of items that will be rendered as actions in the message.11337* @returns A thenable that resolves to the selected item or `undefined` when being dismissed.11338*/11339export function showWarningMessage<T extends MessageItem>(message: string, ...items: T[]): Thenable<T | undefined>;1134011341/**11342* Show a warning message.11343*11344* @see {@link window.showInformationMessage showInformationMessage}11345*11346* @param message The message to show.11347* @param options Configures the behaviour of the message.11348* @param items A set of items that will be rendered as actions in the message.11349* @returns A thenable that resolves to the selected item or `undefined` when being dismissed.11350*/11351export function showWarningMessage<T extends MessageItem>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>;1135211353/**11354* Show an error message.11355*11356* @see {@link window.showInformationMessage showInformationMessage}11357*11358* @param message The message to show.11359* @param items A set of items that will be rendered as actions in the message.11360* @returns A thenable that resolves to the selected item or `undefined` when being dismissed.11361*/11362export function showErrorMessage<T extends string>(message: string, ...items: T[]): Thenable<T | undefined>;1136311364/**11365* Show an error message.11366*11367* @see {@link window.showInformationMessage showInformationMessage}11368*11369* @param message The message to show.11370* @param options Configures the behaviour of the message.11371* @param items A set of items that will be rendered as actions in the message.11372* @returns A thenable that resolves to the selected item or `undefined` when being dismissed.11373*/11374export function showErrorMessage<T extends string>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>;1137511376/**11377* Show an error message.11378*11379* @see {@link window.showInformationMessage showInformationMessage}11380*11381* @param message The message to show.11382* @param items A set of items that will be rendered as actions in the message.11383* @returns A thenable that resolves to the selected item or `undefined` when being dismissed.11384*/11385export function showErrorMessage<T extends MessageItem>(message: string, ...items: T[]): Thenable<T | undefined>;1138611387/**11388* Show an error message.11389*11390* @see {@link window.showInformationMessage showInformationMessage}11391*11392* @param message The message to show.11393* @param options Configures the behaviour of the message.11394* @param items A set of items that will be rendered as actions in the message.11395* @returns A thenable that resolves to the selected item or `undefined` when being dismissed.11396*/11397export function showErrorMessage<T extends MessageItem>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>;1139811399/**11400* Shows a selection list allowing multiple selections.11401*11402* @param items An array of strings, or a promise that resolves to an array of strings.11403* @param options Configures the behavior of the selection list.11404* @param token A token that can be used to signal cancellation.11405* @returns A thenable that resolves to the selected items or `undefined`.11406*/11407export function showQuickPick(items: readonly string[] | Thenable<readonly string[]>, options: QuickPickOptions & { /** literal-type defines return type */canPickMany: true }, token?: CancellationToken): Thenable<string[] | undefined>;1140811409/**11410* Shows a selection list.11411*11412* @param items An array of strings, or a promise that resolves to an array of strings.11413* @param options Configures the behavior of the selection list.11414* @param token A token that can be used to signal cancellation.11415* @returns A thenable that resolves to the selected string or `undefined`.11416*/11417export function showQuickPick(items: readonly string[] | Thenable<readonly string[]>, options?: QuickPickOptions, token?: CancellationToken): Thenable<string | undefined>;1141811419/**11420* Shows a selection list allowing multiple selections.11421*11422* @param items An array of items, or a promise that resolves to an array of items.11423* @param options Configures the behavior of the selection list.11424* @param token A token that can be used to signal cancellation.11425* @returns A thenable that resolves to the selected items or `undefined`.11426*/11427export function showQuickPick<T extends QuickPickItem>(items: readonly T[] | Thenable<readonly T[]>, options: QuickPickOptions & { /** literal-type defines return type */ canPickMany: true }, token?: CancellationToken): Thenable<T[] | undefined>;1142811429/**11430* Shows a selection list.11431*11432* @param items An array of items, or a promise that resolves to an array of items.11433* @param options Configures the behavior of the selection list.11434* @param token A token that can be used to signal cancellation.11435* @returns A thenable that resolves to the selected item or `undefined`.11436*/11437export function showQuickPick<T extends QuickPickItem>(items: readonly T[] | Thenable<readonly T[]>, options?: QuickPickOptions, token?: CancellationToken): Thenable<T | undefined>;1143811439/**11440* Shows a selection list of {@link workspace.workspaceFolders workspace folders} to pick from.11441* Returns `undefined` if no folder is open.11442*11443* @param options Configures the behavior of the workspace folder list.11444* @returns A promise that resolves to the workspace folder or `undefined`.11445*/11446export function showWorkspaceFolderPick(options?: WorkspaceFolderPickOptions): Thenable<WorkspaceFolder | undefined>;1144711448/**11449* Shows a file open dialog to the user which allows to select a file11450* for opening-purposes.11451*11452* @param options Options that control the dialog.11453* @returns A promise that resolves to the selected resources or `undefined`.11454*/11455export function showOpenDialog(options?: OpenDialogOptions): Thenable<Uri[] | undefined>;1145611457/**11458* Shows a file save dialog to the user which allows to select a file11459* for saving-purposes.11460*11461* @param options Options that control the dialog.11462* @returns A promise that resolves to the selected resource or `undefined`.11463*/11464export function showSaveDialog(options?: SaveDialogOptions): Thenable<Uri | undefined>;1146511466/**11467* Opens an input box to ask the user for input.11468*11469* The returned value will be `undefined` if the input box was canceled (e.g., pressing ESC). Otherwise the11470* returned value will be the string typed by the user or an empty string if the user did not type11471* anything but dismissed the input box with OK.11472*11473* @param options Configures the behavior of the input box.11474* @param token A token that can be used to signal cancellation.11475* @returns A thenable that resolves to a string the user provided or to `undefined` in case of dismissal.11476*/11477export function showInputBox(options?: InputBoxOptions, token?: CancellationToken): Thenable<string | undefined>;1147811479/**11480* Creates a {@link QuickPick} to let the user pick an item from a list of items of type `T`.11481*11482* Note that in many cases the more convenient {@link window.showQuickPick} is easier to use.11483* {@link window.createQuickPick} should be used when {@link window.showQuickPick} does not offer11484* the required flexibility.11485*11486* @returns A new {@link QuickPick}.11487*/11488export function createQuickPick<T extends QuickPickItem>(): QuickPick<T>;1148911490/**11491* Creates a {@link InputBox} to let the user enter some text input.11492*11493* Note that in many cases the more convenient {@link window.showInputBox} is easier to use.11494* {@link window.createInputBox} should be used when {@link window.showInputBox} does not offer11495* the required flexibility.11496*11497* @returns A new {@link InputBox}.11498*/11499export function createInputBox(): InputBox;1150011501/**11502* Creates a new {@link OutputChannel output channel} with the given name and language id11503* If language id is not provided, then **Log** is used as default language id.11504*11505* You can access the visible or active output channel as a {@link TextDocument text document} from {@link window.visibleTextEditors visible editors} or {@link window.activeTextEditor active editor}11506* and use the language id to contribute language features like syntax coloring, code lens etc.,11507*11508* @param name Human-readable string which will be used to represent the channel in the UI.11509* @param languageId The identifier of the language associated with the channel.11510* @returns A new output channel.11511*/11512export function createOutputChannel(name: string, languageId?: string): OutputChannel;1151311514/**11515* Creates a new {@link LogOutputChannel log output channel} with the given name.11516*11517* @param name Human-readable string which will be used to represent the channel in the UI.11518* @param options Options for the log output channel.11519* @returns A new log output channel.11520*/11521export function createOutputChannel(name: string, options: { /** literal-type defines return type */log: true }): LogOutputChannel;1152211523/**11524* Create and show a new webview panel.11525*11526* @param viewType Identifies the type of the webview panel.11527* @param title Title of the panel.11528* @param showOptions Where to show the webview in the editor. If preserveFocus is set, the new webview will not take focus.11529* @param options Settings for the new panel.11530*11531* @returns New webview panel.11532*/11533export function createWebviewPanel(viewType: string, title: string, showOptions: ViewColumn | {11534/**11535* The view column in which the {@link WebviewPanel} should be shown.11536*/11537readonly viewColumn: ViewColumn;11538/**11539* An optional flag that when `true` will stop the panel from taking focus.11540*/11541readonly preserveFocus?: boolean;11542}, options?: WebviewPanelOptions & WebviewOptions): WebviewPanel;1154311544/**11545* Set a message to the status bar. This is a short hand for the more powerful11546* status bar {@link window.createStatusBarItem items}.11547*11548* @param text The message to show, supports icon substitution as in status bar {@link StatusBarItem.text items}.11549* @param hideAfterTimeout Timeout in milliseconds after which the message will be disposed.11550* @returns A disposable which hides the status bar message.11551*/11552export function setStatusBarMessage(text: string, hideAfterTimeout: number): Disposable;1155311554/**11555* Set a message to the status bar. This is a short hand for the more powerful11556* status bar {@link window.createStatusBarItem items}.11557*11558* @param text The message to show, supports icon substitution as in status bar {@link StatusBarItem.text items}.11559* @param hideWhenDone Thenable on which completion (resolve or reject) the message will be disposed.11560* @returns A disposable which hides the status bar message.11561*/11562export function setStatusBarMessage(text: string, hideWhenDone: Thenable<any>): Disposable;1156311564/**11565* Set a message to the status bar. This is a short hand for the more powerful11566* status bar {@link window.createStatusBarItem items}.11567*11568* *Note* that status bar messages stack and that they must be disposed when no11569* longer used.11570*11571* @param text The message to show, supports icon substitution as in status bar {@link StatusBarItem.text items}.11572* @returns A disposable which hides the status bar message.11573*/11574export function setStatusBarMessage(text: string): Disposable;1157511576/**11577* Show progress in the Source Control viewlet while running the given callback and while11578* its returned promise isn't resolve or rejected.11579*11580* @deprecated Use `withProgress` instead.11581*11582* @param task A callback returning a promise. Progress increments can be reported with11583* the provided {@link Progress}-object.11584* @returns The thenable the task did return.11585*/11586export function withScmProgress<R>(task: (progress: Progress<number>) => Thenable<R>): Thenable<R>;1158711588/**11589* Show progress in the editor. Progress is shown while running the given callback11590* and while the promise it returned isn't resolved nor rejected. The location at which11591* progress should show (and other details) is defined via the passed {@linkcode ProgressOptions}.11592*11593* @param options A {@linkcode ProgressOptions}-object describing the options to use for showing progress, like its location11594* @param task A callback returning a promise. Progress state can be reported with11595* the provided {@link Progress}-object.11596*11597* To report discrete progress, use `increment` to indicate how much work has been completed. Each call with11598* a `increment` value will be summed up and reflected as overall progress until 100% is reached (a value of11599* e.g. `10` accounts for `10%` of work done).11600* Note that currently only `ProgressLocation.Notification` is capable of showing discrete progress.11601*11602* To monitor if the operation has been cancelled by the user, use the provided {@linkcode CancellationToken}.11603* Note that currently only `ProgressLocation.Notification` is supporting to show a cancel button to cancel the11604* long running operation.11605*11606* @returns The thenable the task-callback returned.11607*/11608export function withProgress<R>(options: ProgressOptions, task: (progress: Progress<{11609/**11610* A progress message that represents a chunk of work11611*/11612message?: string;11613/**11614* An increment for discrete progress. Increments will be summed up until 100% is reached11615*/11616increment?: number;11617}>, token: CancellationToken) => Thenable<R>): Thenable<R>;1161811619/**11620* Creates a status bar {@link StatusBarItem item}.11621*11622* @param id The identifier of the item. Must be unique within the extension.11623* @param alignment The alignment of the item.11624* @param priority The priority of the item. Higher values mean the item should be shown more to the left.11625* @returns A new status bar item.11626*/11627export function createStatusBarItem(id: string, alignment?: StatusBarAlignment, priority?: number): StatusBarItem;1162811629/**11630* Creates a status bar {@link StatusBarItem item}.11631*11632* @see {@link createStatusBarItem} for creating a status bar item with an identifier.11633* @param alignment The alignment of the item.11634* @param priority The priority of the item. Higher values mean the item should be shown more to the left.11635* @returns A new status bar item.11636*/11637export function createStatusBarItem(alignment?: StatusBarAlignment, priority?: number): StatusBarItem;1163811639/**11640* Creates a {@link Terminal} with a backing shell process. The cwd of the terminal will be the workspace11641* directory if it exists.11642*11643* @param name Optional human-readable string which will be used to represent the terminal in the UI.11644* @param shellPath Optional path to a custom shell executable to be used in the terminal.11645* @param shellArgs Optional args for the custom shell executable. A string can be used on Windows only which11646* allows specifying shell args in11647* [command-line format](https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6).11648* @returns A new Terminal.11649* @throws When running in an environment where a new process cannot be started.11650*/11651export function createTerminal(name?: string, shellPath?: string, shellArgs?: readonly string[] | string): Terminal;1165211653/**11654* Creates a {@link Terminal} with a backing shell process.11655*11656* @param options A TerminalOptions object describing the characteristics of the new terminal.11657* @returns A new Terminal.11658* @throws When running in an environment where a new process cannot be started.11659*/11660export function createTerminal(options: TerminalOptions): Terminal;1166111662/**11663* Creates a {@link Terminal} where an extension controls its input and output.11664*11665* @param options An {@link ExtensionTerminalOptions} object describing11666* the characteristics of the new terminal.11667* @returns A new Terminal.11668*/11669export function createTerminal(options: ExtensionTerminalOptions): Terminal;1167011671/**11672* Register a {@link TreeDataProvider} for the view contributed using the extension point `views`.11673* This will allow you to contribute data to the {@link TreeView} and update if the data changes.11674*11675* **Note:** To get access to the {@link TreeView} and perform operations on it, use {@link window.createTreeView createTreeView}.11676*11677* @param viewId Id of the view contributed using the extension point `views`.11678* @param treeDataProvider A {@link TreeDataProvider} that provides tree data for the view11679* @returns A {@link Disposable disposable} that unregisters the {@link TreeDataProvider}.11680*/11681export function registerTreeDataProvider<T>(viewId: string, treeDataProvider: TreeDataProvider<T>): Disposable;1168211683/**11684* Create a {@link TreeView} for the view contributed using the extension point `views`.11685* @param viewId Id of the view contributed using the extension point `views`.11686* @param options Options for creating the {@link TreeView}11687* @returns a {@link TreeView}.11688*/11689export function createTreeView<T>(viewId: string, options: TreeViewOptions<T>): TreeView<T>;1169011691/**11692* Registers a {@link UriHandler uri handler} capable of handling system-wide {@link Uri uris}.11693* In case there are multiple windows open, the topmost window will handle the uri.11694* A uri handler is scoped to the extension it is contributed from; it will only11695* be able to handle uris which are directed to the extension itself. A uri must respect11696* the following rules:11697*11698* - The uri-scheme must be `vscode.env.uriScheme`;11699* - The uri-authority must be the extension id (e.g. `my.extension`);11700* - The uri-path, -query and -fragment parts are arbitrary.11701*11702* For example, if the `my.extension` extension registers a uri handler, it will only11703* be allowed to handle uris with the prefix `product-name://my.extension`.11704*11705* An extension can only register a single uri handler in its entire activation lifetime.11706*11707* * *Note:* There is an activation event `onUri` that fires when a uri directed for11708* the current extension is about to be handled.11709*11710* @param handler The uri handler to register for this extension.11711* @returns A {@link Disposable disposable} that unregisters the handler.11712*/11713export function registerUriHandler(handler: UriHandler): Disposable;1171411715/**11716* Registers a webview panel serializer.11717*11718* Extensions that support reviving should have an `"onWebviewPanel:viewType"` activation event and11719* make sure that `registerWebviewPanelSerializer` is called during activation.11720*11721* Only a single serializer may be registered at a time for a given `viewType`.11722*11723* @param viewType Type of the webview panel that can be serialized.11724* @param serializer Webview serializer.11725* @returns A {@link Disposable disposable} that unregisters the serializer.11726*/11727export function registerWebviewPanelSerializer(viewType: string, serializer: WebviewPanelSerializer): Disposable;1172811729/**11730* Register a new provider for webview views.11731*11732* @param viewId Unique id of the view. This should match the `id` from the11733* `views` contribution in the package.json.11734* @param provider Provider for the webview views.11735*11736* @returns Disposable that unregisters the provider.11737*/11738export function registerWebviewViewProvider(viewId: string, provider: WebviewViewProvider, options?: {11739/**11740* Content settings for the webview created for this view.11741*/11742readonly webviewOptions?: {11743/**11744* Controls if the webview element itself (iframe) is kept around even when the view11745* is no longer visible.11746*11747* Normally the webview's html context is created when the view becomes visible11748* and destroyed when it is hidden. Extensions that have complex state11749* or UI can set the `retainContextWhenHidden` to make the editor keep the webview11750* context around, even when the webview moves to a background tab. When a webview using11751* `retainContextWhenHidden` becomes hidden, its scripts and other dynamic content are suspended.11752* When the view becomes visible again, the context is automatically restored11753* in the exact same state it was in originally. You cannot send messages to a11754* hidden webview, even with `retainContextWhenHidden` enabled.11755*11756* `retainContextWhenHidden` has a high memory overhead and should only be used if11757* your view's context cannot be quickly saved and restored.11758*/11759readonly retainContextWhenHidden?: boolean;11760};11761}): Disposable;1176211763/**11764* Register a provider for custom editors for the `viewType` contributed by the `customEditors` extension point.11765*11766* When a custom editor is opened, an `onCustomEditor:viewType` activation event is fired. Your extension11767* must register a {@linkcode CustomTextEditorProvider}, {@linkcode CustomReadonlyEditorProvider},11768* {@linkcode CustomEditorProvider}for `viewType` as part of activation.11769*11770* @param viewType Unique identifier for the custom editor provider. This should match the `viewType` from the11771* `customEditors` contribution point.11772* @param provider Provider that resolves custom editors.11773* @param options Options for the provider.11774*11775* @returns Disposable that unregisters the provider.11776*/11777export function registerCustomEditorProvider(viewType: string, provider: CustomTextEditorProvider | CustomReadonlyEditorProvider | CustomEditorProvider, options?: {11778/**11779* Content settings for the webview panels created for this custom editor.11780*/11781readonly webviewOptions?: WebviewPanelOptions;1178211783/**11784* Only applies to `CustomReadonlyEditorProvider | CustomEditorProvider`.11785*11786* Indicates that the provider allows multiple editor instances to be open at the same time for11787* the same resource.11788*11789* By default, the editor only allows one editor instance to be open at a time for each resource. If the11790* user tries to open a second editor instance for the resource, the first one is instead moved to where11791* the second one was to be opened.11792*11793* When `supportsMultipleEditorsPerDocument` is enabled, users can split and create copies of the custom11794* editor. In this case, the custom editor must make sure it can properly synchronize the states of all11795* editor instances for a resource so that they are consistent.11796*/11797readonly supportsMultipleEditorsPerDocument?: boolean;11798}): Disposable;1179911800/**11801* Register provider that enables the detection and handling of links within the terminal.11802* @param provider The provider that provides the terminal links.11803* @returns Disposable that unregisters the provider.11804*/11805export function registerTerminalLinkProvider(provider: TerminalLinkProvider): Disposable;1180611807/**11808* Registers a provider for a contributed terminal profile.11809*11810* @param id The ID of the contributed terminal profile.11811* @param provider The terminal profile provider.11812* @returns A {@link Disposable disposable} that unregisters the provider.11813*/11814export function registerTerminalProfileProvider(id: string, provider: TerminalProfileProvider): Disposable;11815/**11816* Register a file decoration provider.11817*11818* @param provider A {@link FileDecorationProvider}.11819* @returns A {@link Disposable} that unregisters the provider.11820*/11821export function registerFileDecorationProvider(provider: FileDecorationProvider): Disposable;1182211823/**11824* The currently active color theme as configured in the settings. The active11825* theme can be changed via the `workbench.colorTheme` setting.11826*/11827export let activeColorTheme: ColorTheme;1182811829/**11830* An {@link Event} which fires when the active color theme is changed or has changes.11831*/11832export const onDidChangeActiveColorTheme: Event<ColorTheme>;11833}1183411835/**11836* Options for creating a {@link TreeView}11837*/11838export interface TreeViewOptions<T> {1183911840/**11841* A data provider that provides tree data.11842*/11843treeDataProvider: TreeDataProvider<T>;1184411845/**11846* Whether to show collapse all action or not.11847*/11848showCollapseAll?: boolean;1184911850/**11851* Whether the tree supports multi-select. When the tree supports multi-select and a command is executed from the tree,11852* the first argument to the command is the tree item that the command was executed on and the second argument is an11853* array containing all selected tree items.11854*/11855canSelectMany?: boolean;1185611857/**11858* An optional interface to implement drag and drop in the tree view.11859*/11860dragAndDropController?: TreeDragAndDropController<T>;1186111862/**11863* By default, when the children of a tree item have already been fetched, child checkboxes are automatically managed based on the checked state of the parent tree item.11864* If the tree item is collapsed by default (meaning that the children haven't yet been fetched) then child checkboxes will not be updated.11865* To override this behavior and manage child and parent checkbox state in the extension, set this to `true`.11866*11867* Examples where {@link TreeViewOptions.manageCheckboxStateManually} is false, the default behavior:11868*11869* 1. A tree item is checked, then its children are fetched. The children will be checked.11870*11871* 2. A tree item's parent is checked. The tree item and all of it's siblings will be checked.11872* - [ ] Parent11873* - [ ] Child 111874* - [ ] Child 211875* When the user checks Parent, the tree will look like this:11876* - [x] Parent11877* - [x] Child 111878* - [x] Child 211879*11880* 3. A tree item and all of it's siblings are checked. The parent will be checked.11881* - [ ] Parent11882* - [ ] Child 111883* - [ ] Child 211884* When the user checks Child 1 and Child 2, the tree will look like this:11885* - [x] Parent11886* - [x] Child 111887* - [x] Child 211888*11889* 4. A tree item is unchecked. The parent will be unchecked.11890* - [x] Parent11891* - [x] Child 111892* - [x] Child 211893* When the user unchecks Child 1, the tree will look like this:11894* - [ ] Parent11895* - [ ] Child 111896* - [x] Child 211897*/11898manageCheckboxStateManually?: boolean;11899}1190011901/**11902* The event that is fired when an element in the {@link TreeView} is expanded or collapsed11903*/11904export interface TreeViewExpansionEvent<T> {1190511906/**11907* Element that is expanded or collapsed.11908*/11909readonly element: T;1191011911}1191211913/**11914* The event that is fired when there is a change in {@link TreeView.selection tree view's selection}11915*/11916export interface TreeViewSelectionChangeEvent<T> {1191711918/**11919* Selected elements.11920*/11921readonly selection: readonly T[];1192211923}1192411925/**11926* The event that is fired when there is a change in {@link TreeView.visible tree view's visibility}11927*/11928export interface TreeViewVisibilityChangeEvent {1192911930/**11931* `true` if the {@link TreeView tree view} is visible otherwise `false`.11932*/11933readonly visible: boolean;11934}1193511936/**11937* A file associated with a {@linkcode DataTransferItem}.11938*11939* Instances of this type can only be created by the editor and not by extensions.11940*/11941export interface DataTransferFile {11942/**11943* The name of the file.11944*/11945readonly name: string;1194611947/**11948* The full file path of the file.11949*11950* May be `undefined` on web.11951*/11952readonly uri?: Uri;1195311954/**11955* The full file contents of the file.11956*/11957data(): Thenable<Uint8Array>;11958}1195911960/**11961* Encapsulates data transferred during drag and drop operations.11962*/11963export class DataTransferItem {11964/**11965* Get a string representation of this item.11966*11967* If {@linkcode DataTransferItem.value} is an object, this returns the result of json stringifying {@linkcode DataTransferItem.value} value.11968*/11969asString(): Thenable<string>;1197011971/**11972* Try getting the {@link DataTransferFile file} associated with this data transfer item.11973*11974* Note that the file object is only valid for the scope of the drag and drop operation.11975*11976* @returns The file for the data transfer or `undefined` if the item is either not a file or the11977* file data cannot be accessed.11978*/11979asFile(): DataTransferFile | undefined;1198011981/**11982* Custom data stored on this item.11983*11984* You can use `value` to share data across operations. The original object can be retrieved so long as the extension that11985* created the `DataTransferItem` runs in the same extension host.11986*/11987readonly value: any;1198811989/**11990* @param value Custom data stored on this item. Can be retrieved using {@linkcode DataTransferItem.value}.11991*/11992constructor(value: any);11993}1199411995/**11996* A map containing a mapping of the mime type of the corresponding transferred data.11997*11998* Drag and drop controllers that implement {@link TreeDragAndDropController.handleDrag `handleDrag`} can add additional mime types to the11999* data transfer. These additional mime types will only be included in the `handleDrop` when the drag was initiated from12000* an element in the same drag and drop controller.12001*/12002export class DataTransfer implements Iterable<[mimeType: string, item: DataTransferItem]> {12003/**12004* Retrieves the data transfer item for a given mime type.12005*12006* @param mimeType The mime type to get the data transfer item for, such as `text/plain` or `image/png`.12007* Mimes type look ups are case-insensitive.12008*12009* Special mime types:12010* - `text/uri-list` — A string with `toString()`ed Uris separated by `\r\n`. To specify a cursor position in the file,12011* set the Uri's fragment to `L3,5`, where 3 is the line number and 5 is the column number.12012*/12013get(mimeType: string): DataTransferItem | undefined;1201412015/**12016* Sets a mime type to data transfer item mapping.12017*12018* @param mimeType The mime type to set the data for. Mimes types stored in lower case, with case-insensitive looks up.12019* @param value The data transfer item for the given mime type.12020*/12021set(mimeType: string, value: DataTransferItem): void;1202212023/**12024* Allows iteration through the data transfer items.12025*12026* @param callbackfn Callback for iteration through the data transfer items.12027* @param thisArg The `this` context used when invoking the handler function.12028*/12029forEach(callbackfn: (item: DataTransferItem, mimeType: string, dataTransfer: DataTransfer) => void, thisArg?: any): void;1203012031/**12032* Get a new iterator with the `[mime, item]` pairs for each element in this data transfer.12033*/12034[Symbol.iterator](): IterableIterator<[mimeType: string, item: DataTransferItem]>;12035}1203612037/**12038* Provides support for drag and drop in `TreeView`.12039*/12040export interface TreeDragAndDropController<T> {1204112042/**12043* The mime types that the {@link TreeDragAndDropController.handleDrop `handleDrop`} method of this `DragAndDropController` supports.12044* This could be well-defined, existing, mime types, and also mime types defined by the extension.12045*12046* To support drops from trees, you will need to add the mime type of that tree.12047* This includes drops from within the same tree.12048* The mime type of a tree is recommended to be of the format `application/vnd.code.tree.<treeidlowercase>`.12049*12050* Use the special `files` mime type to support all types of dropped files {@link DataTransferFile files}, regardless of the file's actual mime type.12051*12052* To learn the mime type of a dragged item:12053* 1. Set up your `DragAndDropController`12054* 2. Use the Developer: Set Log Level... command to set the level to "Debug"12055* 3. Open the developer tools and drag the item with unknown mime type over your tree. The mime types will be logged to the developer console12056*12057* Note that mime types that cannot be sent to the extension will be omitted.12058*/12059readonly dropMimeTypes: readonly string[];1206012061/**12062* The mime types that the {@link TreeDragAndDropController.handleDrag `handleDrag`} method of this `TreeDragAndDropController` may add to the tree data transfer.12063* This could be well-defined, existing, mime types, and also mime types defined by the extension.12064*12065* The recommended mime type of the tree (`application/vnd.code.tree.<treeidlowercase>`) will be automatically added.12066*/12067readonly dragMimeTypes: readonly string[];1206812069/**12070* When the user starts dragging items from this `DragAndDropController`, `handleDrag` will be called.12071* Extensions can use `handleDrag` to add their {@link DataTransferItem `DataTransferItem`} items to the drag and drop.12072*12073* Mime types added in `handleDrag` won't be available outside the application.12074*12075* When the items are dropped on **another tree item** in **the same tree**, your `DataTransferItem` objects12076* will be preserved. Use the recommended mime type for the tree (`application/vnd.code.tree.<treeidlowercase>`) to add12077* tree objects in a data transfer. See the documentation for `DataTransferItem` for how best to take advantage of this.12078*12079* To add a data transfer item that can be dragged into the editor, use the application specific mime type "text/uri-list".12080* The data for "text/uri-list" should be a string with `toString()`ed Uris separated by `\r\n`. To specify a cursor position in the file,12081* set the Uri's fragment to `L3,5`, where 3 is the line number and 5 is the column number.12082*12083* @param source The source items for the drag and drop operation.12084* @param dataTransfer The data transfer associated with this drag.12085* @param token A cancellation token indicating that drag has been cancelled.12086*/12087handleDrag?(source: readonly T[], dataTransfer: DataTransfer, token: CancellationToken): Thenable<void> | void;1208812089/**12090* Called when a drag and drop action results in a drop on the tree that this `DragAndDropController` belongs to.12091*12092* Extensions should fire {@link TreeDataProvider.onDidChangeTreeData onDidChangeTreeData} for any elements that need to be refreshed.12093*12094* @param target The target tree element that the drop is occurring on. When undefined, the target is the root.12095* @param dataTransfer The data transfer items of the source of the drag.12096* @param token A cancellation token indicating that the drop has been cancelled.12097*/12098handleDrop?(target: T | undefined, dataTransfer: DataTransfer, token: CancellationToken): Thenable<void> | void;12099}1210012101/**12102* A badge presenting a value for a view12103*/12104export interface ViewBadge {1210512106/**12107* A label to present in tooltip for the badge.12108*/12109readonly tooltip: string;1211012111/**12112* The value to present in the badge.12113*/12114readonly value: number;12115}1211612117/**12118* An event describing the change in a tree item's checkbox state.12119*/12120export interface TreeCheckboxChangeEvent<T> {12121/**12122* The items that were checked or unchecked.12123*/12124readonly items: ReadonlyArray<[T, TreeItemCheckboxState]>;12125}1212612127/**12128* Represents a Tree view12129*/12130export interface TreeView<T> extends Disposable {1213112132/**12133* Event that is fired when an element is expanded12134*/12135readonly onDidExpandElement: Event<TreeViewExpansionEvent<T>>;1213612137/**12138* Event that is fired when an element is collapsed12139*/12140readonly onDidCollapseElement: Event<TreeViewExpansionEvent<T>>;1214112142/**12143* Currently selected elements.12144*/12145readonly selection: readonly T[];1214612147/**12148* Event that is fired when the {@link TreeView.selection selection} has changed12149*/12150readonly onDidChangeSelection: Event<TreeViewSelectionChangeEvent<T>>;1215112152/**12153* `true` if the {@link TreeView tree view} is visible otherwise `false`.12154*/12155readonly visible: boolean;1215612157/**12158* Event that is fired when {@link TreeView.visible visibility} has changed12159*/12160readonly onDidChangeVisibility: Event<TreeViewVisibilityChangeEvent>;1216112162/**12163* An event to signal that an element or root has either been checked or unchecked.12164*/12165readonly onDidChangeCheckboxState: Event<TreeCheckboxChangeEvent<T>>;1216612167/**12168* An optional human-readable message that will be rendered in the view.12169* Setting the message to null, undefined, or empty string will remove the message from the view.12170*/12171message?: string;1217212173/**12174* The tree view title is initially taken from the extension package.json12175* Changes to the title property will be properly reflected in the UI in the title of the view.12176*/12177title?: string;1217812179/**12180* An optional human-readable description which is rendered less prominently in the title of the view.12181* Setting the title description to null, undefined, or empty string will remove the description from the view.12182*/12183description?: string;1218412185/**12186* The badge to display for this TreeView.12187* To remove the badge, set to undefined.12188*/12189badge?: ViewBadge | undefined;1219012191/**12192* Reveals the given element in the tree view.12193* If the tree view is not visible then the tree view is shown and element is revealed.12194*12195* By default revealed element is selected.12196* In order to not to select, set the option `select` to `false`.12197* In order to focus, set the option `focus` to `true`.12198* In order to expand the revealed element, set the option `expand` to `true`. To expand recursively set `expand` to the number of levels to expand.12199*12200* * *NOTE:* You can expand only to 3 levels maximum.12201* * *NOTE:* The {@link TreeDataProvider} that the `TreeView` {@link window.createTreeView is registered with} with must implement {@link TreeDataProvider.getParent getParent} method to access this API.12202*/12203reveal(element: T, options?: {12204/**12205* If true, then the element will be selected.12206*/12207readonly select?: boolean;12208/**12209* If true, then the element will be focused.12210*/12211readonly focus?: boolean;12212/**12213* If true, then the element will be expanded. If a number is passed, then up to that number of levels of children will be expanded12214*/12215readonly expand?: boolean | number;12216}): Thenable<void>;12217}1221812219/**12220* A data provider that provides tree data12221*/12222export interface TreeDataProvider<T> {12223/**12224* An optional event to signal that an element or root has changed.12225* This will trigger the view to update the changed element/root and its children recursively (if shown).12226* To signal that root has changed, do not pass any argument or pass `undefined` or `null`.12227*/12228onDidChangeTreeData?: Event<T | T[] | undefined | null | void>;1222912230/**12231* Get {@link TreeItem} representation of the `element`12232*12233* @param element The element for which {@link TreeItem} representation is asked for.12234* @returns TreeItem representation of the element.12235*/12236getTreeItem(element: T): TreeItem | Thenable<TreeItem>;1223712238/**12239* Get the children of `element` or root if no element is passed.12240*12241* @param element The element from which the provider gets children. Can be `undefined`.12242* @returns Children of `element` or root if no element is passed.12243*/12244getChildren(element?: T): ProviderResult<T[]>;1224512246/**12247* Optional method to return the parent of `element`.12248* Return `null` or `undefined` if `element` is a child of root.12249*12250* **NOTE:** This method should be implemented in order to access {@link TreeView.reveal reveal} API.12251*12252* @param element The element for which the parent has to be returned.12253* @returns Parent of `element`.12254*/12255getParent?(element: T): ProviderResult<T>;1225612257/**12258* Called on hover to resolve the {@link TreeItem.tooltip TreeItem} property if it is undefined.12259* Called on tree item click/open to resolve the {@link TreeItem.command TreeItem} property if it is undefined.12260* Only properties that were undefined can be resolved in `resolveTreeItem`.12261* Functionality may be expanded later to include being called to resolve other missing12262* properties on selection and/or on open.12263*12264* Will only ever be called once per TreeItem.12265*12266* onDidChangeTreeData should not be triggered from within resolveTreeItem.12267*12268* *Note* that this function is called when tree items are already showing in the UI.12269* Because of that, no property that changes the presentation (label, description, etc.)12270* can be changed.12271*12272* @param item Undefined properties of `item` should be set then `item` should be returned.12273* @param element The object associated with the TreeItem.12274* @param token A cancellation token.12275* @returns The resolved tree item or a thenable that resolves to such. It is OK to return the given12276* `item`. When no result is returned, the given `item` will be used.12277*/12278resolveTreeItem?(item: TreeItem, element: T, token: CancellationToken): ProviderResult<TreeItem>;12279}1228012281/**12282* A tree item is an UI element of the tree. Tree items are created by the {@link TreeDataProvider data provider}.12283*/12284export class TreeItem {12285/**12286* A human-readable string describing this item. When `falsy`, it is derived from {@link TreeItem.resourceUri resourceUri}.12287*/12288label?: string | TreeItemLabel;1228912290/**12291* Optional id for the tree item that has to be unique across tree. The id is used to preserve the selection and expansion state of the tree item.12292*12293* If not provided, an id is generated using the tree item's label. **Note** that when labels change, ids will change and that selection and expansion state cannot be kept stable anymore.12294*/12295id?: string;1229612297/**12298* The icon path or {@link ThemeIcon} for the tree item.12299* When `falsy`, {@link ThemeIcon.Folder Folder Theme Icon} is assigned, if item is collapsible otherwise {@link ThemeIcon.File File Theme Icon}.12300* When a file or folder {@link ThemeIcon} is specified, icon is derived from the current file icon theme for the specified theme icon using {@link TreeItem.resourceUri resourceUri} (if provided).12301*/12302iconPath?: string | IconPath;1230312304/**12305* A human-readable string which is rendered less prominent.12306* When `true`, it is derived from {@link TreeItem.resourceUri resourceUri} and when `falsy`, it is not shown.12307*/12308description?: string | boolean;1230912310/**12311* A {@link Uri} representing the resource associated with this item.12312*12313* When set, this property is used to automatically derive several item properties if they are not explicitly provided:12314* - **Label**: Derived from the resource's file name when {@link TreeItem.label label} is not provided.12315* - **Description**: Derived from the resource's path when {@link TreeItem.description description} is set to `true`.12316* - **Icon**: Derived from the current file icon theme when {@link TreeItem.iconPath iconPath} is set to12317* {@link ThemeIcon.File} or {@link ThemeIcon.Folder}.12318*/12319resourceUri?: Uri;1232012321/**12322* The tooltip text when you hover over this item.12323*/12324tooltip?: string | MarkdownString | undefined;1232512326/**12327* The {@link Command} that should be executed when the tree item is selected.12328*12329* Please use `vscode.open` or `vscode.diff` as command IDs when the tree item is opening12330* something in the editor. Using these commands ensures that the resulting editor will12331* appear consistent with how other built-in trees open editors.12332*/12333command?: Command;1233412335/**12336* {@link TreeItemCollapsibleState} of the tree item.12337*/12338collapsibleState?: TreeItemCollapsibleState;1233912340/**12341* Context value of the tree item. This can be used to contribute item specific actions in the tree.12342* For example, a tree item is given a context value as `folder`. When contributing actions to `view/item/context`12343* using `menus` extension point, you can specify context value for key `viewItem` in `when` expression like `viewItem == folder`.12344* ```json12345* "contributes": {12346* "menus": {12347* "view/item/context": [12348* {12349* "command": "extension.deleteFolder",12350* "when": "viewItem == folder"12351* }12352* ]12353* }12354* }12355* ```12356* This will show action `extension.deleteFolder` only for items with `contextValue` is `folder`.12357*/12358contextValue?: string;1235912360/**12361* Accessibility information used when screen reader interacts with this tree item.12362* Generally, a TreeItem has no need to set the `role` of the accessibilityInformation;12363* however, there are cases where a TreeItem is not displayed in a tree-like way where setting the `role` may make sense.12364*/12365accessibilityInformation?: AccessibilityInformation;1236612367/**12368* {@link TreeItemCheckboxState TreeItemCheckboxState} of the tree item.12369* {@link TreeDataProvider.onDidChangeTreeData onDidChangeTreeData} should be fired when {@link TreeItem.checkboxState checkboxState} changes.12370*/12371checkboxState?: TreeItemCheckboxState | {12372/**12373* The {@link TreeItemCheckboxState} of the tree item12374*/12375readonly state: TreeItemCheckboxState;12376/**12377* A tooltip for the checkbox12378*/12379readonly tooltip?: string;12380/**12381* Accessibility information used when screen readers interact with this checkbox12382*/12383readonly accessibilityInformation?: AccessibilityInformation;12384};1238512386/**12387* @param label A human-readable string describing this item12388* @param collapsibleState {@link TreeItemCollapsibleState} of the tree item. Default is {@link TreeItemCollapsibleState.None}12389*/12390constructor(label: string | TreeItemLabel, collapsibleState?: TreeItemCollapsibleState);1239112392/**12393* @param resourceUri The {@link Uri} of the resource representing this item.12394* @param collapsibleState {@link TreeItemCollapsibleState} of the tree item. Default is {@link TreeItemCollapsibleState.None}12395*/12396constructor(resourceUri: Uri, collapsibleState?: TreeItemCollapsibleState);12397}1239812399/**12400* Collapsible state of the tree item12401*/12402export enum TreeItemCollapsibleState {12403/**12404* Determines an item can be neither collapsed nor expanded. Implies it has no children.12405*/12406None = 0,12407/**12408* Determines an item is collapsed12409*/12410Collapsed = 1,12411/**12412* Determines an item is expanded12413*/12414Expanded = 212415}1241612417/**12418* Label describing the {@link TreeItem Tree item}12419*/12420export interface TreeItemLabel {1242112422/**12423* A human-readable string describing the {@link TreeItem Tree item}.12424*/12425label: string;1242612427/**12428* Ranges in the label to highlight. A range is defined as a tuple of two number where the12429* first is the inclusive start index and the second the exclusive end index12430*/12431highlights?: [number, number][];12432}1243312434/**12435* Checkbox state of the tree item12436*/12437export enum TreeItemCheckboxState {12438/**12439* Determines an item is unchecked12440*/12441Unchecked = 0,12442/**12443* Determines an item is checked12444*/12445Checked = 112446}1244712448/**12449* Value-object describing what options a terminal should use.12450*/12451export interface TerminalOptions {12452/**12453* A human-readable string which will be used to represent the terminal in the UI.12454*/12455name?: string;1245612457/**12458* A path to a custom shell executable to be used in the terminal.12459*/12460shellPath?: string;1246112462/**12463* Args for the custom shell executable. A string can be used on Windows only which allows12464* specifying shell args in [command-line format](https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6).12465*/12466shellArgs?: string[] | string;1246712468/**12469* A path or Uri for the current working directory to be used for the terminal.12470*/12471cwd?: string | Uri;1247212473/**12474* Object with environment variables that will be added to the editor process.12475*/12476env?: { [key: string]: string | null | undefined };1247712478/**12479* Whether the terminal process environment should be exactly as provided in12480* `TerminalOptions.env`. When this is false (default), the environment will be based on the12481* window's environment and also apply configured platform settings like12482* `terminal.integrated.env.windows` on top. When this is true, the complete environment12483* must be provided as nothing will be inherited from the process or any configuration.12484*/12485strictEnv?: boolean;1248612487/**12488* When enabled the terminal will run the process as normal but not be surfaced to the user12489* until `Terminal.show` is called. The typical usage for this is when you need to run12490* something that may need interactivity but only want to tell the user about it when12491* interaction is needed. Note that the terminals will still be exposed to all extensions12492* as normal. The hidden terminals will not be restored when the workspace is next opened.12493*/12494hideFromUser?: boolean;1249512496/**12497* A message to write to the terminal on first launch, note that this is not sent to the12498* process but, rather written directly to the terminal. This supports escape sequences such12499* a setting text style.12500*/12501message?: string;1250212503/**12504* The icon path or {@link ThemeIcon} for the terminal.12505*/12506iconPath?: IconPath;1250712508/**12509* The icon {@link ThemeColor} for the terminal.12510* The `terminal.ansi*` theme keys are12511* recommended for the best contrast and consistency across themes.12512*/12513color?: ThemeColor;1251412515/**12516* The {@link TerminalLocation} or {@link TerminalEditorLocationOptions} or {@link TerminalSplitLocationOptions} for the terminal.12517*/12518location?: TerminalLocation | TerminalEditorLocationOptions | TerminalSplitLocationOptions;1251912520/**12521* Opt-out of the default terminal persistence on restart and reload.12522* This will only take effect when `terminal.integrated.enablePersistentSessions` is enabled.12523*/12524isTransient?: boolean;1252512526/**12527* The nonce to use to verify shell integration sequences are coming from a trusted source.12528* An example impact of UX of this is if the command line is reported with a nonce, it will12529* not need to verify with the user that the command line is correct before rerunning it12530* via the [shell integration command decoration](https://code.visualstudio.com/docs/terminal/shell-integration#_command-decorations-and-the-overview-ruler).12531*12532* This should be used if the terminal includes [custom shell integration support](https://code.visualstudio.com/docs/terminal/shell-integration#_supported-escape-sequences).12533* It should be set to a random GUID which will then set the `VSCODE_NONCE` environment12534* variable. Inside the shell, this should then be removed from the environment so as to12535* protect it from general access. Once that is done it can be passed through in the12536* relevant sequences to make them trusted.12537*/12538shellIntegrationNonce?: string;12539}1254012541/**12542* Value-object describing what options a virtual process terminal should use.12543*/12544export interface ExtensionTerminalOptions {12545/**12546* A human-readable string which will be used to represent the terminal in the UI.12547*/12548name: string;1254912550/**12551* An implementation of {@link Pseudoterminal} that allows an extension to12552* control a terminal.12553*/12554pty: Pseudoterminal;1255512556/**12557* The icon path or {@link ThemeIcon} for the terminal.12558*/12559iconPath?: IconPath;1256012561/**12562* The icon {@link ThemeColor} for the terminal.12563* The standard `terminal.ansi*` theme keys are12564* recommended for the best contrast and consistency across themes.12565*/12566color?: ThemeColor;1256712568/**12569* The {@link TerminalLocation} or {@link TerminalEditorLocationOptions} or {@link TerminalSplitLocationOptions} for the terminal.12570*/12571location?: TerminalLocation | TerminalEditorLocationOptions | TerminalSplitLocationOptions;1257212573/**12574* Opt-out of the default terminal persistence on restart and reload.12575* This will only take effect when `terminal.integrated.enablePersistentSessions` is enabled.12576*/12577isTransient?: boolean;1257812579/**12580* The nonce to use to verify shell integration sequences are coming from a trusted source.12581* An example impact of UX of this is if the command line is reported with a nonce, it will12582* not need to verify with the user that the command line is correct before rerunning it12583* via the [shell integration command decoration](https://code.visualstudio.com/docs/terminal/shell-integration#_command-decorations-and-the-overview-ruler).12584*12585* This should be used if the terminal includes [custom shell integration support](https://code.visualstudio.com/docs/terminal/shell-integration#_supported-escape-sequences).12586* It should be set to a random GUID. Inside the {@link Pseudoterminal} implementation, this value12587* can be passed through in the relevant sequences to make them trusted.12588*/12589shellIntegrationNonce?: string;12590}1259112592/**12593* Defines the interface of a terminal pty, enabling extensions to control a terminal.12594*/12595export interface Pseudoterminal {12596/**12597* An event that when fired will write data to the terminal. Unlike12598* {@link Terminal.sendText} which sends text to the underlying child12599* pseudo-device (the child), this will write the text to parent pseudo-device (the12600* _terminal_ itself).12601*12602* Note writing `\n` will just move the cursor down 1 row, you need to write `\r` as well12603* to move the cursor to the left-most cell.12604*12605* Events fired before {@link Pseudoterminal.open} is called will be be ignored.12606*12607* **Example:** Write red text to the terminal12608* ```typescript12609* const writeEmitter = new vscode.EventEmitter<string>();12610* const pty: vscode.Pseudoterminal = {12611* onDidWrite: writeEmitter.event,12612* open: () => writeEmitter.fire('\x1b[31mHello world\x1b[0m'),12613* close: () => {}12614* };12615* vscode.window.createTerminal({ name: 'My terminal', pty });12616* ```12617*12618* **Example:** Move the cursor to the 10th row and 20th column and write an asterisk12619* ```typescript12620* writeEmitter.fire('\x1b[10;20H*');12621* ```12622*/12623onDidWrite: Event<string>;1262412625/**12626* An event that when fired allows overriding the {@link Pseudoterminal.setDimensions dimensions} of the12627* terminal. Note that when set, the overridden dimensions will only take effect when they12628* are lower than the actual dimensions of the terminal (ie. there will never be a scroll12629* bar). Set to `undefined` for the terminal to go back to the regular dimensions (fit to12630* the size of the panel).12631*12632* Events fired before {@link Pseudoterminal.open} is called will be be ignored.12633*12634* **Example:** Override the dimensions of a terminal to 20 columns and 10 rows12635* ```typescript12636* const dimensionsEmitter = new vscode.EventEmitter<vscode.TerminalDimensions>();12637* const pty: vscode.Pseudoterminal = {12638* onDidWrite: writeEmitter.event,12639* onDidOverrideDimensions: dimensionsEmitter.event,12640* open: () => {12641* dimensionsEmitter.fire({12642* columns: 20,12643* rows: 1012644* });12645* },12646* close: () => {}12647* };12648* vscode.window.createTerminal({ name: 'My terminal', pty });12649* ```12650*/12651onDidOverrideDimensions?: Event<TerminalDimensions | undefined>;1265212653/**12654* An event that when fired will signal that the pty is closed and dispose of the terminal.12655*12656* Events fired before {@link Pseudoterminal.open} is called will be be ignored.12657*12658* A number can be used to provide an exit code for the terminal. Exit codes must be12659* positive and a non-zero exit codes signals failure which shows a notification for a12660* regular terminal and allows dependent tasks to proceed when used with the12661* `CustomExecution` API.12662*12663* **Example:** Exit the terminal when "y" is pressed, otherwise show a notification.12664* ```typescript12665* const writeEmitter = new vscode.EventEmitter<string>();12666* const closeEmitter = new vscode.EventEmitter<void>();12667* const pty: vscode.Pseudoterminal = {12668* onDidWrite: writeEmitter.event,12669* onDidClose: closeEmitter.event,12670* open: () => writeEmitter.fire('Press y to exit successfully'),12671* close: () => {},12672* handleInput: data => {12673* if (data !== 'y') {12674* vscode.window.showInformationMessage('Something went wrong');12675* }12676* closeEmitter.fire();12677* }12678* };12679* const terminal = vscode.window.createTerminal({ name: 'Exit example', pty });12680* terminal.show(true);12681* ```12682*/12683onDidClose?: Event<void | number>;1268412685/**12686* An event that when fired allows changing the name of the terminal.12687*12688* Events fired before {@link Pseudoterminal.open} is called will be be ignored.12689*12690* **Example:** Change the terminal name to "My new terminal".12691* ```typescript12692* const writeEmitter = new vscode.EventEmitter<string>();12693* const changeNameEmitter = new vscode.EventEmitter<string>();12694* const pty: vscode.Pseudoterminal = {12695* onDidWrite: writeEmitter.event,12696* onDidChangeName: changeNameEmitter.event,12697* open: () => changeNameEmitter.fire('My new terminal'),12698* close: () => {}12699* };12700* vscode.window.createTerminal({ name: 'My terminal', pty });12701* ```12702*/12703onDidChangeName?: Event<string>;1270412705/**12706* Implement to handle when the pty is open and ready to start firing events.12707*12708* @param initialDimensions The dimensions of the terminal, this will be undefined if the12709* terminal panel has not been opened before this is called.12710*/12711open(initialDimensions: TerminalDimensions | undefined): void;1271212713/**12714* Implement to handle when the terminal is closed by an act of the user.12715*/12716close(): void;1271712718/**12719* Implement to handle incoming keystrokes in the terminal or when an extension calls12720* {@link Terminal.sendText}. `data` contains the keystrokes/text serialized into12721* their corresponding VT sequence representation.12722*12723* @param data The incoming data.12724*12725* **Example:** Echo input in the terminal. The sequence for enter (`\r`) is translated to12726* CRLF to go to a new line and move the cursor to the start of the line.12727* ```typescript12728* const writeEmitter = new vscode.EventEmitter<string>();12729* const pty: vscode.Pseudoterminal = {12730* onDidWrite: writeEmitter.event,12731* open: () => {},12732* close: () => {},12733* handleInput: data => writeEmitter.fire(data === '\r' ? '\r\n' : data)12734* };12735* vscode.window.createTerminal({ name: 'Local echo', pty });12736* ```12737*/12738handleInput?(data: string): void;1273912740/**12741* Implement to handle when the number of rows and columns that fit into the terminal panel12742* changes, for example when font size changes or when the panel is resized. The initial12743* state of a terminal's dimensions should be treated as `undefined` until this is triggered12744* as the size of a terminal isn't known until it shows up in the user interface.12745*12746* When dimensions are overridden by12747* {@link Pseudoterminal.onDidOverrideDimensions onDidOverrideDimensions}, `setDimensions` will12748* continue to be called with the regular panel dimensions, allowing the extension continue12749* to react dimension changes.12750*12751* @param dimensions The new dimensions.12752*/12753setDimensions?(dimensions: TerminalDimensions): void;12754}1275512756/**12757* Represents the dimensions of a terminal.12758*/12759export interface TerminalDimensions {12760/**12761* The number of columns in the terminal.12762*/12763readonly columns: number;1276412765/**12766* The number of rows in the terminal.12767*/12768readonly rows: number;12769}1277012771/**12772* Represents how a terminal exited.12773*/12774export interface TerminalExitStatus {12775/**12776* The exit code that a terminal exited with, it can have the following values:12777* - Zero: the terminal process or custom execution succeeded.12778* - Non-zero: the terminal process or custom execution failed.12779* - `undefined`: the user forcibly closed the terminal or a custom execution exited12780* without providing an exit code.12781*/12782readonly code: number | undefined;1278312784/**12785* The reason that triggered the exit of a terminal.12786*/12787readonly reason: TerminalExitReason;12788}1278912790/**12791* Terminal exit reason kind.12792*/12793export enum TerminalExitReason {12794/**12795* Unknown reason.12796*/12797Unknown = 0,1279812799/**12800* The window closed/reloaded.12801*/12802Shutdown = 1,1280312804/**12805* The shell process exited.12806*/12807Process = 2,1280812809/**12810* The user closed the terminal.12811*/12812User = 3,1281312814/**12815* An extension disposed the terminal.12816*/12817Extension = 4,12818}1281912820/**12821* A type of mutation that can be applied to an environment variable.12822*/12823export enum EnvironmentVariableMutatorType {12824/**12825* Replace the variable's existing value.12826*/12827Replace = 1,12828/**12829* Append to the end of the variable's existing value.12830*/12831Append = 2,12832/**12833* Prepend to the start of the variable's existing value.12834*/12835Prepend = 312836}1283712838/**12839* Options applied to the mutator.12840*/12841export interface EnvironmentVariableMutatorOptions {12842/**12843* Apply to the environment just before the process is created. Defaults to false.12844*/12845applyAtProcessCreation?: boolean;1284612847/**12848* Apply to the environment in the shell integration script. Note that this _will not_ apply12849* the mutator if shell integration is disabled or not working for some reason. Defaults to12850* false.12851*/12852applyAtShellIntegration?: boolean;12853}1285412855/**12856* A type of mutation and its value to be applied to an environment variable.12857*/12858export interface EnvironmentVariableMutator {12859/**12860* The type of mutation that will occur to the variable.12861*/12862readonly type: EnvironmentVariableMutatorType;1286312864/**12865* The value to use for the variable.12866*/12867readonly value: string;1286812869/**12870* Options applied to the mutator.12871*/12872readonly options: EnvironmentVariableMutatorOptions;12873}1287412875/**12876* A collection of mutations that an extension can apply to a process environment.12877*/12878export interface EnvironmentVariableCollection extends Iterable<[variable: string, mutator: EnvironmentVariableMutator]> {12879/**12880* Whether the collection should be cached for the workspace and applied to the terminal12881* across window reloads. When true the collection will be active immediately such when the12882* window reloads. Additionally, this API will return the cached version if it exists. The12883* collection will be invalidated when the extension is uninstalled or when the collection12884* is cleared. Defaults to true.12885*/12886persistent: boolean;1288712888/**12889* A description for the environment variable collection, this will be used to describe the12890* changes in the UI.12891*/12892description: string | MarkdownString | undefined;1289312894/**12895* Replace an environment variable with a value.12896*12897* Note that an extension can only make a single change to any one variable, so this will12898* overwrite any previous calls to replace, append or prepend.12899*12900* @param variable The variable to replace.12901* @param value The value to replace the variable with.12902* @param options Options applied to the mutator, when no options are provided this will12903* default to `{ applyAtProcessCreation: true }`.12904*/12905replace(variable: string, value: string, options?: EnvironmentVariableMutatorOptions): void;1290612907/**12908* Append a value to an environment variable.12909*12910* Note that an extension can only make a single change to any one variable, so this will12911* overwrite any previous calls to replace, append or prepend.12912*12913* @param variable The variable to append to.12914* @param value The value to append to the variable.12915* @param options Options applied to the mutator, when no options are provided this will12916* default to `{ applyAtProcessCreation: true }`.12917*/12918append(variable: string, value: string, options?: EnvironmentVariableMutatorOptions): void;1291912920/**12921* Prepend a value to an environment variable.12922*12923* Note that an extension can only make a single change to any one variable, so this will12924* overwrite any previous calls to replace, append or prepend.12925*12926* @param variable The variable to prepend.12927* @param value The value to prepend to the variable.12928* @param options Options applied to the mutator, when no options are provided this will12929* default to `{ applyAtProcessCreation: true }`.12930*/12931prepend(variable: string, value: string, options?: EnvironmentVariableMutatorOptions): void;1293212933/**12934* Gets the mutator that this collection applies to a variable, if any.12935*12936* @param variable The variable to get the mutator for.12937*/12938get(variable: string): EnvironmentVariableMutator | undefined;1293912940/**12941* Iterate over each mutator in this collection.12942*12943* @param callback Function to execute for each entry.12944* @param thisArg The `this` context used when invoking the handler function.12945*/12946forEach(callback: (variable: string, mutator: EnvironmentVariableMutator, collection: EnvironmentVariableCollection) => any, thisArg?: any): void;1294712948/**12949* Deletes this collection's mutator for a variable.12950*12951* @param variable The variable to delete the mutator for.12952*/12953delete(variable: string): void;1295412955/**12956* Clears all mutators from this collection.12957*/12958clear(): void;12959}1296012961/**12962* A collection of mutations that an extension can apply to a process environment. Applies to all scopes.12963*/12964export interface GlobalEnvironmentVariableCollection extends EnvironmentVariableCollection {12965/**12966* Gets scope-specific environment variable collection for the extension. This enables alterations to12967* terminal environment variables solely within the designated scope, and is applied in addition to (and12968* after) the global collection.12969*12970* Each object obtained through this method is isolated and does not impact objects for other scopes,12971* including the global collection.12972*12973* @param scope The scope to which the environment variable collection applies to.12974*12975* If a scope parameter is omitted, collection applicable to all relevant scopes for that parameter is12976* returned. For instance, if the 'workspaceFolder' parameter is not specified, the collection that applies12977* across all workspace folders will be returned.12978*12979* @returns Environment variable collection for the passed in scope.12980*/12981getScoped(scope: EnvironmentVariableScope): EnvironmentVariableCollection;12982}1298312984/**12985* The scope object to which the environment variable collection applies.12986*/12987export interface EnvironmentVariableScope {12988/**12989* Any specific workspace folder to get collection for.12990*/12991workspaceFolder?: WorkspaceFolder;12992}1299312994/**12995* A location in the editor at which progress information can be shown. It depends on the12996* location how progress is visually represented.12997*/12998export enum ProgressLocation {1299913000/**13001* Show progress for the source control viewlet, as overlay for the icon and as progress bar13002* inside the viewlet (when visible). Neither supports cancellation nor discrete progress nor13003* a label to describe the operation.13004*/13005SourceControl = 1,1300613007/**13008* Show progress in the status bar of the editor. Neither supports cancellation nor discrete progress.13009* Supports rendering of {@link ThemeIcon theme icons} via the `$(<name>)`-syntax in the progress label.13010*/13011Window = 10,1301213013/**13014* Show progress as notification with an optional cancel button. Supports to show infinite and discrete13015* progress but does not support rendering of icons.13016*/13017Notification = 1513018}1301913020/**13021* Value-object describing where and how progress should show.13022*/13023export interface ProgressOptions {1302413025/**13026* The location at which progress should show.13027*/13028location: ProgressLocation | {13029/**13030* The identifier of a view for which progress should be shown.13031*/13032viewId: string;13033};1303413035/**13036* A human-readable string which will be used to describe the13037* operation.13038*/13039title?: string;1304013041/**13042* Controls if a cancel button should show to allow the user to13043* cancel the long running operation. Note that currently only13044* `ProgressLocation.Notification` is supporting to show a cancel13045* button.13046*/13047cancellable?: boolean;13048}1304913050/**13051* The base interface for all quick input types.13052*13053* Quick input provides a unified way for extensions to interact with users through simple UI elements.13054* A quick input UI is initially not visible. After configuring it through its properties the extension13055* can make it visible by calling {@link QuickInput.show show}.13056*13057* There are several reasons why this UI might have to be hidden and the extension will be notified13058* through {@link QuickInput.onDidHide onDidHide}. Examples include: an explicit call to13059* {@link QuickInput.hide hide}, the user pressing Esc, some other input UI opening, etc.13060*13061* A user pressing Enter or some other gesture implying acceptance of the current state does not13062* automatically hide this UI component. It is up to the extension to decide whether to accept the13063* user's input and if the UI should indeed be hidden through a call to {@link QuickInput.hide hide}.13064*13065* When the extension no longer needs this input UI, it should {@link QuickInput.dispose dispose} it13066* to allow for freeing up any resources associated with it.13067*13068* See {@link QuickPick} and {@link InputBox} for concrete UIs.13069*/13070export interface QuickInput {1307113072/**13073* An optional title for the input UI.13074*/13075title: string | undefined;1307613077/**13078* An optional current step count for multi-step input flows.13079*/13080step: number | undefined;1308113082/**13083* An optional total step count for multi-step input flows.13084*/13085totalSteps: number | undefined;1308613087/**13088* Determines if the UI should allow for user input. Defaults to `true`.13089*13090* Change this to `false`, for example, while validating user input or loading data for the next13091* step in user input.13092*/13093enabled: boolean;1309413095/**13096* Determines if the UI should show a progress indicator. Defaults to `false`.13097*13098* Change this to `true`, for example, while loading more data or validating user input.13099*/13100busy: boolean;1310113102/**13103* Determines if the UI should stay open even when losing UI focus. Defaults to `false`.13104* This setting is ignored on iPad and is always `false`.13105*/13106ignoreFocusOut: boolean;1310713108/**13109* Makes the input UI visible in its current configuration.13110*13111* Any other input UI will first fire an {@link QuickInput.onDidHide onDidHide} event.13112*/13113show(): void;1311413115/**13116* Hides this input UI.13117*13118* This will also fire an {@link QuickInput.onDidHide onDidHide} event.13119*/13120hide(): void;1312113122/**13123* An event signaling when this input UI is hidden.13124*13125* There are several reasons why this UI might have to be hidden and the extension will be notified13126* through {@link QuickInput.onDidHide onDidHide}. Examples include: an explicit call to13127* {@link QuickInput.hide hide}, the user pressing Esc, some other input UI opening, etc.13128*/13129readonly onDidHide: Event<void>;1313013131/**13132* Dispose of this input UI and any associated resources.13133*13134* If it is still visible, it is first hidden. After this call the input UI is no longer functional13135* and no additional methods or properties on it should be accessed. Instead a new input UI should13136* be created.13137*/13138dispose(): void;13139}1314013141/**13142* A concrete {@link QuickInput} to let the user pick an item from a list of items of type `T`.13143*13144* The items can be filtered through a filter text field and there is an option13145* {@link QuickPick.canSelectMany canSelectMany} to allow for selecting multiple items.13146*13147* Note that in many cases the more convenient {@link window.showQuickPick} is easier to use.13148* {@link window.createQuickPick} should be used when {@link window.showQuickPick} does not offer13149* the required flexibility.13150*/13151export interface QuickPick<T extends QuickPickItem> extends QuickInput {1315213153/**13154* The current value of the filter text.13155*/13156value: string;1315713158/**13159* Optional placeholder text displayed in the filter text box when no value has been entered.13160*/13161placeholder: string | undefined;1316213163/**13164* Optional text that provides instructions or context to the user.13165*13166* The prompt is displayed below the input box and above the list of items.13167*/13168prompt: string | undefined;1316913170/**13171* An event signaling when the value of the filter text has changed.13172*/13173readonly onDidChangeValue: Event<string>;1317413175/**13176* An event signaling when the user indicated acceptance of the selected item(s).13177*/13178readonly onDidAccept: Event<void>;1317913180/**13181* Buttons for actions in the UI.13182*/13183buttons: readonly QuickInputButton[];1318413185/**13186* An event signaling when a button was triggered.13187*13188* This event fires for buttons stored in the {@link QuickPick.buttons buttons} array. This event does13189* not fire for buttons on a {@link QuickPickItem}.13190*/13191readonly onDidTriggerButton: Event<QuickInputButton>;1319213193/**13194* An event signaling when a button in a particular {@link QuickPickItem} was triggered.13195*13196* This event does not fire for buttons in the title bar which are part of {@link QuickPick.buttons buttons}.13197*/13198readonly onDidTriggerItemButton: Event<QuickPickItemButtonEvent<T>>;1319913200/**13201* Items to pick from. This can be read and updated by the extension.13202*/13203items: readonly T[];1320413205/**13206* Determines if multiple items can be selected at the same time. Defaults to `false`.13207*/13208canSelectMany: boolean;1320913210/**13211* Determines if the filter text should also be matched against the {@link QuickPickItem.description description} of the items. Defaults to `false`.13212*/13213matchOnDescription: boolean;1321413215/**13216* Determines if the filter text should also be matched against the {@link QuickPickItem.detail detail} of the items. Defaults to `false`.13217*/13218matchOnDetail: boolean;1321913220/**13221* Determines if the scroll position is maintained when the quick pick items are updated. Defaults to `false`.13222*/13223keepScrollPosition?: boolean;1322413225/**13226* Active items. This can be read and updated by the extension.13227*/13228activeItems: readonly T[];1322913230/**13231* An event signaling when the active items have changed.13232*/13233readonly onDidChangeActive: Event<readonly T[]>;1323413235/**13236* Selected items. This can be read and updated by the extension.13237*/13238selectedItems: readonly T[];1323913240/**13241* An event signaling when the selected items have changed.13242*/13243readonly onDidChangeSelection: Event<readonly T[]>;13244}1324513246/**13247* A concrete {@link QuickInput} to let the user input a text value.13248*13249* Note that in many cases the more convenient {@link window.showInputBox} is easier to use.13250* {@link window.createInputBox} should be used when {@link window.showInputBox} does not offer13251* the required flexibility.13252*/13253export interface InputBox extends QuickInput {1325413255/**13256* The current input value.13257*/13258value: string;1325913260/**13261* Selection range in the input value.13262*13263* Defined as tuple of two numbers where the first is the inclusive start index and the second the13264* exclusive end index. When `undefined` the whole pre-filled value will be selected, when empty13265* (start equals end) only the cursor will be set, otherwise the defined range will be selected.13266*13267* This property does not get updated when the user types or makes a selection, but it can be updated13268* by the extension.13269*/13270valueSelection: readonly [number, number] | undefined;1327113272/**13273* Optional placeholder text shown when no value has been input.13274*/13275placeholder: string | undefined;1327613277/**13278* Determines if the input value should be hidden. Defaults to `false`.13279*/13280password: boolean;1328113282/**13283* An event signaling when the value has changed.13284*/13285readonly onDidChangeValue: Event<string>;1328613287/**13288* An event signaling when the user indicated acceptance of the input value.13289*/13290readonly onDidAccept: Event<void>;1329113292/**13293* Buttons for actions in the UI.13294*/13295buttons: readonly QuickInputButton[];1329613297/**13298* An event signaling when a button was triggered.13299*/13300readonly onDidTriggerButton: Event<QuickInputButton>;1330113302/**13303* An optional prompt text providing some ask or explanation to the user.13304*/13305prompt: string | undefined;1330613307/**13308* An optional validation message indicating a problem with the current input value.13309*13310* By setting a string, the InputBox will use a default {@link InputBoxValidationSeverity} of Error.13311* Returning `undefined` clears the validation message.13312*/13313validationMessage: string | InputBoxValidationMessage | undefined;13314}1331513316/**13317* Specifies the location where a {@link QuickInputButton} should be rendered.13318*/13319export enum QuickInputButtonLocation {13320/**13321* The button is rendered in the title bar.13322*/13323Title = 1,1332413325/**13326* The button is rendered inline to the right of the input box.13327*/13328Inline = 2,1332913330/**13331* The button is rendered at the far end inside the input box.13332*/13333Input = 313334}1333513336/**13337* A button for an action in a {@link QuickPick} or {@link InputBox}.13338*/13339export interface QuickInputButton {13340/**13341* The icon for the button.13342*/13343readonly iconPath: IconPath;1334413345/**13346* An optional tooltip displayed when hovering over the button.13347*/13348readonly tooltip?: string | undefined;1334913350/**13351* The location where the button should be rendered.13352*13353* Defaults to {@link QuickInputButtonLocation.Title}.13354*13355* **Note:** This property is ignored if the button was added to a {@link QuickPickItem}.13356*/13357location?: QuickInputButtonLocation;1335813359/**13360* When present, indicates that the button is a toggle button that can be checked or unchecked.13361*/13362readonly toggle?: {13363/**13364* Indicates whether the toggle button is currently checked.13365* This property will be updated when the button is toggled.13366*/13367checked: boolean;13368};13369}1337013371/**13372* Predefined buttons for {@link QuickPick} and {@link InputBox}.13373*/13374export class QuickInputButtons {13375/**13376* A predefined back button for {@link QuickPick} and {@link InputBox}.13377*13378* This button should be used for consistency when a navigation back button is needed. It comes13379* with a predefined icon, tooltip, and location.13380*/13381static readonly Back: QuickInputButton;1338213383/**13384* @hidden13385*/13386private constructor();13387}1338813389/**13390* An event describing a button that was pressed on a {@link QuickPickItem}.13391*/13392export interface QuickPickItemButtonEvent<T extends QuickPickItem> {13393/**13394* The button that was pressed.13395*/13396readonly button: QuickInputButton;13397/**13398* The item that the button belongs to.13399*/13400readonly item: T;13401}1340213403/**13404* An event describing an individual change in the text of a {@link TextDocument document}.13405*/13406export interface TextDocumentContentChangeEvent {13407/**13408* The range that got replaced.13409*/13410readonly range: Range;13411/**13412* The offset of the range that got replaced.13413*/13414readonly rangeOffset: number;13415/**13416* The length of the range that got replaced.13417*/13418readonly rangeLength: number;13419/**13420* The new text for the range.13421*/13422readonly text: string;13423}1342413425/**13426* Reasons for why a text document has changed.13427*/13428export enum TextDocumentChangeReason {13429/** The text change is caused by an undo operation. */13430Undo = 1,1343113432/** The text change is caused by an redo operation. */13433Redo = 2,13434}1343513436/**13437* An event describing a transactional {@link TextDocument document} change.13438*/13439export interface TextDocumentChangeEvent {1344013441/**13442* The affected document.13443*/13444readonly document: TextDocument;1344513446/**13447* An array of content changes.13448*/13449readonly contentChanges: readonly TextDocumentContentChangeEvent[];1345013451/**13452* The reason why the document was changed.13453* Is `undefined` if the reason is not known.13454*/13455readonly reason: TextDocumentChangeReason | undefined;13456}1345713458/**13459* Represents reasons why a text document is saved.13460*/13461export enum TextDocumentSaveReason {1346213463/**13464* Manually triggered, e.g. by the user pressing save, by starting debugging,13465* or by an API call.13466*/13467Manual = 1,1346813469/**13470* Automatic after a delay.13471*/13472AfterDelay = 2,1347313474/**13475* When the editor lost focus.13476*/13477FocusOut = 313478}1347913480/**13481* An event that is fired when a {@link TextDocument document} will be saved.13482*13483* To make modifications to the document before it is being saved, call the13484* {@linkcode TextDocumentWillSaveEvent.waitUntil waitUntil}-function with a thenable13485* that resolves to an array of {@link TextEdit text edits}.13486*/13487export interface TextDocumentWillSaveEvent {1348813489/**13490* The document that will be saved.13491*/13492readonly document: TextDocument;1349313494/**13495* The reason why save was triggered.13496*/13497readonly reason: TextDocumentSaveReason;1349813499/**13500* Allows to pause the event loop and to apply {@link TextEdit pre-save-edits}.13501* Edits of subsequent calls to this function will be applied in order. The13502* edits will be *ignored* if concurrent modifications of the document happened.13503*13504* *Note:* This function can only be called during event dispatch and not13505* in an asynchronous manner:13506*13507* ```ts13508* workspace.onWillSaveTextDocument(event => {13509* // async, will *throw* an error13510* setTimeout(() => event.waitUntil(promise));13511*13512* // sync, OK13513* event.waitUntil(promise);13514* })13515* ```13516*13517* @param thenable A thenable that resolves to {@link TextEdit pre-save-edits}.13518*/13519waitUntil(thenable: Thenable<readonly TextEdit[]>): void;1352013521/**13522* Allows to pause the event loop until the provided thenable resolved.13523*13524* *Note:* This function can only be called during event dispatch.13525*13526* @param thenable A thenable that delays saving.13527*/13528waitUntil(thenable: Thenable<any>): void;13529}1353013531/**13532* An event that is fired when files are going to be created.13533*13534* To make modifications to the workspace before the files are created,13535* call the {@linkcode FileWillCreateEvent.waitUntil waitUntil}-function with a13536* thenable that resolves to a {@link WorkspaceEdit workspace edit}.13537*/13538export interface FileWillCreateEvent {1353913540/**13541* A cancellation token.13542*/13543readonly token: CancellationToken;1354413545/**13546* The files that are going to be created.13547*/13548readonly files: readonly Uri[];1354913550/**13551* Allows to pause the event and to apply a {@link WorkspaceEdit workspace edit}.13552*13553* *Note:* This function can only be called during event dispatch and not13554* in an asynchronous manner:13555*13556* ```ts13557* workspace.onWillCreateFiles(event => {13558* // async, will *throw* an error13559* setTimeout(() => event.waitUntil(promise));13560*13561* // sync, OK13562* event.waitUntil(promise);13563* })13564* ```13565*13566* @param thenable A thenable that delays saving.13567*/13568waitUntil(thenable: Thenable<WorkspaceEdit>): void;1356913570/**13571* Allows to pause the event until the provided thenable resolves.13572*13573* *Note:* This function can only be called during event dispatch.13574*13575* @param thenable A thenable that delays saving.13576*/13577waitUntil(thenable: Thenable<any>): void;13578}1357913580/**13581* An event that is fired after files are created.13582*/13583export interface FileCreateEvent {1358413585/**13586* The files that got created.13587*/13588readonly files: readonly Uri[];13589}1359013591/**13592* An event that is fired when files are going to be deleted.13593*13594* To make modifications to the workspace before the files are deleted,13595* call the {@link FileWillCreateEvent.waitUntil `waitUntil`}-function with a13596* thenable that resolves to a {@link WorkspaceEdit workspace edit}.13597*/13598export interface FileWillDeleteEvent {1359913600/**13601* A cancellation token.13602*/13603readonly token: CancellationToken;1360413605/**13606* The files that are going to be deleted.13607*/13608readonly files: readonly Uri[];1360913610/**13611* Allows to pause the event and to apply a {@link WorkspaceEdit workspace edit}.13612*13613* *Note:* This function can only be called during event dispatch and not13614* in an asynchronous manner:13615*13616* ```ts13617* workspace.onWillCreateFiles(event => {13618* // async, will *throw* an error13619* setTimeout(() => event.waitUntil(promise));13620*13621* // sync, OK13622* event.waitUntil(promise);13623* })13624* ```13625*13626* @param thenable A thenable that delays saving.13627*/13628waitUntil(thenable: Thenable<WorkspaceEdit>): void;1362913630/**13631* Allows to pause the event until the provided thenable resolves.13632*13633* *Note:* This function can only be called during event dispatch.13634*13635* @param thenable A thenable that delays saving.13636*/13637waitUntil(thenable: Thenable<any>): void;13638}1363913640/**13641* An event that is fired after files are deleted.13642*/13643export interface FileDeleteEvent {1364413645/**13646* The files that got deleted.13647*/13648readonly files: readonly Uri[];13649}1365013651/**13652* An event that is fired when files are going to be renamed.13653*13654* To make modifications to the workspace before the files are renamed,13655* call the {@link FileWillCreateEvent.waitUntil `waitUntil`}-function with a13656* thenable that resolves to a {@link WorkspaceEdit workspace edit}.13657*/13658export interface FileWillRenameEvent {1365913660/**13661* A cancellation token.13662*/13663readonly token: CancellationToken;1366413665/**13666* The files that are going to be renamed.13667*/13668readonly files: ReadonlyArray<{13669/**13670* The old uri of a file.13671*/13672readonly oldUri: Uri;13673/**13674* The new uri of a file.13675*/13676readonly newUri: Uri;13677}>;1367813679/**13680* Allows to pause the event and to apply a {@link WorkspaceEdit workspace edit}.13681*13682* *Note:* This function can only be called during event dispatch and not13683* in an asynchronous manner:13684*13685* ```ts13686* workspace.onWillCreateFiles(event => {13687* // async, will *throw* an error13688* setTimeout(() => event.waitUntil(promise));13689*13690* // sync, OK13691* event.waitUntil(promise);13692* })13693* ```13694*13695* @param thenable A thenable that delays saving.13696*/13697waitUntil(thenable: Thenable<WorkspaceEdit>): void;1369813699/**13700* Allows to pause the event until the provided thenable resolves.13701*13702* *Note:* This function can only be called during event dispatch.13703*13704* @param thenable A thenable that delays saving.13705*/13706waitUntil(thenable: Thenable<any>): void;13707}1370813709/**13710* An event that is fired after files are renamed.13711*/13712export interface FileRenameEvent {1371313714/**13715* The files that got renamed.13716*/13717readonly files: ReadonlyArray<{13718/**13719* The old uri of a file.13720*/13721readonly oldUri: Uri;13722/**13723* The new uri of a file.13724*/13725readonly newUri: Uri;13726}>;13727}1372813729/**13730* An event describing a change to the set of {@link workspace.workspaceFolders workspace folders}.13731*/13732export interface WorkspaceFoldersChangeEvent {13733/**13734* Added workspace folders.13735*/13736readonly added: readonly WorkspaceFolder[];1373713738/**13739* Removed workspace folders.13740*/13741readonly removed: readonly WorkspaceFolder[];13742}1374313744/**13745* A workspace folder is one of potentially many roots opened by the editor. All workspace folders13746* are equal which means there is no notion of an active or primary workspace folder.13747*/13748export interface WorkspaceFolder {1374913750/**13751* The associated uri for this workspace folder.13752*13753* *Note:* The {@link Uri}-type was intentionally chosen such that future releases of the editor can support13754* workspace folders that are not stored on the local disk, e.g. `ftp://server/workspaces/foo`.13755*/13756readonly uri: Uri;1375713758/**13759* The name of this workspace folder. Defaults to13760* the basename of its {@link Uri.path uri-path}13761*/13762readonly name: string;1376313764/**13765* The ordinal number of this workspace folder.13766*/13767readonly index: number;13768}1376913770/**13771* Namespace for dealing with the current workspace. A workspace is the collection of one13772* or more folders that are opened in an editor window (instance).13773*13774* It is also possible to open an editor without a workspace. For example, when you open a13775* new editor window by selecting a file from your platform's File menu, you will not be13776* inside a workspace. In this mode, some of the editor's capabilities are reduced but you can13777* still open text files and edit them.13778*13779* Refer to https://code.visualstudio.com/docs/editor/workspaces for more information on13780* the concept of workspaces.13781*13782* The workspace offers support for {@link workspace.createFileSystemWatcher listening} to fs13783* events and for {@link workspace.findFiles finding} files. Both perform well and run _outside_13784* the editor-process so that they should be always used instead of nodejs-equivalents.13785*/13786export namespace workspace {1378713788/**13789* A {@link FileSystem file system} instance that allows to interact with local and remote13790* files, e.g. `vscode.workspace.fs.readDirectory(someUri)` allows to retrieve all entries13791* of a directory or `vscode.workspace.fs.stat(anotherUri)` returns the meta data for a13792* file.13793*/13794export const fs: FileSystem;1379513796/**13797* The uri of the first entry of {@linkcode workspace.workspaceFolders workspaceFolders}13798* as `string`. `undefined` if there is no first entry.13799*13800* Refer to https://code.visualstudio.com/docs/editor/workspaces for more information13801* on workspaces.13802*13803* @deprecated Use {@linkcode workspace.workspaceFolders workspaceFolders} instead.13804*/13805export const rootPath: string | undefined;1380613807/**13808* List of workspace folders (0-N) that are open in the editor. `undefined` when no workspace13809* has been opened.13810*13811* Refer to https://code.visualstudio.com/docs/editor/workspaces for more information13812* on workspaces.13813*/13814export const workspaceFolders: readonly WorkspaceFolder[] | undefined;1381513816/**13817* The name of the workspace. `undefined` when no workspace13818* has been opened.13819*13820* Refer to https://code.visualstudio.com/docs/editor/workspaces for more information on13821* the concept of workspaces.13822*/13823export const name: string | undefined;1382413825/**13826* The location of the workspace file, for example:13827*13828* `file:///Users/name/Development/myProject.code-workspace`13829*13830* or13831*13832* `untitled:1555503116870`13833*13834* for a workspace that is untitled and not yet saved.13835*13836* Depending on the workspace that is opened, the value will be:13837* * `undefined` when no workspace is opened13838* * the path of the workspace file as `Uri` otherwise. if the workspace13839* is untitled, the returned URI will use the `untitled:` scheme13840*13841* The location can e.g. be used with the `vscode.openFolder` command to13842* open the workspace again after it has been closed.13843*13844* **Example:**13845* ```typescript13846* vscode.commands.executeCommand('vscode.openFolder', uriOfWorkspace);13847* ```13848*13849* Refer to https://code.visualstudio.com/docs/editor/workspaces for more information on13850* the concept of workspaces.13851*13852* **Note:** it is not advised to use `workspace.workspaceFile` to write13853* configuration data into the file. You can use `workspace.getConfiguration().update()`13854* for that purpose which will work both when a single folder is opened as13855* well as an untitled or saved workspace.13856*/13857export const workspaceFile: Uri | undefined;1385813859/**13860* An event that is emitted when a workspace folder is added or removed.13861*13862* **Note:** this event will not fire if the first workspace folder is added, removed or changed,13863* because in that case the currently executing extensions (including the one that listens to this13864* event) will be terminated and restarted so that the (deprecated) `rootPath` property is updated13865* to point to the first workspace folder.13866*/13867export const onDidChangeWorkspaceFolders: Event<WorkspaceFoldersChangeEvent>;1386813869/**13870* Returns the {@link WorkspaceFolder workspace folder} that contains a given uri.13871* * returns `undefined` when the given uri doesn't match any workspace folder13872* * returns the *input* when the given uri is a workspace folder itself13873*13874* @param uri An uri.13875* @returns A workspace folder or `undefined`13876*/13877export function getWorkspaceFolder(uri: Uri): WorkspaceFolder | undefined;1387813879/**13880* Returns a path that is relative to the workspace folder or folders.13881*13882* When there are no {@link workspace.workspaceFolders workspace folders} or when the path13883* is not contained in them, the input is returned.13884*13885* @param pathOrUri A path or uri. When a uri is given its {@link Uri.fsPath fsPath} is used.13886* @param includeWorkspaceFolder When `true` and when the given path is contained inside a13887* workspace folder the name of the workspace is prepended. Defaults to `true` when there are13888* multiple workspace folders and `false` otherwise.13889* @returns A path relative to the root or the input.13890*/13891export function asRelativePath(pathOrUri: string | Uri, includeWorkspaceFolder?: boolean): string;1389213893/**13894* This method replaces `deleteCount` {@link workspace.workspaceFolders workspace folders} starting at index `start`13895* by an optional set of `workspaceFoldersToAdd` on the `vscode.workspace.workspaceFolders` array. This "splice"13896* behavior can be used to add, remove and change workspace folders in a single operation.13897*13898* **Note:** in some cases calling this method may result in the currently executing extensions (including the13899* one that called this method) to be terminated and restarted. For example when the first workspace folder is13900* added, removed or changed the (deprecated) `rootPath` property is updated to point to the first workspace13901* folder. Another case is when transitioning from an empty or single-folder workspace into a multi-folder13902* workspace (see also: https://code.visualstudio.com/docs/editor/workspaces).13903*13904* Use the {@linkcode onDidChangeWorkspaceFolders onDidChangeWorkspaceFolders()} event to get notified when the13905* workspace folders have been updated.13906*13907* **Example:** adding a new workspace folder at the end of workspace folders13908* ```typescript13909* workspace.updateWorkspaceFolders(workspace.workspaceFolders ? workspace.workspaceFolders.length : 0, null, { uri: ...});13910* ```13911*13912* **Example:** removing the first workspace folder13913* ```typescript13914* workspace.updateWorkspaceFolders(0, 1);13915* ```13916*13917* **Example:** replacing an existing workspace folder with a new one13918* ```typescript13919* workspace.updateWorkspaceFolders(0, 1, { uri: ...});13920* ```13921*13922* It is valid to remove an existing workspace folder and add it again with a different name13923* to rename that folder.13924*13925* **Note:** it is not valid to call {@link updateWorkspaceFolders updateWorkspaceFolders()} multiple times13926* without waiting for the {@linkcode onDidChangeWorkspaceFolders onDidChangeWorkspaceFolders()} to fire.13927*13928* @param start the zero-based location in the list of currently opened {@link WorkspaceFolder workspace folders}13929* from which to start deleting workspace folders.13930* @param deleteCount the optional number of workspace folders to remove.13931* @param workspaceFoldersToAdd the optional variable set of workspace folders to add in place of the deleted ones.13932* Each workspace is identified with a mandatory URI and an optional name.13933* @returns true if the operation was successfully started and false otherwise if arguments were used that would result13934* in invalid workspace folder state (e.g. 2 folders with the same URI).13935*/13936export function updateWorkspaceFolders(start: number, deleteCount: number | undefined | null, ...workspaceFoldersToAdd: {13937/**13938* The uri of a workspace folder that's to be added.13939*/13940readonly uri: Uri;13941/**13942* The name of a workspace folder that's to be added.13943*/13944readonly name?: string;13945}[]): boolean;1394613947/**13948* Creates a file system watcher that is notified on file events (create, change, delete)13949* depending on the parameters provided.13950*13951* By default, all opened {@link workspace.workspaceFolders workspace folders} will be watched13952* for file changes recursively.13953*13954* Additional paths can be added for file watching by providing a {@link RelativePattern} with13955* a `base` path to watch. If the path is a folder and the `pattern` is complex (e.g. contains13956* `**` or path segments), it will be watched recursively and otherwise will be watched13957* non-recursively (i.e. only changes to the first level of the path will be reported).13958*13959* *Note* that paths that do not exist in the file system will be monitored with a delay until13960* created and then watched depending on the parameters provided. If a watched path is deleted,13961* the watcher will suspend and not report any events until the path is created again.13962*13963* If possible, keep the use of recursive watchers to a minimum because recursive file watching13964* is quite resource intense.13965*13966* Providing a `string` as `globPattern` acts as convenience method for watching file events in13967* all opened workspace folders. It cannot be used to add more folders for file watching, nor will13968* it report any file events from folders that are not part of the opened workspace folders.13969*13970* *Note* that case-sensitivity of the {@link globPattern} parameter will depend on the file system13971* where the watcher is running: on Windows and macOS the matching will be case-insensitive and13972* on Linux it will be case-sensitive.13973*13974* Optionally, flags to ignore certain kinds of events can be provided.13975*13976* To stop listening to events the watcher must be disposed.13977*13978* *Note* that file events from deleting a folder may not include events for the contained files.13979* For example, when a folder is moved to the trash, only one event is reported because technically13980* this is a rename/move operation and not a delete operation for each files within.13981* On top of that, performance optimizations are in place to fold multiple events that all belong13982* to the same parent operation (e.g. delete folder) into one event for that parent. As such, if13983* you need to know about all deleted files, you have to watch with `**` and deal with all file13984* events yourself.13985*13986* *Note* that file events from recursive file watchers may be excluded based on user configuration.13987* The setting `files.watcherExclude` helps to reduce the overhead of file events from folders13988* that are known to produce many file changes at once (such as `.git` folders). As such,13989* it is highly recommended to watch with simple patterns that do not require recursive watchers13990* where the exclude settings are ignored and you have full control over the events.13991*13992* *Note* that symbolic links are not automatically followed for file watching unless the path to13993* watch itself is a symbolic link.13994*13995* *Note* that the file paths that are reported for having changed may have a different path casing13996* compared to the actual casing on disk on case-insensitive platforms (typically macOS and Windows13997* but not Linux). We allow a user to open a workspace folder with any desired path casing and try13998* to preserve that. This means:13999* * if the path is within any of the workspace folders, the path will match the casing of the14000* workspace folder up to that portion of the path and match the casing on disk for children14001* * if the path is outside of any of the workspace folders, the casing will match the case of the14002* path that was provided for watching14003* In the same way, symbolic links are preserved, i.e. the file event will report the path of the14004* symbolic link as it was provided for watching and not the target.14005*14006* ### Examples14007*14008* The basic anatomy of a file watcher is as follows:14009*14010* ```ts14011* const watcher = vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(<folder>, <pattern>));14012*14013* watcher.onDidChange(uri => { ... }); // listen to files being changed14014* watcher.onDidCreate(uri => { ... }); // listen to files/folders being created14015* watcher.onDidDelete(uri => { ... }); // listen to files/folders getting deleted14016*14017* watcher.dispose(); // dispose after usage14018* ```14019*14020* #### Workspace file watching14021*14022* If you only care about file events in a specific workspace folder:14023*14024* ```ts14025* vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(vscode.workspace.workspaceFolders[0], '**​/*.js'));14026* ```14027*14028* If you want to monitor file events across all opened workspace folders:14029*14030* ```ts14031* vscode.workspace.createFileSystemWatcher('**​/*.js');14032* ```14033*14034* *Note:* the array of workspace folders can be empty if no workspace is opened (empty window).14035*14036* #### Out of workspace file watching14037*14038* To watch a folder for changes to *.js files outside the workspace (non recursively), pass in a `Uri` to such14039* a folder:14040*14041* ```ts14042* vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(vscode.Uri.file(<path to folder outside workspace>), '*.js'));14043* ```14044*14045* And use a complex glob pattern to watch recursively:14046*14047* ```ts14048* vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(vscode.Uri.file(<path to folder outside workspace>), '**​/*.js'));14049* ```14050*14051* Here is an example for watching the active editor for file changes:14052*14053* ```ts14054* vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(vscode.window.activeTextEditor.document.uri, '*'));14055* ```14056*14057* @param globPattern A {@link GlobPattern glob pattern} that controls which file events the watcher should report.14058* @param ignoreCreateEvents Ignore when files have been created.14059* @param ignoreChangeEvents Ignore when files have been changed.14060* @param ignoreDeleteEvents Ignore when files have been deleted.14061* @returns A new file system watcher instance. Must be disposed when no longer needed.14062*/14063export function createFileSystemWatcher(globPattern: GlobPattern, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean): FileSystemWatcher;1406414065/**14066* Find files across all {@link workspace.workspaceFolders workspace folders} in the workspace.14067*14068* @example14069* findFiles('**​/*.js', '**​/node_modules/**', 10)14070*14071* @param include A {@link GlobPattern glob pattern} that defines the files to search for. The glob pattern14072* will be matched against the file paths of resulting matches relative to their workspace. Use a {@link RelativePattern relative pattern}14073* to restrict the search results to a {@link WorkspaceFolder workspace folder}.14074* @param exclude A {@link GlobPattern glob pattern} that defines files and folders to exclude. The glob pattern14075* will be matched against the file paths of resulting matches relative to their workspace. When `undefined`, default file-excludes (e.g. the `files.exclude`-setting14076* but not `search.exclude`) will apply. When `null`, no excludes will apply.14077* @param maxResults An upper-bound for the result.14078* @param token A token that can be used to signal cancellation to the underlying search engine.14079* @returns A thenable that resolves to an array of resource identifiers. Will return no results if no14080* {@link workspace.workspaceFolders workspace folders} are opened.14081*/14082export function findFiles(include: GlobPattern, exclude?: GlobPattern | null, maxResults?: number, token?: CancellationToken): Thenable<Uri[]>;1408314084/**14085* Saves the editor identified by the given resource and returns the resulting resource or `undefined`14086* if save was not successful or no editor with the given resource was found.14087*14088* **Note** that an editor with the provided resource must be opened in order to be saved.14089*14090* @param uri the associated uri for the opened editor to save.14091* @returns A thenable that resolves when the save operation has finished.14092*/14093export function save(uri: Uri): Thenable<Uri | undefined>;1409414095/**14096* Saves the editor identified by the given resource to a new file name as provided by the user and14097* returns the resulting resource or `undefined` if save was not successful or cancelled or no editor14098* with the given resource was found.14099*14100* **Note** that an editor with the provided resource must be opened in order to be saved as.14101*14102* @param uri the associated uri for the opened editor to save as.14103* @returns A thenable that resolves when the save-as operation has finished.14104*/14105export function saveAs(uri: Uri): Thenable<Uri | undefined>;1410614107/**14108* Save all dirty files.14109*14110* @param includeUntitled Also save files that have been created during this session.14111* @returns A thenable that resolves when the files have been saved. Will return `false`14112* for any file that failed to save.14113*/14114export function saveAll(includeUntitled?: boolean): Thenable<boolean>;1411514116/**14117* Make changes to one or many resources or create, delete, and rename resources as defined by the given14118* {@link WorkspaceEdit workspace edit}.14119*14120* All changes of a workspace edit are applied in the same order in which they have been added. If14121* multiple textual inserts are made at the same position, these strings appear in the resulting text14122* in the order the 'inserts' were made, unless that are interleaved with resource edits. Invalid sequences14123* like 'delete file a' -> 'insert text in file a' cause failure of the operation.14124*14125* When applying a workspace edit that consists only of text edits an 'all-or-nothing'-strategy is used.14126* A workspace edit with resource creations or deletions aborts the operation, e.g. consecutive edits will14127* not be attempted, when a single edit fails.14128*14129* @param edit A workspace edit.14130* @param metadata Optional {@link WorkspaceEditMetadata metadata} for the edit.14131* @returns A thenable that resolves when the edit could be applied.14132*/14133export function applyEdit(edit: WorkspaceEdit, metadata?: WorkspaceEditMetadata): Thenable<boolean>;1413414135/**14136* All text documents currently known to the editor.14137*/14138export const textDocuments: readonly TextDocument[];1413914140/**14141* Opens a document. Will return early if this document is already open. Otherwise14142* the document is loaded and the {@link workspace.onDidOpenTextDocument didOpen}-event fires.14143*14144* The document is denoted by an {@link Uri}. Depending on the {@link Uri.scheme scheme} the14145* following rules apply:14146* * `file`-scheme: Open a file on disk (`openTextDocument(Uri.file(path))`). Will be rejected if the file14147* does not exist or cannot be loaded.14148* * `untitled`-scheme: Open a blank untitled file with associated path (`openTextDocument(Uri.file(path).with({ scheme: 'untitled' }))`).14149* The language will be derived from the file name.14150* * For all other schemes contributed {@link TextDocumentContentProvider text document content providers} and14151* {@link FileSystemProvider file system providers} are consulted.14152*14153* *Note* that the lifecycle of the returned document is owned by the editor and not by the extension. That means an14154* {@linkcode workspace.onDidCloseTextDocument onDidClose}-event can occur at any time after opening it.14155*14156* @param uri Identifies the resource to open.14157* @returns A promise that resolves to a {@link TextDocument document}.14158*/14159export function openTextDocument(uri: Uri, options?: {14160/**14161* The {@link TextDocument.encoding encoding} of the document to use14162* for decoding the underlying buffer to text. If omitted, the encoding14163* will be guessed based on the file content and/or the editor settings14164* unless the document is already opened.14165*14166* Opening a text document that was already opened with a different encoding14167* has the potential of changing the text contents of the text document.14168* Specifically, when the encoding results in a different set of characters14169* than the previous encoding. As such, an error is thrown for dirty documents14170* when the specified encoding is different from the encoding of the document.14171*14172* See {@link TextDocument.encoding} for more information about valid14173* values for encoding. Using an unsupported encoding will fallback to the14174* default encoding for the document.14175*14176* *Note* that if you open a document with an encoding that does not14177* support decoding the underlying bytes, content may be replaced with14178* substitution characters as appropriate.14179*/14180readonly encoding?: string;14181}): Thenable<TextDocument>;1418214183/**14184* A short-hand for `openTextDocument(Uri.file(path))`.14185*14186* @see {@link workspace.openTextDocument}14187* @param path A path of a file on disk.14188* @returns A promise that resolves to a {@link TextDocument document}.14189*/14190export function openTextDocument(path: string, options?: {14191/**14192* The {@link TextDocument.encoding encoding} of the document to use14193* for decoding the underlying buffer to text. If omitted, the encoding14194* will be guessed based on the file content and/or the editor settings14195* unless the document is already opened.14196*14197* Opening a text document that was already opened with a different encoding14198* has the potential of changing the text contents of the text document.14199* Specifically, when the encoding results in a different set of characters14200* than the previous encoding. As such, an error is thrown for dirty documents14201* when the specified encoding is different from the encoding of the document.14202*14203* See {@link TextDocument.encoding} for more information about valid14204* values for encoding. Using an unsupported encoding will fallback to the14205* default encoding for the document.14206*14207* *Note* that if you open a document with an encoding that does not14208* support decoding the underlying bytes, content may be replaced with14209* substitution characters as appropriate.14210*/14211readonly encoding?: string;14212}): Thenable<TextDocument>;1421314214/**14215* Opens an untitled text document. The editor will prompt the user for a file14216* path when the document is to be saved. The `options` parameter allows to14217* specify the *language* and/or the *content* of the document.14218*14219* @param options Options to control how the document will be created.14220* @returns A promise that resolves to a {@link TextDocument document}.14221*/14222export function openTextDocument(options?: {14223/**14224* The {@link TextDocument.languageId language} of the document.14225*/14226language?: string;14227/**14228* The initial contents of the document.14229*/14230content?: string;14231/**14232* The {@link TextDocument.encoding encoding} of the document.14233*14234* See {@link TextDocument.encoding} for more information about valid14235* values for encoding. Using an unsupported encoding will fallback to the14236* default encoding for the document.14237*/14238readonly encoding?: string;14239}): Thenable<TextDocument>;1424014241/**14242* Register a text document content provider.14243*14244* Only one provider can be registered per scheme.14245*14246* @param scheme The uri-scheme to register for.14247* @param provider A content provider.14248* @returns A {@link Disposable} that unregisters this provider when being disposed.14249*/14250export function registerTextDocumentContentProvider(scheme: string, provider: TextDocumentContentProvider): Disposable;1425114252/**14253* An event that is emitted when a {@link TextDocument text document} is opened or when the language id14254* of a text document {@link languages.setTextDocumentLanguage has been changed}.14255*14256* To add an event listener when a visible text document is opened, use the {@link TextEditor} events in the14257* {@link window} namespace. Note that:14258*14259* - The event is emitted before the {@link TextDocument document} is updated in the14260* {@link window.activeTextEditor active text editor}14261* - When a {@link TextDocument text document} is already open (e.g.: open in another {@link window.visibleTextEditors visible text editor}) this event is not emitted14262*14263*/14264export const onDidOpenTextDocument: Event<TextDocument>;1426514266/**14267* An event that is emitted when a {@link TextDocument text document} is disposed or when the language id14268* of a text document {@link languages.setTextDocumentLanguage has been changed}.14269*14270* *Note 1:* There is no guarantee that this event fires when an editor tab is closed, use the14271* {@linkcode window.onDidChangeVisibleTextEditors onDidChangeVisibleTextEditors}-event to know when editors change.14272*14273* *Note 2:* A document can be open but not shown in an editor which means this event can fire14274* for a document that has not been shown in an editor.14275*/14276export const onDidCloseTextDocument: Event<TextDocument>;1427714278/**14279* An event that is emitted when a {@link TextDocument text document} is changed. This usually happens14280* when the {@link TextDocument.getText contents} changes but also when other things like the14281* {@link TextDocument.isDirty dirty}-state changes.14282*/14283export const onDidChangeTextDocument: Event<TextDocumentChangeEvent>;1428414285/**14286* An event that is emitted when a {@link TextDocument text document} will be saved to disk.14287*14288* *Note 1:* Subscribers can delay saving by registering asynchronous work. For the sake of data integrity the editor14289* might save without firing this event. For instance when shutting down with dirty files.14290*14291* *Note 2:* Subscribers are called sequentially and they can {@link TextDocumentWillSaveEvent.waitUntil delay} saving14292* by registering asynchronous work. Protection against misbehaving listeners is implemented as such:14293* * there is an overall time budget that all listeners share and if that is exhausted no further listener is called14294* * listeners that take a long time or produce errors frequently will not be called anymore14295*14296* The current thresholds are 1.5 seconds as overall time budget and a listener can misbehave 3 times before being ignored.14297*/14298export const onWillSaveTextDocument: Event<TextDocumentWillSaveEvent>;1429914300/**14301* An event that is emitted when a {@link TextDocument text document} is saved to disk.14302*/14303export const onDidSaveTextDocument: Event<TextDocument>;1430414305/**14306* All notebook documents currently known to the editor.14307*/14308export const notebookDocuments: readonly NotebookDocument[];1430914310/**14311* Open a notebook. Will return early if this notebook is already {@link notebookDocuments loaded}. Otherwise14312* the notebook is loaded and the {@linkcode onDidOpenNotebookDocument}-event fires.14313*14314* *Note* that the lifecycle of the returned notebook is owned by the editor and not by the extension. That means an14315* {@linkcode onDidCloseNotebookDocument}-event can occur at any time after.14316*14317* *Note* that opening a notebook does not show a notebook editor. This function only returns a notebook document which14318* can be shown in a notebook editor but it can also be used for other things.14319*14320* @param uri The resource to open.14321* @returns A promise that resolves to a {@link NotebookDocument notebook}14322*/14323export function openNotebookDocument(uri: Uri): Thenable<NotebookDocument>;1432414325/**14326* Open an untitled notebook. The editor will prompt the user for a file14327* path when the document is to be saved.14328*14329* @see {@link workspace.openNotebookDocument}14330* @param notebookType The notebook type that should be used.14331* @param content The initial contents of the notebook.14332* @returns A promise that resolves to a {@link NotebookDocument notebook}.14333*/14334export function openNotebookDocument(notebookType: string, content?: NotebookData): Thenable<NotebookDocument>;1433514336/**14337* An event that is emitted when a {@link NotebookDocument notebook} has changed.14338*/14339export const onDidChangeNotebookDocument: Event<NotebookDocumentChangeEvent>;1434014341/**14342* An event that is emitted when a {@link NotebookDocument notebook document} will be saved to disk.14343*14344* *Note 1:* Subscribers can delay saving by registering asynchronous work. For the sake of data integrity the editor14345* might save without firing this event. For instance when shutting down with dirty files.14346*14347* *Note 2:* Subscribers are called sequentially and they can {@link NotebookDocumentWillSaveEvent.waitUntil delay} saving14348* by registering asynchronous work. Protection against misbehaving listeners is implemented as such:14349* * there is an overall time budget that all listeners share and if that is exhausted no further listener is called14350* * listeners that take a long time or produce errors frequently will not be called anymore14351*14352* The current thresholds are 1.5 seconds as overall time budget and a listener can misbehave 3 times before being ignored.14353*/14354export const onWillSaveNotebookDocument: Event<NotebookDocumentWillSaveEvent>;1435514356/**14357* An event that is emitted when a {@link NotebookDocument notebook} is saved.14358*/14359export const onDidSaveNotebookDocument: Event<NotebookDocument>;1436014361/**14362* Register a {@link NotebookSerializer notebook serializer}.14363*14364* A notebook serializer must be contributed through the `notebooks` extension point. When opening a notebook file, the editor will send14365* the `onNotebook:<notebookType>` activation event, and extensions must register their serializer in return.14366*14367* @param notebookType A notebook.14368* @param serializer A notebook serializer.14369* @param options Optional context options that define what parts of a notebook should be persisted14370* @returns A {@link Disposable} that unregisters this serializer when being disposed.14371*/14372export function registerNotebookSerializer(notebookType: string, serializer: NotebookSerializer, options?: NotebookDocumentContentOptions): Disposable;1437314374/**14375* An event that is emitted when a {@link NotebookDocument notebook} is opened.14376*/14377export const onDidOpenNotebookDocument: Event<NotebookDocument>;1437814379/**14380* An event that is emitted when a {@link NotebookDocument notebook} is disposed.14381*14382* *Note 1:* There is no guarantee that this event fires when an editor tab is closed.14383*14384* *Note 2:* A notebook can be open but not shown in an editor which means this event can fire14385* for a notebook that has not been shown in an editor.14386*/14387export const onDidCloseNotebookDocument: Event<NotebookDocument>;1438814389/**14390* An event that is emitted when files are being created.14391*14392* *Note 1:* This event is triggered by user gestures, like creating a file from the14393* explorer, or from the {@linkcode workspace.applyEdit}-api. This event is *not* fired when14394* files change on disk, e.g triggered by another application, or when using the14395* {@linkcode FileSystem workspace.fs}-api.14396*14397* *Note 2:* When this event is fired, edits to files that are are being created cannot be applied.14398*/14399export const onWillCreateFiles: Event<FileWillCreateEvent>;1440014401/**14402* An event that is emitted when files have been created.14403*14404* *Note:* This event is triggered by user gestures, like creating a file from the14405* explorer, or from the {@linkcode workspace.applyEdit}-api, but this event is *not* fired when14406* files change on disk, e.g triggered by another application, or when using the14407* {@linkcode FileSystem workspace.fs}-api.14408*/14409export const onDidCreateFiles: Event<FileCreateEvent>;1441014411/**14412* An event that is emitted when files are being deleted.14413*14414* *Note 1:* This event is triggered by user gestures, like deleting a file from the14415* explorer, or from the {@linkcode workspace.applyEdit}-api, but this event is *not* fired when14416* files change on disk, e.g triggered by another application, or when using the14417* {@linkcode FileSystem workspace.fs}-api.14418*14419* *Note 2:* When deleting a folder with children only one event is fired.14420*/14421export const onWillDeleteFiles: Event<FileWillDeleteEvent>;1442214423/**14424* An event that is emitted when files have been deleted.14425*14426* *Note 1:* This event is triggered by user gestures, like deleting a file from the14427* explorer, or from the {@linkcode workspace.applyEdit}-api, but this event is *not* fired when14428* files change on disk, e.g triggered by another application, or when using the14429* {@linkcode FileSystem workspace.fs}-api.14430*14431* *Note 2:* When deleting a folder with children only one event is fired.14432*/14433export const onDidDeleteFiles: Event<FileDeleteEvent>;1443414435/**14436* An event that is emitted when files are being renamed.14437*14438* *Note 1:* This event is triggered by user gestures, like renaming a file from the14439* explorer, and from the {@linkcode workspace.applyEdit}-api, but this event is *not* fired when14440* files change on disk, e.g triggered by another application, or when using the14441* {@linkcode FileSystem workspace.fs}-api.14442*14443* *Note 2:* When renaming a folder with children only one event is fired.14444*/14445export const onWillRenameFiles: Event<FileWillRenameEvent>;1444614447/**14448* An event that is emitted when files have been renamed.14449*14450* *Note 1:* This event is triggered by user gestures, like renaming a file from the14451* explorer, and from the {@linkcode workspace.applyEdit}-api, but this event is *not* fired when14452* files change on disk, e.g triggered by another application, or when using the14453* {@linkcode FileSystem workspace.fs}-api.14454*14455* *Note 2:* When renaming a folder with children only one event is fired.14456*/14457export const onDidRenameFiles: Event<FileRenameEvent>;1445814459/**14460* Get a workspace configuration object.14461*14462* When a section-identifier is provided only that part of the configuration14463* is returned. Dots in the section-identifier are interpreted as child-access,14464* like `{ myExt: { setting: { doIt: true }}}` and `getConfiguration('myExt.setting').get('doIt') === true`.14465*14466* When a scope is provided configuration confined to that scope is returned. Scope can be a resource or a language identifier or both.14467*14468* @param section A dot-separated identifier.14469* @param scope A scope for which the configuration is asked for.14470* @returns The full configuration or a subset.14471*/14472export function getConfiguration(section?: string, scope?: ConfigurationScope | null): WorkspaceConfiguration;1447314474/**14475* An event that is emitted when the {@link WorkspaceConfiguration configuration} changed.14476*/14477export const onDidChangeConfiguration: Event<ConfigurationChangeEvent>;1447814479/**14480* Register a task provider.14481*14482* @deprecated Use the corresponding function on the `tasks` namespace instead14483*14484* @param type The task kind type this provider is registered for.14485* @param provider A task provider.14486* @returns A {@link Disposable} that unregisters this provider when being disposed.14487*/14488export function registerTaskProvider(type: string, provider: TaskProvider): Disposable;1448914490/**14491* Register a filesystem provider for a given scheme, e.g. `ftp`.14492*14493* There can only be one provider per scheme and an error is being thrown when a scheme14494* has been claimed by another provider or when it is reserved.14495*14496* @param scheme The uri-{@link Uri.scheme scheme} the provider registers for.14497* @param provider The filesystem provider.14498* @param options Immutable metadata about the provider.14499* @returns A {@link Disposable} that unregisters this provider when being disposed.14500*/14501export function registerFileSystemProvider(scheme: string, provider: FileSystemProvider, options?: {14502/**14503* Whether the file system provider use case sensitive compare for {@link Uri.path paths}14504*/14505readonly isCaseSensitive?: boolean;14506/**14507* Whether the file system provider is readonly, no modifications like write, delete, create are possible.14508* If a {@link MarkdownString} is given, it will be shown as the reason why the file system is readonly.14509*/14510readonly isReadonly?: boolean | MarkdownString;14511}): Disposable;1451214513/**14514* When true, the user has explicitly trusted the contents of the workspace.14515*/14516export const isTrusted: boolean;1451714518/**14519* Event that fires when the current workspace has been trusted.14520*/14521export const onDidGrantWorkspaceTrust: Event<void>;1452214523/**14524* Decodes the content from a `Uint8Array` to a `string`. You MUST14525* provide the entire content at once to ensure that the encoding14526* can properly apply. Do not use this method to decode content14527* in chunks, as that may lead to incorrect results.14528*14529* Will pick an encoding based on settings and the content of the14530* buffer (for example byte order marks).14531*14532* *Note* that if you decode content that is unsupported by the14533* encoding, the result may contain substitution characters as14534* appropriate.14535*14536* @throws This method will throw an error when the content is binary.14537*14538* @param content The text content to decode as a `Uint8Array`.14539* @returns A thenable that resolves to the decoded `string`.14540*/14541export function decode(content: Uint8Array): Thenable<string>;1454214543/**14544* Decodes the content from a `Uint8Array` to a `string` using the14545* provided encoding. You MUST provide the entire content at once14546* to ensure that the encoding can properly apply. Do not use this14547* method to decode content in chunks, as that may lead to incorrect14548* results.14549*14550* *Note* that if you decode content that is unsupported by the14551* encoding, the result may contain substitution characters as14552* appropriate.14553*14554* @throws This method will throw an error when the content is binary.14555*14556* @param content The text content to decode as a `Uint8Array`.14557* @param options Additional context for picking the encoding.14558* @returns A thenable that resolves to the decoded `string`.14559*/14560export function decode(content: Uint8Array, options: {14561/**14562* Allows to explicitly pick the encoding to use.14563* See {@link TextDocument.encoding} for more information14564* about valid values for encoding.14565* Using an unsupported encoding will fallback to the14566* default configured encoding.14567*/14568readonly encoding: string;14569}): Thenable<string>;1457014571/**14572* Decodes the content from a `Uint8Array` to a `string`. You MUST14573* provide the entire content at once to ensure that the encoding14574* can properly apply. Do not use this method to decode content14575* in chunks, as that may lead to incorrect results.14576*14577* The encoding is picked based on settings and the content14578* of the buffer (for example byte order marks).14579*14580* *Note* that if you decode content that is unsupported by the14581* encoding, the result may contain substitution characters as14582* appropriate.14583*14584* @throws This method will throw an error when the content is binary.14585*14586* @param content The content to decode as a `Uint8Array`.14587* @param options Additional context for picking the encoding.14588* @returns A thenable that resolves to the decoded `string`.14589*/14590export function decode(content: Uint8Array, options: {14591/**14592* The URI that represents the file if known. This information14593* is used to figure out the encoding related configuration14594* for the file if any.14595*/14596readonly uri: Uri;14597}): Thenable<string>;1459814599/**14600* Encodes the content of a `string` to a `Uint8Array`.14601*14602* Will pick an encoding based on settings.14603*14604* @param content The content to decode as a `string`.14605* @returns A thenable that resolves to the encoded `Uint8Array`.14606*/14607export function encode(content: string): Thenable<Uint8Array>;1460814609/**14610* Encodes the content of a `string` to a `Uint8Array` using the14611* provided encoding.14612*14613* @param content The content to decode as a `string`.14614* @param options Additional context for picking the encoding.14615* @returns A thenable that resolves to the encoded `Uint8Array`.14616*/14617export function encode(content: string, options: {14618/**14619* Allows to explicitly pick the encoding to use.14620* See {@link TextDocument.encoding} for more information14621* about valid values for encoding.14622* Using an unsupported encoding will fallback to the14623* default configured encoding.14624*/14625readonly encoding: string;14626}): Thenable<Uint8Array>;1462714628/**14629* Encodes the content of a `string` to a `Uint8Array`.14630*14631* The encoding is picked based on settings.14632*14633* @param content The content to decode as a `string`.14634* @param options Additional context for picking the encoding.14635* @returns A thenable that resolves to the encoded `Uint8Array`.14636*/14637export function encode(content: string, options: {14638/**14639* The URI that represents the file if known. This information14640* is used to figure out the encoding related configuration14641* for the file if any.14642*/14643readonly uri: Uri;14644}): Thenable<Uint8Array>;14645}1464614647/**14648* The configuration scope which can be:14649* - a {@link Uri} representing a resource14650* - a {@link TextDocument} representing an open text document14651* - a {@link WorkspaceFolder} representing a workspace folder14652* - an object containing:14653* - `uri`: an optional {@link Uri} of a text document14654* - `languageId`: the language identifier of a text document14655*/14656export type ConfigurationScope = Uri | TextDocument | WorkspaceFolder | {14657/**14658* The uri of a {@link TextDocument text document}14659*/14660uri?: Uri;14661/**14662* The language of a text document14663*/14664languageId: string;14665};1466614667/**14668* An event describing the change in Configuration14669*/14670export interface ConfigurationChangeEvent {1467114672/**14673* Checks if the given section has changed.14674* If scope is provided, checks if the section has changed for resources under the given scope.14675*14676* @param section Configuration name, supports _dotted_ names.14677* @param scope A scope in which to check.14678* @returns `true` if the given section has changed.14679*/14680affectsConfiguration(section: string, scope?: ConfigurationScope): boolean;14681}1468214683/**14684* Namespace for participating in language-specific editor [features](https://code.visualstudio.com/docs/editor/editingevolved),14685* like IntelliSense, code actions, diagnostics etc.14686*14687* Many programming languages exist and there is huge variety in syntaxes, semantics, and paradigms. Despite that, features14688* like automatic word-completion, code navigation, or code checking have become popular across different tools for different14689* programming languages.14690*14691* The editor provides an API that makes it simple to provide such common features by having all UI and actions already in place and14692* by allowing you to participate by providing data only. For instance, to contribute a hover all you have to do is provide a function14693* that can be called with a {@link TextDocument} and a {@link Position} returning hover info. The rest, like tracking the14694* mouse, positioning the hover, keeping the hover stable etc. is taken care of by the editor.14695*14696* ```javascript14697* languages.registerHoverProvider('javascript', {14698* provideHover(document, position, token) {14699* return new Hover('I am a hover!');14700* }14701* });14702* ```14703*14704* Registration is done using a {@link DocumentSelector document selector} which is either a language id, like `javascript` or14705* a more complex {@link DocumentFilter filter} like `{ language: 'typescript', scheme: 'file' }`. Matching a document against such14706* a selector will result in a {@link languages.match score} that is used to determine if and how a provider shall be used. When14707* scores are equal the provider that came last wins. For features that allow full arity, like {@link languages.registerHoverProvider hover},14708* the score is only checked to be `>0`, for other features, like {@link languages.registerCompletionItemProvider IntelliSense} the14709* score is used for determining the order in which providers are asked to participate.14710*/14711export namespace languages {1471214713/**14714* Return the identifiers of all known languages.14715* @returns Promise resolving to an array of identifier strings.14716*/14717export function getLanguages(): Thenable<string[]>;1471814719/**14720* Set (and change) the {@link TextDocument.languageId language} that is associated14721* with the given document.14722*14723* *Note* that calling this function will trigger the {@linkcode workspace.onDidCloseTextDocument onDidCloseTextDocument} event14724* followed by the {@linkcode workspace.onDidOpenTextDocument onDidOpenTextDocument} event.14725*14726* @param document The document which language is to be changed14727* @param languageId The new language identifier.14728* @returns A thenable that resolves with the updated document.14729*/14730export function setTextDocumentLanguage(document: TextDocument, languageId: string): Thenable<TextDocument>;1473114732/**14733* Compute the match between a document {@link DocumentSelector selector} and a document. Values14734* greater than zero mean the selector matches the document.14735*14736* A match is computed according to these rules:14737* 1. When {@linkcode DocumentSelector} is an array, compute the match for each contained `DocumentFilter` or language identifier and take the maximum value.14738* 2. A string will be desugared to become the `language`-part of a {@linkcode DocumentFilter}, so `"fooLang"` is like `{ language: "fooLang" }`.14739* 3. A {@linkcode DocumentFilter} will be matched against the document by comparing its parts with the document. The following rules apply:14740* 1. When the `DocumentFilter` is empty (`{}`) the result is `0`14741* 2. When `scheme`, `language`, `pattern`, or `notebook` are defined but one doesn't match, the result is `0`14742* 3. Matching against `*` gives a score of `5`, matching via equality or via a glob-pattern gives a score of `10`14743* 4. The result is the maximum value of each match14744*14745* Samples:14746* ```js14747* // default document from disk (file-scheme)14748* doc.uri; //'file:///my/file.js'14749* doc.languageId; // 'javascript'14750* match('javascript', doc); // 10;14751* match({ language: 'javascript' }, doc); // 10;14752* match({ language: 'javascript', scheme: 'file' }, doc); // 10;14753* match('*', doc); // 514754* match('fooLang', doc); // 014755* match(['fooLang', '*'], doc); // 514756*14757* // virtual document, e.g. from git-index14758* doc.uri; // 'git:/my/file.js'14759* doc.languageId; // 'javascript'14760* match('javascript', doc); // 10;14761* match({ language: 'javascript', scheme: 'git' }, doc); // 10;14762* match('*', doc); // 514763*14764* // notebook cell document14765* doc.uri; // `vscode-notebook-cell:///my/notebook.ipynb#gl65s2pmha`;14766* doc.languageId; // 'python'14767* match({ notebookType: 'jupyter-notebook' }, doc) // 1014768* match({ notebookType: 'fooNotebook', language: 'python' }, doc) // 014769* match({ language: 'python' }, doc) // 1014770* match({ notebookType: '*' }, doc) // 514771* ```14772*14773* @param selector A document selector.14774* @param document A text document.14775* @returns A number `>0` when the selector matches and `0` when the selector does not match.14776*/14777export function match(selector: DocumentSelector, document: TextDocument): number;1477814779/**14780* An {@link Event} which fires when the global set of diagnostics changes. This is14781* newly added and removed diagnostics.14782*/14783export const onDidChangeDiagnostics: Event<DiagnosticChangeEvent>;1478414785/**14786* Get all diagnostics for a given resource.14787*14788* @param resource A resource14789* @returns An array of {@link Diagnostic diagnostics} objects or an empty array.14790*/14791export function getDiagnostics(resource: Uri): Diagnostic[];1479214793/**14794* Get all diagnostics.14795*14796* @returns An array of uri-diagnostics tuples or an empty array.14797*/14798export function getDiagnostics(): [Uri, Diagnostic[]][];1479914800/**14801* Create a diagnostics collection.14802*14803* @param name The {@link DiagnosticCollection.name name} of the collection.14804* @returns A new diagnostic collection.14805*/14806export function createDiagnosticCollection(name?: string): DiagnosticCollection;1480714808/**14809* Creates a new {@link LanguageStatusItem language status item}.14810*14811* @param id The identifier of the item.14812* @param selector The document selector that defines for what editors the item shows.14813* @returns A new language status item.14814*/14815export function createLanguageStatusItem(id: string, selector: DocumentSelector): LanguageStatusItem;1481614817/**14818* Register a completion provider.14819*14820* Multiple providers can be registered for a language. In that case providers are sorted14821* by their {@link languages.match score} and groups of equal score are sequentially asked for14822* completion items. The process stops when one or many providers of a group return a14823* result. A failing provider (rejected promise or exception) will not fail the whole14824* operation.14825*14826* A completion item provider can be associated with a set of `triggerCharacters`. When trigger14827* characters are being typed, completions are requested but only from providers that registered14828* the typed character. Because of that trigger characters should be different than {@link LanguageConfiguration.wordPattern word characters},14829* a common trigger character is `.` to trigger member completions.14830*14831* @param selector A selector that defines the documents this provider is applicable to.14832* @param provider A completion provider.14833* @param triggerCharacters Trigger completion when the user types one of the characters.14834* @returns A {@link Disposable} that unregisters this provider when being disposed.14835*/14836export function registerCompletionItemProvider(selector: DocumentSelector, provider: CompletionItemProvider, ...triggerCharacters: string[]): Disposable;1483714838/**14839* Registers an inline completion provider.14840*14841* Multiple providers can be registered for a language. In that case providers are asked in14842* parallel and the results are merged. A failing provider (rejected promise or exception) will14843* not cause a failure of the whole operation.14844*14845* @param selector A selector that defines the documents this provider is applicable to.14846* @param provider An inline completion provider.14847* @returns A {@link Disposable} that unregisters this provider when being disposed.14848*/14849export function registerInlineCompletionItemProvider(selector: DocumentSelector, provider: InlineCompletionItemProvider): Disposable;1485014851/**14852* Register a code action provider.14853*14854* Multiple providers can be registered for a language. In that case providers are asked in14855* parallel and the results are merged. A failing provider (rejected promise or exception) will14856* not cause a failure of the whole operation.14857*14858* @param selector A selector that defines the documents this provider is applicable to.14859* @param provider A code action provider.14860* @param metadata Metadata about the kind of code actions the provider provides.14861* @returns A {@link Disposable} that unregisters this provider when being disposed.14862*/14863export function registerCodeActionsProvider(selector: DocumentSelector, provider: CodeActionProvider, metadata?: CodeActionProviderMetadata): Disposable;1486414865/**14866* Register a code lens provider.14867*14868* Multiple providers can be registered for a language. In that case providers are asked in14869* parallel and the results are merged. A failing provider (rejected promise or exception) will14870* not cause a failure of the whole operation.14871*14872* @param selector A selector that defines the documents this provider is applicable to.14873* @param provider A code lens provider.14874* @returns A {@link Disposable} that unregisters this provider when being disposed.14875*/14876export function registerCodeLensProvider(selector: DocumentSelector, provider: CodeLensProvider): Disposable;1487714878/**14879* Register a definition provider.14880*14881* Multiple providers can be registered for a language. In that case providers are asked in14882* parallel and the results are merged. A failing provider (rejected promise or exception) will14883* not cause a failure of the whole operation.14884*14885* @param selector A selector that defines the documents this provider is applicable to.14886* @param provider A definition provider.14887* @returns A {@link Disposable} that unregisters this provider when being disposed.14888*/14889export function registerDefinitionProvider(selector: DocumentSelector, provider: DefinitionProvider): Disposable;1489014891/**14892* Register an implementation provider.14893*14894* Multiple providers can be registered for a language. In that case providers are asked in14895* parallel and the results are merged. A failing provider (rejected promise or exception) will14896* not cause a failure of the whole operation.14897*14898* @param selector A selector that defines the documents this provider is applicable to.14899* @param provider An implementation provider.14900* @returns A {@link Disposable} that unregisters this provider when being disposed.14901*/14902export function registerImplementationProvider(selector: DocumentSelector, provider: ImplementationProvider): Disposable;1490314904/**14905* Register a type definition provider.14906*14907* Multiple providers can be registered for a language. In that case providers are asked in14908* parallel and the results are merged. A failing provider (rejected promise or exception) will14909* not cause a failure of the whole operation.14910*14911* @param selector A selector that defines the documents this provider is applicable to.14912* @param provider A type definition provider.14913* @returns A {@link Disposable} that unregisters this provider when being disposed.14914*/14915export function registerTypeDefinitionProvider(selector: DocumentSelector, provider: TypeDefinitionProvider): Disposable;1491614917/**14918* Register a declaration provider.14919*14920* Multiple providers can be registered for a language. In that case providers are asked in14921* parallel and the results are merged. A failing provider (rejected promise or exception) will14922* not cause a failure of the whole operation.14923*14924* @param selector A selector that defines the documents this provider is applicable to.14925* @param provider A declaration provider.14926* @returns A {@link Disposable} that unregisters this provider when being disposed.14927*/14928export function registerDeclarationProvider(selector: DocumentSelector, provider: DeclarationProvider): Disposable;1492914930/**14931* Register a hover provider.14932*14933* Multiple providers can be registered for a language. In that case providers are asked in14934* parallel and the results are merged. A failing provider (rejected promise or exception) will14935* not cause a failure of the whole operation.14936*14937* @param selector A selector that defines the documents this provider is applicable to.14938* @param provider A hover provider.14939* @returns A {@link Disposable} that unregisters this provider when being disposed.14940*/14941export function registerHoverProvider(selector: DocumentSelector, provider: HoverProvider): Disposable;1494214943/**14944* Register a provider that locates evaluatable expressions in text documents.14945* The editor will evaluate the expression in the active debug session and will show the result in the debug hover.14946*14947* If multiple providers are registered for a language an arbitrary provider will be used.14948*14949* @param selector A selector that defines the documents this provider is applicable to.14950* @param provider An evaluatable expression provider.14951* @returns A {@link Disposable} that unregisters this provider when being disposed.14952*/14953export function registerEvaluatableExpressionProvider(selector: DocumentSelector, provider: EvaluatableExpressionProvider): Disposable;1495414955/**14956* Register a provider that returns data for the debugger's 'inline value' feature.14957* Whenever the generic debugger has stopped in a source file, providers registered for the language of the file14958* are called to return textual data that will be shown in the editor at the end of lines.14959*14960* Multiple providers can be registered for a language. In that case providers are asked in14961* parallel and the results are merged. A failing provider (rejected promise or exception) will14962* not cause a failure of the whole operation.14963*14964* @param selector A selector that defines the documents this provider is applicable to.14965* @param provider An inline values provider.14966* @returns A {@link Disposable} that unregisters this provider when being disposed.14967*/14968export function registerInlineValuesProvider(selector: DocumentSelector, provider: InlineValuesProvider): Disposable;1496914970/**14971* Register a document highlight provider.14972*14973* Multiple providers can be registered for a language. In that case providers are sorted14974* by their {@link languages.match score} and groups sequentially asked for document highlights.14975* The process stops when a provider returns a `non-falsy` or `non-failure` result.14976*14977* @param selector A selector that defines the documents this provider is applicable to.14978* @param provider A document highlight provider.14979* @returns A {@link Disposable} that unregisters this provider when being disposed.14980*/14981export function registerDocumentHighlightProvider(selector: DocumentSelector, provider: DocumentHighlightProvider): Disposable;1498214983/**14984* Register a document symbol provider.14985*14986* Multiple providers can be registered for a language. In that case providers are asked in14987* parallel and the results are merged. A failing provider (rejected promise or exception) will14988* not cause a failure of the whole operation.14989*14990* @param selector A selector that defines the documents this provider is applicable to.14991* @param provider A document symbol provider.14992* @param metaData metadata about the provider14993* @returns A {@link Disposable} that unregisters this provider when being disposed.14994*/14995export function registerDocumentSymbolProvider(selector: DocumentSelector, provider: DocumentSymbolProvider, metaData?: DocumentSymbolProviderMetadata): Disposable;1499614997/**14998* Register a workspace symbol provider.14999*15000* Multiple providers can be registered. In that case providers are asked in parallel and15001* the results are merged. A failing provider (rejected promise or exception) will not cause15002* a failure of the whole operation.15003*15004* @param provider A workspace symbol provider.15005* @returns A {@link Disposable} that unregisters this provider when being disposed.15006*/15007export function registerWorkspaceSymbolProvider(provider: WorkspaceSymbolProvider): Disposable;1500815009/**15010* Register a reference provider.15011*15012* Multiple providers can be registered for a language. In that case providers are asked in15013* parallel and the results are merged. A failing provider (rejected promise or exception) will15014* not cause a failure of the whole operation.15015*15016* @param selector A selector that defines the documents this provider is applicable to.15017* @param provider A reference provider.15018* @returns A {@link Disposable} that unregisters this provider when being disposed.15019*/15020export function registerReferenceProvider(selector: DocumentSelector, provider: ReferenceProvider): Disposable;1502115022/**15023* Register a rename provider.15024*15025* Multiple providers can be registered for a language. In that case providers are sorted15026* by their {@link languages.match score} and asked in sequence. The first provider producing a result15027* defines the result of the whole operation.15028*15029* @param selector A selector that defines the documents this provider is applicable to.15030* @param provider A rename provider.15031* @returns A {@link Disposable} that unregisters this provider when being disposed.15032*/15033export function registerRenameProvider(selector: DocumentSelector, provider: RenameProvider): Disposable;1503415035/**15036* Register a semantic tokens provider for a whole document.15037*15038* Multiple providers can be registered for a language. In that case providers are sorted15039* by their {@link languages.match score} and the best-matching provider is used. Failure15040* of the selected provider will cause a failure of the whole operation.15041*15042* @param selector A selector that defines the documents this provider is applicable to.15043* @param provider A document semantic tokens provider.15044* @returns A {@link Disposable} that unregisters this provider when being disposed.15045*/15046export function registerDocumentSemanticTokensProvider(selector: DocumentSelector, provider: DocumentSemanticTokensProvider, legend: SemanticTokensLegend): Disposable;1504715048/**15049* Register a semantic tokens provider for a document range.15050*15051* *Note:* If a document has both a `DocumentSemanticTokensProvider` and a `DocumentRangeSemanticTokensProvider`,15052* the range provider will be invoked only initially, for the time in which the full document provider takes15053* to resolve the first request. Once the full document provider resolves the first request, the semantic tokens15054* provided via the range provider will be discarded and from that point forward, only the document provider15055* will be used.15056*15057* Multiple providers can be registered for a language. In that case providers are sorted15058* by their {@link languages.match score} and the best-matching provider is used. Failure15059* of the selected provider will cause a failure of the whole operation.15060*15061* @param selector A selector that defines the documents this provider is applicable to.15062* @param provider A document range semantic tokens provider.15063* @returns A {@link Disposable} that unregisters this provider when being disposed.15064*/15065export function registerDocumentRangeSemanticTokensProvider(selector: DocumentSelector, provider: DocumentRangeSemanticTokensProvider, legend: SemanticTokensLegend): Disposable;1506615067/**15068* Register a formatting provider for a document.15069*15070* Multiple providers can be registered for a language. In that case providers are sorted15071* by their {@link languages.match score} and the best-matching provider is used. Failure15072* of the selected provider will cause a failure of the whole operation.15073*15074* @param selector A selector that defines the documents this provider is applicable to.15075* @param provider A document formatting edit provider.15076* @returns A {@link Disposable} that unregisters this provider when being disposed.15077*/15078export function registerDocumentFormattingEditProvider(selector: DocumentSelector, provider: DocumentFormattingEditProvider): Disposable;1507915080/**15081* Register a formatting provider for a document range.15082*15083* *Note:* A document range provider is also a {@link DocumentFormattingEditProvider document formatter}15084* which means there is no need to {@link languages.registerDocumentFormattingEditProvider register} a document15085* formatter when also registering a range provider.15086*15087* Multiple providers can be registered for a language. In that case providers are sorted15088* by their {@link languages.match score} and the best-matching provider is used. Failure15089* of the selected provider will cause a failure of the whole operation.15090*15091* @param selector A selector that defines the documents this provider is applicable to.15092* @param provider A document range formatting edit provider.15093* @returns A {@link Disposable} that unregisters this provider when being disposed.15094*/15095export function registerDocumentRangeFormattingEditProvider(selector: DocumentSelector, provider: DocumentRangeFormattingEditProvider): Disposable;1509615097/**15098* Register a formatting provider that works on type. The provider is active when the user enables the setting `editor.formatOnType`.15099*15100* Multiple providers can be registered for a language. In that case providers are sorted15101* by their {@link languages.match score} and the best-matching provider is used. Failure15102* of the selected provider will cause a failure of the whole operation.15103*15104* @param selector A selector that defines the documents this provider is applicable to.15105* @param provider An on type formatting edit provider.15106* @param firstTriggerCharacter A character on which formatting should be triggered, like `}`.15107* @param moreTriggerCharacter More trigger characters.15108* @returns A {@link Disposable} that unregisters this provider when being disposed.15109*/15110export function registerOnTypeFormattingEditProvider(selector: DocumentSelector, provider: OnTypeFormattingEditProvider, firstTriggerCharacter: string, ...moreTriggerCharacter: string[]): Disposable;1511115112/**15113* Register a signature help provider.15114*15115* Multiple providers can be registered for a language. In that case providers are sorted15116* by their {@link languages.match score} and called sequentially until a provider returns a15117* valid result.15118*15119* @param selector A selector that defines the documents this provider is applicable to.15120* @param provider A signature help provider.15121* @param triggerCharacters Trigger signature help when the user types one of the characters, like `,` or `(`.15122* @returns A {@link Disposable} that unregisters this provider when being disposed.15123*/15124export function registerSignatureHelpProvider(selector: DocumentSelector, provider: SignatureHelpProvider, ...triggerCharacters: string[]): Disposable;1512515126/**15127* @see {@link languages.registerSignatureHelpProvider}15128*15129* @param selector A selector that defines the documents this provider is applicable to.15130* @param provider A signature help provider.15131* @param metadata Information about the provider.15132* @returns A {@link Disposable} that unregisters this provider when being disposed.15133*/15134export function registerSignatureHelpProvider(selector: DocumentSelector, provider: SignatureHelpProvider, metadata: SignatureHelpProviderMetadata): Disposable;1513515136/**15137* Register a document link provider.15138*15139* Multiple providers can be registered for a language. In that case providers are asked in15140* parallel and the results are merged. A failing provider (rejected promise or exception) will15141* not cause a failure of the whole operation.15142*15143* @param selector A selector that defines the documents this provider is applicable to.15144* @param provider A document link provider.15145* @returns A {@link Disposable} that unregisters this provider when being disposed.15146*/15147export function registerDocumentLinkProvider(selector: DocumentSelector, provider: DocumentLinkProvider): Disposable;1514815149/**15150* Register a color provider.15151*15152* Multiple providers can be registered for a language. In that case providers are asked in15153* parallel and the results are merged. A failing provider (rejected promise or exception) will15154* not cause a failure of the whole operation.15155*15156* @param selector A selector that defines the documents this provider is applicable to.15157* @param provider A color provider.15158* @returns A {@link Disposable} that unregisters this provider when being disposed.15159*/15160export function registerColorProvider(selector: DocumentSelector, provider: DocumentColorProvider): Disposable;1516115162/**15163* Register a inlay hints provider.15164*15165* Multiple providers can be registered for a language. In that case providers are asked in15166* parallel and the results are merged. A failing provider (rejected promise or exception) will15167* not cause a failure of the whole operation.15168*15169* @param selector A selector that defines the documents this provider is applicable to.15170* @param provider An inlay hints provider.15171* @returns A {@link Disposable} that unregisters this provider when being disposed.15172*/15173export function registerInlayHintsProvider(selector: DocumentSelector, provider: InlayHintsProvider): Disposable;1517415175/**15176* Register a folding range provider.15177*15178* Multiple providers can be registered for a language. In that case providers are asked in15179* parallel and the results are merged.15180* If multiple folding ranges start at the same position, only the range of the first registered provider is used.15181* If a folding range overlaps with an other range that has a smaller position, it is also ignored.15182*15183* A failing provider (rejected promise or exception) will15184* not cause a failure of the whole operation.15185*15186* @param selector A selector that defines the documents this provider is applicable to.15187* @param provider A folding range provider.15188* @returns A {@link Disposable} that unregisters this provider when being disposed.15189*/15190export function registerFoldingRangeProvider(selector: DocumentSelector, provider: FoldingRangeProvider): Disposable;1519115192/**15193* Register a selection range provider.15194*15195* Multiple providers can be registered for a language. In that case providers are asked in15196* parallel and the results are merged. A failing provider (rejected promise or exception) will15197* not cause a failure of the whole operation.15198*15199* @param selector A selector that defines the documents this provider is applicable to.15200* @param provider A selection range provider.15201* @returns A {@link Disposable} that unregisters this provider when being disposed.15202*/15203export function registerSelectionRangeProvider(selector: DocumentSelector, provider: SelectionRangeProvider): Disposable;1520415205/**15206* Register a call hierarchy provider.15207*15208* @param selector A selector that defines the documents this provider is applicable to.15209* @param provider A call hierarchy provider.15210* @returns A {@link Disposable} that unregisters this provider when being disposed.15211*/15212export function registerCallHierarchyProvider(selector: DocumentSelector, provider: CallHierarchyProvider): Disposable;1521315214/**15215* Register a type hierarchy provider.15216*15217* @param selector A selector that defines the documents this provider is applicable to.15218* @param provider A type hierarchy provider.15219* @returns A {@link Disposable} that unregisters this provider when being disposed.15220*/15221export function registerTypeHierarchyProvider(selector: DocumentSelector, provider: TypeHierarchyProvider): Disposable;1522215223/**15224* Register a linked editing range provider.15225*15226* Multiple providers can be registered for a language. In that case providers are sorted15227* by their {@link languages.match score} and the best-matching provider that has a result is used. Failure15228* of the selected provider will cause a failure of the whole operation.15229*15230* @param selector A selector that defines the documents this provider is applicable to.15231* @param provider A linked editing range provider.15232* @returns A {@link Disposable} that unregisters this provider when being disposed.15233*/15234export function registerLinkedEditingRangeProvider(selector: DocumentSelector, provider: LinkedEditingRangeProvider): Disposable;1523515236/**15237* Registers a new {@link DocumentDropEditProvider}.15238*15239* Multiple drop providers can be registered for a language. When dropping content into an editor, all15240* registered providers for the editor's language will be invoked based on the mimetypes they handle15241* as specified by their {@linkcode DocumentDropEditProviderMetadata}.15242*15243* Each provider can return one or more {@linkcode DocumentDropEdit DocumentDropEdits}. The edits are sorted15244* using the {@linkcode DocumentDropEdit.yieldTo} property. By default the first edit will be applied. If there15245* are any additional edits, these will be shown to the user as selectable drop options in the drop widget.15246*15247* @param selector A selector that defines the documents this provider applies to.15248* @param provider A drop provider.15249* @param metadata Additional metadata about the provider.15250*15251* @returns A {@linkcode Disposable} that unregisters this provider when disposed of.15252*/15253export function registerDocumentDropEditProvider(selector: DocumentSelector, provider: DocumentDropEditProvider, metadata?: DocumentDropEditProviderMetadata): Disposable;1525415255/**15256* Registers a new {@linkcode DocumentPasteEditProvider}.15257*15258* Multiple providers can be registered for a language. All registered providers for a language will be invoked15259* for copy and paste operations based on their handled mimetypes as specified by the {@linkcode DocumentPasteProviderMetadata}.15260*15261* For {@link DocumentPasteEditProvider.prepareDocumentPaste copy operations}, changes to the {@linkcode DataTransfer}15262* made by each provider will be merged into a single {@linkcode DataTransfer} that is used to populate the clipboard.15263*15264* For {@link DocumentPasteEditProvider.providerDocumentPasteEdits paste operations}, each provider will be invoked15265* and can return one or more {@linkcode DocumentPasteEdit DocumentPasteEdits}. The edits are sorted using15266* the {@linkcode DocumentPasteEdit.yieldTo} property. By default the first edit will be applied15267* and the rest of the edits will be shown to the user as selectable paste options in the paste widget.15268*15269* @param selector A selector that defines the documents this provider applies to.15270* @param provider A paste editor provider.15271* @param metadata Additional metadata about the provider.15272*15273* @returns A {@linkcode Disposable} that unregisters this provider when disposed of.15274*/15275export function registerDocumentPasteEditProvider(selector: DocumentSelector, provider: DocumentPasteEditProvider, metadata: DocumentPasteProviderMetadata): Disposable;152761527715278/**15279* Set a {@link LanguageConfiguration language configuration} for a language.15280*15281* @param language A language identifier like `typescript`.15282* @param configuration Language configuration.15283* @returns A {@link Disposable} that unsets this configuration.15284*/15285export function setLanguageConfiguration(language: string, configuration: LanguageConfiguration): Disposable;15286}1528715288/**15289* Represents a notebook editor that is attached to a {@link NotebookDocument notebook}.15290*/15291export enum NotebookEditorRevealType {15292/**15293* The range will be revealed with as little scrolling as possible.15294*/15295Default = 0,1529615297/**15298* The range will always be revealed in the center of the viewport.15299*/15300InCenter = 1,1530115302/**15303* If the range is outside the viewport, it will be revealed in the center of the viewport.15304* Otherwise, it will be revealed with as little scrolling as possible.15305*/15306InCenterIfOutsideViewport = 2,1530715308/**15309* The range will always be revealed at the top of the viewport.15310*/15311AtTop = 315312}1531315314/**15315* Represents a notebook editor that is attached to a {@link NotebookDocument notebook}.15316* Additional properties of the NotebookEditor are available in the proposed15317* API, which will be finalized later.15318*/15319export interface NotebookEditor {1532015321/**15322* The {@link NotebookDocument notebook document} associated with this notebook editor.15323*/15324readonly notebook: NotebookDocument;1532515326/**15327* The primary selection in this notebook editor.15328*/15329selection: NotebookRange;1533015331/**15332* All selections in this notebook editor.15333*15334* The primary selection (or focused range) is `selections[0]`. When the document has no cells, the primary selection is empty `{ start: 0, end: 0 }`;15335*/15336selections: readonly NotebookRange[];1533715338/**15339* The current visible ranges in the editor (vertically).15340*/15341readonly visibleRanges: readonly NotebookRange[];1534215343/**15344* The column in which this editor shows.15345*/15346readonly viewColumn?: ViewColumn;1534715348/**15349* Scroll as indicated by `revealType` in order to reveal the given range.15350*15351* @param range A range.15352* @param revealType The scrolling strategy for revealing `range`.15353*/15354revealRange(range: NotebookRange, revealType?: NotebookEditorRevealType): void;15355}1535615357/**15358* Renderer messaging is used to communicate with a single renderer. It's returned from {@link notebooks.createRendererMessaging}.15359*/15360export interface NotebookRendererMessaging {15361/**15362* An event that fires when a message is received from a renderer.15363*/15364readonly onDidReceiveMessage: Event<{15365/**15366* The {@link NotebookEditor editor} that sent the message.15367*/15368readonly editor: NotebookEditor;15369/**15370* The actual message.15371*/15372readonly message: any;15373}>;1537415375/**15376* Send a message to one or all renderer.15377*15378* @param message Message to send15379* @param editor Editor to target with the message. If not provided, the15380* message is sent to all renderers.15381* @returns a boolean indicating whether the message was successfully15382* delivered to any renderer.15383*/15384postMessage(message: any, editor?: NotebookEditor): Thenable<boolean>;15385}1538615387/**15388* A notebook cell kind.15389*/15390export enum NotebookCellKind {1539115392/**15393* A markup-cell is formatted source that is used for display.15394*/15395Markup = 1,1539615397/**15398* A code-cell is source that can be {@link NotebookController executed} and that15399* produces {@link NotebookCellOutput output}.15400*/15401Code = 215402}1540315404/**15405* Represents a cell of a {@link NotebookDocument notebook}, either a {@link NotebookCellKind.Code code}-cell15406* or {@link NotebookCellKind.Markup markup}-cell.15407*15408* NotebookCell instances are immutable and are kept in sync for as long as they are part of their notebook.15409*/15410export interface NotebookCell {1541115412/**15413* The index of this cell in its {@link NotebookDocument.cellAt containing notebook}. The15414* index is updated when a cell is moved within its notebook. The index is `-1`15415* when the cell has been removed from its notebook.15416*/15417readonly index: number;1541815419/**15420* The {@link NotebookDocument notebook} that contains this cell.15421*/15422readonly notebook: NotebookDocument;1542315424/**15425* The kind of this cell.15426*/15427readonly kind: NotebookCellKind;1542815429/**15430* The {@link TextDocument text} of this cell, represented as text document.15431*/15432readonly document: TextDocument;1543315434/**15435* The metadata of this cell. Can be anything but must be JSON-stringifyable.15436*/15437readonly metadata: { readonly [key: string]: any };1543815439/**15440* The outputs of this cell.15441*/15442readonly outputs: readonly NotebookCellOutput[];1544315444/**15445* The most recent {@link NotebookCellExecutionSummary execution summary} for this cell.15446*/15447readonly executionSummary: NotebookCellExecutionSummary | undefined;15448}1544915450/**15451* Represents a notebook which itself is a sequence of {@link NotebookCell code or markup cells}. Notebook documents are15452* created from {@link NotebookData notebook data}.15453*/15454export interface NotebookDocument {1545515456/**15457* The associated uri for this notebook.15458*15459* *Note* that most notebooks use the `file`-scheme, which means they are files on disk. However, **not** all notebooks are15460* saved on disk and therefore the `scheme` must be checked before trying to access the underlying file or siblings on disk.15461*15462* @see {@link FileSystemProvider}15463*/15464readonly uri: Uri;1546515466/**15467* The type of notebook.15468*/15469readonly notebookType: string;1547015471/**15472* The version number of this notebook (it will strictly increase after each15473* change, including undo/redo).15474*/15475readonly version: number;1547615477/**15478* `true` if there are unpersisted changes.15479*/15480readonly isDirty: boolean;1548115482/**15483* Is this notebook representing an untitled file which has not been saved yet.15484*/15485readonly isUntitled: boolean;1548615487/**15488* `true` if the notebook has been closed. A closed notebook isn't synchronized anymore15489* and won't be re-used when the same resource is opened again.15490*/15491readonly isClosed: boolean;1549215493/**15494* Arbitrary metadata for this notebook. Can be anything but must be JSON-stringifyable.15495*/15496readonly metadata: { [key: string]: any };1549715498/**15499* The number of cells in the notebook.15500*/15501readonly cellCount: number;1550215503/**15504* Return the cell at the specified index. The index will be adjusted to the notebook.15505*15506* @param index - The index of the cell to retrieve.15507* @returns A {@link NotebookCell cell}.15508*/15509cellAt(index: number): NotebookCell;1551015511/**15512* Get the cells of this notebook. A subset can be retrieved by providing15513* a range. The range will be adjusted to the notebook.15514*15515* @param range A notebook range.15516* @returns The cells contained by the range or all cells.15517*/15518getCells(range?: NotebookRange): NotebookCell[];1551915520/**15521* Save the document. The saving will be handled by the corresponding {@link NotebookSerializer serializer}.15522*15523* @returns A promise that will resolve to true when the document15524* has been saved. Will return false if the file was not dirty or when save failed.15525*/15526save(): Thenable<boolean>;15527}1552815529/**15530* Describes a change to a notebook cell.15531*15532* @see {@link NotebookDocumentChangeEvent}15533*/15534export interface NotebookDocumentCellChange {1553515536/**15537* The affected cell.15538*/15539readonly cell: NotebookCell;1554015541/**15542* The document of the cell or `undefined` when it did not change.15543*15544* *Note* that you should use the {@link workspace.onDidChangeTextDocument onDidChangeTextDocument}-event15545* for detailed change information, like what edits have been performed.15546*/15547readonly document: TextDocument | undefined;1554815549/**15550* The new metadata of the cell or `undefined` when it did not change.15551*/15552readonly metadata: { [key: string]: any } | undefined;1555315554/**15555* The new outputs of the cell or `undefined` when they did not change.15556*/15557readonly outputs: readonly NotebookCellOutput[] | undefined;1555815559/**15560* The new execution summary of the cell or `undefined` when it did not change.15561*/15562readonly executionSummary: NotebookCellExecutionSummary | undefined;15563}1556415565/**15566* Describes a structural change to a notebook document, e.g newly added and removed cells.15567*15568* @see {@link NotebookDocumentChangeEvent}15569*/15570export interface NotebookDocumentContentChange {1557115572/**15573* The range at which cells have been either added or removed.15574*15575* Note that no cells have been {@link NotebookDocumentContentChange.removedCells removed}15576* when this range is {@link NotebookRange.isEmpty empty}.15577*/15578readonly range: NotebookRange;1557915580/**15581* Cells that have been added to the document.15582*/15583readonly addedCells: readonly NotebookCell[];1558415585/**15586* Cells that have been removed from the document.15587*/15588readonly removedCells: readonly NotebookCell[];15589}1559015591/**15592* An event describing a transactional {@link NotebookDocument notebook} change.15593*/15594export interface NotebookDocumentChangeEvent {1559515596/**15597* The affected notebook.15598*/15599readonly notebook: NotebookDocument;1560015601/**15602* The new metadata of the notebook or `undefined` when it did not change.15603*/15604readonly metadata: { [key: string]: any } | undefined;1560515606/**15607* An array of content changes describing added or removed {@link NotebookCell cells}.15608*/15609readonly contentChanges: readonly NotebookDocumentContentChange[];1561015611/**15612* An array of {@link NotebookDocumentCellChange cell changes}.15613*/15614readonly cellChanges: readonly NotebookDocumentCellChange[];15615}1561615617/**15618* An event that is fired when a {@link NotebookDocument notebook document} will be saved.15619*15620* To make modifications to the document before it is being saved, call the15621* {@linkcode NotebookDocumentWillSaveEvent.waitUntil waitUntil}-function with a thenable15622* that resolves to a {@link WorkspaceEdit workspace edit}.15623*/15624export interface NotebookDocumentWillSaveEvent {15625/**15626* A cancellation token.15627*/15628readonly token: CancellationToken;1562915630/**15631* The {@link NotebookDocument notebook document} that will be saved.15632*/15633readonly notebook: NotebookDocument;1563415635/**15636* The reason why save was triggered.15637*/15638readonly reason: TextDocumentSaveReason;1563915640/**15641* Allows to pause the event loop and to apply {@link WorkspaceEdit workspace edit}.15642* Edits of subsequent calls to this function will be applied in order. The15643* edits will be *ignored* if concurrent modifications of the notebook document happened.15644*15645* *Note:* This function can only be called during event dispatch and not15646* in an asynchronous manner:15647*15648* ```ts15649* workspace.onWillSaveNotebookDocument(event => {15650* // async, will *throw* an error15651* setTimeout(() => event.waitUntil(promise));15652*15653* // sync, OK15654* event.waitUntil(promise);15655* })15656* ```15657*15658* @param thenable A thenable that resolves to {@link WorkspaceEdit workspace edit}.15659*/15660waitUntil(thenable: Thenable<WorkspaceEdit>): void;1566115662/**15663* Allows to pause the event loop until the provided thenable resolved.15664*15665* *Note:* This function can only be called during event dispatch.15666*15667* @param thenable A thenable that delays saving.15668*/15669waitUntil(thenable: Thenable<any>): void;15670}1567115672/**15673* The summary of a notebook cell execution.15674*/15675export interface NotebookCellExecutionSummary {1567615677/**15678* The order in which the execution happened.15679*/15680readonly executionOrder?: number;1568115682/**15683* If the execution finished successfully.15684*/15685readonly success?: boolean;1568615687/**15688* The times at which execution started and ended, as unix timestamps15689*/15690readonly timing?: {15691/**15692* Execution start time.15693*/15694readonly startTime: number;15695/**15696* Execution end time.15697*/15698readonly endTime: number;15699};15700}1570115702/**15703* A notebook range represents an ordered pair of two cell indices.15704* It is guaranteed that start is less than or equal to end.15705*/15706export class NotebookRange {1570715708/**15709* The zero-based start index of this range.15710*/15711readonly start: number;1571215713/**15714* The exclusive end index of this range (zero-based).15715*/15716readonly end: number;1571715718/**15719* `true` if `start` and `end` are equal.15720*/15721readonly isEmpty: boolean;1572215723/**15724* Create a new notebook range. If `start` is not15725* before or equal to `end`, the values will be swapped.15726*15727* @param start start index15728* @param end end index.15729*/15730constructor(start: number, end: number);1573115732/**15733* Derive a new range for this range.15734*15735* @param change An object that describes a change to this range.15736* @returns A range that reflects the given change. Will return `this` range if the change15737* is not changing anything.15738*/15739with(change: {15740/**15741* New start index, defaults to `this.start`.15742*/15743start?: number;15744/**15745* New end index, defaults to `this.end`.15746*/15747end?: number;15748}): NotebookRange;15749}1575015751/**15752* One representation of a {@link NotebookCellOutput notebook output}, defined by MIME type and data.15753*/15754export class NotebookCellOutputItem {1575515756/**15757* Factory function to create a `NotebookCellOutputItem` from a string.15758*15759* *Note* that an UTF-8 encoder is used to create bytes for the string.15760*15761* @param value A string.15762* @param mime Optional MIME type, defaults to `text/plain`.15763* @returns A new output item object.15764*/15765static text(value: string, mime?: string): NotebookCellOutputItem;1576615767/**15768* Factory function to create a `NotebookCellOutputItem` from15769* a JSON object.15770*15771* *Note* that this function is not expecting "stringified JSON" but15772* an object that can be stringified. This function will throw an error15773* when the passed value cannot be JSON-stringified.15774*15775* @param value A JSON-stringifyable value.15776* @param mime Optional MIME type, defaults to `application/json`15777* @returns A new output item object.15778*/15779static json(value: any, mime?: string): NotebookCellOutputItem;1578015781/**15782* Factory function to create a `NotebookCellOutputItem` that uses15783* uses the `application/vnd.code.notebook.stdout` mime type.15784*15785* @param value A string.15786* @returns A new output item object.15787*/15788static stdout(value: string): NotebookCellOutputItem;1578915790/**15791* Factory function to create a `NotebookCellOutputItem` that uses15792* uses the `application/vnd.code.notebook.stderr` mime type.15793*15794* @param value A string.15795* @returns A new output item object.15796*/15797static stderr(value: string): NotebookCellOutputItem;1579815799/**15800* Factory function to create a `NotebookCellOutputItem` that uses15801* uses the `application/vnd.code.notebook.error` mime type.15802*15803* @param value An error object.15804* @returns A new output item object.15805*/15806static error(value: Error): NotebookCellOutputItem;1580715808/**15809* The mime type which determines how the {@linkcode NotebookCellOutputItem.data data}-property15810* is interpreted.15811*15812* Notebooks have built-in support for certain mime-types, extensions can add support for new15813* types and override existing types.15814*/15815mime: string;1581615817/**15818* The data of this output item. Must always be an array of unsigned 8-bit integers.15819*/15820data: Uint8Array;1582115822/**15823* Create a new notebook cell output item.15824*15825* @param data The value of the output item.15826* @param mime The mime type of the output item.15827*/15828constructor(data: Uint8Array, mime: string);15829}1583015831/**15832* Notebook cell output represents a result of executing a cell. It is a container type for multiple15833* {@link NotebookCellOutputItem output items} where contained items represent the same result but15834* use different MIME types.15835*/15836export class NotebookCellOutput {1583715838/**15839* The output items of this output. Each item must represent the same result. _Note_ that repeated15840* MIME types per output is invalid and that the editor will just pick one of them.15841*15842* ```ts15843* new vscode.NotebookCellOutput([15844* vscode.NotebookCellOutputItem.text('Hello', 'text/plain'),15845* vscode.NotebookCellOutputItem.text('<i>Hello</i>', 'text/html'),15846* vscode.NotebookCellOutputItem.text('_Hello_', 'text/markdown'),15847* vscode.NotebookCellOutputItem.text('Hey', 'text/plain'), // INVALID: repeated type, editor will pick just one15848* ])15849* ```15850*/15851items: NotebookCellOutputItem[];1585215853/**15854* Arbitrary metadata for this cell output. Can be anything but must be JSON-stringifyable.15855*/15856metadata?: { [key: string]: any };1585715858/**15859* Create new notebook output.15860*15861* @param items Notebook output items.15862* @param metadata Optional metadata.15863*/15864constructor(items: NotebookCellOutputItem[], metadata?: { [key: string]: any });15865}1586615867/**15868* NotebookCellData is the raw representation of notebook cells. Its is part of {@linkcode NotebookData}.15869*/15870export class NotebookCellData {1587115872/**15873* The {@link NotebookCellKind kind} of this cell data.15874*/15875kind: NotebookCellKind;1587615877/**15878* The source value of this cell data - either source code or formatted text.15879*/15880value: string;1588115882/**15883* The language identifier of the source value of this cell data. Any value from15884* {@linkcode languages.getLanguages getLanguages} is possible.15885*/15886languageId: string;1588715888/**15889* The outputs of this cell data.15890*/15891outputs?: NotebookCellOutput[];1589215893/**15894* Arbitrary metadata of this cell data. Can be anything but must be JSON-stringifyable.15895*/15896metadata?: { [key: string]: any };1589715898/**15899* The execution summary of this cell data.15900*/15901executionSummary?: NotebookCellExecutionSummary;1590215903/**15904* Create new cell data. Minimal cell data specifies its kind, its source value, and the15905* language identifier of its source.15906*15907* @param kind The kind.15908* @param value The source value.15909* @param languageId The language identifier of the source value.15910*/15911constructor(kind: NotebookCellKind, value: string, languageId: string);15912}1591315914/**15915* Raw representation of a notebook.15916*15917* Extensions are responsible for creating {@linkcode NotebookData} so that the editor15918* can create a {@linkcode NotebookDocument}.15919*15920* @see {@link NotebookSerializer}15921*/15922export class NotebookData {15923/**15924* The cell data of this notebook data.15925*/15926cells: NotebookCellData[];1592715928/**15929* Arbitrary metadata of notebook data.15930*/15931metadata?: { [key: string]: any };1593215933/**15934* Create new notebook data.15935*15936* @param cells An array of cell data.15937*/15938constructor(cells: NotebookCellData[]);15939}1594015941/**15942* The notebook serializer enables the editor to open notebook files.15943*15944* At its core the editor only knows a {@link NotebookData notebook data structure} but not15945* how that data structure is written to a file, nor how it is read from a file. The15946* notebook serializer bridges this gap by deserializing bytes into notebook data and15947* vice versa.15948*/15949export interface NotebookSerializer {1595015951/**15952* Deserialize contents of a notebook file into the notebook data structure.15953*15954* @param content Contents of a notebook file.15955* @param token A cancellation token.15956* @returns Notebook data or a thenable that resolves to such.15957*/15958deserializeNotebook(content: Uint8Array, token: CancellationToken): NotebookData | Thenable<NotebookData>;1595915960/**15961* Serialize notebook data into file contents.15962*15963* @param data A notebook data structure.15964* @param token A cancellation token.15965* @returns An array of bytes or a thenable that resolves to such.15966*/15967serializeNotebook(data: NotebookData, token: CancellationToken): Uint8Array | Thenable<Uint8Array>;15968}1596915970/**15971* Notebook content options define what parts of a notebook are persisted. Note15972*15973* For instance, a notebook serializer can opt-out of saving outputs and in that case the editor doesn't mark a15974* notebooks as {@link NotebookDocument.isDirty dirty} when its output has changed.15975*/15976export interface NotebookDocumentContentOptions {15977/**15978* Controls if output change events will trigger notebook document content change events and15979* if it will be used in the diff editor, defaults to false. If the content provider doesn't15980* persist the outputs in the file document, this should be set to true.15981*/15982transientOutputs?: boolean;1598315984/**15985* Controls if a cell metadata property change event will trigger notebook document content15986* change events and if it will be used in the diff editor, defaults to false. If the15987* content provider doesn't persist a metadata property in the file document, it should be15988* set to true.15989*/15990transientCellMetadata?: { [key: string]: boolean | undefined };1599115992/**15993* Controls if a document metadata property change event will trigger notebook document15994* content change event and if it will be used in the diff editor, defaults to false. If the15995* content provider doesn't persist a metadata property in the file document, it should be15996* set to true.15997*/15998transientDocumentMetadata?: { [key: string]: boolean | undefined };15999}1600016001/**16002* Notebook controller affinity for notebook documents.16003*16004* @see {@link NotebookController.updateNotebookAffinity}16005*/16006export enum NotebookControllerAffinity {16007/**16008* Default affinity.16009*/16010Default = 1,16011/**16012* A controller is preferred for a notebook.16013*/16014Preferred = 216015}1601616017/**16018* A notebook controller represents an entity that can execute notebook cells. This is often referred to as a kernel.16019*16020* There can be multiple controllers and the editor will let users choose which controller to use for a certain notebook. The16021* {@linkcode NotebookController.notebookType notebookType}-property defines for what kind of notebooks a controller is for and16022* the {@linkcode NotebookController.updateNotebookAffinity updateNotebookAffinity}-function allows controllers to set a preference16023* for specific notebook documents. When a controller has been selected its16024* {@link NotebookController.onDidChangeSelectedNotebooks onDidChangeSelectedNotebooks}-event fires.16025*16026* When a cell is being run the editor will invoke the {@linkcode NotebookController.executeHandler executeHandler} and a controller16027* is expected to create and finalize a {@link NotebookCellExecution notebook cell execution}. However, controllers are also free16028* to create executions by themselves.16029*/16030export interface NotebookController {1603116032/**16033* The identifier of this notebook controller.16034*16035* _Note_ that controllers are remembered by their identifier and that extensions should use16036* stable identifiers across sessions.16037*/16038readonly id: string;1603916040/**16041* The notebook type this controller is for.16042*/16043readonly notebookType: string;1604416045/**16046* An array of language identifiers that are supported by this16047* controller. Any language identifier from {@linkcode languages.getLanguages getLanguages}16048* is possible. When falsy all languages are supported.16049*16050* Samples:16051* ```js16052* // support JavaScript and TypeScript16053* myController.supportedLanguages = ['javascript', 'typescript']16054*16055* // support all languages16056* myController.supportedLanguages = undefined; // falsy16057* myController.supportedLanguages = []; // falsy16058* ```16059*/16060supportedLanguages?: string[];1606116062/**16063* The human-readable label of this notebook controller.16064*/16065label: string;1606616067/**16068* The human-readable description which is rendered less prominent.16069*/16070description?: string;1607116072/**16073* The human-readable detail which is rendered less prominent.16074*/16075detail?: string;1607616077/**16078* Whether this controller supports execution order so that the16079* editor can render placeholders for them.16080*/16081supportsExecutionOrder?: boolean;1608216083/**16084* Create a cell execution task.16085*16086* _Note_ that there can only be one execution per cell at a time and that an error is thrown if16087* a cell execution is created while another is still active.16088*16089* This should be used in response to the {@link NotebookController.executeHandler execution handler}16090* being called or when cell execution has been started else, e.g when a cell was already16091* executing or when cell execution was triggered from another source.16092*16093* @param cell The notebook cell for which to create the execution.16094* @returns A notebook cell execution.16095*/16096createNotebookCellExecution(cell: NotebookCell): NotebookCellExecution;1609716098/**16099* The execute handler is invoked when the run gestures in the UI are selected, e.g Run Cell, Run All,16100* Run Selection etc. The execute handler is responsible for creating and managing {@link NotebookCellExecution execution}-objects.16101*/16102executeHandler: (cells: NotebookCell[], notebook: NotebookDocument, controller: NotebookController) => void | Thenable<void>;1610316104/**16105* Optional interrupt handler.16106*16107* By default cell execution is canceled via {@link NotebookCellExecution.token tokens}. Cancellation16108* tokens require that a controller can keep track of its execution so that it can cancel a specific execution at a later16109* point. Not all scenarios allow for that, eg. REPL-style controllers often work by interrupting whatever is currently16110* running. For those cases the interrupt handler exists - it can be thought of as the equivalent of `SIGINT`16111* or `Control+C` in terminals.16112*16113* _Note_ that supporting {@link NotebookCellExecution.token cancellation tokens} is preferred and that interrupt handlers should16114* only be used when tokens cannot be supported.16115*/16116interruptHandler?: (notebook: NotebookDocument) => void | Thenable<void>;1611716118/**16119* An event that fires whenever a controller has been selected or un-selected for a notebook document.16120*16121* There can be multiple controllers for a notebook and in that case a controllers needs to be _selected_. This is a user gesture16122* and happens either explicitly or implicitly when interacting with a notebook for which a controller was _suggested_. When possible,16123* the editor _suggests_ a controller that is most likely to be _selected_.16124*16125* _Note_ that controller selection is persisted (by the controllers {@link NotebookController.id id}) and restored as soon as a16126* controller is re-created or as a notebook is {@link workspace.onDidOpenNotebookDocument opened}.16127*/16128readonly onDidChangeSelectedNotebooks: Event<{16129/**16130* The notebook for which the controller has been selected or un-selected.16131*/16132readonly notebook: NotebookDocument;16133/**16134* Whether the controller has been selected or un-selected.16135*/16136readonly selected: boolean;16137}>;1613816139/**16140* A controller can set affinities for specific notebook documents. This allows a controller16141* to be presented more prominent for some notebooks.16142*16143* @param notebook The notebook for which a priority is set.16144* @param affinity A controller affinity16145*/16146updateNotebookAffinity(notebook: NotebookDocument, affinity: NotebookControllerAffinity): void;1614716148/**16149* Dispose and free associated resources.16150*/16151dispose(): void;16152}1615316154/**16155* A NotebookCellExecution is how {@link NotebookController notebook controller} modify a notebook cell as16156* it is executing.16157*16158* When a cell execution object is created, the cell enters the {@linkcode NotebookCellExecutionState.Pending Pending} state.16159* When {@linkcode NotebookCellExecution.start start(...)} is called on the execution task, it enters the {@linkcode NotebookCellExecutionState.Executing Executing} state. When16160* {@linkcode NotebookCellExecution.end end(...)} is called, it enters the {@linkcode NotebookCellExecutionState.Idle Idle} state.16161*/16162export interface NotebookCellExecution {1616316164/**16165* The {@link NotebookCell cell} for which this execution has been created.16166*/16167readonly cell: NotebookCell;1616816169/**16170* A cancellation token which will be triggered when the cell execution is canceled16171* from the UI.16172*16173* _Note_ that the cancellation token will not be triggered when the {@link NotebookController controller}16174* that created this execution uses an {@link NotebookController.interruptHandler interrupt-handler}.16175*/16176readonly token: CancellationToken;1617716178/**16179* Set and unset the order of this cell execution.16180*/16181executionOrder: number | undefined;1618216183/**16184* Signal that the execution has begun.16185*16186* @param startTime The time that execution began, in milliseconds in the Unix epoch. Used to drive the clock16187* that shows for how long a cell has been running. If not given, the clock won't be shown.16188*/16189start(startTime?: number): void;1619016191/**16192* Signal that execution has ended.16193*16194* @param success If true, a green check is shown on the cell status bar.16195* If false, a red X is shown.16196* If undefined, no check or X icon is shown.16197* @param endTime The time that execution finished, in milliseconds in the Unix epoch.16198*/16199end(success: boolean | undefined, endTime?: number): void;1620016201/**16202* Clears the output of the cell that is executing or of another cell that is affected by this execution.16203*16204* @param cell Cell for which output is cleared. Defaults to the {@link NotebookCellExecution.cell cell} of16205* this execution.16206* @returns A thenable that resolves when the operation finished.16207*/16208clearOutput(cell?: NotebookCell): Thenable<void>;1620916210/**16211* Replace the output of the cell that is executing or of another cell that is affected by this execution.16212*16213* @param out Output that replaces the current output.16214* @param cell Cell for which output is cleared. Defaults to the {@link NotebookCellExecution.cell cell} of16215* this execution.16216* @returns A thenable that resolves when the operation finished.16217*/16218replaceOutput(out: NotebookCellOutput | readonly NotebookCellOutput[], cell?: NotebookCell): Thenable<void>;1621916220/**16221* Append to the output of the cell that is executing or to another cell that is affected by this execution.16222*16223* @param out Output that is appended to the current output.16224* @param cell Cell for which output is cleared. Defaults to the {@link NotebookCellExecution.cell cell} of16225* this execution.16226* @returns A thenable that resolves when the operation finished.16227*/16228appendOutput(out: NotebookCellOutput | readonly NotebookCellOutput[], cell?: NotebookCell): Thenable<void>;1622916230/**16231* Replace all output items of existing cell output.16232*16233* @param items Output items that replace the items of existing output.16234* @param output Output object that already exists.16235* @returns A thenable that resolves when the operation finished.16236*/16237replaceOutputItems(items: NotebookCellOutputItem | readonly NotebookCellOutputItem[], output: NotebookCellOutput): Thenable<void>;1623816239/**16240* Append output items to existing cell output.16241*16242* @param items Output items that are append to existing output.16243* @param output Output object that already exists.16244* @returns A thenable that resolves when the operation finished.16245*/16246appendOutputItems(items: NotebookCellOutputItem | readonly NotebookCellOutputItem[], output: NotebookCellOutput): Thenable<void>;16247}1624816249/**16250* Represents the alignment of status bar items.16251*/16252export enum NotebookCellStatusBarAlignment {1625316254/**16255* Aligned to the left side.16256*/16257Left = 1,1625816259/**16260* Aligned to the right side.16261*/16262Right = 216263}1626416265/**16266* A contribution to a cell's status bar16267*/16268export class NotebookCellStatusBarItem {16269/**16270* The text to show for the item.16271*/16272text: string;1627316274/**16275* Whether the item is aligned to the left or right.16276*/16277alignment: NotebookCellStatusBarAlignment;1627816279/**16280* An optional {@linkcode Command} or identifier of a command to run on click.16281*16282* The command must be {@link commands.getCommands known}.16283*16284* Note that if this is a {@linkcode Command} object, only the {@linkcode Command.command command} and {@linkcode Command.arguments arguments}16285* are used by the editor.16286*/16287command?: string | Command;1628816289/**16290* A tooltip to show when the item is hovered.16291*/16292tooltip?: string;1629316294/**16295* The priority of the item. A higher value item will be shown more to the left.16296*/16297priority?: number;1629816299/**16300* Accessibility information used when a screen reader interacts with this item.16301*/16302accessibilityInformation?: AccessibilityInformation;1630316304/**16305* Creates a new NotebookCellStatusBarItem.16306* @param text The text to show for the item.16307* @param alignment Whether the item is aligned to the left or right.16308*/16309constructor(text: string, alignment: NotebookCellStatusBarAlignment);16310}1631116312/**16313* A provider that can contribute items to the status bar that appears below a cell's editor.16314*/16315export interface NotebookCellStatusBarItemProvider {16316/**16317* An optional event to signal that statusbar items have changed. The provide method will be called again.16318*/16319onDidChangeCellStatusBarItems?: Event<void>;1632016321/**16322* The provider will be called when the cell scrolls into view, when its content, outputs, language, or metadata change, and when it changes execution state.16323* @param cell The cell for which to return items.16324* @param token A token triggered if this request should be cancelled.16325* @returns One or more {@link NotebookCellStatusBarItem cell statusbar items}16326*/16327provideCellStatusBarItems(cell: NotebookCell, token: CancellationToken): ProviderResult<NotebookCellStatusBarItem | NotebookCellStatusBarItem[]>;16328}1632916330/**16331* Namespace for notebooks.16332*16333* The notebooks functionality is composed of three loosely coupled components:16334*16335* 1. {@link NotebookSerializer} enable the editor to open, show, and save notebooks16336* 2. {@link NotebookController} own the execution of notebooks, e.g they create output from code cells.16337* 3. NotebookRenderer present notebook output in the editor. They run in a separate context.16338*/16339export namespace notebooks {1634016341/**16342* Creates a new notebook controller.16343*16344* @param id Identifier of the controller. Must be unique per extension.16345* @param notebookType A notebook type for which this controller is for.16346* @param label The label of the controller.16347* @param handler The execute-handler of the controller.16348* @returns A new notebook controller.16349*/16350export function createNotebookController(id: string, notebookType: string, label: string, handler?: (cells: NotebookCell[], notebook: NotebookDocument, controller: NotebookController) => void | Thenable<void>): NotebookController;1635116352/**16353* Register a {@link NotebookCellStatusBarItemProvider cell statusbar item provider} for the given notebook type.16354*16355* @param notebookType The notebook type to register for.16356* @param provider A cell status bar provider.16357* @returns A {@link Disposable} that unregisters this provider when being disposed.16358*/16359export function registerNotebookCellStatusBarItemProvider(notebookType: string, provider: NotebookCellStatusBarItemProvider): Disposable;1636016361/**16362* Creates a new messaging instance used to communicate with a specific renderer.16363*16364* * *Note 1:* Extensions can only create renderer that they have defined in their `package.json`-file16365* * *Note 2:* A renderer only has access to messaging if `requiresMessaging` is set to `always` or `optional` in16366* its `notebookRenderer` contribution.16367*16368* @param rendererId The renderer ID to communicate with16369* @returns A new notebook renderer messaging object.16370*/16371export function createRendererMessaging(rendererId: string): NotebookRendererMessaging;16372}1637316374/**16375* Represents the input box in the Source Control viewlet.16376*/16377export interface SourceControlInputBox {1637816379/**16380* Setter and getter for the contents of the input box.16381*/16382value: string;1638316384/**16385* A string to show as placeholder in the input box to guide the user.16386*/16387placeholder: string;1638816389/**16390* Controls whether the input box is enabled (default is `true`).16391*/16392enabled: boolean;1639316394/**16395* Controls whether the input box is visible (default is `true`).16396*/16397visible: boolean;16398}1639916400/**16401* A quick diff provider provides a {@link Uri uri} to the original state of a16402* modified resource. The editor will use this information to render ad'hoc diffs16403* within the text.16404*/16405export interface QuickDiffProvider {1640616407/**16408* Provide a {@link Uri} to the original resource of any given resource uri.16409*16410* @param uri The uri of the resource open in a text editor.16411* @param token A cancellation token.16412* @returns A thenable that resolves to uri of the matching original resource.16413*/16414provideOriginalResource?(uri: Uri, token: CancellationToken): ProviderResult<Uri>;16415}1641616417/**16418* The theme-aware decorations for a16419* {@link SourceControlResourceState source control resource state}.16420*/16421export interface SourceControlResourceThemableDecorations {1642216423/**16424* The icon path for a specific16425* {@link SourceControlResourceState source control resource state}.16426*/16427readonly iconPath?: string | Uri | ThemeIcon;16428}1642916430/**16431* The decorations for a {@link SourceControlResourceState source control resource state}.16432* Can be independently specified for light and dark themes.16433*/16434export interface SourceControlResourceDecorations extends SourceControlResourceThemableDecorations {1643516436/**16437* Whether the {@link SourceControlResourceState source control resource state} should16438* be striked-through in the UI.16439*/16440readonly strikeThrough?: boolean;1644116442/**16443* Whether the {@link SourceControlResourceState source control resource state} should16444* be faded in the UI.16445*/16446readonly faded?: boolean;1644716448/**16449* The title for a specific16450* {@link SourceControlResourceState source control resource state}.16451*/16452readonly tooltip?: string;1645316454/**16455* The light theme decorations.16456*/16457readonly light?: SourceControlResourceThemableDecorations;1645816459/**16460* The dark theme decorations.16461*/16462readonly dark?: SourceControlResourceThemableDecorations;16463}1646416465/**16466* An source control resource state represents the state of an underlying workspace16467* resource within a certain {@link SourceControlResourceGroup source control group}.16468*/16469export interface SourceControlResourceState {1647016471/**16472* The {@link Uri} of the underlying resource inside the workspace.16473*/16474readonly resourceUri: Uri;1647516476/**16477* The {@link Command} which should be run when the resource16478* state is open in the Source Control viewlet.16479*/16480readonly command?: Command;1648116482/**16483* The {@link SourceControlResourceDecorations decorations} for this source control16484* resource state.16485*/16486readonly decorations?: SourceControlResourceDecorations;1648716488/**16489* Context value of the resource state. This can be used to contribute resource specific actions.16490* For example, if a resource is given a context value as `diffable`. When contributing actions to `scm/resourceState/context`16491* using `menus` extension point, you can specify context value for key `scmResourceState` in `when` expressions, like `scmResourceState == diffable`.16492* ```json16493* "contributes": {16494* "menus": {16495* "scm/resourceState/context": [16496* {16497* "command": "extension.diff",16498* "when": "scmResourceState == diffable"16499* }16500* ]16501* }16502* }16503* ```16504* This will show action `extension.diff` only for resources with `contextValue` is `diffable`.16505*/16506readonly contextValue?: string;16507}1650816509/**16510* A source control resource group is a collection of16511* {@link SourceControlResourceState source control resource states}.16512*/16513export interface SourceControlResourceGroup {1651416515/**16516* The id of this source control resource group.16517*/16518readonly id: string;1651916520/**16521* The label of this source control resource group.16522*/16523label: string;1652416525/**16526* Whether this source control resource group is hidden when it contains16527* no {@link SourceControlResourceState source control resource states}.16528*/16529hideWhenEmpty?: boolean;1653016531/**16532* Context value of the resource group. This can be used to contribute resource group specific actions.16533* For example, if a resource group is given a context value of `exportable`, when contributing actions to `scm/resourceGroup/context`16534* using `menus` extension point, you can specify context value for key `scmResourceGroupState` in `when` expressions, like `scmResourceGroupState == exportable`.16535* ```json16536* "contributes": {16537* "menus": {16538* "scm/resourceGroup/context": [16539* {16540* "command": "extension.export",16541* "when": "scmResourceGroupState == exportable"16542* }16543* ]16544* }16545* }16546* ```16547* This will show action `extension.export` only for resource groups with `contextValue` equal to `exportable`.16548*/16549contextValue?: string;1655016551/**16552* This group's collection of16553* {@link SourceControlResourceState source control resource states}.16554*/16555resourceStates: SourceControlResourceState[];1655616557/**16558* Dispose this source control resource group.16559*/16560dispose(): void;16561}1656216563/**16564* An source control is able to provide {@link SourceControlResourceState resource states}16565* to the editor and interact with the editor in several source control related ways.16566*/16567export interface SourceControl {1656816569/**16570* The id of this source control.16571*/16572readonly id: string;1657316574/**16575* The human-readable label of this source control.16576*/16577readonly label: string;1657816579/**16580* The (optional) Uri of the root of this source control.16581*/16582readonly rootUri: Uri | undefined;1658316584/**16585* The {@link SourceControlInputBox input box} for this source control.16586*/16587readonly inputBox: SourceControlInputBox;1658816589/**16590* The UI-visible count of {@link SourceControlResourceState resource states} of16591* this source control.16592*16593* If undefined, this source control will16594* - display its UI-visible count as zero, and16595* - contribute the count of its {@link SourceControlResourceState resource states} to the UI-visible aggregated count for all source controls16596*/16597count?: number;1659816599/**16600* An optional {@link QuickDiffProvider quick diff provider}.16601*/16602quickDiffProvider?: QuickDiffProvider;1660316604/**16605* Optional commit template string.16606*16607* The Source Control viewlet will populate the Source Control16608* input with this value when appropriate.16609*/16610commitTemplate?: string;1661116612/**16613* Optional accept input command.16614*16615* This command will be invoked when the user accepts the value16616* in the Source Control input.16617*/16618acceptInputCommand?: Command;1661916620/**16621* Optional status bar commands.16622*16623* These commands will be displayed in the editor's status bar.16624*/16625statusBarCommands?: Command[];1662616627/**16628* Create a new {@link SourceControlResourceGroup resource group}.16629*/16630createResourceGroup(id: string, label: string): SourceControlResourceGroup;1663116632/**16633* Dispose this source control.16634*/16635dispose(): void;16636}1663716638/**16639* Namespace for source control management.16640*/16641export namespace scm {1664216643/**16644* The {@link SourceControlInputBox input box} for the last source control16645* created by the extension.16646*16647* @deprecated Use SourceControl.inputBox instead16648*/16649export const inputBox: SourceControlInputBox;1665016651/**16652* Creates a new {@link SourceControl source control} instance.16653*16654* @param id An `id` for the source control. Something short, e.g.: `git`.16655* @param label A human-readable string for the source control. E.g.: `Git`.16656* @param rootUri An optional Uri of the root of the source control. E.g.: `Uri.parse(workspaceRoot)`.16657* @returns An instance of {@link SourceControl source control}.16658*/16659export function createSourceControl(id: string, label: string, rootUri?: Uri): SourceControl;16660}1666116662/**16663* A DebugProtocolMessage is an opaque stand-in type for the [ProtocolMessage](https://microsoft.github.io/debug-adapter-protocol/specification#Base_Protocol_ProtocolMessage) type defined in the Debug Adapter Protocol.16664*/16665export interface DebugProtocolMessage {16666// Properties: see [ProtocolMessage details](https://microsoft.github.io/debug-adapter-protocol/specification#Base_Protocol_ProtocolMessage).16667}1666816669/**16670* A DebugProtocolSource is an opaque stand-in type for the [Source](https://microsoft.github.io/debug-adapter-protocol/specification#Types_Source) type defined in the Debug Adapter Protocol.16671*/16672export interface DebugProtocolSource {16673// Properties: see [Source details](https://microsoft.github.io/debug-adapter-protocol/specification#Types_Source).16674}1667516676/**16677* A DebugProtocolBreakpoint is an opaque stand-in type for the [Breakpoint](https://microsoft.github.io/debug-adapter-protocol/specification#Types_Breakpoint) type defined in the Debug Adapter Protocol.16678*/16679export interface DebugProtocolBreakpoint {16680// Properties: see [Breakpoint details](https://microsoft.github.io/debug-adapter-protocol/specification#Types_Breakpoint).16681}1668216683/**16684* Configuration for a debug session.16685*/16686export interface DebugConfiguration {16687/**16688* The type of the debug session.16689*/16690type: string;1669116692/**16693* The name of the debug session.16694*/16695name: string;1669616697/**16698* The request type of the debug session.16699*/16700request: string;1670116702/**16703* Additional debug type specific properties.16704*/16705[key: string]: any;16706}1670716708/**16709* A debug session.16710*/16711export interface DebugSession {1671216713/**16714* The unique ID of this debug session.16715*/16716readonly id: string;1671716718/**16719* The debug session's type from the {@link DebugConfiguration debug configuration}.16720*/16721readonly type: string;1672216723/**16724* The parent session of this debug session, if it was created as a child.16725* @see DebugSessionOptions.parentSession16726*/16727readonly parentSession?: DebugSession;1672816729/**16730* The debug session's name is initially taken from the {@link DebugConfiguration debug configuration}.16731* Any changes will be properly reflected in the UI.16732*/16733name: string;1673416735/**16736* The workspace folder of this session or `undefined` for a folderless setup.16737*/16738readonly workspaceFolder: WorkspaceFolder | undefined;1673916740/**16741* The "resolved" {@link DebugConfiguration debug configuration} of this session.16742* "Resolved" means that16743* - all variables have been substituted and16744* - platform specific attribute sections have been "flattened" for the matching platform and removed for non-matching platforms.16745*/16746readonly configuration: DebugConfiguration;1674716748/**16749* Send a custom request to the debug adapter.16750*/16751customRequest(command: string, args?: any): Thenable<any>;1675216753/**16754* Maps a breakpoint in the editor to the corresponding Debug Adapter Protocol (DAP) breakpoint that is managed by the debug adapter of the debug session.16755* If no DAP breakpoint exists (either because the editor breakpoint was not yet registered or because the debug adapter is not interested in the breakpoint), the value `undefined` is returned.16756*16757* @param breakpoint A {@link Breakpoint} in the editor.16758* @returns A promise that resolves to the Debug Adapter Protocol breakpoint or `undefined`.16759*/16760getDebugProtocolBreakpoint(breakpoint: Breakpoint): Thenable<DebugProtocolBreakpoint | undefined>;16761}1676216763/**16764* A custom Debug Adapter Protocol event received from a {@link DebugSession debug session}.16765*/16766export interface DebugSessionCustomEvent {16767/**16768* The {@link DebugSession debug session} for which the custom event was received.16769*/16770readonly session: DebugSession;1677116772/**16773* Type of event.16774*/16775readonly event: string;1677616777/**16778* Event specific information.16779*/16780readonly body: any;16781}1678216783/**16784* A debug configuration provider allows to add debug configurations to the debug service16785* and to resolve launch configurations before they are used to start a debug session.16786* A debug configuration provider is registered via {@link debug.registerDebugConfigurationProvider}.16787*/16788export interface DebugConfigurationProvider {16789/**16790* Provides {@link DebugConfiguration debug configuration} to the debug service. If more than one debug configuration provider is16791* registered for the same type, debug configurations are concatenated in arbitrary order.16792*16793* @param folder The workspace folder for which the configurations are used or `undefined` for a folderless setup.16794* @param token A cancellation token.16795* @returns An array of {@link DebugConfiguration debug configurations}.16796*/16797provideDebugConfigurations?(folder: WorkspaceFolder | undefined, token?: CancellationToken): ProviderResult<DebugConfiguration[]>;1679816799/**16800* Resolves a {@link DebugConfiguration debug configuration} by filling in missing values or by adding/changing/removing attributes.16801* If more than one debug configuration provider is registered for the same type, the resolveDebugConfiguration calls are chained16802* in arbitrary order and the initial debug configuration is piped through the chain.16803* Returning the value 'undefined' prevents the debug session from starting.16804* Returning the value 'null' prevents the debug session from starting and opens the underlying debug configuration instead.16805*16806* @param folder The workspace folder from which the configuration originates from or `undefined` for a folderless setup.16807* @param debugConfiguration The {@link DebugConfiguration debug configuration} to resolve.16808* @param token A cancellation token.16809* @returns The resolved debug configuration or undefined or null.16810*/16811resolveDebugConfiguration?(folder: WorkspaceFolder | undefined, debugConfiguration: DebugConfiguration, token?: CancellationToken): ProviderResult<DebugConfiguration>;1681216813/**16814* This hook is directly called after 'resolveDebugConfiguration' but with all variables substituted.16815* It can be used to resolve or verify a {@link DebugConfiguration debug configuration} by filling in missing values or by adding/changing/removing attributes.16816* If more than one debug configuration provider is registered for the same type, the 'resolveDebugConfigurationWithSubstitutedVariables' calls are chained16817* in arbitrary order and the initial debug configuration is piped through the chain.16818* Returning the value 'undefined' prevents the debug session from starting.16819* Returning the value 'null' prevents the debug session from starting and opens the underlying debug configuration instead.16820*16821* @param folder The workspace folder from which the configuration originates from or `undefined` for a folderless setup.16822* @param debugConfiguration The {@link DebugConfiguration debug configuration} to resolve.16823* @param token A cancellation token.16824* @returns The resolved debug configuration or undefined or null.16825*/16826resolveDebugConfigurationWithSubstitutedVariables?(folder: WorkspaceFolder | undefined, debugConfiguration: DebugConfiguration, token?: CancellationToken): ProviderResult<DebugConfiguration>;16827}1682816829/**16830* Represents a debug adapter executable and optional arguments and runtime options passed to it.16831*/16832export class DebugAdapterExecutable {1683316834/**16835* Creates a description for a debug adapter based on an executable program.16836*16837* @param command The command or executable path that implements the debug adapter.16838* @param args Optional arguments to be passed to the command or executable.16839* @param options Optional options to be used when starting the command or executable.16840*/16841constructor(command: string, args?: string[], options?: DebugAdapterExecutableOptions);1684216843/**16844* The command or path of the debug adapter executable.16845* A command must be either an absolute path of an executable or the name of an command to be looked up via the PATH environment variable.16846* The special value 'node' will be mapped to the editor's built-in Node.js runtime.16847*/16848readonly command: string;1684916850/**16851* The arguments passed to the debug adapter executable. Defaults to an empty array.16852*/16853readonly args: string[];1685416855/**16856* Optional options to be used when the debug adapter is started.16857* Defaults to undefined.16858*/16859readonly options?: DebugAdapterExecutableOptions;16860}1686116862/**16863* Options for a debug adapter executable.16864*/16865export interface DebugAdapterExecutableOptions {1686616867/**16868* The additional environment of the executed program or shell. If omitted16869* the parent process' environment is used. If provided it is merged with16870* the parent process' environment.16871*/16872env?: { [key: string]: string };1687316874/**16875* The current working directory for the executed debug adapter.16876*/16877cwd?: string;16878}1687916880/**16881* Represents a debug adapter running as a socket based server.16882*/16883export class DebugAdapterServer {1688416885/**16886* The port.16887*/16888readonly port: number;1688916890/**16891* The host.16892*/16893readonly host?: string | undefined;1689416895/**16896* Create a description for a debug adapter running as a socket based server.16897*/16898constructor(port: number, host?: string);16899}1690016901/**16902* Represents a debug adapter running as a Named Pipe (on Windows)/UNIX Domain Socket (on non-Windows) based server.16903*/16904export class DebugAdapterNamedPipeServer {16905/**16906* The path to the NamedPipe/UNIX Domain Socket.16907*/16908readonly path: string;1690916910/**16911* Create a description for a debug adapter running as a Named Pipe (on Windows)/UNIX Domain Socket (on non-Windows) based server.16912*/16913constructor(path: string);16914}1691516916/**16917* A debug adapter that implements the Debug Adapter Protocol can be registered with the editor if it implements the DebugAdapter interface.16918*/16919export interface DebugAdapter extends Disposable {1692016921/**16922* An event which fires after the debug adapter has sent a Debug Adapter Protocol message to the editor.16923* Messages can be requests, responses, or events.16924*/16925readonly onDidSendMessage: Event<DebugProtocolMessage>;1692616927/**16928* Handle a Debug Adapter Protocol message.16929* Messages can be requests, responses, or events.16930* Results or errors are returned via onSendMessage events.16931* @param message A Debug Adapter Protocol message16932*/16933handleMessage(message: DebugProtocolMessage): void;16934}1693516936/**16937* A debug adapter descriptor for an inline implementation.16938*/16939export class DebugAdapterInlineImplementation {1694016941/**16942* Create a descriptor for an inline implementation of a debug adapter.16943*/16944constructor(implementation: DebugAdapter);16945}1694616947/**16948* Represents the different types of debug adapters16949*/16950export type DebugAdapterDescriptor = DebugAdapterExecutable | DebugAdapterServer | DebugAdapterNamedPipeServer | DebugAdapterInlineImplementation;1695116952/**16953* A debug adapter factory that creates {@link DebugAdapterDescriptor debug adapter descriptors}.16954*/16955export interface DebugAdapterDescriptorFactory {16956/**16957* 'createDebugAdapterDescriptor' is called at the start of a debug session to provide details about the debug adapter to use.16958* These details must be returned as objects of type {@link DebugAdapterDescriptor}.16959* Currently two types of debug adapters are supported:16960* - a debug adapter executable is specified as a command path and arguments (see {@link DebugAdapterExecutable}),16961* - a debug adapter server reachable via a communication port (see {@link DebugAdapterServer}).16962* If the method is not implemented the default behavior is this:16963* createDebugAdapter(session: DebugSession, executable: DebugAdapterExecutable) {16964* if (typeof session.configuration.debugServer === 'number') {16965* return new DebugAdapterServer(session.configuration.debugServer);16966* }16967* return executable;16968* }16969* @param session The {@link DebugSession debug session} for which the debug adapter will be used.16970* @param executable The debug adapter's executable information as specified in the package.json (or undefined if no such information exists).16971* @returns a {@link DebugAdapterDescriptor debug adapter descriptor} or undefined.16972*/16973createDebugAdapterDescriptor(session: DebugSession, executable: DebugAdapterExecutable | undefined): ProviderResult<DebugAdapterDescriptor>;16974}1697516976/**16977* A Debug Adapter Tracker is a means to track the communication between the editor and a Debug Adapter.16978*/16979export interface DebugAdapterTracker {16980/**16981* A session with the debug adapter is about to be started.16982*/16983onWillStartSession?(): void;16984/**16985* The debug adapter is about to receive a Debug Adapter Protocol message from the editor.16986*/16987onWillReceiveMessage?(message: any): void;16988/**16989* The debug adapter has sent a Debug Adapter Protocol message to the editor.16990*/16991onDidSendMessage?(message: any): void;16992/**16993* The debug adapter session is about to be stopped.16994*/16995onWillStopSession?(): void;16996/**16997* An error with the debug adapter has occurred.16998*/16999onError?(error: Error): void;17000/**17001* The debug adapter has exited with the given exit code or signal.17002*/17003onExit?(code: number | undefined, signal: string | undefined): void;17004}1700517006/**17007* A debug adapter factory that creates {@link DebugAdapterTracker debug adapter trackers}.17008*/17009export interface DebugAdapterTrackerFactory {17010/**17011* The method 'createDebugAdapterTracker' is called at the start of a debug session in order17012* to return a "tracker" object that provides read-access to the communication between the editor and a debug adapter.17013*17014* @param session The {@link DebugSession debug session} for which the debug adapter tracker will be used.17015* @returns A {@link DebugAdapterTracker debug adapter tracker} or undefined.17016*/17017createDebugAdapterTracker(session: DebugSession): ProviderResult<DebugAdapterTracker>;17018}1701917020/**17021* Represents the debug console.17022*/17023export interface DebugConsole {17024/**17025* Append the given value to the debug console.17026*17027* @param value A string, falsy values will not be printed.17028*/17029append(value: string): void;1703017031/**17032* Append the given value and a line feed character17033* to the debug console.17034*17035* @param value A string, falsy values will be printed.17036*/17037appendLine(value: string): void;17038}1703917040/**17041* An event describing the changes to the set of {@link Breakpoint breakpoints}.17042*/17043export interface BreakpointsChangeEvent {17044/**17045* Added breakpoints.17046*/17047readonly added: readonly Breakpoint[];1704817049/**17050* Removed breakpoints.17051*/17052readonly removed: readonly Breakpoint[];1705317054/**17055* Changed breakpoints.17056*/17057readonly changed: readonly Breakpoint[];17058}1705917060/**17061* The base class of all breakpoint types.17062*/17063export class Breakpoint {17064/**17065* The unique ID of the breakpoint.17066*/17067readonly id: string;17068/**17069* Is breakpoint enabled.17070*/17071readonly enabled: boolean;17072/**17073* An optional expression for conditional breakpoints.17074*/17075readonly condition?: string | undefined;17076/**17077* An optional expression that controls how many hits of the breakpoint are ignored.17078*/17079readonly hitCondition?: string | undefined;17080/**17081* An optional message that gets logged when this breakpoint is hit. Embedded expressions within {} are interpolated by the debug adapter.17082*/17083readonly logMessage?: string | undefined;1708417085/**17086* Creates a new breakpoint17087*17088* @param enabled Is breakpoint enabled.17089* @param condition Expression for conditional breakpoints17090* @param hitCondition Expression that controls how many hits of the breakpoint are ignored17091* @param logMessage Log message to display when breakpoint is hit17092*/17093protected constructor(enabled?: boolean, condition?: string, hitCondition?: string, logMessage?: string);17094}1709517096/**17097* A breakpoint specified by a source location.17098*/17099export class SourceBreakpoint extends Breakpoint {17100/**17101* The source and line position of this breakpoint.17102*/17103readonly location: Location;1710417105/**17106* Create a new breakpoint for a source location.17107*/17108constructor(location: Location, enabled?: boolean, condition?: string, hitCondition?: string, logMessage?: string);17109}1711017111/**17112* A breakpoint specified by a function name.17113*/17114export class FunctionBreakpoint extends Breakpoint {17115/**17116* The name of the function to which this breakpoint is attached.17117*/17118readonly functionName: string;1711917120/**17121* Create a new function breakpoint.17122*/17123constructor(functionName: string, enabled?: boolean, condition?: string, hitCondition?: string, logMessage?: string);17124}1712517126/**17127* Debug console mode used by debug session, see {@link DebugSessionOptions options}.17128*/17129export enum DebugConsoleMode {17130/**17131* Debug session should have a separate debug console.17132*/17133Separate = 0,1713417135/**17136* Debug session should share debug console with its parent session.17137* This value has no effect for sessions which do not have a parent session.17138*/17139MergeWithParent = 117140}1714117142/**17143* Options for {@link debug.startDebugging starting a debug session}.17144*/17145export interface DebugSessionOptions {1714617147/**17148* When specified the newly created debug session is registered as a "child" session of this17149* "parent" debug session.17150*/17151parentSession?: DebugSession;1715217153/**17154* Controls whether lifecycle requests like 'restart' are sent to the newly created session or its parent session.17155* By default (if the property is false or missing), lifecycle requests are sent to the new session.17156* This property is ignored if the session has no parent session.17157*/17158lifecycleManagedByParent?: boolean;1715917160/**17161* Controls whether this session should have a separate debug console or share it17162* with the parent session. Has no effect for sessions which do not have a parent session.17163* Defaults to Separate.17164*/17165consoleMode?: DebugConsoleMode;1716617167/**17168* Controls whether this session should run without debugging, thus ignoring breakpoints.17169* When this property is not specified, the value from the parent session (if there is one) is used.17170*/17171noDebug?: boolean;1717217173/**17174* Controls if the debug session's parent session is shown in the CALL STACK view even if it has only a single child.17175* By default, the debug session will never hide its parent.17176* If compact is true, debug sessions with a single child are hidden in the CALL STACK view to make the tree more compact.17177*/17178compact?: boolean;1717917180/**17181* 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.17182*/17183suppressSaveBeforeStart?: boolean;1718417185/**17186* When true, the debug toolbar will not be shown for this session.17187*/17188suppressDebugToolbar?: boolean;1718917190/**17191* When true, the window statusbar color will not be changed for this session.17192*/17193suppressDebugStatusbar?: boolean;1719417195/**17196* When true, the debug viewlet will not be automatically revealed for this session.17197*/17198suppressDebugView?: boolean;1719917200/**17201* Signals to the editor that the debug session was started from a test run17202* request. This is used to link the lifecycle of the debug session and17203* test run in UI actions.17204*/17205testRun?: TestRun;17206}1720717208/**17209* A DebugConfigurationProviderTriggerKind specifies when the `provideDebugConfigurations` method of a `DebugConfigurationProvider` is triggered.17210* Currently there are two situations: to provide the initial debug configurations for a newly created launch.json or17211* to provide dynamically generated debug configurations when the user asks for them through the UI (e.g. via the "Select and Start Debugging" command).17212* A trigger kind is used when registering a `DebugConfigurationProvider` with {@link debug.registerDebugConfigurationProvider}.17213*/17214export enum DebugConfigurationProviderTriggerKind {17215/**17216* `DebugConfigurationProvider.provideDebugConfigurations` is called to provide the initial debug configurations for a newly created launch.json.17217*/17218Initial = 1,17219/**17220* `DebugConfigurationProvider.provideDebugConfigurations` is called to provide dynamically generated debug configurations when the user asks for them through the UI (e.g. via the "Select and Start Debugging" command).17221*/17222Dynamic = 217223}1722417225/**17226* Represents a thread in a debug session.17227*/17228export class DebugThread {17229/**17230* Debug session for thread.17231*/17232readonly session: DebugSession;1723317234/**17235* ID of the associated thread in the debug protocol.17236*/17237readonly threadId: number;1723817239/**17240* @hidden17241*/17242private constructor(session: DebugSession, threadId: number);17243}1724417245/**17246* Represents a stack frame in a debug session.17247*/17248export class DebugStackFrame {17249/**17250* Debug session for thread.17251*/17252readonly session: DebugSession;1725317254/**17255* ID of the associated thread in the debug protocol.17256*/17257readonly threadId: number;17258/**17259* ID of the stack frame in the debug protocol.17260*/17261readonly frameId: number;1726217263/**17264* @hidden17265*/17266private constructor(session: DebugSession, threadId: number, frameId: number);17267}1726817269/**17270* Namespace for debug functionality.17271*/17272export namespace debug {1727317274/**17275* The currently active {@link DebugSession debug session} or `undefined`. The active debug session is the one17276* represented by the debug action floating window or the one currently shown in the drop down menu of the debug action floating window.17277* If no debug session is active, the value is `undefined`.17278*/17279export let activeDebugSession: DebugSession | undefined;1728017281/**17282* The currently active {@link DebugConsole debug console}.17283* If no debug session is active, output sent to the debug console is not shown.17284*/17285export let activeDebugConsole: DebugConsole;1728617287/**17288* List of breakpoints.17289*/17290export let breakpoints: readonly Breakpoint[];1729117292/**17293* An {@link Event} which fires when the {@link debug.activeDebugSession active debug session}17294* has changed. *Note* that the event also fires when the active debug session changes17295* to `undefined`.17296*/17297export const onDidChangeActiveDebugSession: Event<DebugSession | undefined>;1729817299/**17300* An {@link Event} which fires when a new {@link DebugSession debug session} has been started.17301*/17302export const onDidStartDebugSession: Event<DebugSession>;1730317304/**17305* An {@link Event} which fires when a custom DAP event is received from the {@link DebugSession debug session}.17306*/17307export const onDidReceiveDebugSessionCustomEvent: Event<DebugSessionCustomEvent>;1730817309/**17310* An {@link Event} which fires when a {@link DebugSession debug session} has terminated.17311*/17312export const onDidTerminateDebugSession: Event<DebugSession>;1731317314/**17315* An {@link Event} that is emitted when the set of breakpoints is added, removed, or changed.17316*/17317export const onDidChangeBreakpoints: Event<BreakpointsChangeEvent>;1731817319/**17320* The currently focused thread or stack frame, or `undefined` if no17321* thread or stack is focused. A thread can be focused any time there is17322* an active debug session, while a stack frame can only be focused when17323* a session is paused and the call stack has been retrieved.17324*/17325export const activeStackItem: DebugThread | DebugStackFrame | undefined;1732617327/**17328* An event which fires when the {@link debug.activeStackItem} has changed.17329*/17330export const onDidChangeActiveStackItem: Event<DebugThread | DebugStackFrame | undefined>;1733117332/**17333* Register a {@link DebugConfigurationProvider debug configuration provider} for a specific debug type.17334* The optional {@link DebugConfigurationProviderTriggerKind triggerKind} can be used to specify when the `provideDebugConfigurations` method of the provider is triggered.17335* Currently two trigger kinds are possible: with the value `Initial` (or if no trigger kind argument is given) the `provideDebugConfigurations` method is used to provide the initial debug configurations to be copied into a newly created launch.json.17336* With the trigger kind `Dynamic` the `provideDebugConfigurations` method is used to dynamically determine debug configurations to be presented to the user (in addition to the static configurations from the launch.json).17337* Please note that the `triggerKind` argument only applies to the `provideDebugConfigurations` method: so the `resolveDebugConfiguration` methods are not affected at all.17338* Registering a single provider with resolve methods for different trigger kinds, results in the same resolve methods called multiple times.17339* More than one provider can be registered for the same type.17340*17341* @param debugType The debug type for which the provider is registered.17342* @param provider The {@link DebugConfigurationProvider debug configuration provider} to register.17343* @param triggerKind The {@link DebugConfigurationProviderTriggerKind trigger} for which the 'provideDebugConfiguration' method of the provider is registered. If `triggerKind` is missing, the value `DebugConfigurationProviderTriggerKind.Initial` is assumed.17344* @returns A {@link Disposable} that unregisters this provider when being disposed.17345*/17346export function registerDebugConfigurationProvider(debugType: string, provider: DebugConfigurationProvider, triggerKind?: DebugConfigurationProviderTriggerKind): Disposable;1734717348/**17349* Register a {@link DebugAdapterDescriptorFactory debug adapter descriptor factory} for a specific debug type.17350* An extension is only allowed to register a DebugAdapterDescriptorFactory for the debug type(s) defined by the extension. Otherwise an error is thrown.17351* Registering more than one DebugAdapterDescriptorFactory for a debug type results in an error.17352*17353* @param debugType The debug type for which the factory is registered.17354* @param factory The {@link DebugAdapterDescriptorFactory debug adapter descriptor factory} to register.17355* @returns A {@link Disposable} that unregisters this factory when being disposed.17356*/17357export function registerDebugAdapterDescriptorFactory(debugType: string, factory: DebugAdapterDescriptorFactory): Disposable;1735817359/**17360* Register a debug adapter tracker factory for the given debug type.17361*17362* @param debugType The debug type for which the factory is registered or '*' for matching all debug types.17363* @param factory The {@link DebugAdapterTrackerFactory debug adapter tracker factory} to register.17364* @returns A {@link Disposable} that unregisters this factory when being disposed.17365*/17366export function registerDebugAdapterTrackerFactory(debugType: string, factory: DebugAdapterTrackerFactory): Disposable;1736717368/**17369* Start debugging by using either a named launch or named compound configuration,17370* or by directly passing a {@link DebugConfiguration}.17371* The named configurations are looked up in '.vscode/launch.json' found in the given folder.17372* Before debugging starts, all unsaved files are saved and the launch configurations are brought up-to-date.17373* Folder specific variables used in the configuration (e.g. '${workspaceFolder}') are resolved against the given folder.17374* @param folder The {@link WorkspaceFolder workspace folder} for looking up named configurations and resolving variables or `undefined` for a non-folder setup.17375* @param nameOrConfiguration Either the name of a debug or compound configuration or a {@link DebugConfiguration} object.17376* @param parentSessionOrOptions Debug session options. When passed a parent {@link DebugSession debug session}, assumes options with just this parent session.17377* @returns A thenable that resolves when debugging could be successfully started.17378*/17379export function startDebugging(folder: WorkspaceFolder | undefined, nameOrConfiguration: string | DebugConfiguration, parentSessionOrOptions?: DebugSession | DebugSessionOptions): Thenable<boolean>;1738017381/**17382* Stop the given debug session or stop all debug sessions if session is omitted.17383*17384* @param session The {@link DebugSession debug session} to stop; if omitted all sessions are stopped.17385* @returns A thenable that resolves when the session(s) have been stopped.17386*/17387export function stopDebugging(session?: DebugSession): Thenable<void>;1738817389/**17390* Add breakpoints.17391* @param breakpoints The breakpoints to add.17392*/17393export function addBreakpoints(breakpoints: readonly Breakpoint[]): void;1739417395/**17396* Remove breakpoints.17397* @param breakpoints The breakpoints to remove.17398*/17399export function removeBreakpoints(breakpoints: readonly Breakpoint[]): void;1740017401/**17402* Converts a "Source" descriptor object received via the Debug Adapter Protocol into a Uri that can be used to load its contents.17403* If the source descriptor is based on a path, a file Uri is returned.17404* If the source descriptor uses a reference number, a specific debug Uri (scheme 'debug') is constructed that requires a corresponding ContentProvider and a running debug session17405*17406* If the "Source" descriptor has insufficient information for creating the Uri, an error is thrown.17407*17408* @param source An object conforming to the [Source](https://microsoft.github.io/debug-adapter-protocol/specification#Types_Source) type defined in the Debug Adapter Protocol.17409* @param session An optional debug session that will be used when the source descriptor uses a reference number to load the contents from an active debug session.17410* @returns A uri that can be used to load the contents of the source.17411*/17412export function asDebugSourceUri(source: DebugProtocolSource, session?: DebugSession): Uri;17413}1741417415/**17416* Namespace for dealing with installed extensions. Extensions are represented17417* by an {@link Extension}-interface which enables reflection on them.17418*17419* Extension writers can provide APIs to other extensions by returning their API public17420* surface from the `activate`-call.17421*17422* ```javascript17423* export function activate(context: vscode.ExtensionContext) {17424* let api = {17425* sum(a, b) {17426* return a + b;17427* },17428* mul(a, b) {17429* return a * b;17430* }17431* };17432* // 'export' public api-surface17433* return api;17434* }17435* ```17436* When depending on the API of another extension add an `extensionDependencies`-entry17437* to `package.json`, and use the {@link extensions.getExtension getExtension}-function17438* and the {@link Extension.exports exports}-property, like below:17439*17440* ```javascript17441* let mathExt = extensions.getExtension('genius.math');17442* let importedApi = mathExt.exports;17443*17444* console.log(importedApi.mul(42, 1));17445* ```17446*/17447export namespace extensions {1744817449/**17450* Get an extension by its full identifier in the form of: `publisher.name`.17451*17452* @param extensionId An extension identifier.17453* @returns An extension or `undefined`.17454*/17455export function getExtension<T = any>(extensionId: string): Extension<T> | undefined;1745617457/**17458* All extensions currently known to the system.17459*/17460export const all: readonly Extension<any>[];1746117462/**17463* An event which fires when `extensions.all` changes. This can happen when extensions are17464* installed, uninstalled, enabled or disabled.17465*/17466export const onDidChange: Event<void>;17467}1746817469/**17470* Collapsible state of a {@link CommentThread comment thread}17471*/17472export enum CommentThreadCollapsibleState {17473/**17474* Determines an item is collapsed17475*/17476Collapsed = 0,1747717478/**17479* Determines an item is expanded17480*/17481Expanded = 117482}1748317484/**17485* Comment mode of a {@link Comment}17486*/17487export enum CommentMode {17488/**17489* Displays the comment editor17490*/17491Editing = 0,1749217493/**17494* Displays the preview of the comment17495*/17496Preview = 117497}1749817499/**17500* The state of a comment thread.17501*/17502export enum CommentThreadState {17503/**17504* Unresolved thread state17505*/17506Unresolved = 0,17507/**17508* Resolved thread state17509*/17510Resolved = 117511}1751217513/**17514* A collection of {@link Comment comments} representing a conversation at a particular range in a document.17515*/17516export interface CommentThread {17517/**17518* The uri of the document the thread has been created on.17519*/17520readonly uri: Uri;1752117522/**17523* The range the comment thread is located within the document. The thread icon will be shown17524* at the last line of the range. When set to undefined, the comment will be associated with the17525* file, and not a specific range.17526*/17527range: Range | undefined;1752817529/**17530* The ordered comments of the thread.17531*/17532comments: readonly Comment[];1753317534/**17535* Whether the thread should be collapsed or expanded when opening the document.17536* Defaults to Collapsed.17537*/17538collapsibleState: CommentThreadCollapsibleState;1753917540/**17541* Whether the thread supports reply.17542* Defaults to true.17543*/17544canReply: boolean | CommentAuthorInformation;1754517546/**17547* Context value of the comment thread. This can be used to contribute thread specific actions.17548* For example, a comment thread is given a context value as `editable`. When contributing actions to `comments/commentThread/title`17549* using `menus` extension point, you can specify context value for key `commentThread` in `when` expression like `commentThread == editable`.17550* ```json17551* "contributes": {17552* "menus": {17553* "comments/commentThread/title": [17554* {17555* "command": "extension.deleteCommentThread",17556* "when": "commentThread == editable"17557* }17558* ]17559* }17560* }17561* ```17562* This will show action `extension.deleteCommentThread` only for comment threads with `contextValue` is `editable`.17563*/17564contextValue?: string;1756517566/**17567* The optional human-readable label describing the {@link CommentThread Comment Thread}17568*/17569label?: string;1757017571/**17572* The optional state of a comment thread, which may affect how the comment is displayed.17573*/17574state?: CommentThreadState;1757517576/**17577* Dispose this comment thread.17578*17579* Once disposed, this comment thread will be removed from visible editors and Comment Panel when appropriate.17580*/17581dispose(): void;17582}1758317584/**17585* Author information of a {@link Comment}17586*/17587export interface CommentAuthorInformation {17588/**17589* The display name of the author of the comment17590*/17591name: string;1759217593/**17594* The optional icon path for the author17595*/17596iconPath?: Uri;17597}1759817599/**17600* Reactions of a {@link Comment}17601*/17602export interface CommentReaction {17603/**17604* The human-readable label for the reaction17605*/17606readonly label: string;1760717608/**17609* Icon for the reaction shown in UI.17610*/17611readonly iconPath: string | Uri;1761217613/**17614* The number of users who have reacted to this reaction17615*/17616readonly count: number;1761717618/**17619* Whether the {@link CommentAuthorInformation author} of the comment has reacted to this reaction17620*/17621readonly authorHasReacted: boolean;17622}1762317624/**17625* A comment is displayed within the editor or the Comments Panel, depending on how it is provided.17626*/17627export interface Comment {17628/**17629* The human-readable comment body17630*/17631body: string | MarkdownString;1763217633/**17634* {@link CommentMode Comment mode} of the comment17635*/17636mode: CommentMode;1763717638/**17639* The {@link CommentAuthorInformation author information} of the comment17640*/17641author: CommentAuthorInformation;1764217643/**17644* Context value of the comment. This can be used to contribute comment specific actions.17645* For example, a comment is given a context value as `editable`. When contributing actions to `comments/comment/title`17646* using `menus` extension point, you can specify context value for key `comment` in `when` expression like `comment == editable`.17647* ```json17648* "contributes": {17649* "menus": {17650* "comments/comment/title": [17651* {17652* "command": "extension.deleteComment",17653* "when": "comment == editable"17654* }17655* ]17656* }17657* }17658* ```17659* This will show action `extension.deleteComment` only for comments with `contextValue` is `editable`.17660*/17661contextValue?: string;1766217663/**17664* Optional reactions of the {@link Comment}17665*/17666reactions?: CommentReaction[];1766717668/**17669* Optional label describing the {@link Comment}17670* Label will be rendered next to authorName if exists.17671*/17672label?: string;1767317674/**17675* Optional timestamp that will be displayed in comments.17676* The date will be formatted according to the user's locale and settings.17677*/17678timestamp?: Date;17679}1768017681/**17682* Command argument for actions registered in `comments/commentThread/context`.17683*/17684export interface CommentReply {17685/**17686* The active {@link CommentThread comment thread}17687*/17688thread: CommentThread;1768917690/**17691* The value in the comment editor17692*/17693text: string;17694}1769517696/**17697* The ranges a CommentingRangeProvider enables commenting on.17698*/17699export interface CommentingRanges {17700/**17701* Enables comments to be added to a file without a specific range.17702*/17703enableFileComments: boolean;1770417705/**17706* The ranges which allow new comment threads creation.17707*/17708ranges?: Range[];17709}1771017711/**17712* Commenting range provider for a {@link CommentController comment controller}.17713*/17714export interface CommentingRangeProvider {17715/**17716* Provide a list of ranges which allow new comment threads creation or null for a given document17717*/17718provideCommentingRanges(document: TextDocument, token: CancellationToken): ProviderResult<Range[] | CommentingRanges>;17719}1772017721/**17722* Represents a {@link CommentController comment controller}'s {@link CommentController.options options}.17723*/17724export interface CommentOptions {17725/**17726* An optional string to show on the comment input box when it's collapsed.17727*/17728prompt?: string;1772917730/**17731* An optional string to show as placeholder in the comment input box when it's focused.17732*/17733placeHolder?: string;17734}1773517736/**17737* A comment controller is able to provide {@link CommentThread comments} support to the editor and17738* provide users various ways to interact with comments.17739*/17740export interface CommentController {17741/**17742* The id of this comment controller.17743*/17744readonly id: string;1774517746/**17747* The human-readable label of this comment controller.17748*/17749readonly label: string;1775017751/**17752* Comment controller options17753*/17754options?: CommentOptions;1775517756/**17757* Optional commenting range provider. Provide a list {@link Range ranges} which support commenting to any given resource uri.17758*17759* If not provided, users cannot leave any comments.17760*/17761commentingRangeProvider?: CommentingRangeProvider;1776217763/**17764* Create a {@link CommentThread comment thread}. The comment thread will be displayed in visible text editors (if the resource matches)17765* and Comments Panel once created.17766*17767* @param uri The uri of the document the thread has been created on.17768* @param range The range the comment thread is located within the document.17769* @param comments The ordered comments of the thread.17770*/17771createCommentThread(uri: Uri, range: Range, comments: readonly Comment[]): CommentThread;1777217773/**17774* Optional reaction handler for creating and deleting reactions on a {@link Comment}.17775*/17776reactionHandler?: (comment: Comment, reaction: CommentReaction) => Thenable<void>;1777717778/**17779* Dispose this comment controller.17780*17781* Once disposed, all {@link CommentThread comment threads} created by this comment controller will also be removed from the editor17782* and Comments Panel.17783*/17784dispose(): void;17785}1778617787namespace comments {17788/**17789* Creates a new {@link CommentController comment controller} instance.17790*17791* @param id An `id` for the comment controller.17792* @param label A human-readable string for the comment controller.17793* @returns An instance of {@link CommentController comment controller}.17794*/17795export function createCommentController(id: string, label: string): CommentController;17796}1779717798/**17799* Represents a session of a currently logged in user.17800*/17801export interface AuthenticationSession {17802/**17803* The identifier of the authentication session.17804*/17805readonly id: string;1780617807/**17808* The access token. This token should be used to authenticate requests to a service. Popularized by OAuth.17809* @reference https://oauth.net/2/access-tokens/17810*/17811readonly accessToken: string;1781217813/**17814* The ID token. This token contains identity information about the user. Popularized by OpenID Connect.17815* @reference https://openid.net/specs/openid-connect-core-1_0.html#IDToken17816*/17817readonly idToken?: string;1781817819/**17820* The account associated with the session.17821*/17822readonly account: AuthenticationSessionAccountInformation;1782317824/**17825* The permissions granted by the session's access token. Available scopes17826* are defined by the {@link AuthenticationProvider}.17827*/17828readonly scopes: readonly string[];17829}1783017831/**17832* The information of an account associated with an {@link AuthenticationSession}.17833*/17834export interface AuthenticationSessionAccountInformation {17835/**17836* The unique identifier of the account.17837*/17838readonly id: string;1783917840/**17841* The human-readable name of the account.17842*/17843readonly label: string;17844}1784517846/**17847* Optional options to be used when calling {@link authentication.getSession} with interactive options `forceNewSession` & `createIfNone`.17848*/17849export interface AuthenticationGetSessionPresentationOptions {17850/**17851* An optional message that will be displayed to the user when we ask to re-authenticate. Providing additional context17852* as to why you are asking a user to re-authenticate can help increase the odds that they will accept.17853*/17854detail?: string;17855}1785617857/**17858* Optional options to be used when calling {@link authentication.getSession} with the flag `forceNewSession`.17859* @deprecated Use {@link AuthenticationGetSessionPresentationOptions} instead.17860*/17861export type AuthenticationForceNewSessionOptions = AuthenticationGetSessionPresentationOptions;1786217863/**17864* Options to be used when getting an {@link AuthenticationSession} from an {@link AuthenticationProvider}.17865*/17866export interface AuthenticationGetSessionOptions {17867/**17868* Whether the existing session preference should be cleared.17869*17870* For authentication providers that support being signed into multiple accounts at once, the user will be17871* prompted to select an account to use when {@link authentication.getSession getSession} is called. This preference17872* is remembered until {@link authentication.getSession getSession} is called with this flag.17873*17874* Note:17875* The preference is extension specific. So if one extension calls {@link authentication.getSession getSession}, it will not17876* affect the session preference for another extension calling {@link authentication.getSession getSession}. Additionally,17877* the preference is set for the current workspace and also globally. This means that new workspaces will use the "global"17878* value at first and then when this flag is provided, a new value can be set for that workspace. This also means17879* that pre-existing workspaces will not lose their preference if a new workspace sets this flag.17880*17881* Defaults to false.17882*/17883clearSessionPreference?: boolean;1788417885/**17886* Whether login should be performed if there is no matching session.17887*17888* If true, a modal dialog will be shown asking the user to sign in. If false, a numbered badge will be shown17889* on the accounts activity bar icon. An entry for the extension will be added under the menu to sign in. This17890* allows quietly prompting the user to sign in.17891*17892* If you provide options, you will also see the dialog but with the additional context provided.17893*17894* If there is a matching session but the extension has not been granted access to it, setting this to true17895* will also result in an immediate modal dialog, and false will add a numbered badge to the accounts icon.17896*17897* Defaults to false.17898*17899* Note: you cannot use this option with {@link AuthenticationGetSessionOptions.silent silent}.17900*/17901createIfNone?: boolean | AuthenticationGetSessionPresentationOptions;1790217903/**17904* Whether we should attempt to reauthenticate even if there is already a session available.17905*17906* If true, a modal dialog will be shown asking the user to sign in again. This is mostly used for scenarios17907* where the token needs to be re minted because it has lost some authorization.17908*17909* If you provide options, you will also see the dialog but with the additional context provided.17910*17911* If there are no existing sessions and forceNewSession is true, it will behave identically to17912* {@link AuthenticationGetSessionOptions.createIfNone createIfNone}.17913*17914* This defaults to false.17915*/17916forceNewSession?: boolean | AuthenticationGetSessionPresentationOptions | AuthenticationForceNewSessionOptions;1791717918/**17919* Whether we should show the indication to sign in in the Accounts menu.17920*17921* If false, the user will be shown a badge on the Accounts menu with an option to sign in for the extension.17922* If true, no indication will be shown.17923*17924* Defaults to false.17925*17926* Note: you cannot use this option with any other options that prompt the user like {@link AuthenticationGetSessionOptions.createIfNone createIfNone}.17927*/17928silent?: boolean;1792917930/**17931* The account that you would like to get a session for. This is passed down to the Authentication Provider to be used for creating the correct session.17932*/17933account?: AuthenticationSessionAccountInformation;17934}1793517936/**17937* Represents parameters for creating a session based on a WWW-Authenticate header value.17938* This is used when an API returns a 401 with a WWW-Authenticate header indicating17939* that additional authentication is required. The details of which will be passed down17940* to the authentication provider to create a session.17941*17942* @note The authorization provider must support handling challenges and specifically17943* the challenges in this WWW-Authenticate value.17944* @note For more information on WWW-Authenticate please see https://developer.mozilla.org/docs/Web/HTTP/Reference/Headers/WWW-Authenticate17945*/17946export interface AuthenticationWwwAuthenticateRequest {17947/**17948* The raw WWW-Authenticate header value that triggered this challenge.17949* This will be parsed by the authentication provider to extract the necessary17950* challenge information.17951*/17952readonly wwwAuthenticate: string;1795317954/**17955* The fallback scopes to use if no scopes are found in the WWW-Authenticate header.17956*/17957readonly fallbackScopes?: readonly string[];17958}1795917960/**17961* Basic information about an {@link AuthenticationProvider}17962*/17963export interface AuthenticationProviderInformation {17964/**17965* The unique identifier of the authentication provider.17966*/17967readonly id: string;1796817969/**17970* The human-readable name of the authentication provider.17971*/17972readonly label: string;17973}1797417975/**17976* An {@link Event} which fires when an {@link AuthenticationSession} is added, removed, or changed.17977*/17978export interface AuthenticationSessionsChangeEvent {17979/**17980* The {@link AuthenticationProvider} that has had its sessions change.17981*/17982readonly provider: AuthenticationProviderInformation;17983}1798417985/**17986* Options for creating an {@link AuthenticationProvider}.17987*/17988export interface AuthenticationProviderOptions {17989/**17990* Whether it is possible to be signed into multiple accounts at once with this provider.17991* If not specified, will default to false.17992*/17993readonly supportsMultipleAccounts?: boolean;17994}1799517996/**17997* An {@link Event} which fires when an {@link AuthenticationSession} is added, removed, or changed.17998*/17999export interface AuthenticationProviderAuthenticationSessionsChangeEvent {18000/**18001* The {@link AuthenticationSession AuthenticationSessions} of the {@link AuthenticationProvider} that have been added.18002*/18003readonly added: readonly AuthenticationSession[] | undefined;1800418005/**18006* The {@link AuthenticationSession AuthenticationSessions} of the {@link AuthenticationProvider} that have been removed.18007*/18008readonly removed: readonly AuthenticationSession[] | undefined;1800918010/**18011* The {@link AuthenticationSession AuthenticationSessions} of the {@link AuthenticationProvider} that have been changed.18012* A session changes when its data excluding the id are updated. An example of this is a session refresh that results in a new18013* access token being set for the session.18014*/18015readonly changed: readonly AuthenticationSession[] | undefined;18016}1801718018/**18019* The options passed in to the {@link AuthenticationProvider.getSessions} and18020* {@link AuthenticationProvider.createSession} call.18021*/18022export interface AuthenticationProviderSessionOptions {18023/**18024* The account that is being asked about. If this is passed in, the provider should18025* attempt to return the sessions that are only related to this account.18026*/18027account?: AuthenticationSessionAccountInformation;18028}1802918030/**18031* A provider for performing authentication to a service.18032*/18033export interface AuthenticationProvider {18034/**18035* An {@link Event} which fires when the array of sessions has changed, or data18036* within a session has changed.18037*/18038readonly onDidChangeSessions: Event<AuthenticationProviderAuthenticationSessionsChangeEvent>;1803918040/**18041* Get a list of sessions.18042* @param scopes An optional list of scopes. If provided, the sessions returned should match18043* these permissions, otherwise all sessions should be returned.18044* @param options Additional options for getting sessions.18045* @returns A promise that resolves to an array of authentication sessions.18046*/18047getSessions(scopes: readonly string[] | undefined, options: AuthenticationProviderSessionOptions): Thenable<AuthenticationSession[]>;1804818049/**18050* Prompts a user to login.18051*18052* If login is successful, the onDidChangeSessions event should be fired.18053*18054* If login fails, a rejected promise should be returned.18055*18056* If the provider has specified that it does not support multiple accounts,18057* then this should never be called if there is already an existing session matching these18058* scopes.18059* @param scopes A list of scopes, permissions, that the new session should be created with.18060* @param options Additional options for creating a session.18061* @returns A promise that resolves to an authentication session.18062*/18063createSession(scopes: readonly string[], options: AuthenticationProviderSessionOptions): Thenable<AuthenticationSession>;1806418065/**18066* Removes the session corresponding to session id.18067*18068* If the removal is successful, the onDidChangeSessions event should be fired.18069*18070* If a session cannot be removed, the provider should reject with an error message.18071* @param sessionId The id of the session to remove.18072*/18073removeSession(sessionId: string): Thenable<void>;18074}180751807618077/**18078* Namespace for authentication.18079*/18080export namespace authentication {18081/**18082* Get an authentication session matching the desired scopes or satisfying the WWW-Authenticate request. Rejects if18083* a provider with providerId is not registered, or if the user does not consent to sharing authentication information18084* with the extension. If there are multiple sessions with the same scopes, the user will be shown a quickpick to18085* select which account they would like to use.18086*18087* Built-in auth providers include:18088* * 'github' - For GitHub.com18089* * 'microsoft' For both personal & organizational Microsoft accounts18090* * (less common) 'github-enterprise' - for alternative GitHub hostings, GHE.com, GitHub Enterprise Server18091* * (less common) 'microsoft-sovereign-cloud' - for alternative Microsoft clouds18092*18093* @param providerId The id of the provider to use18094* @param scopeListOrRequest A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider.18095* @param options The {@link AuthenticationGetSessionOptions} to use18096* @returns A thenable that resolves to an authentication session18097*/18098export function getSession(providerId: string, scopeListOrRequest: ReadonlyArray<string> | AuthenticationWwwAuthenticateRequest, options: AuthenticationGetSessionOptions & { /** */createIfNone: true | AuthenticationGetSessionPresentationOptions }): Thenable<AuthenticationSession>;1809918100/**18101* Get an authentication session matching the desired scopes or request. Rejects if a provider with providerId is not18102* registered, or if the user does not consent to sharing authentication information with the extension. If there18103* are multiple sessions with the same scopes, the user will be shown a quickpick to select which account they would like to use.18104*18105* Built-in auth providers include:18106* * 'github' - For GitHub.com18107* * 'microsoft' For both personal & organizational Microsoft accounts18108* * (less common) 'github-enterprise' - for alternative GitHub hostings, GHE.com, GitHub Enterprise Server18109* * (less common) 'microsoft-sovereign-cloud' - for alternative Microsoft clouds18110*18111* @param providerId The id of the provider to use18112* @param scopeListOrRequest A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider.18113* @param options The {@link AuthenticationGetSessionOptions} to use18114* @returns A thenable that resolves to an authentication session18115*/18116export function getSession(providerId: string, scopeListOrRequest: ReadonlyArray<string> | AuthenticationWwwAuthenticateRequest, options: AuthenticationGetSessionOptions & { /** literal-type defines return type */forceNewSession: true | AuthenticationGetSessionPresentationOptions | AuthenticationForceNewSessionOptions }): Thenable<AuthenticationSession>;1811718118/**18119* Get an authentication session matching the desired scopes or request. Rejects if a provider with providerId is not18120* registered, or if the user does not consent to sharing authentication information with the extension. If there18121* are multiple sessions with the same scopes, the user will be shown a quickpick to select which account they would like to use.18122*18123* Built-in auth providers include:18124* * 'github' - For GitHub.com18125* * 'microsoft' For both personal & organizational Microsoft accounts18126* * (less common) 'github-enterprise' - for alternative GitHub hostings, GHE.com, GitHub Enterprise Server18127* * (less common) 'microsoft-sovereign-cloud' - for alternative Microsoft clouds18128*18129* @param providerId The id of the provider to use18130* @param scopeListOrRequest A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider.18131* @param options The {@link AuthenticationGetSessionOptions} to use18132* @returns A thenable that resolves to an authentication session or undefined if a silent flow was used and no session was found18133*/18134export function getSession(providerId: string, scopeListOrRequest: ReadonlyArray<string> | AuthenticationWwwAuthenticateRequest, options?: AuthenticationGetSessionOptions): Thenable<AuthenticationSession | undefined>;1813518136/**18137* Get all accounts that the user is logged in to for the specified provider.18138* Use this paired with {@link getSession} in order to get an authentication session for a specific account.18139*18140* Currently, there are only two authentication providers that are contributed from built in extensions18141* to the editor that implement GitHub and Microsoft authentication: their providerId's are 'github' and 'microsoft'.18142*18143* Note: Getting accounts does not imply that your extension has access to that account or its authentication sessions. You can verify access to the account by calling {@link getSession}.18144*18145* @param providerId The id of the provider to use18146* @returns A thenable that resolves to a readonly array of authentication accounts.18147*/18148export function getAccounts(providerId: string): Thenable<readonly AuthenticationSessionAccountInformation[]>;1814918150/**18151* An {@link Event} which fires when the authentication sessions of an authentication provider have18152* been added, removed, or changed.18153*/18154export const onDidChangeSessions: Event<AuthenticationSessionsChangeEvent>;1815518156/**18157* Register an authentication provider.18158*18159* There can only be one provider per id and an error is being thrown when an id18160* has already been used by another provider. Ids are case-sensitive.18161*18162* @param id The unique identifier of the provider.18163* @param label The human-readable name of the provider.18164* @param provider The authentication provider provider.18165* @param options Additional options for the provider.18166* @returns A {@link Disposable} that unregisters this provider when being disposed.18167*/18168export function registerAuthenticationProvider(id: string, label: string, provider: AuthenticationProvider, options?: AuthenticationProviderOptions): Disposable;18169}1817018171/**18172* Namespace for localization-related functionality in the extension API. To use this properly,18173* you must have `l10n` defined in your extension manifest and have bundle.l10n.<language>.json files.18174* For more information on how to generate bundle.l10n.<language>.json files, check out the18175* [vscode-l10n repo](https://github.com/microsoft/vscode-l10n).18176*18177* Note: Built-in extensions (for example, Git, TypeScript Language Features, GitHub Authentication)18178* are excluded from the `l10n` property requirement. In other words, they do not need to specify18179* a `l10n` in the extension manifest because their translated strings come from Language Packs.18180*/18181export namespace l10n {18182/**18183* Marks a string for localization. If a localized bundle is available for the language specified by18184* {@link env.language} and the bundle has a localized value for this message, then that localized18185* value will be returned (with injected {@link args} values for any templated values).18186*18187* @param message - The message to localize. Supports index templating where strings like `{0}` and `{1}` are18188* replaced by the item at that index in the {@link args} array.18189* @param args - The arguments to be used in the localized string. The index of the argument is used to18190* match the template placeholder in the localized string.18191* @returns localized string with injected arguments.18192*18193* @example18194* l10n.t('Hello {0}!', 'World');18195*/18196export function t(message: string, ...args: Array<string | number | boolean>): string;1819718198/**18199* Marks a string for localization. If a localized bundle is available for the language specified by18200* {@link env.language} and the bundle has a localized value for this message, then that localized18201* value will be returned (with injected {@link args} values for any templated values).18202*18203* @param message The message to localize. Supports named templating where strings like `{foo}` and `{bar}` are18204* replaced by the value in the Record for that key (foo, bar, etc).18205* @param args The arguments to be used in the localized string. The name of the key in the record is used to18206* match the template placeholder in the localized string.18207* @returns localized string with injected arguments.18208*18209* @example18210* l10n.t('Hello {name}', { name: 'Erich' });18211*/18212export function t(message: string, args: Record<string, string | number | boolean>): string;18213/**18214* Marks a string for localization. If a localized bundle is available for the language specified by18215* {@link env.language} and the bundle has a localized value for this message, then that localized18216* value will be returned (with injected args values for any templated values).18217*18218* @param options The options to use when localizing the message.18219* @returns localized string with injected arguments.18220*/18221export function t(options: {18222/**18223* The message to localize. If {@link options.args args} is an array, this message supports index templating where strings like18224* `{0}` and `{1}` are replaced by the item at that index in the {@link options.args args} array. If `args` is a `Record`,18225* this supports named templating where strings like `{foo}` and `{bar}` are replaced by the value in18226* the Record for that key (foo, bar, etc).18227*/18228message: string;18229/**18230* The arguments to be used in the localized string. As an array, the index of the argument is used to18231* match the template placeholder in the localized string. As a `Record`, the key is used to match the template18232* placeholder in the localized string.18233*/18234args?: Array<string | number | boolean> | Record<string, string | number | boolean>;18235/**18236* A comment to help translators understand the context of the message.18237*/18238comment: string | string[];18239}): string;18240/**18241* The bundle of localized strings that have been loaded for the extension.18242* It's undefined if no bundle has been loaded. The bundle is typically not loaded if18243* there was no bundle found or when we are running with the default language.18244*/18245export const bundle: { [key: string]: string } | undefined;18246/**18247* The URI of the localization bundle that has been loaded for the extension.18248* It's undefined if no bundle has been loaded. The bundle is typically not loaded if18249* there was no bundle found or when we are running with the default language.18250*/18251export const uri: Uri | undefined;18252}1825318254/**18255* Namespace for testing functionality. Tests are published by registering18256* {@link TestController} instances, then adding {@link TestItem TestItems}.18257* Controllers may also describe how to run tests by creating one or more18258* {@link TestRunProfile} instances.18259*/18260export namespace tests {18261/**18262* Creates a new test controller.18263*18264* @param id Identifier for the controller, must be globally unique.18265* @param label A human-readable label for the controller.18266* @returns An instance of the {@link TestController}.18267*/18268export function createTestController(id: string, label: string): TestController;18269}1827018271/**18272* The kind of executions that {@link TestRunProfile TestRunProfiles} control.18273*/18274export enum TestRunProfileKind {18275/**18276* The `Run` test profile kind.18277*/18278Run = 1,18279/**18280* The `Debug` test profile kind.18281*/18282Debug = 2,18283/**18284* The `Coverage` test profile kind.18285*/18286Coverage = 3,18287}1828818289/**18290* Tags can be associated with {@link TestItem TestItems} and18291* {@link TestRunProfile TestRunProfiles}. A profile with a tag can only18292* execute tests that include that tag in their {@link TestItem.tags} array.18293*/18294export class TestTag {18295/**18296* ID of the test tag. `TestTag` instances with the same ID are considered18297* to be identical.18298*/18299readonly id: string;1830018301/**18302* Creates a new TestTag instance.18303* @param id ID of the test tag.18304*/18305constructor(id: string);18306}1830718308/**18309* A TestRunProfile describes one way to execute tests in a {@link TestController}.18310*/18311export interface TestRunProfile {18312/**18313* Label shown to the user in the UI.18314*18315* Note that the label has some significance if the user requests that18316* tests be re-run in a certain way. For example, if tests were run18317* normally and the user requests to re-run them in debug mode, the editor18318* will attempt use a configuration with the same label of the `Debug`18319* kind. If there is no such configuration, the default will be used.18320*/18321label: string;1832218323/**18324* Configures what kind of execution this profile controls. If there18325* are no profiles for a kind, it will not be available in the UI.18326*/18327readonly kind: TestRunProfileKind;1832818329/**18330* Controls whether this profile is the default action that will18331* be taken when its kind is actioned. For example, if the user clicks18332* the generic "run all" button, then the default profile for18333* {@link TestRunProfileKind.Run} will be executed, although the18334* user can configure this.18335*18336* Changes the user makes in their default profiles will be reflected18337* in this property after a {@link onDidChangeDefault} event.18338*/18339isDefault: boolean;1834018341/**18342* Fired when a user has changed whether this is a default profile. The18343* event contains the new value of {@link isDefault}18344*/18345readonly onDidChangeDefault: Event<boolean>;1834618347/**18348* Whether this profile supports continuous running of requests. If so,18349* then {@link TestRunRequest.continuous} may be set to `true`. Defaults18350* to false.18351*/18352supportsContinuousRun: boolean;1835318354/**18355* Associated tag for the profile. If this is set, only {@link TestItem}18356* instances with the same tag will be eligible to execute in this profile.18357*/18358tag: TestTag | undefined;1835918360/**18361* If this method is present, a configuration gear will be present in the18362* UI, and this method will be invoked when it's clicked. When called,18363* you can take other editor actions, such as showing a quick pick or18364* opening a configuration file.18365*/18366configureHandler: (() => void) | undefined;1836718368/**18369* Handler called to start a test run. When invoked, the function should call18370* {@link TestController.createTestRun} at least once, and all test runs18371* associated with the request should be created before the function returns18372* or the returned promise is resolved.18373*18374* If {@link supportsContinuousRun} is set, then {@link TestRunRequest.continuous}18375* may be `true`. In this case, the profile should observe changes to18376* source code and create new test runs by calling {@link TestController.createTestRun},18377* until the cancellation is requested on the `token`.18378*18379* @param request Request information for the test run.18380* @param cancellationToken Token that signals the used asked to abort the18381* test run. If cancellation is requested on this token, all {@link TestRun}18382* instances associated with the request will be18383* automatically cancelled as well.18384*/18385runHandler: (request: TestRunRequest, token: CancellationToken) => Thenable<void> | void;1838618387/**18388* An extension-provided function that provides detailed statement and18389* function-level coverage for a file. The editor will call this when more18390* detail is needed for a file, such as when it's opened in an editor or18391* expanded in the **Test Coverage** view.18392*18393* The {@link FileCoverage} object passed to this function is the same instance18394* emitted on {@link TestRun.addCoverage} calls associated with this profile.18395*/18396loadDetailedCoverage?: (testRun: TestRun, fileCoverage: FileCoverage, token: CancellationToken) => Thenable<FileCoverageDetail[]>;1839718398/**18399* An extension-provided function that provides detailed statement and18400* function-level coverage for a single test in a file. This is the per-test18401* sibling of {@link TestRunProfile.loadDetailedCoverage}, called only if18402* a test item is provided in {@link FileCoverage.includesTests} and only18403* for files where such data is reported.18404*18405* Often {@link TestRunProfile.loadDetailedCoverage} will be called first18406* when a user opens a file, and then this method will be called if they18407* drill down into specific per-test coverage information. This method18408* should then return coverage data only for statements and declarations18409* executed by the specific test during the run.18410*18411* The {@link FileCoverage} object passed to this function is the same18412* instance emitted on {@link TestRun.addCoverage} calls associated with this profile.18413*18414* @param testRun The test run that generated the coverage data.18415* @param fileCoverage The file coverage object to load detailed coverage for.18416* @param fromTestItem The test item to request coverage information for.18417* @param token A cancellation token that indicates the operation should be cancelled.18418*/18419loadDetailedCoverageForTest?: (testRun: TestRun, fileCoverage: FileCoverage, fromTestItem: TestItem, token: CancellationToken) => Thenable<FileCoverageDetail[]>;1842018421/**18422* Deletes the run profile.18423*/18424dispose(): void;18425}1842618427/**18428* Entry point to discover and execute tests. It contains {@link TestController.items} which18429* are used to populate the editor UI, and is associated with18430* {@link TestController.createRunProfile run profiles} to allow18431* for tests to be executed.18432*/18433export interface TestController {18434/**18435* The id of the controller passed in {@link tests.createTestController}.18436* This must be globally unique.18437*/18438readonly id: string;1843918440/**18441* Human-readable label for the test controller.18442*/18443label: string;1844418445/**18446* A collection of "top-level" {@link TestItem} instances, which can in18447* turn have their own {@link TestItem.children children} to form the18448* "test tree."18449*18450* The extension controls when to add tests. For example, extensions should18451* add tests for a file when {@link workspace.onDidOpenTextDocument}18452* fires in order for decorations for tests within a file to be visible.18453*18454* However, the editor may sometimes explicitly request children using the18455* {@link resolveHandler} See the documentation on that method for more details.18456*/18457readonly items: TestItemCollection;1845818459/**18460* Creates a profile used for running tests. Extensions must create18461* at least one profile in order for tests to be run.18462* @param label A human-readable label for this profile.18463* @param kind Configures what kind of execution this profile manages.18464* @param runHandler Function called to start a test run.18465* @param isDefault Whether this is the default action for its kind.18466* @param tag Profile test tag.18467* @param supportsContinuousRun Whether the profile supports continuous running.18468* @returns An instance of a {@link TestRunProfile}, which is automatically18469* associated with this controller.18470*/18471createRunProfile(label: string, kind: TestRunProfileKind, runHandler: (request: TestRunRequest, token: CancellationToken) => Thenable<void> | void, isDefault?: boolean, tag?: TestTag, supportsContinuousRun?: boolean): TestRunProfile;1847218473/**18474* A function provided by the extension that the editor may call to request18475* children of a test item, if the {@link TestItem.canResolveChildren} is18476* `true`. When called, the item should discover children and call18477* {@link TestController.createTestItem} as children are discovered.18478*18479* Generally the extension manages the lifecycle of test items, but under18480* certain conditions the editor may request the children of a specific18481* item to be loaded. For example, if the user requests to re-run tests18482* after reloading the editor, the editor may need to call this method18483* to resolve the previously-run tests.18484*18485* The item in the explorer will automatically be marked as "busy" until18486* the function returns or the returned thenable resolves.18487*18488* @param item An unresolved test item for which children are being18489* requested, or `undefined` to resolve the controller's initial {@link TestController.items items}.18490*/18491resolveHandler?: (item: TestItem | undefined) => Thenable<void> | void;1849218493/**18494* If this method is present, a refresh button will be present in the18495* UI, and this method will be invoked when it's clicked. When called,18496* the extension should scan the workspace for any new, changed, or18497* removed tests.18498*18499* It's recommended that extensions try to update tests in realtime, using18500* a {@link FileSystemWatcher} for example, and use this method as a fallback.18501*18502* @returns A thenable that resolves when tests have been refreshed.18503*/18504refreshHandler: ((token: CancellationToken) => Thenable<void> | void) | undefined;1850518506/**18507* Creates a {@link TestRun}. This should be called by the18508* {@link TestRunProfile} when a request is made to execute tests, and may18509* also be called if a test run is detected externally. Once created, tests18510* that are included in the request will be moved into the queued state.18511*18512* All runs created using the same `request` instance will be grouped18513* together. This is useful if, for example, a single suite of tests is18514* run on multiple platforms.18515*18516* @param request Test run request. Only tests inside the `include` may be18517* modified, and tests in its `exclude` are ignored.18518* @param name The human-readable name of the run. This can be used to18519* disambiguate multiple sets of results in a test run. It is useful if18520* tests are run across multiple platforms, for example.18521* @param persist Whether the results created by the run should be18522* persisted in the editor. This may be false if the results are coming from18523* a file already saved externally, such as a coverage information file.18524* @returns An instance of the {@link TestRun}. It will be considered "running"18525* from the moment this method is invoked until {@link TestRun.end} is called.18526*/18527createTestRun(request: TestRunRequest, name?: string, persist?: boolean): TestRun;1852818529/**18530* Creates a new managed {@link TestItem} instance. It can be added into18531* the {@link TestItem.children} of an existing item, or into the18532* {@link TestController.items}.18533*18534* @param id Identifier for the TestItem. The test item's ID must be unique18535* in the {@link TestItemCollection} it's added to.18536* @param label Human-readable label of the test item.18537* @param uri URI this TestItem is associated with. May be a file or directory.18538*/18539createTestItem(id: string, label: string, uri?: Uri): TestItem;1854018541/**18542* Marks an item's results as being outdated. This is commonly called when18543* code or configuration changes and previous results should no longer18544* be considered relevant. The same logic used to mark results as outdated18545* may be used to drive {@link TestRunRequest.continuous continuous test runs}.18546*18547* If an item is passed to this method, test results for the item and all of18548* its children will be marked as outdated. If no item is passed, then all18549* test owned by the TestController will be marked as outdated.18550*18551* Any test runs started before the moment this method is called, including18552* runs which may still be ongoing, will be marked as outdated and deprioritized18553* in the editor's UI.18554*18555* @param items Item to mark as outdated. If undefined, all the controller's items are marked outdated.18556*/18557invalidateTestResults(items?: TestItem | readonly TestItem[]): void;1855818559/**18560* Unregisters the test controller, disposing of its associated tests18561* and unpersisted results.18562*/18563dispose(): void;18564}1856518566/**18567* A TestRunRequest is a precursor to a {@link TestRun}, which in turn is18568* created by passing a request to {@link TestController.createTestRun}. The18569* TestRunRequest contains information about which tests should be run, which18570* should not be run, and how they are run (via the {@link TestRunRequest.profile profile}).18571*18572* In general, TestRunRequests are created by the editor and pass to18573* {@link TestRunProfile.runHandler}, however you can also create test18574* requests and runs outside of the `runHandler`.18575*/18576export class TestRunRequest {18577/**18578* A filter for specific tests to run. If given, the extension should run18579* all of the included tests and all their children, excluding any tests18580* that appear in {@link TestRunRequest.exclude}. If this property is18581* undefined, then the extension should simply run all tests.18582*18583* The process of running tests should resolve the children of any test18584* items who have not yet been resolved.18585*/18586readonly include: readonly TestItem[] | undefined;1858718588/**18589* An array of tests the user has marked as excluded from the test included18590* in this run; exclusions should apply after inclusions.18591*18592* May be omitted if no exclusions were requested. Test controllers should18593* not run excluded tests or any children of excluded tests.18594*/18595readonly exclude: readonly TestItem[] | undefined;1859618597/**18598* The profile used for this request. This will always be defined18599* for requests issued from the editor UI, though extensions may18600* programmatically create requests not associated with any profile.18601*/18602readonly profile: TestRunProfile | undefined;1860318604/**18605* Whether the profile should run continuously as source code changes. Only18606* relevant for profiles that set {@link TestRunProfile.supportsContinuousRun}.18607*/18608readonly continuous?: boolean;1860918610/**18611* Controls how test Test Results view is focused. If true, the editor18612* will keep the maintain the user's focus. If false, the editor will18613* prefer to move focus into the Test Results view, although18614* this may be configured by users.18615*/18616readonly preserveFocus: boolean;1861718618/**18619* @param include Array of specific tests to run, or undefined to run all tests18620* @param exclude An array of tests to exclude from the run.18621* @param profile The run profile used for this request.18622* @param continuous Whether to run tests continuously as source changes.18623* @param preserveFocus Whether to preserve the user's focus when the run is started18624*/18625constructor(include?: readonly TestItem[], exclude?: readonly TestItem[], profile?: TestRunProfile, continuous?: boolean, preserveFocus?: boolean);18626}1862718628/**18629* A TestRun represents an in-progress or completed test run and18630* provides methods to report the state of individual tests in the run.18631*/18632export interface TestRun {18633/**18634* The human-readable name of the run. This can be used to18635* disambiguate multiple sets of results in a test run. It is useful if18636* tests are run across multiple platforms, for example.18637*/18638readonly name: string | undefined;1863918640/**18641* A cancellation token which will be triggered when the test run is18642* canceled from the UI.18643*/18644readonly token: CancellationToken;1864518646/**18647* Whether the test run will be persisted across reloads by the editor.18648*/18649readonly isPersisted: boolean;1865018651/**18652* Indicates a test is queued for later execution.18653* @param test Test item to update.18654*/18655enqueued(test: TestItem): void;1865618657/**18658* Indicates a test has started running.18659* @param test Test item to update.18660*/18661started(test: TestItem): void;1866218663/**18664* Indicates a test has been skipped.18665* @param test Test item to update.18666*/18667skipped(test: TestItem): void;1866818669/**18670* Indicates a test has failed. You should pass one or more18671* {@link TestMessage TestMessages} to describe the failure.18672* @param test Test item to update.18673* @param message Messages associated with the test failure.18674* @param duration How long the test took to execute, in milliseconds.18675*/18676failed(test: TestItem, message: TestMessage | readonly TestMessage[], duration?: number): void;1867718678/**18679* Indicates a test has errored. You should pass one or more18680* {@link TestMessage TestMessages} to describe the failure. This differs18681* from the "failed" state in that it indicates a test that couldn't be18682* executed at all, from a compilation error for example.18683* @param test Test item to update.18684* @param message Messages associated with the test failure.18685* @param duration How long the test took to execute, in milliseconds.18686*/18687errored(test: TestItem, message: TestMessage | readonly TestMessage[], duration?: number): void;1868818689/**18690* Indicates a test has passed.18691* @param test Test item to update.18692* @param duration How long the test took to execute, in milliseconds.18693*/18694passed(test: TestItem, duration?: number): void;1869518696/**18697* Appends raw output from the test runner. On the user's request, the18698* output will be displayed in a terminal. ANSI escape sequences,18699* such as colors and text styles, are supported. New lines must be given18700* as CRLF (`\r\n`) rather than LF (`\n`).18701*18702* @param output Output text to append.18703* @param location Indicate that the output was logged at the given18704* location.18705* @param test Test item to associate the output with.18706*/18707appendOutput(output: string, location?: Location, test?: TestItem): void;1870818709/**18710* Adds coverage for a file in the run.18711*/18712addCoverage(fileCoverage: FileCoverage): void;1871318714/**18715* Signals the end of the test run. Any tests included in the run whose18716* states have not been updated will have their state reset.18717*/18718end(): void;1871918720/**18721* An event fired when the editor is no longer interested in data18722* associated with the test run.18723*/18724readonly onDidDispose: Event<void>;18725}1872618727/**18728* Collection of test items, found in {@link TestItem.children} and18729* {@link TestController.items}.18730*/18731export interface TestItemCollection extends Iterable<[id: string, testItem: TestItem]> {18732/**18733* Gets the number of items in the collection.18734*/18735readonly size: number;1873618737/**18738* Replaces the items stored by the collection.18739* @param items Items to store.18740*/18741replace(items: readonly TestItem[]): void;1874218743/**18744* Iterate over each entry in this collection.18745*18746* @param callback Function to execute for each entry.18747* @param thisArg The `this` context used when invoking the handler function.18748*/18749forEach(callback: (item: TestItem, collection: TestItemCollection) => unknown, thisArg?: any): void;1875018751/**18752* Adds the test item to the children. If an item with the same ID already18753* exists, it'll be replaced.18754* @param item Item to add.18755*/18756add(item: TestItem): void;1875718758/**18759* Removes a single test item from the collection.18760* @param itemId Item ID to delete.18761*/18762delete(itemId: string): void;1876318764/**18765* Efficiently gets a test item by ID, if it exists, in the children.18766* @param itemId Item ID to get.18767* @returns The found item or undefined if it does not exist.18768*/18769get(itemId: string): TestItem | undefined;18770}1877118772/**18773* An item shown in the "test explorer" view.18774*18775* A `TestItem` can represent either a test suite or a test itself, since18776* they both have similar capabilities.18777*/18778export interface TestItem {18779/**18780* Identifier for the `TestItem`. This is used to correlate18781* test results and tests in the document with those in the workspace18782* (test explorer). This cannot change for the lifetime of the `TestItem`,18783* and must be unique among its parent's direct children.18784*/18785readonly id: string;1878618787/**18788* URI this `TestItem` is associated with. May be a file or directory.18789*/18790readonly uri: Uri | undefined;1879118792/**18793* The children of this test item. For a test suite, this may contain the18794* individual test cases or nested suites.18795*/18796readonly children: TestItemCollection;1879718798/**18799* The parent of this item. It's set automatically, and is undefined18800* top-level items in the {@link TestController.items} and for items that18801* aren't yet included in another item's {@link TestItem.children children}.18802*/18803readonly parent: TestItem | undefined;1880418805/**18806* Tags associated with this test item. May be used in combination with18807* {@link TestRunProfile.tag tags}, or simply as an organizational feature.18808*/18809tags: readonly TestTag[];1881018811/**18812* Indicates whether this test item may have children discovered by resolving.18813*18814* If true, this item is shown as expandable in the Test Explorer view and18815* expanding the item will cause {@link TestController.resolveHandler}18816* to be invoked with the item.18817*18818* Default to `false`.18819*/18820canResolveChildren: boolean;1882118822/**18823* Controls whether the item is shown as "busy" in the Test Explorer view.18824* This is useful for showing status while discovering children.18825*18826* Defaults to `false`.18827*/18828busy: boolean;1882918830/**18831* Display name describing the test case.18832*/18833label: string;1883418835/**18836* Optional description that appears next to the label.18837*/18838description?: string;1883918840/**18841* A string that should be used when comparing this item18842* with other items. When `falsy` the {@link TestItem.label label}18843* is used.18844*/18845sortText?: string | undefined;1884618847/**18848* Location of the test item in its {@link TestItem.uri uri}.18849*18850* This is only meaningful if the `uri` points to a file.18851*/18852range: Range | undefined;1885318854/**18855* Optional error encountered while loading the test.18856*18857* Note that this is not a test result and should only be used to represent errors in18858* test discovery, such as syntax errors.18859*/18860error: string | MarkdownString | undefined;18861}1886218863/**18864* A stack frame found in the {@link TestMessage.stackTrace}.18865*/18866export class TestMessageStackFrame {18867/**18868* The location of this stack frame. This should be provided as a URI if the18869* location of the call frame can be accessed by the editor.18870*/18871uri?: Uri;1887218873/**18874* Position of the stack frame within the file.18875*/18876position?: Position;1887718878/**18879* The name of the stack frame, typically a method or function name.18880*/18881label: string;1888218883/**18884* @param label The name of the stack frame18885* @param file The file URI of the stack frame18886* @param position The position of the stack frame within the file18887*/18888constructor(label: string, uri?: Uri, position?: Position);18889}1889018891/**18892* Message associated with the test state. Can be linked to a specific18893* source range -- useful for assertion failures, for example.18894*/18895export class TestMessage {18896/**18897* Human-readable message text to display.18898*/18899message: string | MarkdownString;1890018901/**18902* Expected test output. If given with {@link TestMessage.actualOutput actualOutput }, a diff view will be shown.18903*/18904expectedOutput?: string;1890518906/**18907* Actual test output. If given with {@link TestMessage.expectedOutput expectedOutput }, a diff view will be shown.18908*/18909actualOutput?: string;1891018911/**18912* Associated file location.18913*/18914location?: Location;1891518916/**18917* Context value of the test item. This can be used to contribute message-18918* specific actions to the test peek view. The value set here can be found18919* in the `testMessage` property of the following `menus` contribution points:18920*18921* - `testing/message/context` - context menu for the message in the results tree18922* - `testing/message/content` - a prominent button overlaying editor content where18923* the message is displayed.18924*18925* For example:18926*18927* ```json18928* "contributes": {18929* "menus": {18930* "testing/message/content": [18931* {18932* "command": "extension.deleteCommentThread",18933* "when": "testMessage == canApplyRichDiff"18934* }18935* ]18936* }18937* }18938* ```18939*18940* The command will be called with an object containing:18941* - `test`: the {@link TestItem} the message is associated with, *if* it18942* is still present in the {@link TestController.items} collection.18943* - `message`: the {@link TestMessage} instance.18944*/18945contextValue?: string;1894618947/**18948* The stack trace associated with the message or failure.18949*/18950stackTrace?: TestMessageStackFrame[];1895118952/**18953* Creates a new TestMessage that will present as a diff in the editor.18954* @param message Message to display to the user.18955* @param expected Expected output.18956* @param actual Actual output.18957*/18958static diff(message: string | MarkdownString, expected: string, actual: string): TestMessage;1895918960/**18961* Creates a new TestMessage instance.18962* @param message The message to show to the user.18963*/18964constructor(message: string | MarkdownString);18965}1896618967/**18968* A class that contains information about a covered resource. A count can18969* be give for lines, branches, and declarations in a file.18970*/18971export class TestCoverageCount {18972/**18973* Number of items covered in the file.18974*/18975covered: number;18976/**18977* Total number of covered items in the file.18978*/18979total: number;1898018981/**18982* @param covered Value for {@link TestCoverageCount.covered}18983* @param total Value for {@link TestCoverageCount.total}18984*/18985constructor(covered: number, total: number);18986}1898718988/**18989* Contains coverage metadata for a file.18990*/18991export class FileCoverage {18992/**18993* File URI.18994*/18995readonly uri: Uri;1899618997/**18998* Statement coverage information. If the reporter does not provide statement18999* coverage information, this can instead be used to represent line coverage.19000*/19001statementCoverage: TestCoverageCount;1900219003/**19004* Branch coverage information.19005*/19006branchCoverage?: TestCoverageCount;1900719008/**19009* Declaration coverage information. Depending on the reporter and19010* language, this may be types such as functions, methods, or namespaces.19011*/19012declarationCoverage?: TestCoverageCount;1901319014/**19015* A list of {@link TestItem test cases} that generated coverage in this19016* file. If set, then {@link TestRunProfile.loadDetailedCoverageForTest}19017* should also be defined in order to retrieve detailed coverage information.19018*/19019includesTests?: TestItem[];1902019021/**19022* Creates a {@link FileCoverage} instance with counts filled in from19023* the coverage details.19024* @param uri Covered file URI19025* @param details Detailed coverage information19026*/19027static fromDetails(uri: Uri, details: readonly FileCoverageDetail[]): FileCoverage;1902819029/**19030* @param uri Covered file URI19031* @param statementCoverage Statement coverage information. If the reporter19032* does not provide statement coverage information, this can instead be19033* used to represent line coverage.19034* @param branchCoverage Branch coverage information19035* @param declarationCoverage Declaration coverage information19036* @param includesTests Test cases included in this coverage report, see {@link FileCoverage.includesTests}19037*/19038constructor(19039uri: Uri,19040statementCoverage: TestCoverageCount,19041branchCoverage?: TestCoverageCount,19042declarationCoverage?: TestCoverageCount,19043includesTests?: TestItem[],19044);19045}1904619047/**19048* Contains coverage information for a single statement or line.19049*/19050export class StatementCoverage {19051/**19052* The number of times this statement was executed, or a boolean indicating19053* whether it was executed if the exact count is unknown. If zero or false,19054* the statement will be marked as un-covered.19055*/19056executed: number | boolean;1905719058/**19059* Statement location.19060*/19061location: Position | Range;1906219063/**19064* Coverage from branches of this line or statement. If it's not a19065* conditional, this will be empty.19066*/19067branches: BranchCoverage[];1906819069/**19070* @param location The statement position.19071* @param executed The number of times this statement was executed, or a19072* boolean indicating whether it was executed if the exact count is19073* unknown. If zero or false, the statement will be marked as un-covered.19074* @param branches Coverage from branches of this line. If it's not a19075* conditional, this should be omitted.19076*/19077constructor(executed: number | boolean, location: Position | Range, branches?: BranchCoverage[]);19078}1907919080/**19081* Contains coverage information for a branch of a {@link StatementCoverage}.19082*/19083export class BranchCoverage {19084/**19085* The number of times this branch was executed, or a boolean indicating19086* whether it was executed if the exact count is unknown. If zero or false,19087* the branch will be marked as un-covered.19088*/19089executed: number | boolean;1909019091/**19092* Branch location.19093*/19094location?: Position | Range;1909519096/**19097* Label for the branch, used in the context of "the ${label} branch was19098* not taken," for example.19099*/19100label?: string;1910119102/**19103* @param executed The number of times this branch was executed, or a19104* boolean indicating whether it was executed if the exact count is19105* unknown. If zero or false, the branch will be marked as un-covered.19106* @param location The branch position.19107*/19108constructor(executed: number | boolean, location?: Position | Range, label?: string);19109}1911019111/**19112* Contains coverage information for a declaration. Depending on the reporter19113* and language, this may be types such as functions, methods, or namespaces.19114*/19115export class DeclarationCoverage {19116/**19117* Name of the declaration.19118*/19119name: string;1912019121/**19122* The number of times this declaration was executed, or a boolean19123* indicating whether it was executed if the exact count is unknown. If19124* zero or false, the declaration will be marked as un-covered.19125*/19126executed: number | boolean;1912719128/**19129* Declaration location.19130*/19131location: Position | Range;1913219133/**19134* @param executed The number of times this declaration was executed, or a19135* boolean indicating whether it was executed if the exact count is19136* unknown. If zero or false, the declaration will be marked as un-covered.19137* @param location The declaration position.19138*/19139constructor(name: string, executed: number | boolean, location: Position | Range);19140}1914119142/**19143* Coverage details returned from {@link TestRunProfile.loadDetailedCoverage}.19144*/19145export type FileCoverageDetail = StatementCoverage | DeclarationCoverage;1914619147/**19148* The tab represents a single text based resource.19149*/19150export class TabInputText {19151/**19152* The uri represented by the tab.19153*/19154readonly uri: Uri;19155/**19156* Constructs a text tab input with the given URI.19157* @param uri The URI of the tab.19158*/19159constructor(uri: Uri);19160}1916119162/**19163* The tab represents two text based resources19164* being rendered as a diff.19165*/19166export class TabInputTextDiff {19167/**19168* The uri of the original text resource.19169*/19170readonly original: Uri;19171/**19172* The uri of the modified text resource.19173*/19174readonly modified: Uri;19175/**19176* Constructs a new text diff tab input with the given URIs.19177* @param original The uri of the original text resource.19178* @param modified The uri of the modified text resource.19179*/19180constructor(original: Uri, modified: Uri);19181}1918219183/**19184* The tab represents a custom editor.19185*/19186export class TabInputCustom {19187/**19188* The uri that the tab is representing.19189*/19190readonly uri: Uri;19191/**19192* The type of custom editor.19193*/19194readonly viewType: string;19195/**19196* Constructs a custom editor tab input.19197* @param uri The uri of the tab.19198* @param viewType The viewtype of the custom editor.19199*/19200constructor(uri: Uri, viewType: string);19201}1920219203/**19204* The tab represents a webview.19205*/19206export class TabInputWebview {19207/**19208* The type of webview. Maps to {@linkcode WebviewPanel.viewType WebviewPanel's viewType}19209*/19210readonly viewType: string;19211/**19212* Constructs a webview tab input with the given view type.19213* @param viewType The type of webview. Maps to {@linkcode WebviewPanel.viewType WebviewPanel's viewType}19214*/19215constructor(viewType: string);19216}1921719218/**19219* The tab represents a notebook.19220*/19221export class TabInputNotebook {19222/**19223* The uri that the tab is representing.19224*/19225readonly uri: Uri;19226/**19227* The type of notebook. Maps to {@linkcode NotebookDocument.notebookType NotebookDocuments's notebookType}19228*/19229readonly notebookType: string;19230/**19231* Constructs a new tab input for a notebook.19232* @param uri The uri of the notebook.19233* @param notebookType The type of notebook. Maps to {@linkcode NotebookDocument.notebookType NotebookDocuments's notebookType}19234*/19235constructor(uri: Uri, notebookType: string);19236}1923719238/**19239* The tabs represents two notebooks in a diff configuration.19240*/19241export class TabInputNotebookDiff {19242/**19243* The uri of the original notebook.19244*/19245readonly original: Uri;19246/**19247* The uri of the modified notebook.19248*/19249readonly modified: Uri;19250/**19251* The type of notebook. Maps to {@linkcode NotebookDocument.notebookType NotebookDocuments's notebookType}19252*/19253readonly notebookType: string;19254/**19255* Constructs a notebook diff tab input.19256* @param original The uri of the original unmodified notebook.19257* @param modified The uri of the modified notebook.19258* @param notebookType The type of notebook. Maps to {@linkcode NotebookDocument.notebookType NotebookDocuments's notebookType}19259*/19260constructor(original: Uri, modified: Uri, notebookType: string);19261}1926219263/**19264* The tab represents a terminal in the editor area.19265*/19266export class TabInputTerminal {19267/**19268* Constructs a terminal tab input.19269*/19270constructor();19271}1927219273/**19274* Represents a tab within a {@link TabGroup group of tabs}.19275* Tabs are merely the graphical representation within the editor area.19276* A backing editor is not a guarantee.19277*/19278export interface Tab {1927919280/**19281* The text displayed on the tab.19282*/19283readonly label: string;1928419285/**19286* The group which the tab belongs to.19287*/19288readonly group: TabGroup;1928919290/**19291* Defines the structure of the tab i.e. text, notebook, custom, etc.19292* Resource and other useful properties are defined on the tab kind.19293*/19294readonly input: TabInputText | TabInputTextDiff | TabInputCustom | TabInputWebview | TabInputNotebook | TabInputNotebookDiff | TabInputTerminal | unknown;1929519296/**19297* Whether or not the tab is currently active.19298* This is dictated by being the selected tab in the group.19299*/19300readonly isActive: boolean;1930119302/**19303* Whether or not the dirty indicator is present on the tab.19304*/19305readonly isDirty: boolean;1930619307/**19308* Whether or not the tab is pinned (pin icon is present).19309*/19310readonly isPinned: boolean;1931119312/**19313* Whether or not the tab is in preview mode.19314*/19315readonly isPreview: boolean;19316}1931719318/**19319* An event describing change to tabs.19320*/19321export interface TabChangeEvent {19322/**19323* The tabs that have been opened.19324*/19325readonly opened: readonly Tab[];19326/**19327* The tabs that have been closed.19328*/19329readonly closed: readonly Tab[];19330/**19331* Tabs that have changed, e.g have changed19332* their {@link Tab.isActive active} state.19333*/19334readonly changed: readonly Tab[];19335}1933619337/**19338* An event describing changes to tab groups.19339*/19340export interface TabGroupChangeEvent {19341/**19342* Tab groups that have been opened.19343*/19344readonly opened: readonly TabGroup[];19345/**19346* Tab groups that have been closed.19347*/19348readonly closed: readonly TabGroup[];19349/**19350* Tab groups that have changed, e.g have changed19351* their {@link TabGroup.isActive active} state.19352*/19353readonly changed: readonly TabGroup[];19354}1935519356/**19357* Represents a group of tabs. A tab group itself consists of multiple tabs.19358*/19359export interface TabGroup {19360/**19361* Whether or not the group is currently active.19362*19363* *Note* that only one tab group is active at a time, but that multiple tab19364* groups can have an {@link activeTab active tab}.19365*19366* @see {@link Tab.isActive}19367*/19368readonly isActive: boolean;1936919370/**19371* The view column of the group.19372*/19373readonly viewColumn: ViewColumn;1937419375/**19376* The active {@link Tab tab} in the group. This is the tab whose contents are currently19377* being rendered.19378*19379* *Note* that there can be one active tab per group but there can only be one {@link TabGroups.activeTabGroup active group}.19380*/19381readonly activeTab: Tab | undefined;1938219383/**19384* The list of tabs contained within the group.19385* This can be empty if the group has no tabs open.19386*/19387readonly tabs: readonly Tab[];19388}1938919390/**19391* Represents the main editor area which consists of multiple groups which contain tabs.19392*/19393export interface TabGroups {19394/**19395* All the groups within the group container.19396*/19397readonly all: readonly TabGroup[];1939819399/**19400* The currently active group.19401*/19402readonly activeTabGroup: TabGroup;1940319404/**19405* An {@link Event event} which fires when {@link TabGroup tab groups} have changed.19406*/19407readonly onDidChangeTabGroups: Event<TabGroupChangeEvent>;1940819409/**19410* An {@link Event event} which fires when {@link Tab tabs} have changed.19411*/19412readonly onDidChangeTabs: Event<TabChangeEvent>;1941319414/**19415* Closes the tab. This makes the tab object invalid and the tab19416* should no longer be used for further actions.19417* Note: In the case of a dirty tab, a confirmation dialog will be shown which may be cancelled. If cancelled the tab is still valid19418*19419* @param tab The tab to close.19420* @param preserveFocus When `true` focus will remain in its current position. If `false` it will jump to the next tab.19421* @returns A promise that resolves to `true` when all tabs have been closed.19422*/19423close(tab: Tab | readonly Tab[], preserveFocus?: boolean): Thenable<boolean>;1942419425/**19426* Closes the tab group. This makes the tab group object invalid and the tab group19427* should no longer be used for further actions.19428* @param tabGroup The tab group to close.19429* @param preserveFocus When `true` focus will remain in its current position.19430* @returns A promise that resolves to `true` when all tab groups have been closed.19431*/19432close(tabGroup: TabGroup | readonly TabGroup[], preserveFocus?: boolean): Thenable<boolean>;19433}1943419435/**19436* A special value wrapper denoting a value that is safe to not clean.19437* This is to be used when you can guarantee no identifiable information is contained in the value and the cleaning is improperly redacting it.19438*/19439export class TelemetryTrustedValue<T = any> {1944019441/**19442* The value that is trusted to not contain PII.19443*/19444readonly value: T;1944519446/**19447* Creates a new telemetry trusted value.19448*19449* @param value A value to trust19450*/19451constructor(value: T);19452}1945319454/**19455* A telemetry logger which can be used by extensions to log usage and error telemetry.19456*19457* A logger wraps around an {@link TelemetrySender sender} but it guarantees that19458* - user settings to disable or tweak telemetry are respected, and that19459* - potential sensitive data is removed19460*19461* It also enables an "echo UI" that prints whatever data is send and it allows the editor19462* to forward unhandled errors to the respective extensions.19463*19464* To get an instance of a `TelemetryLogger`, use19465* {@link env.createTelemetryLogger `createTelemetryLogger`}.19466*/19467export interface TelemetryLogger {1946819469/**19470* An {@link Event} which fires when the enablement state of usage or error telemetry changes.19471*/19472readonly onDidChangeEnableStates: Event<TelemetryLogger>;1947319474/**19475* Whether or not usage telemetry is enabled for this logger.19476*/19477readonly isUsageEnabled: boolean;1947819479/**19480* Whether or not error telemetry is enabled for this logger.19481*/19482readonly isErrorsEnabled: boolean;1948319484/**19485* Log a usage event.19486*19487* After completing cleaning, telemetry setting checks, and data mix-in calls `TelemetrySender.sendEventData` to log the event.19488* Automatically supports echoing to extension telemetry output channel.19489* @param eventName The event name to log19490* @param data The data to log19491*/19492logUsage(eventName: string, data?: Record<string, any | TelemetryTrustedValue>): void;1949319494/**19495* Log an error event.19496*19497* After completing cleaning, telemetry setting checks, and data mix-in calls `TelemetrySender.sendEventData` to log the event. Differs from `logUsage` in that it will log the event if the telemetry setting is Error+.19498* Automatically supports echoing to extension telemetry output channel.19499* @param eventName The event name to log19500* @param data The data to log19501*/19502logError(eventName: string, data?: Record<string, any | TelemetryTrustedValue>): void;1950319504/**19505* Log an error event.19506*19507* Calls `TelemetrySender.sendErrorData`. Does cleaning, telemetry checks, and data mix-in.19508* Automatically supports echoing to extension telemetry output channel.19509* Will also automatically log any exceptions thrown within the extension host process.19510* @param error The error object which contains the stack trace cleaned of PII19511* @param data Additional data to log alongside the stack trace19512*/19513logError(error: Error, data?: Record<string, any | TelemetryTrustedValue>): void;1951419515/**19516* Dispose this object and free resources.19517*/19518dispose(): void;19519}1952019521/**19522* The telemetry sender is the contract between a telemetry logger and some telemetry service. **Note** that extensions must NOT19523* call the methods of their sender directly as the logger provides extra guards and cleaning.19524*19525* ```js19526* const sender: vscode.TelemetrySender = {...};19527* const logger = vscode.env.createTelemetryLogger(sender);19528*19529* // GOOD - uses the logger19530* logger.logUsage('myEvent', { myData: 'myValue' });19531*19532* // BAD - uses the sender directly: no data cleansing, ignores user settings, no echoing to the telemetry output channel etc19533* sender.logEvent('myEvent', { myData: 'myValue' });19534* ```19535*/19536export interface TelemetrySender {19537/**19538* Function to send event data without a stacktrace. Used within a {@link TelemetryLogger}19539*19540* @param eventName The name of the event which you are logging19541* @param data A serializable key value pair that is being logged19542*/19543sendEventData(eventName: string, data?: Record<string, any>): void;1954419545/**19546* Function to send an error. Used within a {@link TelemetryLogger}19547*19548* @param error The error being logged19549* @param data Any additional data to be collected with the exception19550*/19551sendErrorData(error: Error, data?: Record<string, any>): void;1955219553/**19554* Optional flush function which will give this sender a chance to send any remaining events19555* as its {@link TelemetryLogger} is being disposed19556*/19557flush?(): void | Thenable<void>;19558}1955919560/**19561* Options for creating a {@link TelemetryLogger}19562*/19563export interface TelemetryLoggerOptions {19564/**19565* Whether or not you want to avoid having the built-in common properties such as os, extension name, etc injected into the data object.19566* Defaults to `false` if not defined.19567*/19568readonly ignoreBuiltInCommonProperties?: boolean;1956919570/**19571* Whether or not unhandled errors on the extension host caused by your extension should be logged to your sender.19572* Defaults to `false` if not defined.19573*/19574readonly ignoreUnhandledErrors?: boolean;1957519576/**19577* Any additional common properties which should be injected into the data object.19578*/19579readonly additionalCommonProperties?: Record<string, any>;19580}1958119582/**19583* Represents a user request in chat history.19584*/19585export class ChatRequestTurn {19586/**19587* The prompt as entered by the user.19588*19589* Information about references used in this request is stored in {@link ChatRequestTurn.references}.19590*19591* *Note* that the {@link ChatParticipant.name name} of the participant and the {@link ChatCommand.name command}19592* are not part of the prompt.19593*/19594readonly prompt: string;1959519596/**19597* The id of the chat participant to which this request was directed.19598*/19599readonly participant: string;1960019601/**19602* The name of the {@link ChatCommand command} that was selected for this request.19603*/19604readonly command?: string;1960519606/**19607* The references that were used in this message.19608*/19609readonly references: ChatPromptReference[];1961019611/**19612* The list of tools were attached to this request.19613*/19614readonly toolReferences: readonly ChatLanguageModelToolReference[];1961519616/**19617* @hidden19618*/19619private constructor(prompt: string, command: string | undefined, references: ChatPromptReference[], participant: string, toolReferences: ChatLanguageModelToolReference[]);19620}1962119622/**19623* Represents a chat participant's response in chat history.19624*/19625export class ChatResponseTurn {19626/**19627* The content that was received from the chat participant. Only the stream parts that represent actual content (not metadata) are represented.19628*/19629readonly response: ReadonlyArray<ChatResponseMarkdownPart | ChatResponseFileTreePart | ChatResponseAnchorPart | ChatResponseCommandButtonPart>;1963019631/**19632* The result that was received from the chat participant.19633*/19634readonly result: ChatResult;1963519636/**19637* The id of the chat participant that this response came from.19638*/19639readonly participant: string;1964019641/**19642* The name of the command that this response came from.19643*/19644readonly command?: string;1964519646/**19647* @hidden19648*/19649private constructor(response: ReadonlyArray<ChatResponseMarkdownPart | ChatResponseFileTreePart | ChatResponseAnchorPart | ChatResponseCommandButtonPart>, result: ChatResult, participant: string);19650}1965119652/**19653* Extra context passed to a participant.19654*/19655export interface ChatContext {19656/**19657* All of the chat messages so far in the current chat session. Currently, only chat messages for the current participant are included.19658*/19659readonly history: ReadonlyArray<ChatRequestTurn | ChatResponseTurn>;19660}1966119662/**19663* Represents an error result from a chat request.19664*/19665export interface ChatErrorDetails {19666/**19667* An error message that is shown to the user.19668*/19669message: string;1967019671/**19672* If set to true, the response will be partly blurred out.19673*/19674responseIsFiltered?: boolean;19675}1967619677/**19678* The result of a chat request.19679*/19680export interface ChatResult {19681/**19682* If the request resulted in an error, this property defines the error details.19683*/19684errorDetails?: ChatErrorDetails;1968519686/**19687* Arbitrary metadata for this result. Can be anything, but must be JSON-stringifyable.19688*/19689readonly metadata?: { readonly [key: string]: any };19690}1969119692/**19693* Represents the type of user feedback received.19694*/19695export enum ChatResultFeedbackKind {19696/**19697* The user marked the result as unhelpful.19698*/19699Unhelpful = 0,1970019701/**19702* The user marked the result as helpful.19703*/19704Helpful = 1,19705}1970619707/**19708* Represents user feedback for a result.19709*/19710export interface ChatResultFeedback {19711/**19712* The ChatResult for which the user is providing feedback.19713* This object has the same properties as the result returned from the participant callback, including `metadata`, but is not the same instance.19714*/19715readonly result: ChatResult;1971619717/**19718* The kind of feedback that was received.19719*/19720readonly kind: ChatResultFeedbackKind;19721}1972219723/**19724* A followup question suggested by the participant.19725*/19726export interface ChatFollowup {19727/**19728* The message to send to the chat.19729*/19730prompt: string;1973119732/**19733* A title to show the user. The prompt will be shown by default, when this is unspecified.19734*/19735label?: string;1973619737/**19738* By default, the followup goes to the same participant/command. But this property can be set to invoke a different participant by ID.19739* Followups can only invoke a participant that was contributed by the same extension.19740*/19741participant?: string;1974219743/**19744* By default, the followup goes to the same participant/command. But this property can be set to invoke a different command.19745*/19746command?: string;19747}1974819749/**19750* Will be invoked once after each request to get suggested followup questions to show the user. The user can click the followup to send it to the chat.19751*/19752export interface ChatFollowupProvider {19753/**19754* Provide followups for the given result.19755*19756* @param result This object has the same properties as the result returned from the participant callback, including `metadata`, but is not the same instance.19757* @param context Extra context passed to a participant.19758* @param token A cancellation token.19759*/19760provideFollowups(result: ChatResult, context: ChatContext, token: CancellationToken): ProviderResult<ChatFollowup[]>;19761}1976219763/**19764* A chat request handler is a callback that will be invoked when a request is made to a chat participant.19765*/19766export type ChatRequestHandler = (request: ChatRequest, context: ChatContext, response: ChatResponseStream, token: CancellationToken) => ProviderResult<ChatResult | void>;1976719768/**19769* A chat participant can be invoked by the user in a chat session, using the `@` prefix. When it is invoked, it handles the chat request and is solely19770* responsible for providing a response to the user. A ChatParticipant is created using {@link chat.createChatParticipant}.19771*/19772export interface ChatParticipant {19773/**19774* A unique ID for this participant.19775*/19776readonly id: string;1977719778/**19779* An icon for the participant shown in UI.19780*/19781iconPath?: IconPath;1978219783/**19784* The handler for requests to this participant.19785*/19786requestHandler: ChatRequestHandler;1978719788/**19789* This provider will be called once after each request to retrieve suggested followup questions.19790*/19791followupProvider?: ChatFollowupProvider;1979219793/**19794* An event that fires whenever feedback for a result is received, e.g. when a user up- or down-votes19795* a result.19796*19797* The passed {@link ChatResultFeedback.result result} is guaranteed to have the same properties as the result that was19798* previously returned from this chat participant's handler.19799*/19800readonly onDidReceiveFeedback: Event<ChatResultFeedback>;1980119802/**19803* Dispose this participant and free resources.19804*/19805dispose(): void;19806}1980719808/**19809* A reference to a value that the user added to their chat request.19810*/19811export interface ChatPromptReference {19812/**19813* A unique identifier for this kind of reference.19814*/19815readonly id: string;1981619817/**19818* The start and end index of the reference in the {@link ChatRequest.prompt prompt}. When undefined, the reference was not part of the prompt text.19819*19820* *Note* that the indices take the leading `#`-character into account which means they can19821* used to modify the prompt as-is.19822*/19823readonly range?: [start: number, end: number];1982419825/**19826* A description of this value that could be used in an LLM prompt.19827*/19828readonly modelDescription?: string;1982919830/**19831* The value of this reference. The `string | Uri | Location` types are used today, but this could expand in the future.19832*/19833readonly value: string | Uri | Location | unknown;19834}1983519836/**19837* A request to a chat participant.19838*/19839export interface ChatRequest {19840/**19841* The prompt as entered by the user.19842*19843* Information about references used in this request is stored in {@link ChatRequest.references}.19844*19845* *Note* that the {@link ChatParticipant.name name} of the participant and the {@link ChatCommand.name command}19846* are not part of the prompt.19847*/19848readonly prompt: string;1984919850/**19851* The name of the {@link ChatCommand command} that was selected for this request.19852*/19853readonly command: string | undefined;1985419855/**19856* The list of references and their values that are referenced in the prompt.19857*19858* *Note* that the prompt contains references as authored and that it is up to the participant19859* to further modify the prompt, for instance by inlining reference values or creating links to19860* headings which contain the resolved values. References are sorted in reverse by their range19861* in the prompt. That means the last reference in the prompt is the first in this list. This simplifies19862* string-manipulation of the prompt.19863*/19864readonly references: readonly ChatPromptReference[];1986519866/**19867* The list of tools that the user attached to their request.19868*19869* When a tool reference is present, the chat participant should make a chat request using19870* {@link LanguageModelChatToolMode.Required} to force the language model to generate input for the tool. Then, the19871* participant can use {@link lm.invokeTool} to use the tool attach the result to its request for the user's prompt. The19872* tool may contribute useful extra context for the user's request.19873*/19874readonly toolReferences: readonly ChatLanguageModelToolReference[];1987519876/**19877* A token that can be passed to {@link lm.invokeTool} when invoking a tool inside the context of handling a chat request.19878* This associates the tool invocation to a chat session.19879*/19880readonly toolInvocationToken: ChatParticipantToolToken;1988119882/**19883* This is the model that is currently selected in the UI. Extensions can use this or use {@link lm.selectChatModels} to19884* pick another model. Don't hold onto this past the lifetime of the request.19885*/19886readonly model: LanguageModelChat;19887}1988819889/**19890* The ChatResponseStream is how a participant is able to return content to the chat view. It provides several methods for streaming different types of content19891* which will be rendered in an appropriate way in the chat view. A participant can use the helper method for the type of content it wants to return, or it19892* can instantiate a {@link ChatResponsePart} and use the generic {@link ChatResponseStream.push} method to return it.19893*/19894export interface ChatResponseStream {19895/**19896* Push a markdown part to this stream. Short-hand for19897* `push(new ChatResponseMarkdownPart(value))`.19898*19899* @see {@link ChatResponseStream.push}19900* @param value A markdown string or a string that should be interpreted as markdown. The boolean form of {@link MarkdownString.isTrusted} is NOT supported.19901*/19902markdown(value: string | MarkdownString): void;1990319904/**19905* Push an anchor part to this stream. Short-hand for19906* `push(new ChatResponseAnchorPart(value, title))`.19907* An anchor is an inline reference to some type of resource.19908*19909* @param value A uri or location.19910* @param title An optional title that is rendered with value.19911*/19912anchor(value: Uri | Location, title?: string): void;1991319914/**19915* Push a command button part to this stream. Short-hand for19916* `push(new ChatResponseCommandButtonPart(value, title))`.19917*19918* @param command A Command that will be executed when the button is clicked.19919*/19920button(command: Command): void;1992119922/**19923* Push a filetree part to this stream. Short-hand for19924* `push(new ChatResponseFileTreePart(value))`.19925*19926* @param value File tree data.19927* @param baseUri The base uri to which this file tree is relative.19928*/19929filetree(value: ChatResponseFileTree[], baseUri: Uri): void;1993019931/**19932* Push a progress part to this stream. Short-hand for19933* `push(new ChatResponseProgressPart(value))`.19934*19935* @param value A progress message19936*/19937progress(value: string): void;1993819939/**19940* Push a reference to this stream. Short-hand for19941* `push(new ChatResponseReferencePart(value))`.19942*19943* *Note* that the reference is not rendered inline with the response.19944*19945* @param value A uri or location19946* @param iconPath Icon for the reference shown in UI19947*/19948reference(value: Uri | Location, iconPath?: IconPath): void;1994919950/**19951* Pushes a part to this stream.19952*19953* @param part A response part, rendered or metadata19954*/19955push(part: ChatResponsePart): void;19956}1995719958/**19959* Represents a part of a chat response that is formatted as Markdown.19960*/19961export class ChatResponseMarkdownPart {19962/**19963* A markdown string or a string that should be interpreted as markdown.19964*/19965value: MarkdownString;1996619967/**19968* Create a new ChatResponseMarkdownPart.19969*19970* @param value A markdown string or a string that should be interpreted as markdown. The boolean form of {@link MarkdownString.isTrusted} is NOT supported.19971*/19972constructor(value: string | MarkdownString);19973}1997419975/**19976* Represents a file tree structure in a chat response.19977*/19978export interface ChatResponseFileTree {19979/**19980* The name of the file or directory.19981*/19982name: string;1998319984/**19985* An array of child file trees, if the current file tree is a directory.19986*/19987children?: ChatResponseFileTree[];19988}1998919990/**19991* Represents a part of a chat response that is a file tree.19992*/19993export class ChatResponseFileTreePart {19994/**19995* File tree data.19996*/19997value: ChatResponseFileTree[];1999819999/**20000* The base uri to which this file tree is relative20001*/20002baseUri: Uri;2000320004/**20005* Create a new ChatResponseFileTreePart.20006* @param value File tree data.20007* @param baseUri The base uri to which this file tree is relative.20008*/20009constructor(value: ChatResponseFileTree[], baseUri: Uri);20010}2001120012/**20013* Represents a part of a chat response that is an anchor, that is rendered as a link to a target.20014*/20015export class ChatResponseAnchorPart {20016/**20017* The target of this anchor.20018*/20019value: Uri | Location;2002020021/**20022* An optional title that is rendered with value.20023*/20024title?: string;2002520026/**20027* Create a new ChatResponseAnchorPart.20028* @param value A uri or location.20029* @param title An optional title that is rendered with value.20030*/20031constructor(value: Uri | Location, title?: string);20032}2003320034/**20035* Represents a part of a chat response that is a progress message.20036*/20037export class ChatResponseProgressPart {20038/**20039* The progress message20040*/20041value: string;2004220043/**20044* Create a new ChatResponseProgressPart.20045* @param value A progress message20046*/20047constructor(value: string);20048}2004920050/**20051* Represents a part of a chat response that is a reference, rendered separately from the content.20052*/20053export class ChatResponseReferencePart {20054/**20055* The reference target.20056*/20057value: Uri | Location;2005820059/**20060* The icon for the reference.20061*/20062iconPath?: IconPath;2006320064/**20065* Create a new ChatResponseReferencePart.20066* @param value A uri or location20067* @param iconPath Icon for the reference shown in UI20068*/20069constructor(value: Uri | Location, iconPath?: IconPath);20070}2007120072/**20073* Represents a part of a chat response that is a button that executes a command.20074*/20075export class ChatResponseCommandButtonPart {20076/**20077* The command that will be executed when the button is clicked.20078*/20079value: Command;2008020081/**20082* Create a new ChatResponseCommandButtonPart.20083* @param value A Command that will be executed when the button is clicked.20084*/20085constructor(value: Command);20086}2008720088/**20089* Represents the different chat response types.20090*/20091export type ChatResponsePart = ChatResponseMarkdownPart | ChatResponseFileTreePart | ChatResponseAnchorPart20092| ChatResponseProgressPart | ChatResponseReferencePart | ChatResponseCommandButtonPart;200932009420095/**20096* Namespace for chat functionality. Users interact with chat participants by sending messages20097* to them in the chat view. Chat participants can respond with markdown or other types of content20098* via the {@link ChatResponseStream}.20099*/20100export namespace chat {20101/**20102* Create a new {@link ChatParticipant chat participant} instance.20103*20104* @param id A unique identifier for the participant.20105* @param handler A request handler for the participant.20106* @returns A new chat participant20107*/20108export function createChatParticipant(id: string, handler: ChatRequestHandler): ChatParticipant;20109}2011020111/**20112* Represents the role of a chat message. This is either the user or the assistant.20113*/20114export enum LanguageModelChatMessageRole {20115/**20116* The user role, e.g the human interacting with a language model.20117*/20118User = 1,2011920120/**20121* The assistant role, e.g. the language model generating responses.20122*/20123Assistant = 220124}2012520126/**20127* Represents a message in a chat. Can assume different roles, like user or assistant.20128*/20129export class LanguageModelChatMessage {2013020131/**20132* Utility to create a new user message.20133*20134* @param content The content of the message.20135* @param name The optional name of a user for the message.20136*/20137static User(content: string | Array<LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelDataPart>, name?: string): LanguageModelChatMessage;2013820139/**20140* Utility to create a new assistant message.20141*20142* @param content The content of the message.20143* @param name The optional name of a user for the message.20144*/20145static Assistant(content: string | Array<LanguageModelTextPart | LanguageModelToolCallPart | LanguageModelDataPart>, name?: string): LanguageModelChatMessage;2014620147/**20148* The role of this message.20149*/20150role: LanguageModelChatMessageRole;2015120152/**20153* A string or heterogeneous array of things that a message can contain as content. Some parts may be message-type20154* specific for some models.20155*/20156content: Array<LanguageModelInputPart>;2015720158/**20159* The optional name of a user for this message.20160*/20161name: string | undefined;2016220163/**20164* Create a new user message.20165*20166* @param role The role of the message.20167* @param content The content of the message.20168* @param name The optional name of a user for the message.20169*/20170constructor(role: LanguageModelChatMessageRole, content: string | Array<LanguageModelInputPart>, name?: string);20171}2017220173/**20174* Represents a language model response.20175*20176* @see {@link ChatRequest}20177*/20178export interface LanguageModelChatResponse {2017920180/**20181* An async iterable that is a stream of text and tool-call parts forming the overall response. A20182* {@link LanguageModelTextPart} is part of the assistant's response to be shown to the user. A20183* {@link LanguageModelToolCallPart} is a request from the language model to call a tool. The latter will20184* only be returned if tools were passed in the request via {@link LanguageModelChatRequestOptions.tools}. The20185* `unknown`-type is used as a placeholder for future parts, like image data parts.20186*20187* *Note* that this stream will error when during data receiving an error occurs. Consumers of the stream should handle20188* the errors accordingly.20189*20190* To cancel the stream, the consumer can {@link CancellationTokenSource.cancel cancel} the token that was used to make20191* the request or break from the for-loop.20192*20193* @example20194* ```ts20195* try {20196* // consume stream20197* for await (const chunk of response.stream) {20198* if (chunk instanceof LanguageModelTextPart) {20199* console.log("TEXT", chunk);20200* } else if (chunk instanceof LanguageModelToolCallPart) {20201* console.log("TOOL CALL", chunk);20202* }20203* }20204*20205* } catch(e) {20206* // stream ended with an error20207* console.error(e);20208* }20209* ```20210*/20211stream: AsyncIterable<LanguageModelTextPart | LanguageModelToolCallPart | LanguageModelDataPart | unknown>;2021220213/**20214* This is equivalent to filtering everything except for text parts from a {@link LanguageModelChatResponse.stream}.20215*20216* @see {@link LanguageModelChatResponse.stream}20217*/20218text: AsyncIterable<string>;20219}2022020221/**20222* Represents a language model for making chat requests.20223*20224* @see {@link lm.selectChatModels}20225*/20226export interface LanguageModelChat {2022720228/**20229* Human-readable name of the language model.20230*/20231readonly name: string;2023220233/**20234* Opaque identifier of the language model.20235*/20236readonly id: string;2023720238/**20239* A well-known identifier of the vendor of the language model. An example is `copilot`, but20240* values are defined by extensions contributing chat models and need to be looked up with them.20241*/20242readonly vendor: string;2024320244/**20245* Opaque family-name of the language model. Values might be `gpt-3.5-turbo`, `gpt4`, `phi2`, or `llama`20246* but they are defined by extensions contributing languages and subject to change.20247*/20248readonly family: string;2024920250/**20251* Opaque version string of the model. This is defined by the extension contributing the language model20252* and subject to change.20253*/20254readonly version: string;2025520256/**20257* The maximum number of tokens that can be sent to the model in a single request.20258*/20259readonly maxInputTokens: number;2026020261/**20262* Make a chat request using a language model.20263*20264* *Note* that language model use may be subject to access restrictions and user consent. Calling this function20265* for the first time (for an extension) will show a consent dialog to the user and because of that this function20266* must _only be called in response to a user action!_ Extensions can use {@link LanguageModelAccessInformation.canSendRequest}20267* to check if they have the necessary permissions to make a request.20268*20269* This function will return a rejected promise if making a request to the language model is not20270* possible. Reasons for this can be:20271*20272* - user consent not given, see {@link LanguageModelError.NoPermissions `NoPermissions`}20273* - model does not exist anymore, see {@link LanguageModelError.NotFound `NotFound`}20274* - quota limits exceeded, see {@link LanguageModelError.Blocked `Blocked`}20275* - other issues in which case extension must check {@link LanguageModelError.cause `LanguageModelError.cause`}20276*20277* An extension can make use of language model tool calling by passing a set of tools to20278* {@link LanguageModelChatRequestOptions.tools}. The language model will return a {@link LanguageModelToolCallPart} and20279* the extension can invoke the tool and make another request with the result.20280*20281* @param messages An array of message instances.20282* @param options Options that control the request.20283* @param token A cancellation token which controls the request. See {@link CancellationTokenSource} for how to create one.20284* @returns A thenable that resolves to a {@link LanguageModelChatResponse}. The promise will reject when the request couldn't be made.20285*/20286sendRequest(messages: LanguageModelChatMessage[], options?: LanguageModelChatRequestOptions, token?: CancellationToken): Thenable<LanguageModelChatResponse>;2028720288/**20289* Count the number of tokens in a message using the model specific tokenizer-logic.2029020291* @param text A string or a message instance.20292* @param token Optional cancellation token. See {@link CancellationTokenSource} for how to create one.20293* @returns A thenable that resolves to the number of tokens.20294*/20295countTokens(text: string | LanguageModelChatMessage, token?: CancellationToken): Thenable<number>;20296}2029720298/**20299* Describes how to select language models for chat requests.20300*20301* @see {@link lm.selectChatModels}20302*/20303export interface LanguageModelChatSelector {2030420305/**20306* A vendor of language models.20307* @see {@link LanguageModelChat.vendor}20308*/20309vendor?: string;2031020311/**20312* A family of language models.20313* @see {@link LanguageModelChat.family}20314*/20315family?: string;2031620317/**20318* The version of a language model.20319* @see {@link LanguageModelChat.version}20320*/20321version?: string;2032220323/**20324* The identifier of a language model.20325* @see {@link LanguageModelChat.id}20326*/20327id?: string;20328}2032920330/**20331* An error type for language model specific errors.20332*20333* Consumers of language models should check the code property to determine specific20334* failure causes, like `if(someError.code === vscode.LanguageModelError.NotFound.name) {...}`20335* for the case of referring to an unknown language model. For unspecified errors the `cause`-property20336* will contain the actual error.20337*/20338export class LanguageModelError extends Error {2033920340/**20341* The requestor does not have permissions to use this20342* language model20343*/20344static NoPermissions(message?: string): LanguageModelError;2034520346/**20347* The requestor is blocked from using this language model.20348*/20349static Blocked(message?: string): LanguageModelError;2035020351/**20352* The language model does not exist.20353*/20354static NotFound(message?: string): LanguageModelError;2035520356/**20357* A code that identifies this error.20358*20359* Possible values are names of errors, like {@linkcode LanguageModelError.NotFound NotFound},20360* or `Unknown` for unspecified errors from the language model itself. In the latter case the20361* `cause`-property will contain the actual error.20362*/20363readonly code: string;20364}2036520366/**20367* Options for making a chat request using a language model.20368*20369* @see {@link LanguageModelChat.sendRequest}20370*/20371export interface LanguageModelChatRequestOptions {2037220373/**20374* A human-readable message that explains why access to a language model is needed and what feature is enabled by it.20375*/20376justification?: string;2037720378/**20379* A set of options that control the behavior of the language model. These options are specific to the language model20380* and need to be looked up in the respective documentation.20381*/20382modelOptions?: { [name: string]: any };2038320384/**20385* An optional list of tools that are available to the language model. These could be registered tools available via20386* {@link lm.tools}, or private tools that are just implemented within the calling extension.20387*20388* If the LLM requests to call one of these tools, it will return a {@link LanguageModelToolCallPart} in20389* {@link LanguageModelChatResponse.stream}. It's the caller's responsibility to invoke the tool. If it's a tool20390* registered in {@link lm.tools}, that means calling {@link lm.invokeTool}.20391*20392* Then, the tool result can be provided to the LLM by creating an Assistant-type {@link LanguageModelChatMessage} with a20393* {@link LanguageModelToolCallPart}, followed by a User-type message with a {@link LanguageModelToolResultPart}.20394*/20395tools?: LanguageModelChatTool[];2039620397/**20398* The tool-selecting mode to use. {@link LanguageModelChatToolMode.Auto} by default.20399*/20400toolMode?: LanguageModelChatToolMode;20401}2040220403/**20404* McpStdioServerDefinition represents an MCP server available by running20405* a local process and operating on its stdin and stdout streams. The process20406* will be spawned as a child process of the extension host and by default20407* will not run in a shell environment.20408*/20409export class McpStdioServerDefinition {20410/**20411* The human-readable name of the server.20412*/20413readonly label: string;2041420415/**20416* The working directory used to start the server.20417*/20418cwd?: Uri;2041920420/**20421* The command used to start the server. Node.js-based servers may use20422* `process.execPath` to use the editor's version of Node.js to run the script.20423*/20424command: string;2042520426/**20427* Additional command-line arguments passed to the server.20428*/20429args: string[];2043020431/**20432* Optional additional environment information for the server. Variables20433* in this environment will overwrite or remove (if null) the default20434* environment variables of the editor's extension host.20435*/20436env: Record<string, string | number | null>;2043720438/**20439* Optional version identification for the server. If this changes, the20440* editor will indicate that tools have changed and prompt to refresh them.20441*/20442version?: string;2044320444/**20445* @param label The human-readable name of the server.20446* @param command The command used to start the server.20447* @param args Additional command-line arguments passed to the server.20448* @param env Optional additional environment information for the server.20449* @param version Optional version identification for the server.20450*/20451constructor(label: string, command: string, args?: string[], env?: Record<string, string | number | null>, version?: string);20452}2045320454/**20455* McpHttpServerDefinition represents an MCP server available using the20456* Streamable HTTP transport.20457*/20458export class McpHttpServerDefinition {20459/**20460* The human-readable name of the server.20461*/20462readonly label: string;2046320464/**20465* The URI of the server. The editor will make a POST request to this URI20466* to begin each session.20467*/20468uri: Uri;2046920470/**20471* Optional additional heads included with each request to the server.20472*/20473headers: Record<string, string>;2047420475/**20476* Optional version identification for the server. If this changes, the20477* editor will indicate that tools have changed and prompt to refresh them.20478*/20479version?: string;2048020481/**20482* @param label The human-readable name of the server.20483* @param uri The URI of the server.20484* @param headers Optional additional heads included with each request to the server.20485*/20486constructor(label: string, uri: Uri, headers?: Record<string, string>, version?: string);20487}2048820489/**20490* Definitions that describe different types of Model Context Protocol servers,20491* which can be returned from the {@link McpServerDefinitionProvider}.20492*/20493export type McpServerDefinition = McpStdioServerDefinition | McpHttpServerDefinition;2049420495/**20496* A type that can provide Model Context Protocol server definitions. This20497* should be registered using {@link lm.registerMcpServerDefinitionProvider}20498* during extension activation.20499*/20500export interface McpServerDefinitionProvider<T extends McpServerDefinition = McpServerDefinition> {20501/**20502* Optional event fired to signal that the set of available servers has changed.20503*/20504readonly onDidChangeMcpServerDefinitions?: Event<void>;2050520506/**20507* Provides available MCP servers. The editor will call this method eagerly20508* to ensure the availability of servers for the language model, and so20509* extensions should not take actions which would require user20510* interaction, such as authentication.20511*20512* @param token A cancellation token.20513* @returns An array of MCP available MCP servers20514*/20515provideMcpServerDefinitions(token: CancellationToken): ProviderResult<T[]>;2051620517/**20518* This function will be called when the editor needs to start a MCP server.20519* At this point, the extension may take any actions which may require user20520* interaction, such as authentication. Any non-`readonly` property of the20521* server may be modified, and the extension should return the resolved server.20522*20523* The extension may return undefined to indicate that the server20524* should not be started, or throw an error. If there is a pending tool20525* call, the editor will cancel it and return an error message to the20526* language model.20527*20528* @param server The MCP server to resolve20529* @param token A cancellation token.20530* @returns The resolved server or thenable that resolves to such. This may20531* be the given `server` definition with non-readonly properties filled in.20532*/20533resolveMcpServerDefinition?(server: T, token: CancellationToken): ProviderResult<T>;20534}2053520536/**20537* The provider version of {@linkcode LanguageModelChatRequestOptions}20538*/20539export interface ProvideLanguageModelChatResponseOptions {20540/**20541* A set of options that control the behavior of the language model. These options are specific to the language model.20542*/20543readonly modelOptions?: { readonly [name: string]: any };2054420545/**20546* An optional list of tools that are available to the language model. These could be registered tools available via20547* {@link lm.tools}, or private tools that are just implemented within the calling extension.20548*20549* If the LLM requests to call one of these tools, it will return a {@link LanguageModelToolCallPart} in20550* {@link LanguageModelChatResponse.stream}. It's the caller's responsibility to invoke the tool. If it's a tool20551* registered in {@link lm.tools}, that means calling {@link lm.invokeTool}.20552*20553* Then, the tool result can be provided to the LLM by creating an Assistant-type {@link LanguageModelChatMessage} with a20554* {@link LanguageModelToolCallPart}, followed by a User-type message with a {@link LanguageModelToolResultPart}.20555*/20556readonly tools?: readonly LanguageModelChatTool[];2055720558/**20559* The tool-selecting mode to use. The provider must implement respecting this.20560*/20561readonly toolMode: LanguageModelChatToolMode;20562}2056320564/**20565* Represents a language model provided by a {@linkcode LanguageModelChatProvider}.20566*/20567export interface LanguageModelChatInformation {2056820569/**20570* Unique identifier for the language model. Must be unique per provider, but not required to be globally unique.20571*/20572readonly id: string;2057320574/**20575* Human-readable name of the language model.20576*/20577readonly name: string;2057820579/**20580* Opaque family-name of the language model. Values might be `gpt-3.5-turbo`, `gpt4`, `phi2`, or `llama`20581*/20582readonly family: string;2058320584/**20585* The tooltip to render when hovering the model. Used to provide more information about the model.20586*/20587readonly tooltip?: string;2058820589/**20590* An optional, human-readable string which will be rendered alongside the model.20591* Useful for distinguishing models of the same name in the UI.20592*/20593readonly detail?: string;2059420595/**20596* Opaque version string of the model.20597* This is used as a lookup value in {@linkcode LanguageModelChatSelector.version}20598* An example is how GPT 4o has multiple versions like 2024-11-20 and 2024-08-0620599*/20600readonly version: string;2060120602/**20603* The maximum number of tokens the model can accept as input.20604*/20605readonly maxInputTokens: number;2060620607/**20608* The maximum number of tokens the model is capable of producing.20609*/20610readonly maxOutputTokens: number;2061120612/**20613* Various features that the model supports such as tool calling or image input.20614*/20615readonly capabilities: LanguageModelChatCapabilities;20616}2061720618/**20619* Various features that the {@link LanguageModelChatInformation} supports such as tool calling or image input.20620*/20621export interface LanguageModelChatCapabilities {20622/**20623* Whether image input is supported by the model.20624* Common supported images are jpg and png, but each model will vary in supported mimetypes.20625*/20626readonly imageInput?: boolean;2062720628/**20629* Whether tool calling is supported by the model.20630* If a number is provided, that is the maximum number of tools that can be provided in a request to the model.20631*/20632readonly toolCalling?: boolean | number;20633}2063420635/**20636* The provider version of {@linkcode LanguageModelChatMessage}.20637*/20638export interface LanguageModelChatRequestMessage {20639/**20640* The role of this message.20641*/20642readonly role: LanguageModelChatMessageRole;2064320644/**20645* A heterogeneous array of things that a message can contain as content. Some parts may be message-type20646* specific for some models.20647*/20648readonly content: ReadonlyArray<LanguageModelInputPart | unknown>;2064920650/**20651* The optional name of a user for this message.20652*/20653readonly name: string | undefined;20654}2065520656/**20657* The various message types which a {@linkcode LanguageModelChatProvider} can emit in the chat response stream20658*/20659export type LanguageModelResponsePart = LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelToolCallPart | LanguageModelDataPart;2066020661/**20662* The various message types which can be sent via {@linkcode LanguageModelChat.sendRequest } and processed by a {@linkcode LanguageModelChatProvider}20663*/20664export type LanguageModelInputPart = LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelToolCallPart | LanguageModelDataPart;2066520666/**20667* A LanguageModelChatProvider implements access to language models, which users can then use through the chat view, or through extension API by acquiring a LanguageModelChat.20668* An example of this would be an OpenAI provider that provides models like gpt-5, o3, etc.20669*/20670export interface LanguageModelChatProvider<T extends LanguageModelChatInformation = LanguageModelChatInformation> {2067120672/**20673* An optional event fired when the available set of language models changes.20674*/20675readonly onDidChangeLanguageModelChatInformation?: Event<void>;2067620677/**20678* Get the list of available language models provided by this provider20679* @param options Options which specify the calling context of this function20680* @param token A cancellation token20681* @returns The list of available language models20682*/20683provideLanguageModelChatInformation(options: PrepareLanguageModelChatModelOptions, token: CancellationToken): ProviderResult<T[]>;2068420685/**20686* Returns the response for a chat request, passing the results to the progress callback.20687* The {@linkcode LanguageModelChatProvider} must emit the response parts to the progress callback as they are received from the language model.20688* @param model The language model to use20689* @param messages The messages to include in the request20690* @param options Options for the request20691* @param progress The progress to emit the streamed response chunks to20692* @param token A cancellation token20693* @returns A promise that resolves when the response is complete. Results are actually passed to the progress callback.20694*/20695provideLanguageModelChatResponse(model: T, messages: readonly LanguageModelChatRequestMessage[], options: ProvideLanguageModelChatResponseOptions, progress: Progress<LanguageModelResponsePart>, token: CancellationToken): Thenable<void>;2069620697/**20698* Returns the number of tokens for a given text using the model-specific tokenizer logic20699* @param model The language model to use20700* @param text The text to count tokens for20701* @param token A cancellation token20702* @returns The number of tokens20703*/20704provideTokenCount(model: T, text: string | LanguageModelChatRequestMessage, token: CancellationToken): Thenable<number>;20705}2070620707/**20708* The list of options passed into {@linkcode LanguageModelChatProvider.provideLanguageModelChatInformation}20709*/20710export interface PrepareLanguageModelChatModelOptions {20711/**20712* Whether or not the user should be prompted via some UI flow, or if models should be attempted to be resolved silently.20713* If silent is true, all models may not be resolved due to lack of info such as API keys.20714*/20715readonly silent: boolean;20716}2071720718/**20719* Namespace for language model related functionality.20720*/20721export namespace lm {2072220723/**20724* An event that is fired when the set of available chat models changes.20725*/20726export const onDidChangeChatModels: Event<void>;2072720728/**20729* Select chat models by a {@link LanguageModelChatSelector selector}. This can yield multiple or no chat models and20730* extensions must handle these cases, esp. when no chat model exists, gracefully.20731*20732* ```ts20733* const models = await vscode.lm.selectChatModels({ family: 'gpt-3.5-turbo' });20734* if (models.length > 0) {20735* const [first] = models;20736* const response = await first.sendRequest(...)20737* // ...20738* } else {20739* // NO chat models available20740* }20741* ```20742*20743* A selector can be written to broadly match all models of a given vendor or family, or it can narrowly select one model by ID.20744* Keep in mind that the available set of models will change over time, but also that prompts may perform differently in20745* different models.20746*20747* *Note* that extensions can hold on to the results returned by this function and use them later. However, when the20748* {@link onDidChangeChatModels}-event is fired the list of chat models might have changed and extensions should re-query.20749*20750* @param selector A chat model selector. When omitted all chat models are returned.20751* @returns An array of chat models, can be empty!20752*/20753export function selectChatModels(selector?: LanguageModelChatSelector): Thenable<LanguageModelChat[]>;2075420755/**20756* Register a LanguageModelTool. The tool must also be registered in the package.json `languageModelTools` contribution20757* point. A registered tool is available in the {@link lm.tools} list for any extension to see. But in order for it to20758* be seen by a language model, it must be passed in the list of available tools in {@link LanguageModelChatRequestOptions.tools}.20759* @returns A {@link Disposable} that unregisters the tool when disposed.20760*/20761export function registerTool<T>(name: string, tool: LanguageModelTool<T>): Disposable;2076220763/**20764* A list of all available tools that were registered by all extensions using {@link lm.registerTool}. They can be called20765* with {@link lm.invokeTool} with input that match their declared `inputSchema`.20766*/20767export const tools: readonly LanguageModelToolInformation[];2076820769/**20770* Invoke a tool listed in {@link lm.tools} by name with the given input. The input will be validated against20771* the schema declared by the tool20772*20773* A tool can be invoked by a chat participant, in the context of handling a chat request, or globally by any extension in20774* any custom flow.20775*20776* In the former case, the caller shall pass the20777* {@link LanguageModelToolInvocationOptions.toolInvocationToken toolInvocationToken}, which comes from a20778* {@link ChatRequest.toolInvocationToken chat request}. This makes sure the chat UI shows the tool invocation for the20779* correct conversation.20780*20781* A tool {@link LanguageModelToolResult result} is an array of {@link LanguageModelTextPart text-} and20782* {@link LanguageModelPromptTsxPart prompt-tsx}-parts. If the tool caller is using `@vscode/prompt-tsx`, it can20783* incorporate the response parts into its prompt using a `ToolResult`. If not, the parts can be passed along to the20784* {@link LanguageModelChat} via a user message with a {@link LanguageModelToolResultPart}.20785*20786* If a chat participant wants to preserve tool results for requests across multiple turns, it can store tool results in20787* the {@link ChatResult.metadata} returned from the handler and retrieve them on the next turn from20788* {@link ChatResponseTurn.result}.20789*20790* @param name The name of the tool to call.20791* @param options The options to use when invoking the tool.20792* @param token A cancellation token. See {@link CancellationTokenSource} for how to create one.20793* @returns The result of the tool invocation.20794*/20795export function invokeTool(name: string, options: LanguageModelToolInvocationOptions<object>, token?: CancellationToken): Thenable<LanguageModelToolResult>;2079620797/**20798* Registers a provider that publishes Model Context Protocol servers for the editor to20799* consume. This allows MCP servers to be dynamically provided to the editor in20800* addition to those the user creates in their configuration files.20801*20802* Before calling this method, extensions must register the `contributes.mcpServerDefinitionProviders`20803* extension point with the corresponding {@link id}, for example:20804*20805* ```js20806* "contributes": {20807* "mcpServerDefinitionProviders": [20808* {20809* "id": "cool-cloud-registry.mcp-servers",20810* "label": "Cool Cloud Registry",20811* }20812* ]20813* }20814* ```20815*20816* When a new McpServerDefinitionProvider is available, the editor will, by default,20817* automatically invoke it to discover new servers and tools when a chat message is20818* submitted. To enable this flow, extensions should call20819* `registerMcpServerDefinitionProvider` during activation.20820*20821* @param id The ID of the provider, which is unique to the extension.20822* @param provider The provider to register20823* @returns A disposable that unregisters the provider when disposed.20824*/20825export function registerMcpServerDefinitionProvider(id: string, provider: McpServerDefinitionProvider): Disposable;2082620827/**20828* Registers a {@linkcode LanguageModelChatProvider}20829* Note: You must also define the language model chat provider via the `languageModelChatProviders` contribution point in package.json20830* @param vendor The vendor for this provider. Must be globally unique. An example is `copilot` or `openai`.20831* @param provider The provider to register20832* @returns A disposable that unregisters the provider when disposed20833*/20834export function registerLanguageModelChatProvider(vendor: string, provider: LanguageModelChatProvider): Disposable;20835}2083620837/**20838* Represents extension specific information about the access to language models.20839*/20840export interface LanguageModelAccessInformation {2084120842/**20843* An event that fires when access information changes.20844*/20845readonly onDidChange: Event<void>;2084620847/**20848* Checks if a request can be made to a language model.20849*20850* *Note* that calling this function will not trigger a consent UI but just checks for a persisted state.20851*20852* @param chat A language model chat object.20853* @return `true` if a request can be made, `false` if not, `undefined` if the language20854* model does not exist or consent hasn't been asked for.20855*/20856canSendRequest(chat: LanguageModelChat): boolean | undefined;20857}2085820859/**20860* A tool that is available to the language model via {@link LanguageModelChatRequestOptions}. A language model uses all the20861* properties of this interface to decide which tool to call, and how to call it.20862*/20863export interface LanguageModelChatTool {20864/**20865* The name of the tool.20866*/20867name: string;2086820869/**20870* The description of the tool.20871*/20872description: string;2087320874/**20875* A JSON schema for the input this tool accepts.20876*/20877inputSchema?: object | undefined;20878}2087920880/**20881* A tool-calling mode for the language model to use.20882*/20883export enum LanguageModelChatToolMode {20884/**20885* The language model can choose to call a tool or generate a message. Is the default.20886*/20887Auto = 1,2088820889/**20890* The language model must call one of the provided tools. Note- some models only support a single tool when using this20891* mode.20892*/20893Required = 220894}2089520896/**20897* A language model response part indicating a tool call, returned from a {@link LanguageModelChatResponse}, and also can be20898* included as a content part on a {@link LanguageModelChatMessage}, to represent a previous tool call in a chat request.20899*/20900export class LanguageModelToolCallPart {20901/**20902* The ID of the tool call. This is a unique identifier for the tool call within the chat request.20903*/20904callId: string;2090520906/**20907* The name of the tool to call.20908*/20909name: string;2091020911/**20912* The input with which to call the tool.20913*/20914input: object;2091520916/**20917* Create a new LanguageModelToolCallPart.20918*20919* @param callId The ID of the tool call.20920* @param name The name of the tool to call.20921* @param input The input with which to call the tool.20922*/20923constructor(callId: string, name: string, input: object);20924}2092520926/**20927* The result of a tool call. This is the counterpart of a {@link LanguageModelToolCallPart tool call} and20928* it can only be included in the content of a User message20929*/20930export class LanguageModelToolResultPart {20931/**20932* The ID of the tool call.20933*20934* *Note* that this should match the {@link LanguageModelToolCallPart.callId callId} of a tool call part.20935*/20936callId: string;2093720938/**20939* The value of the tool result.20940*/20941content: Array<LanguageModelTextPart | LanguageModelPromptTsxPart | LanguageModelDataPart | unknown>;2094220943/**20944* @param callId The ID of the tool call.20945* @param content The content of the tool result.20946*/20947constructor(callId: string, content: Array<LanguageModelTextPart | LanguageModelPromptTsxPart | LanguageModelDataPart | unknown>);20948}2094920950/**20951* A language model response part containing a piece of text, returned from a {@link LanguageModelChatResponse}.20952*/20953export class LanguageModelTextPart {20954/**20955* The text content of the part.20956*/20957value: string;2095820959/**20960* Construct a text part with the given content.20961* @param value The text content of the part.20962*/20963constructor(value: string);20964}2096520966/**20967* A language model response part containing a PromptElementJSON from `@vscode/prompt-tsx`.20968* @see {@link LanguageModelToolResult}20969*/20970export class LanguageModelPromptTsxPart {20971/**20972* The value of the part.20973*/20974value: unknown;2097520976/**20977* Construct a prompt-tsx part with the given content.20978* @param value The value of the part, the result of `renderElementJSON` from `@vscode/prompt-tsx`.20979*/20980constructor(value: unknown);20981}2098220983/**20984* A result returned from a tool invocation. If using `@vscode/prompt-tsx`, this result may be rendered using a `ToolResult`.20985*/20986export class LanguageModelToolResult {20987/**20988* A list of tool result content parts. Includes `unknown` because this list may be extended with new content types in20989* the future.20990* @see {@link lm.invokeTool}.20991*/20992content: Array<LanguageModelTextPart | LanguageModelPromptTsxPart | LanguageModelDataPart | unknown>;2099320994/**20995* Create a LanguageModelToolResult20996* @param content A list of tool result content parts20997*/20998constructor(content: Array<LanguageModelTextPart | LanguageModelPromptTsxPart | LanguageModelDataPart | unknown>);20999}2100021001/**21002* A language model response part containing arbitrary data. Can be used in {@link LanguageModelChatResponse responses},21003* {@link LanguageModelChatMessage chat messages}, {@link LanguageModelToolResult tool results}, and other language model interactions.21004*/21005export class LanguageModelDataPart {21006/**21007* Create a new {@linkcode LanguageModelDataPart} for an image.21008* @param data Binary image data21009* @param mime The MIME type of the image. Common values are `image/png` and `image/jpeg`.21010*/21011static image(data: Uint8Array, mime: string): LanguageModelDataPart;2101221013/**21014* Create a new {@linkcode LanguageModelDataPart} for a json.21015*21016* *Note* that this function is not expecting "stringified JSON" but21017* an object that can be stringified. This function will throw an error21018* when the passed value cannot be JSON-stringified.21019* @param value A JSON-stringifyable value.21020* @param mime Optional MIME type, defaults to `application/json`21021*/21022static json(value: any, mime?: string): LanguageModelDataPart;2102321024/**21025* Create a new {@linkcode LanguageModelDataPart} for text.21026*21027* *Note* that an UTF-8 encoder is used to create bytes for the string.21028* @param value Text data21029* @param mime The MIME type if any. Common values are `text/plain` and `text/markdown`.21030*/21031static text(value: string, mime?: string): LanguageModelDataPart;2103221033/**21034* The mime type which determines how the data property is interpreted.21035*/21036mimeType: string;2103721038/**21039* The byte data for this part.21040*/21041data: Uint8Array;2104221043/**21044* Construct a generic data part with the given content.21045* @param data The byte data for this part.21046* @param mimeType The mime type of the data.21047*/21048constructor(data: Uint8Array, mimeType: string);21049}2105021051/**21052* A token that can be passed to {@link lm.invokeTool} when invoking a tool inside the context of handling a chat request.21053*/21054export type ChatParticipantToolToken = never;2105521056/**21057* Options provided for tool invocation.21058*/21059export interface LanguageModelToolInvocationOptions<T> {21060/**21061* An opaque object that ties a tool invocation to a chat request from a {@link ChatParticipant chat participant}.21062*21063* The _only_ way to get a valid tool invocation token is using the provided {@link ChatRequest.toolInvocationToken toolInvocationToken}21064* from a chat request. In that case, a progress bar will be automatically shown for the tool invocation in the chat response view, and if21065* the tool requires user confirmation, it will show up inline in the chat view.21066*21067* If the tool is being invoked outside of a chat request, `undefined` should be passed instead, and no special UI except for21068* confirmations will be shown.21069*21070* *Note* that a tool that invokes another tool during its invocation, can pass along the `toolInvocationToken` that it received.21071*/21072toolInvocationToken: ChatParticipantToolToken | undefined;2107321074/**21075* The input with which to invoke the tool. The input must match the schema defined in21076* {@link LanguageModelToolInformation.inputSchema}21077*/21078input: T;2107921080/**21081* Options to hint at how many tokens the tool should return in its response, and enable the tool to count tokens21082* accurately.21083*/21084tokenizationOptions?: LanguageModelToolTokenizationOptions;21085}2108621087/**21088* Options related to tokenization for a tool invocation.21089*/21090export interface LanguageModelToolTokenizationOptions {21091/**21092* If known, the maximum number of tokens the tool should emit in its result.21093*/21094tokenBudget: number;2109521096/**21097* Count the number of tokens in a message using the model specific tokenizer-logic.21098* @param text A string.21099* @param token Optional cancellation token. See {@link CancellationTokenSource} for how to create one.21100* @returns A thenable that resolves to the number of tokens.21101*/21102countTokens(text: string, token?: CancellationToken): Thenable<number>;21103}2110421105/**21106* Information about a registered tool available in {@link lm.tools}.21107*/21108export interface LanguageModelToolInformation {21109/**21110* A unique name for the tool.21111*/21112readonly name: string;2111321114/**21115* A description of this tool that may be passed to a language model.21116*/21117readonly description: string;2111821119/**21120* A JSON schema for the input this tool accepts.21121*/21122readonly inputSchema: object | undefined;2112321124/**21125* A set of tags, declared by the tool, that roughly describe the tool's capabilities. A tool user may use these to filter21126* the set of tools to just ones that are relevant for the task at hand.21127*/21128readonly tags: readonly string[];21129}2113021131/**21132* Options for {@link LanguageModelTool.prepareInvocation}.21133*/21134export interface LanguageModelToolInvocationPrepareOptions<T> {21135/**21136* The input that the tool is being invoked with.21137*/21138input: T;21139}2114021141/**21142* A tool that can be invoked by a call to a {@link LanguageModelChat}.21143*/21144export interface LanguageModelTool<T> {21145/**21146* Invoke the tool with the given input and return a result.21147*21148* The provided {@link LanguageModelToolInvocationOptions.input} has been validated against the declared schema.21149*/21150invoke(options: LanguageModelToolInvocationOptions<T>, token: CancellationToken): ProviderResult<LanguageModelToolResult>;2115121152/**21153* Called once before a tool is invoked. It's recommended to implement this to customize the progress message that appears21154* while the tool is running, and to provide a more useful message with context from the invocation input. Can also21155* signal that a tool needs user confirmation before running, if appropriate.21156*21157* * *Note 1:* Must be free of side-effects.21158* * *Note 2:* A call to `prepareInvocation` is not necessarily followed by a call to `invoke`.21159*/21160prepareInvocation?(options: LanguageModelToolInvocationPrepareOptions<T>, token: CancellationToken): ProviderResult<PreparedToolInvocation>;21161}2116221163/**21164* When this is returned in {@link PreparedToolInvocation}, the user will be asked to confirm before running the tool. These21165* messages will be shown with buttons that say "Continue" and "Cancel".21166*/21167export interface LanguageModelToolConfirmationMessages {21168/**21169* The title of the confirmation message.21170*/21171title: string;2117221173/**21174* The body of the confirmation message.21175*/21176message: string | MarkdownString;21177}2117821179/**21180* The result of a call to {@link LanguageModelTool.prepareInvocation}.21181*/21182export interface PreparedToolInvocation {21183/**21184* A customized progress message to show while the tool runs.21185*/21186invocationMessage?: string | MarkdownString;2118721188/**21189* The presence of this property indicates that the user should be asked to confirm before running the tool. The user21190* should be asked for confirmation for any tool that has a side-effect or may potentially be dangerous.21191*/21192confirmationMessages?: LanguageModelToolConfirmationMessages;21193}2119421195/**21196* A reference to a tool that the user manually attached to their request, either using the `#`-syntax inline, or as an21197* attachment via the paperclip button.21198*/21199export interface ChatLanguageModelToolReference {21200/**21201* The tool name. Refers to a tool listed in {@link lm.tools}.21202*/21203readonly name: string;2120421205/**21206* The start and end index of the reference in the {@link ChatRequest.prompt prompt}. When undefined, the reference was21207* not part of the prompt text.21208*21209* *Note* that the indices take the leading `#`-character into account which means they can be used to modify the prompt21210* as-is.21211*/21212readonly range?: [start: number, end: number];21213}21214}2121521216/**21217* Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise,21218* and others. This API makes no assumption about what promise library is being used which21219* enables reusing existing code without migrating to a specific promise implementation. Still,21220* we recommend the use of native promises which are available in this editor.21221*/21222interface Thenable<T> extends PromiseLike<T> { }212232122421225