> AI agents: For documentation discovery and navigation, see [llms.txt](/llms.txt).


# VS Code API

**VS Code API** is a set of JavaScript APIs that you can invoke in your Visual Studio Code extension. This page lists all VS Code APIs available to extension authors.

## API namespaces and classes

This listing is compiled from the [vscode.d.ts](https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.d.ts) file from the VS Code repository.

## authentication



<div class="comment"><p>Namespace for authentication.</p>
</div>

#### Events



<a name="authentication.onDidChangeSessions"></a><span class="ts" id=4398 data-target="#details-4398" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeSessions</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#AuthenticationSessionsChangeEvent">AuthenticationSessionsChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-4398">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the authentication sessions of an authentication provider have
been added, removed, or changed.</p>
</div>
</div>

#### Functions



<a name="authentication.getAccounts"></a><span class="ts" id=4390 data-target="#details-4390" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getAccounts</span><span>(</span><span class="ident">providerId</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;readonly <a class="type-ref" href="#AuthenticationSessionAccountInformation">AuthenticationSessionAccountInformation</a>[]&gt;</span>
<div class="details collapse" id="details-4390">
<div class="comment"><p>Get all accounts that the user is logged in to for the specified provider.
Use this paired with <a href="#authentication.getSession">getSession</a> in order to get an authentication session for a specific account.</p>
<p>Currently, there are only two authentication providers that are contributed from built in extensions
to the editor that implement GitHub and Microsoft authentication: their providerId&#39;s are &#39;github&#39; and &#39;microsoft&#39;.</p>
<p>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 <a href="#authentication.getSession">getSession</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">providerId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The id of the provider to use</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;readonly <a class="type-ref" href="#AuthenticationSessionAccountInformation">AuthenticationSessionAccountInformation</a>[]&gt;</td><td><div class="comment"><p>A thenable that resolves to a readonly array of authentication accounts.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="authentication.getSession"></a><span class="ts" id=4373 data-target="#details-4373" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getSession</span><span>(</span><span class="ident">providerId</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">scopeListOrRequest</span><span>: </span>readonly <span class="type-intrinsic">string</span>[] &#124; <a class="type-ref" href="#AuthenticationWwwAuthenticateRequest">AuthenticationWwwAuthenticateRequest</a>, <span class="ident">options</span><span>: </span><a class="type-ref" href="#AuthenticationGetSessionOptions">AuthenticationGetSessionOptions</a> &#38; {createIfNone: <span class="type-literal">true</span> &#124; <a class="type-ref" href="#AuthenticationGetSessionPresentationOptions">AuthenticationGetSessionPresentationOptions</a>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#AuthenticationSession">AuthenticationSession</a>&gt;</span>
<div class="details collapse" id="details-4373">
<div class="comment"><p>Get an authentication session matching the desired scopes or satisfying the WWW-Authenticate request. Rejects if
a provider with providerId is not registered, or if the user does not consent to sharing authentication information
with the extension. If there are multiple sessions with the same scopes, the user will be shown a quickpick to
select which account they would like to use.</p>
<p>Built-in auth providers include:</p>
<ul>
<li>&#39;github&#39; - For GitHub.com</li>
<li>&#39;microsoft&#39; For both personal &amp; organizational Microsoft accounts</li>
<li>(less common) &#39;github-enterprise&#39; - for alternative GitHub hostings, GHE.com, GitHub Enterprise Server</li>
<li>(less common) &#39;microsoft-sovereign-cloud&#39; - for alternative Microsoft clouds</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">providerId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The id of the provider to use</p>
</div></td></tr>
<tr><td><span class="ident">scopeListOrRequest</span><span>: </span>readonly <span class="type-intrinsic">string</span>[] &#124; <a class="type-ref" href="#AuthenticationWwwAuthenticateRequest">AuthenticationWwwAuthenticateRequest</a></td><td><div class="comment"><p>A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#AuthenticationGetSessionOptions">AuthenticationGetSessionOptions</a> &#38; {createIfNone: <span class="type-literal">true</span> &#124; <a class="type-ref" href="#AuthenticationGetSessionPresentationOptions">AuthenticationGetSessionPresentationOptions</a>}</td><td><div class="comment"><p>The <a href="#AuthenticationGetSessionOptions">AuthenticationGetSessionOptions</a> to use</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#AuthenticationSession">AuthenticationSession</a>&gt;</td><td><div class="comment"><p>A thenable that resolves to an authentication session</p>
</div></td></tr>
</table>
</div>
</div>



<a name="authentication.getSession"></a><span class="ts" id=4379 data-target="#details-4379" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getSession</span><span>(</span><span class="ident">providerId</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">scopeListOrRequest</span><span>: </span>readonly <span class="type-intrinsic">string</span>[] &#124; <a class="type-ref" href="#AuthenticationWwwAuthenticateRequest">AuthenticationWwwAuthenticateRequest</a>, <span class="ident">options</span><span>: </span><a class="type-ref" href="#AuthenticationGetSessionOptions">AuthenticationGetSessionOptions</a> &#38; {forceNewSession: <span class="type-literal">true</span> &#124; <a class="type-ref" href="#AuthenticationGetSessionPresentationOptions">AuthenticationGetSessionPresentationOptions</a>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#AuthenticationSession">AuthenticationSession</a>&gt;</span>
<div class="details collapse" id="details-4379">
<div class="comment"><p>Get an authentication session matching the desired scopes or request. Rejects if a provider with providerId is not
registered, or if the user does not consent to sharing authentication information with the extension. If there
are multiple sessions with the same scopes, the user will be shown a quickpick to select which account they would like to use.</p>
<p>Built-in auth providers include:</p>
<ul>
<li>&#39;github&#39; - For GitHub.com</li>
<li>&#39;microsoft&#39; For both personal &amp; organizational Microsoft accounts</li>
<li>(less common) &#39;github-enterprise&#39; - for alternative GitHub hostings, GHE.com, GitHub Enterprise Server</li>
<li>(less common) &#39;microsoft-sovereign-cloud&#39; - for alternative Microsoft clouds</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">providerId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The id of the provider to use</p>
</div></td></tr>
<tr><td><span class="ident">scopeListOrRequest</span><span>: </span>readonly <span class="type-intrinsic">string</span>[] &#124; <a class="type-ref" href="#AuthenticationWwwAuthenticateRequest">AuthenticationWwwAuthenticateRequest</a></td><td><div class="comment"><p>A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#AuthenticationGetSessionOptions">AuthenticationGetSessionOptions</a> &#38; {forceNewSession: <span class="type-literal">true</span> &#124; <a class="type-ref" href="#AuthenticationGetSessionPresentationOptions">AuthenticationGetSessionPresentationOptions</a>}</td><td><div class="comment"><p>The <a href="#AuthenticationGetSessionOptions">AuthenticationGetSessionOptions</a> to use</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#AuthenticationSession">AuthenticationSession</a>&gt;</td><td><div class="comment"><p>A thenable that resolves to an authentication session</p>
</div></td></tr>
</table>
</div>
</div>



<a name="authentication.getSession"></a><span class="ts" id=4385 data-target="#details-4385" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getSession</span><span>(</span><span class="ident">providerId</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">scopeListOrRequest</span><span>: </span>readonly <span class="type-intrinsic">string</span>[] &#124; <a class="type-ref" href="#AuthenticationWwwAuthenticateRequest">AuthenticationWwwAuthenticateRequest</a>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#AuthenticationGetSessionOptions">AuthenticationGetSessionOptions</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#AuthenticationSession">AuthenticationSession</a>&gt;</span>
<div class="details collapse" id="details-4385">
<div class="comment"><p>Get an authentication session matching the desired scopes or request. Rejects if a provider with providerId is not
registered, or if the user does not consent to sharing authentication information with the extension. If there
are multiple sessions with the same scopes, the user will be shown a quickpick to select which account they would like to use.</p>
<p>Built-in auth providers include:</p>
<ul>
<li>&#39;github&#39; - For GitHub.com</li>
<li>&#39;microsoft&#39; For both personal &amp; organizational Microsoft accounts</li>
<li>(less common) &#39;github-enterprise&#39; - for alternative GitHub hostings, GHE.com, GitHub Enterprise Server</li>
<li>(less common) &#39;microsoft-sovereign-cloud&#39; - for alternative Microsoft clouds</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">providerId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The id of the provider to use</p>
</div></td></tr>
<tr><td><span class="ident">scopeListOrRequest</span><span>: </span>readonly <span class="type-intrinsic">string</span>[] &#124; <a class="type-ref" href="#AuthenticationWwwAuthenticateRequest">AuthenticationWwwAuthenticateRequest</a></td><td><div class="comment"><p>A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#AuthenticationGetSessionOptions">AuthenticationGetSessionOptions</a></td><td><div class="comment"><p>The <a href="#AuthenticationGetSessionOptions">AuthenticationGetSessionOptions</a> to use</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#AuthenticationSession">AuthenticationSession</a>&gt;</td><td><div class="comment"><p>A thenable that resolves to an authentication session or undefined if a silent flow was used and no session was found</p>
</div></td></tr>
</table>
</div>
</div>



<a name="authentication.registerAuthenticationProvider"></a><span class="ts" id=4393 data-target="#details-4393" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerAuthenticationProvider</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#AuthenticationProvider">AuthenticationProvider</a>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#AuthenticationProviderOptions">AuthenticationProviderOptions</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-4393">
<div class="comment"><p>Register an authentication provider.</p>
<p>There can only be one provider per id and an error is being thrown when an id
has already been used by another provider. Ids are case-sensitive.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The unique identifier of the provider.</p>
</div></td></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The human-readable name of the provider.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#AuthenticationProvider">AuthenticationProvider</a></td><td><div class="comment"><p>The authentication provider provider.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#AuthenticationProviderOptions">AuthenticationProviderOptions</a></td><td><div class="comment"><p>Additional options for the provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>

## chat



<div class="comment"><p>Namespace for chat functionality. Users interact with chat participants by sending messages
to them in the chat view. Chat participants can respond with markdown or other types of content
via the <a href="#ChatResponseStream">ChatResponseStream</a>.</p>
</div>

#### Functions



<a name="chat.createChatParticipant"></a><span class="ts" id=4923 data-target="#details-4923" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createChatParticipant</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">handler</span><span>: </span><a class="type-ref" href="#ChatRequestHandler">ChatRequestHandler</a><span>)</span><span>: </span><a class="type-ref" href="#ChatParticipant">ChatParticipant</a></span>
<div class="details collapse" id="details-4923">
<div class="comment"><p>Create a new <a href="#ChatParticipant">chat participant</a> instance.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A unique identifier for the participant.</p>
</div></td></tr>
<tr><td><span class="ident">handler</span><span>: </span><a class="type-ref" href="#ChatRequestHandler">ChatRequestHandler</a></td><td><div class="comment"><p>A request handler for the participant.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ChatParticipant">ChatParticipant</a></td><td><div class="comment"><p>A new chat participant</p>
</div></td></tr>
</table>
</div>
</div>

## commands



<div class="comment"><p>Namespace for dealing with commands. In short, a command is a function with a
unique identifier. The function is sometimes also called <em>command handler</em>.</p>
<p>Commands can be added to the editor using the <a href="#commands.registerCommand">registerCommand</a>
and <a href="#commands.registerTextEditorCommand">registerTextEditorCommand</a> functions. Commands
can be executed <a href="#commands.executeCommand">manually</a> or from a UI gesture. Those are:</p>
<ul>
<li>palette - Use the <code>commands</code>-section in <code>package.json</code> to make a command show in
the <a href="https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette">command palette</a>.</li>
<li>keybinding - Use the <code>keybindings</code>-section in <code>package.json</code> to enable
<a href="https://code.visualstudio.com/docs/getstarted/keybindings#_advanced-customization">keybindings</a>
for your extension.</li>
</ul>
<p>Commands from other extensions and from the editor itself are accessible to an extension. However,
when invoking an editor command not all argument types are supported.</p>
<p>This is a sample that registers a command handler and adds an entry for that command to the palette. First
register a command handler with the identifier <code>extension.sayHello</code>.</p>
<pre class="shiki" data-lang="javascript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commands</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">registerCommand</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'extension.sayHello'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, () </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">showInformationMessage</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Hello World!'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"></span></code></pre>
<p>Second, bind the command identifier to a title under which it will show in the palette (<code>package.json</code>).</p>
<pre class="shiki" data-lang="json" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">{</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">  "contributes"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">    "commands"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: [</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">      {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">        "command"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"extension.sayHello"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">        "title"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"Hello World"</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">      }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    ]</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span>
<span class="line"></span></code></pre>
</div>

#### Functions



<a name="commands.executeCommand"></a><span class="ts" id=2631 data-target="#details-2631" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executeCommand</span><span>&lt;</span>T<span>&gt;</span><span>(</span><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span>, <span>...</span><span class="ident">rest</span><span>: </span><span class="type-intrinsic">any</span>[]<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2631">
<div class="comment"><p>Executes the command denoted by the given command identifier.</p>
<ul>
<li><em>Note 1:</em> When executing an editor command not all types are allowed to
be passed as arguments. Allowed are the primitive types <code>string</code>, <code>boolean</code>,
<code>number</code>, <code>undefined</code>, and <code>null</code>, as well as <a href="#Position">Position</a>, <a href="#Range">Range</a>, <a href="#Uri">Uri</a> and <a href="#Location">Location</a>.</li>
<li><em>Note 2:</em> There are no restrictions when executing commands that have been contributed
by extensions.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Identifier of the command to execute.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">rest</span><span>: </span><span class="type-intrinsic">any</span>[]</td><td><div class="comment"><p>Parameters passed to the command function.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the returned value of the given command. Returns <code>undefined</code> when
the command handler function doesn&#39;t return anything.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="commands.getCommands"></a><span class="ts" id=2636 data-target="#details-2636" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getCommands</span><span>(</span><span class="ident">filterInternal</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>[]&gt;</span>
<div class="details collapse" id="details-2636">
<div class="comment"><p>Retrieve the list of all available commands. Commands starting with an underscore are
treated as internal commands.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">filterInternal</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Set <code>true</code> to not see internal commands (starting with an underscore)</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>[]&gt;</td><td><div class="comment"><p>Thenable that resolves to a list of command ids.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="commands.registerCommand"></a><span class="ts" id=2613 data-target="#details-2613" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerCommand</span><span>(</span><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">callback</span><span>: </span>(args: <span class="type-intrinsic">any</span>[]) =&gt; <span class="type-intrinsic">any</span>, <span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2613">
<div class="comment"><p>Registers a command that can be invoked via a keyboard shortcut,
a menu item, an action, or directly.</p>
<p>Registering a command with an existing command identifier twice
will cause an error.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A unique identifier for the command.</p>
</div></td></tr>
<tr><td><span class="ident">callback</span><span>: </span>(args: <span class="type-intrinsic">any</span>[]) =&gt; <span class="type-intrinsic">any</span></td><td><div class="comment"><p>A command handler function.</p>
</div></td></tr>
<tr><td><span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>The <code>this</code> context used when invoking the handler function.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>Disposable which unregisters this command on disposal.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="commands.registerTextEditorCommand"></a><span class="ts" id=2621 data-target="#details-2621" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerTextEditorCommand</span><span>(</span><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">callback</span><span>: </span>(textEditor: <a class="type-ref" href="#TextEditor">TextEditor</a>, edit: <a class="type-ref" href="#TextEditorEdit">TextEditorEdit</a>, args: <span class="type-intrinsic">any</span>[]) =&gt; <span class="type-intrinsic">void</span>, <span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2621">
<div class="comment"><p>Registers a text editor command that can be invoked via a keyboard shortcut,
a menu item, an action, or directly.</p>
<p>Text editor commands are different from ordinary <a href="#commands.registerCommand">commands</a> as
they only execute when there is an active editor when the command is called. Also, the
command handler of an editor command has access to the active editor and to an
<a href="#TextEditorEdit">edit</a>-builder. Note that the edit-builder is only valid while the
callback executes.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A unique identifier for the command.</p>
</div></td></tr>
<tr><td><span class="ident">callback</span><span>: </span>(textEditor: <a class="type-ref" href="#TextEditor">TextEditor</a>, edit: <a class="type-ref" href="#TextEditorEdit">TextEditorEdit</a>, args: <span class="type-intrinsic">any</span>[]) =&gt; <span class="type-intrinsic">void</span></td><td><div class="comment"><p>A command handler function with access to an <a href="#TextEditor">editor</a> and an <a href="#TextEditorEdit">edit</a>.</p>
</div></td></tr>
<tr><td><span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>The <code>this</code> context used when invoking the handler function.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>Disposable which unregisters this command on disposal.</p>
</div></td></tr>
</table>
</div>
</div>

## comments



<div class="comment"></div>

#### Functions



<a name="comments.createCommentController"></a><span class="ts" id=4321 data-target="#details-4321" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createCommentController</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#CommentController">CommentController</a></span>
<div class="details collapse" id="details-4321">
<div class="comment"><p>Creates a new <a href="#CommentController">comment controller</a> instance.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>An <code>id</code> for the comment controller.</p>
</div></td></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A human-readable string for the comment controller.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#CommentController">CommentController</a></td><td><div class="comment"><p>An instance of <a href="#CommentController">comment controller</a>.</p>
</div></td></tr>
</table>
</div>
</div>

## debug



<div class="comment"><p>Namespace for debug functionality.</p>
</div>

#### Variables



<a name="debug.activeDebugConsole"></a><span class="ts" id=4236 data-target="#details-4236" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeDebugConsole</span><span>: </span><a class="type-ref" href="#DebugConsole">DebugConsole</a></span>
<div class="details collapse" id="details-4236">
<div class="comment"><p>The currently active <a href="#DebugConsole">debug console</a>.
If no debug session is active, output sent to the debug console is not shown.</p>
</div>
</div>



<a name="debug.activeDebugSession"></a><span class="ts" id=4235 data-target="#details-4235" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeDebugSession</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a> &#124; <span class="type-intrinsic">undefined</span></span>
<div class="details collapse" id="details-4235">
<div class="comment"><p>The currently active <a href="#DebugSession">debug session</a> or <code>undefined</code>. The active debug session is the one
represented by the debug action floating window or the one currently shown in the drop down menu of the debug action floating window.
If no debug session is active, the value is <code>undefined</code>.</p>
</div>
</div>



<a name="debug.activeStackItem"></a><span class="ts" id=4243 data-target="#details-4243" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeStackItem</span><span>: </span><a class="type-ref" href="#DebugThread">DebugThread</a> &#124; <a class="type-ref" href="#DebugStackFrame">DebugStackFrame</a> &#124; <span class="type-intrinsic">undefined</span></span>
<div class="details collapse" id="details-4243">
<div class="comment"><p>The currently focused thread or stack frame, or <code>undefined</code> if no
thread or stack is focused. A thread can be focused any time there is
an active debug session, while a stack frame can only be focused when
a session is paused and the call stack has been retrieved.</p>
</div>
</div>



<a name="debug.breakpoints"></a><span class="ts" id=4237 data-target="#details-4237" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">breakpoints</span><span>: </span>readonly <a class="type-ref" href="#Breakpoint">Breakpoint</a>[]</span>
<div class="details collapse" id="details-4237">
<div class="comment"><p>List of breakpoints.</p>
</div>
</div>

#### Events



<a name="debug.onDidChangeActiveDebugSession"></a><span class="ts" id=4238 data-target="#details-4238" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeActiveDebugSession</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#DebugSession">DebugSession</a> &#124; <span class="type-intrinsic">undefined</span>&gt;</span>
<div class="details collapse" id="details-4238">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the <a href="#debug.activeDebugSession">active debug session</a>
has changed. <em>Note</em> that the event also fires when the active debug session changes
to <code>undefined</code>.</p>
</div>
</div>



<a name="debug.onDidChangeActiveStackItem"></a><span class="ts" id=4244 data-target="#details-4244" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeActiveStackItem</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#DebugThread">DebugThread</a> &#124; <a class="type-ref" href="#DebugStackFrame">DebugStackFrame</a> &#124; <span class="type-intrinsic">undefined</span>&gt;</span>
<div class="details collapse" id="details-4244">
<div class="comment"><p>An event which fires when the <a href="#debug.activeStackItem">debug.activeStackItem</a> has changed.</p>
</div>
</div>



<a name="debug.onDidChangeBreakpoints"></a><span class="ts" id=4242 data-target="#details-4242" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeBreakpoints</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#BreakpointsChangeEvent">BreakpointsChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-4242">
<div class="comment"><p>An <a href="#Event">Event</a> that is emitted when the set of breakpoints is added, removed, or changed.</p>
</div>
</div>



<a name="debug.onDidReceiveDebugSessionCustomEvent"></a><span class="ts" id=4240 data-target="#details-4240" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidReceiveDebugSessionCustomEvent</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#DebugSessionCustomEvent">DebugSessionCustomEvent</a>&gt;</span>
<div class="details collapse" id="details-4240">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when a custom DAP event is received from the <a href="#DebugSession">debug session</a>.</p>
</div>
</div>



<a name="debug.onDidStartDebugSession"></a><span class="ts" id=4239 data-target="#details-4239" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidStartDebugSession</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#DebugSession">DebugSession</a>&gt;</span>
<div class="details collapse" id="details-4239">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when a new <a href="#DebugSession">debug session</a> has been started.</p>
</div>
</div>



<a name="debug.onDidTerminateDebugSession"></a><span class="ts" id=4241 data-target="#details-4241" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidTerminateDebugSession</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#DebugSession">DebugSession</a>&gt;</span>
<div class="details collapse" id="details-4241">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when a <a href="#DebugSession">debug session</a> has terminated.</p>
</div>
</div>

#### Functions



<a name="debug.addBreakpoints"></a><span class="ts" id=4226 data-target="#details-4226" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">addBreakpoints</span><span>(</span><span class="ident">breakpoints</span><span>: </span>readonly <a class="type-ref" href="#Breakpoint">Breakpoint</a>[]<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4226">
<div class="comment"><p>Add breakpoints.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">breakpoints</span><span>: </span>readonly <a class="type-ref" href="#Breakpoint">Breakpoint</a>[]</td><td><div class="comment"><p>The breakpoints to add.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="debug.asDebugSourceUri"></a><span class="ts" id=4232 data-target="#details-4232" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">asDebugSourceUri</span><span>(</span><span class="ident">source</span><span>: </span><a class="type-ref" href="#DebugProtocolSource">DebugProtocolSource</a>, <span class="ident">session</span><span>?</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a><span>)</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4232">
<div class="comment"><p>Converts a &quot;Source&quot; descriptor object received via the Debug Adapter Protocol into a Uri that can be used to load its contents.
If the source descriptor is based on a path, a file Uri is returned.
If the source descriptor uses a reference number, a specific debug Uri (scheme &#39;debug&#39;) is constructed that requires a corresponding ContentProvider and a running debug session</p>
<p>If the &quot;Source&quot; descriptor has insufficient information for creating the Uri, an error is thrown.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">source</span><span>: </span><a class="type-ref" href="#DebugProtocolSource">DebugProtocolSource</a></td><td><div class="comment"><p>An object conforming to the <a href="https://microsoft.github.io/debug-adapter-protocol/specification#Types_Source">Source</a> type defined in the Debug Adapter Protocol.</p>
</div></td></tr>
<tr><td><span class="ident">session</span><span>?</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a></td><td><div class="comment"><p>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.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A uri that can be used to load the contents of the source.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="debug.registerDebugAdapterDescriptorFactory"></a><span class="ts" id=4210 data-target="#details-4210" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDebugAdapterDescriptorFactory</span><span>(</span><span class="ident">debugType</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">factory</span><span>: </span><a class="type-ref" href="#DebugAdapterDescriptorFactory">DebugAdapterDescriptorFactory</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-4210">
<div class="comment"><p>Register a <a href="#DebugAdapterDescriptorFactory">debug adapter descriptor factory</a> for a specific debug type.
An extension is only allowed to register a DebugAdapterDescriptorFactory for the debug type(s) defined by the extension. Otherwise an error is thrown.
Registering more than one DebugAdapterDescriptorFactory for a debug type results in an error.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">debugType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The debug type for which the factory is registered.</p>
</div></td></tr>
<tr><td><span class="ident">factory</span><span>: </span><a class="type-ref" href="#DebugAdapterDescriptorFactory">DebugAdapterDescriptorFactory</a></td><td><div class="comment"><p>The <a href="#DebugAdapterDescriptorFactory">debug adapter descriptor factory</a> to register.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this factory when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="debug.registerDebugAdapterTrackerFactory"></a><span class="ts" id=4214 data-target="#details-4214" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDebugAdapterTrackerFactory</span><span>(</span><span class="ident">debugType</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">factory</span><span>: </span><a class="type-ref" href="#DebugAdapterTrackerFactory">DebugAdapterTrackerFactory</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-4214">
<div class="comment"><p>Register a debug adapter tracker factory for the given debug type.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">debugType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The debug type for which the factory is registered or &#39;*&#39; for matching all debug types.</p>
</div></td></tr>
<tr><td><span class="ident">factory</span><span>: </span><a class="type-ref" href="#DebugAdapterTrackerFactory">DebugAdapterTrackerFactory</a></td><td><div class="comment"><p>The <a href="#DebugAdapterTrackerFactory">debug adapter tracker factory</a> to register.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this factory when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="debug.registerDebugConfigurationProvider"></a><span class="ts" id=4205 data-target="#details-4205" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDebugConfigurationProvider</span><span>(</span><span class="ident">debugType</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#DebugConfigurationProvider">DebugConfigurationProvider</a>, <span class="ident">triggerKind</span><span>?</span><span>: </span><a class="type-ref" href="#DebugConfigurationProviderTriggerKind">DebugConfigurationProviderTriggerKind</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-4205">
<div class="comment"><p>Register a <a href="#DebugConfigurationProvider">debug configuration provider</a> for a specific debug type.
The optional <a href="#DebugConfigurationProviderTriggerKind">triggerKind</a> can be used to specify when the <code>provideDebugConfigurations</code> method of the provider is triggered.
Currently two trigger kinds are possible: with the value <code>Initial</code> (or if no trigger kind argument is given) the <code>provideDebugConfigurations</code> method is used to provide the initial debug configurations to be copied into a newly created launch.json.
With the trigger kind <code>Dynamic</code> the <code>provideDebugConfigurations</code> method is used to dynamically determine debug configurations to be presented to the user (in addition to the static configurations from the launch.json).
Please note that the <code>triggerKind</code> argument only applies to the <code>provideDebugConfigurations</code> method: so the <code>resolveDebugConfiguration</code> methods are not affected at all.
Registering a single provider with resolve methods for different trigger kinds, results in the same resolve methods called multiple times.
More than one provider can be registered for the same type.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">debugType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The debug type for which the provider is registered.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#DebugConfigurationProvider">DebugConfigurationProvider</a></td><td><div class="comment"><p>The <a href="#DebugConfigurationProvider">debug configuration provider</a> to register.</p>
</div></td></tr>
<tr><td><span class="ident">triggerKind</span><span>?</span><span>: </span><a class="type-ref" href="#DebugConfigurationProviderTriggerKind">DebugConfigurationProviderTriggerKind</a></td><td><div class="comment"><p>The <a href="#DebugConfigurationProviderTriggerKind">trigger</a> for which the &#39;provideDebugConfiguration&#39; method of the provider is registered. If <code>triggerKind</code> is missing, the value <code>DebugConfigurationProviderTriggerKind.Initial</code> is assumed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="debug.removeBreakpoints"></a><span class="ts" id=4229 data-target="#details-4229" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">removeBreakpoints</span><span>(</span><span class="ident">breakpoints</span><span>: </span>readonly <a class="type-ref" href="#Breakpoint">Breakpoint</a>[]<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4229">
<div class="comment"><p>Remove breakpoints.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">breakpoints</span><span>: </span>readonly <a class="type-ref" href="#Breakpoint">Breakpoint</a>[]</td><td><div class="comment"><p>The breakpoints to remove.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="debug.startDebugging"></a><span class="ts" id=4218 data-target="#details-4218" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">startDebugging</span><span>(</span><span class="ident">folder</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a>, <span class="ident">nameOrConfiguration</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#DebugConfiguration">DebugConfiguration</a>, <span class="ident">parentSessionOrOptions</span><span>?</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a> &#124; <a class="type-ref" href="#DebugSessionOptions">DebugSessionOptions</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-4218">
<div class="comment"><p>Start debugging by using either a named launch or named compound configuration,
or by directly passing a <a href="#DebugConfiguration">DebugConfiguration</a>.
The named configurations are looked up in &#39;.vscode/launch.json&#39; found in the given folder.
Before debugging starts, all unsaved files are saved and the launch configurations are brought up-to-date.
Folder specific variables used in the configuration (e.g. &#39;${workspaceFolder}&#39;) are resolved against the given folder.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">folder</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a></td><td><div class="comment"><p>The <a href="#WorkspaceFolder">workspace folder</a> for looking up named configurations and resolving variables or <code>undefined</code> for a non-folder setup.</p>
</div></td></tr>
<tr><td><span class="ident">nameOrConfiguration</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#DebugConfiguration">DebugConfiguration</a></td><td><div class="comment"><p>Either the name of a debug or compound configuration or a <a href="#DebugConfiguration">DebugConfiguration</a> object.</p>
</div></td></tr>
<tr><td><span class="ident">parentSessionOrOptions</span><span>?</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a> &#124; <a class="type-ref" href="#DebugSessionOptions">DebugSessionOptions</a></td><td><div class="comment"><p>Debug session options. When passed a parent <a href="#DebugSession">debug session</a>, assumes options with just this parent session.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>A thenable that resolves when debugging could be successfully started.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="debug.stopDebugging"></a><span class="ts" id=4223 data-target="#details-4223" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">stopDebugging</span><span>(</span><span class="ident">session</span><span>?</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-4223">
<div class="comment"><p>Stop the given debug session or stop all debug sessions if session is omitted.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">session</span><span>?</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a></td><td><div class="comment"><p>The <a href="#DebugSession">debug session</a> to stop; if omitted all sessions are stopped.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>A thenable that resolves when the session(s) have been stopped.</p>
</div></td></tr>
</table>
</div>
</div>

## env



<div class="comment"><p>Namespace describing the environment the editor runs in.</p>
</div>

#### Variables



<a name="env.appHost"></a><span class="ts" id=2595 data-target="#details-2595" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appHost</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2595">
<div class="comment"><p>The hosted location of the application
On desktop this is &#39;desktop&#39;
In the web this is the specified embedder i.e. &#39;github.dev&#39;, &#39;codespaces&#39;, or &#39;web&#39; if the embedder
does not provide that information</p>
</div>
</div>



<a name="env.appName"></a><span class="ts" id=2593 data-target="#details-2593" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appName</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2593">
<div class="comment"><p>The application name of the editor, like &#39;VS Code&#39;.</p>
</div>
</div>



<a name="env.appRoot"></a><span class="ts" id=2594 data-target="#details-2594" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appRoot</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2594">
<div class="comment"><p>The application root folder from which the editor is running.</p>
<p><em>Note</em> that the value is the empty string when running in an
environment that has no representation of an application root folder.</p>
</div>
</div>



<a name="env.clipboard"></a><span class="ts" id=2598 data-target="#details-2598" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">clipboard</span><span>: </span><a class="type-ref" href="#Clipboard">Clipboard</a></span>
<div class="details collapse" id="details-2598">
<div class="comment"><p>The system clipboard.</p>
</div>
</div>



<a name="env.isAppPortable"></a><span class="ts" id=2602 data-target="#details-2602" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isAppPortable</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2602">
<div class="comment"><p>Indicates whether the application is running in portable mode.</p>
<p>Portable mode is enabled when the application is run from a folder that contains
a <code>data</code> directory, allowing for self-contained installations.</p>
<p>Learn more about <a href="https://code.visualstudio.com/docs/editor/portable">Portable Mode</a>.</p>
</div>
</div>



<a name="env.isNewAppInstall"></a><span class="ts" id=2601 data-target="#details-2601" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isNewAppInstall</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2601">
<div class="comment"><p>Indicates that this is a fresh install of the application.
<code>true</code> if within the first day of installation otherwise <code>false</code>.</p>
</div>
</div>



<a name="env.isTelemetryEnabled"></a><span class="ts" id=2603 data-target="#details-2603" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isTelemetryEnabled</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2603">
<div class="comment"><p>Indicates whether the users has telemetry enabled.
Can be observed to determine if the extension should send telemetry.</p>
</div>
</div>



<a name="env.language"></a><span class="ts" id=2597 data-target="#details-2597" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">language</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2597">
<div class="comment"><p>Represents the preferred user-language, like <code>de-CH</code>, <code>fr</code>, or <code>en-US</code>.</p>
</div>
</div>



<a name="env.logLevel"></a><span class="ts" id=2609 data-target="#details-2609" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">logLevel</span><span>: </span><a class="type-ref" href="#LogLevel">LogLevel</a></span>
<div class="details collapse" id="details-2609">
<div class="comment"><p>The current log level of the editor.</p>
</div>
</div>



<a name="env.machineId"></a><span class="ts" id=2599 data-target="#details-2599" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">machineId</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2599">
<div class="comment"><p>A unique identifier for the computer.</p>
</div>
</div>



<a name="env.remoteName"></a><span class="ts" id=2606 data-target="#details-2606" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">remoteName</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">undefined</span></span>
<div class="details collapse" id="details-2606">
<div class="comment"><p>The name of a remote. Defined by extensions, popular samples are <code>wsl</code> for the Windows
Subsystem for Linux or <code>ssh-remote</code> for remotes using a secure shell.</p>
<p><em>Note</em> that the value is <code>undefined</code> when there is no remote extension host but that the
value is defined in all extension hosts (local and remote) in case a remote extension host
exists. Use <a href="#Extension.extensionKind">Extension.extensionKind</a> to know if
a specific extension runs remote or not.</p>
</div>
</div>



<a name="env.sessionId"></a><span class="ts" id=2600 data-target="#details-2600" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">sessionId</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2600">
<div class="comment"><p>A unique identifier for the current session.
Changes each time the editor is started.</p>
</div>
</div>



<a name="env.shell"></a><span class="ts" id=2607 data-target="#details-2607" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">shell</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2607">
<div class="comment"><p>The detected default shell for the extension host, this is overridden by the
<code>terminal.integrated.defaultProfile</code> setting for the extension host&#39;s platform. Note that in
environments that do not support a shell the value is the empty string.</p>
</div>
</div>



<a name="env.uiKind"></a><span class="ts" id=2608 data-target="#details-2608" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uiKind</span><span>: </span><a class="type-ref" href="#UIKind">UIKind</a></span>
<div class="details collapse" id="details-2608">
<div class="comment"><p>The UI kind property indicates from which UI extensions
are accessed from. For example, extensions could be accessed
from a desktop application or a web browser.</p>
</div>
</div>



<a name="env.uriScheme"></a><span class="ts" id=2596 data-target="#details-2596" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uriScheme</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2596">
<div class="comment"><p>The custom uri scheme the editor registers to in the operating system.</p>
</div>
</div>

#### Events



<a name="env.onDidChangeLogLevel"></a><span class="ts" id=2610 data-target="#details-2610" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeLogLevel</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#LogLevel">LogLevel</a>&gt;</span>
<div class="details collapse" id="details-2610">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the log level of the editor changes.</p>
</div>
</div>



<a name="env.onDidChangeShell"></a><span class="ts" id=2605 data-target="#details-2605" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeShell</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-2605">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the default shell changes. This fires with the new
shell path.</p>
</div>
</div>



<a name="env.onDidChangeTelemetryEnabled"></a><span class="ts" id=2604 data-target="#details-2604" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeTelemetryEnabled</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-2604">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the user enabled or disables telemetry.
<code>true</code> if the user has enabled telemetry or <code>false</code> if the user has disabled telemetry.</p>
</div>
</div>

#### Functions



<a name="env.asExternalUri"></a><span class="ts" id=2591 data-target="#details-2591" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">asExternalUri</span><span>(</span><span class="ident">target</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</span>
<div class="details collapse" id="details-2591">
<div class="comment"><p>Resolves a uri to a form that is accessible externally.</p>
<h4 id="http-or-https-scheme"><code>http:</code> or <code>https:</code> scheme</h4>
<p>Resolves an <em>external</em> uri, such as a <code>http:</code> or <code>https:</code> link, from where the extension is running to a
uri to the same resource on the client machine.</p>
<p>This is a no-op if the extension is running on the client machine.</p>
<p>If the extension is running remotely, this function automatically establishes a port forwarding tunnel
from the local machine to <code>target</code> on the remote and returns a local uri to the tunnel. The lifetime of
the port forwarding tunnel is managed by the editor and the tunnel can be closed by the user.</p>
<p><em>Note</em> that uris passed through <code>openExternal</code> are automatically resolved and you should not call <code>asExternalUri</code> on them.</p>
<h4 id="vscodeenvurischeme"><code>vscode.env.uriScheme</code></h4>
<p>Creates a uri that - if opened in a browser (e.g. via <code>openExternal</code>) - will result in a registered <a href="#UriHandler">UriHandler</a>
to trigger.</p>
<p>Extensions should not make any assumptions about the resulting uri and should not alter it in any way.
Rather, extensions can e.g. use this uri in an authentication flow, by adding the uri as callback query
argument to the server to authenticate to.</p>
<p><em>Note</em> that if the server decides to add additional query parameters to the uri (e.g. a token or secret), it
will appear in the uri that is passed to the <a href="#UriHandler">UriHandler</a>.</p>
<p><strong>Example</strong> of an authentication flow:</p>
<pre class="shiki" data-lang="typescript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">registerUriHandler</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  handleUri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">Uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">): </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">ProviderResult</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">void</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">> {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">    if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">path</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'/did-authenticate'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">      console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">toString</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">());</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> callableUri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">await</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">env</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">asExternalUri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">Uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">parse</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">env</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uriScheme</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> + </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'://my.extension/did-authenticate'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">)</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">await</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">env</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">openExternal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">callableUri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span></code></pre>
<p><em>Note</em> that extensions should not cache the result of <code>asExternalUri</code> as the resolved uri may become invalid due to
a system or user action — for example, in remote cases, a user may close a port forwarding tunnel that was opened by
<code>asExternalUri</code>.</p>
<h4 id="any-other-scheme">Any other scheme</h4>
<p>Any other scheme will be handled as if the provided URI is a workspace URI. In that case, the method will return
a URI which, when handled, will make the editor open the workspace.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">target</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</td><td><div class="comment"><p>A uri that can be used on the client machine.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="env.createTelemetryLogger"></a><span class="ts" id=2584 data-target="#details-2584" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createTelemetryLogger</span><span>(</span><span class="ident">sender</span><span>: </span><a class="type-ref" href="#TelemetrySender">TelemetrySender</a>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#TelemetryLoggerOptions">TelemetryLoggerOptions</a><span>)</span><span>: </span><a class="type-ref" href="#TelemetryLogger">TelemetryLogger</a></span>
<div class="details collapse" id="details-2584">
<div class="comment"><p>Creates a new <a href="#TelemetryLogger">telemetry logger</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">sender</span><span>: </span><a class="type-ref" href="#TelemetrySender">TelemetrySender</a></td><td><div class="comment"><p>The telemetry sender that is used by the telemetry logger.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#TelemetryLoggerOptions">TelemetryLoggerOptions</a></td><td><div class="comment"><p>Options for the telemetry logger.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TelemetryLogger">TelemetryLogger</a></td><td><div class="comment"><p>A new telemetry logger</p>
</div></td></tr>
</table>
</div>
</div>



<a name="env.openExternal"></a><span class="ts" id=2588 data-target="#details-2588" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">openExternal</span><span>(</span><span class="ident">target</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-2588">
<div class="comment"><p>Opens a link externally using the default application. Depending on the
used scheme this can be:</p>
<ul>
<li>a browser (<code>http:</code>, <code>https:</code>)</li>
<li>a mail client (<code>mailto:</code>)</li>
<li>VSCode itself (<code>vscode:</code> from <code>vscode.env.uriScheme</code>)</li>
</ul>
<p><em>Note</em> that <a href="#window.showTextDocument">showTextDocument</a> is the right
way to open a text document inside the editor, not this function.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">target</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri that should be opened.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>A promise indicating if open was successful.</p>
</div></td></tr>
</table>
</div>
</div>

## extensions



<div class="comment"><p>Namespace for dealing with installed extensions. Extensions are represented
by an <a href="#Extension">Extension</a>-interface which enables reflection on them.</p>
<p>Extension writers can provide APIs to other extensions by returning their API public
surface from the <code>activate</code>-call.</p>
<pre class="shiki" data-lang="javascript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">export</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> function</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26"> activate</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">context</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">ExtensionContext</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">  let</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> api</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = {</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">    sum</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">a</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">b</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">      return</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> a</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> + </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">b</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    },</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">    mul</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">a</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">b</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">      return</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> a</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> * </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">b</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  };</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // 'export' public api-surface</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">  return</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> api</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span>
<span class="line"></span></code></pre>
<p>When depending on the API of another extension add an <code>extensionDependencies</code>-entry
to <code>package.json</code>, and use the <a href="#extensions.getExtension">getExtension</a>-function
and the <a href="#Extension.exports">exports</a>-property, like below:</p>
<pre class="shiki" data-lang="javascript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">let</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> mathExt</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">extensions</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">getExtension</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'genius.math'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">let</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> importedApi</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">mathExt</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">exports</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">importedApi</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">mul</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">42</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">1</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">));</span></span>
<span class="line"></span></code></pre>
</div>

#### Variables



<a name="extensions.all"></a><span class="ts" id=4250 data-target="#details-4250" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">all</span><span>: </span>readonly <a class="type-ref" href="#Extension&amp;lt;T&amp;gt;">Extension</a>&lt;<span class="type-intrinsic">any</span>&gt;[]</span>
<div class="details collapse" id="details-4250">
<div class="comment"><p>All extensions currently known to the system.</p>
</div>
</div>

#### Events



<a name="extensions.onDidChange"></a><span class="ts" id=4251 data-target="#details-4251" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChange</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-4251">
<div class="comment"><p>An event which fires when <code>extensions.all</code> changes. This can happen when extensions are
installed, uninstalled, enabled or disabled.</p>
</div>
</div>

#### Functions



<a name="extensions.getExtension"></a><span class="ts" id=4247 data-target="#details-4247" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getExtension</span><span>&lt;</span>T<span>&gt;</span><span>(</span><span class="ident">extensionId</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#Extension&amp;lt;T&amp;gt;">Extension</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-4247">
<div class="comment"><p>Get an extension by its full identifier in the form of: <code>publisher.name</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">extensionId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>An extension identifier.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Extension&amp;lt;T&amp;gt;">Extension</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>An extension or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>

## l10n



<div class="comment"><p>Namespace for localization-related functionality in the extension API. To use this properly,
you must have <code>l10n</code> defined in your extension manifest and have bundle.l10n.<language>.json files.
For more information on how to generate bundle.l10n.<language>.json files, check out the
<a href="https://github.com/microsoft/vscode-l10n">vscode-l10n repo</a>.</p>
<p>Note: Built-in extensions (for example, Git, TypeScript Language Features, GitHub Authentication)
are excluded from the <code>l10n</code> property requirement. In other words, they do not need to specify
a <code>l10n</code> in the extension manifest because their translated strings come from Language Packs.</p>
</div>

#### Variables



<a name="l10n.bundle"></a><span class="ts" id=4413 data-target="#details-4413" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">bundle</span><span>: </span> &#124; <span class="type-intrinsic">undefined</span></span>
<div class="details collapse" id="details-4413">
<div class="comment"><p>The bundle of localized strings that have been loaded for the extension.
It&#39;s undefined if no bundle has been loaded. The bundle is typically not loaded if
there was no bundle found or when we are running with the default language.</p>
</div>
</div>



<a name="l10n.uri"></a><span class="ts" id=4417 data-target="#details-4417" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; <span class="type-intrinsic">undefined</span></span>
<div class="details collapse" id="details-4417">
<div class="comment"><p>The URI of the localization bundle that has been loaded for the extension.
It&#39;s undefined if no bundle has been loaded. The bundle is typically not loaded if
there was no bundle found or when we are running with the default language.</p>
</div>
</div>

#### Functions



<a name="l10n.t"></a><span class="ts" id=4401 data-target="#details-4401" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">t</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span>...</span><span class="ident">args</span><span>: </span>Array&lt;<span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span>&gt;<span>)</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4401">
<div class="comment"><p>Marks a string for localization. If a localized bundle is available for the language specified by
<a href="#env.language">env.language</a> and the bundle has a localized value for this message, then that localized
value will be returned (with injected <a href="#l10n.t.args">args</a> values for any templated values).</p>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">l10n</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">t</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Hello {0}!'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'World'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to localize. Supports index templating where strings like <code>{0}</code> and <code>{1}</code> are
replaced by the item at that index in the <a href="#l10n.t.args">args</a> array.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">args</span><span>: </span>Array&lt;<span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>The arguments to be used in the localized string. The index of the argument is used to
match the template placeholder in the localized string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">string</span></td><td><div class="comment"><p>localized string with injected arguments.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="l10n.t"></a><span class="ts" id=4404 data-target="#details-4404" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">t</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">args</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span>&gt;<span>)</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4404">
<div class="comment"><p>Marks a string for localization. If a localized bundle is available for the language specified by
<a href="#env.language">env.language</a> and the bundle has a localized value for this message, then that localized
value will be returned (with injected <a href="#l10n.t.args">args</a> values for any templated values).</p>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">l10n</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">t</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Hello {name}'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, { </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">name:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'Erich'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to localize. Supports named templating where strings like <code>{foo}</code> and <code>{bar}</code> are
replaced by the value in the Record for that key (foo, bar, etc).</p>
</div></td></tr>
<tr><td><span class="ident">args</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>The arguments to be used in the localized string. The name of the key in the record is used to
match the template placeholder in the localized string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">string</span></td><td><div class="comment"><p>localized string with injected arguments.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="l10n.t"></a><span class="ts" id=4407 data-target="#details-4407" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">t</span><span>(</span><span class="ident">options</span><span>: </span>{args: Array&lt;<span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span>&gt; &#124; <span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span>&gt;, comment: <span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">string</span>[], message: <span class="type-intrinsic">string</span>}<span>)</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4407">
<div class="comment"><p>Marks a string for localization. If a localized bundle is available for the language specified by
<a href="#env.language">env.language</a> and the bundle has a localized value for this message, then that localized
value will be returned (with injected args values for any templated values).</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>: </span>{args: Array&lt;<span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span>&gt; &#124; <span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span>&gt;, comment: <span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">string</span>[], message: <span class="type-intrinsic">string</span>}</td><td><div class="comment"><p>The options to use when localizing the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">string</span></td><td><div class="comment"><p>localized string with injected arguments.</p>
</div></td></tr>
</table>
</div>
</div>

## languages



<div class="comment"><p>Namespace for participating in language-specific editor <a href="https://code.visualstudio.com/docs/editor/editingevolved">features</a>,
like IntelliSense, code actions, diagnostics etc.</p>
<p>Many programming languages exist and there is huge variety in syntaxes, semantics, and paradigms. Despite that, features
like automatic word-completion, code navigation, or code checking have become popular across different tools for different
programming languages.</p>
<p>The editor provides an API that makes it simple to provide such common features by having all UI and actions already in place and
by allowing you to participate by providing data only. For instance, to contribute a hover all you have to do is provide a function
that can be called with a <a href="#TextDocument">TextDocument</a> and a <a href="#Position">Position</a> returning hover info. The rest, like tracking the
mouse, positioning the hover, keeping the hover stable etc. is taken care of by the editor.</p>
<pre class="shiki" data-lang="javascript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">languages</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">registerHoverProvider</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'javascript'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, {</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  provideHover</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">document</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">position</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">token</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">    return</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> new</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26"> Hover</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'I am a hover!'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"></span></code></pre>
<p>Registration is done using a <a href="#DocumentSelector">document selector</a> which is either a language id, like <code>javascript</code> or
a more complex <a href="#DocumentFilter">filter</a> like <code>{ language: &#39;typescript&#39;, scheme: &#39;file&#39; }</code>. Matching a document against such
a selector will result in a <a href="#languages.match">score</a> that is used to determine if and how a provider shall be used. When
scores are equal the provider that came last wins. For features that allow full arity, like <a href="#languages.registerHoverProvider">hover</a>,
the score is only checked to be <code>&gt;0</code>, for other features, like <a href="#languages.registerCompletionItemProvider">IntelliSense</a> the
score is used for determining the order in which providers are asked to participate.</p>
</div>

#### Events



<a name="languages.onDidChangeDiagnostics"></a><span class="ts" id=3663 data-target="#details-3663" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeDiagnostics</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#DiagnosticChangeEvent">DiagnosticChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-3663">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the global set of diagnostics changes. This is
newly added and removed diagnostics.</p>
</div>
</div>

#### Functions



<a name="languages.createDiagnosticCollection"></a><span class="ts" id=3512 data-target="#details-3512" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createDiagnosticCollection</span><span>(</span><span class="ident">name</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#DiagnosticCollection">DiagnosticCollection</a></span>
<div class="details collapse" id="details-3512">
<div class="comment"><p>Create a diagnostics collection.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">name</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The <a href="#DiagnosticCollection.name">name</a> of the collection.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DiagnosticCollection">DiagnosticCollection</a></td><td><div class="comment"><p>A new diagnostic collection.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.createLanguageStatusItem"></a><span class="ts" id=3515 data-target="#details-3515" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createLanguageStatusItem</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a><span>)</span><span>: </span><a class="type-ref" href="#LanguageStatusItem">LanguageStatusItem</a></span>
<div class="details collapse" id="details-3515">
<div class="comment"><p>Creates a new <a href="#LanguageStatusItem">language status item</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The identifier of the item.</p>
</div></td></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>The document selector that defines for what editors the item shows.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageStatusItem">LanguageStatusItem</a></td><td><div class="comment"><p>A new language status item.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.getDiagnostics"></a><span class="ts" id=3508 data-target="#details-3508" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getDiagnostics</span><span>(</span><span class="ident">resource</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#Diagnostic">Diagnostic</a>[]</span>
<div class="details collapse" id="details-3508">
<div class="comment"><p>Get all diagnostics for a given resource.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">resource</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Diagnostic">Diagnostic</a>[]</td><td><div class="comment"><p>An array of <a href="#Diagnostic">diagnostics</a> objects or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.getDiagnostics"></a><span class="ts" id=3510 data-target="#details-3510" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getDiagnostics</span><span>(</span><span>)</span><span>: </span>Array&lt;[<a class="type-ref" href="#Uri">Uri</a>, <a class="type-ref" href="#Diagnostic">Diagnostic</a>[]]&gt;</span>
<div class="details collapse" id="details-3510">
<div class="comment"><p>Get all diagnostics.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td>Array&lt;[<a class="type-ref" href="#Uri">Uri</a>, <a class="type-ref" href="#Diagnostic">Diagnostic</a>[]]&gt;</td><td><div class="comment"><p>An array of uri-diagnostics tuples or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.getLanguages"></a><span class="ts" id=3498 data-target="#details-3498" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getLanguages</span><span>(</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>[]&gt;</span>
<div class="details collapse" id="details-3498">
<div class="comment"><p>Return the identifiers of all known languages.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>[]&gt;</td><td><div class="comment"><p>Promise resolving to an array of identifier strings.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.match"></a><span class="ts" id=3504 data-target="#details-3504" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">match</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a><span>)</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3504">
<div class="comment"><p>Compute the match between a document <a href="#DocumentSelector">selector</a> and a document. Values
greater than zero mean the selector matches the document.</p>
<p>A match is computed according to these rules:</p>
<ol>
<li>When <a href="#DocumentSelector">DocumentSelector</a> is an array, compute the match for each contained <code>DocumentFilter</code> or language identifier and take the maximum value.</li>
<li>A string will be desugared to become the <code>language</code>-part of a <a href="#DocumentFilter">DocumentFilter</a>, so <code>&quot;fooLang&quot;</code> is like <code>{ language: &quot;fooLang&quot; }</code>.</li>
<li>A <a href="#DocumentFilter">DocumentFilter</a> will be matched against the document by comparing its parts with the document. The following rules apply:<ol>
<li>When the <code>DocumentFilter</code> is empty (<code>{}</code>) the result is <code>0</code></li>
<li>When <code>scheme</code>, <code>language</code>, <code>pattern</code>, or <code>notebook</code> are defined but one doesn&#39;t match, the result is <code>0</code></li>
<li>Matching against <code>*</code> gives a score of <code>5</code>, matching via equality or via a glob-pattern gives a score of <code>10</code></li>
<li>The result is the maximum value of each match</li>
</ol>
</li>
</ol>
<p>Samples:</p>
<pre class="shiki" data-lang="js" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// default document from disk (file-scheme)</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">; </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">//'file:///my/file.js'</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">languageId</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">; </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 'javascript'</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">match</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'javascript'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 10;</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">match</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">language:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'javascript'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> }, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 10;</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">match</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">language:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'javascript'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">scheme:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'file'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> }, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 10;</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">match</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'*'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 5</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">match</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'fooLang'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 0</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">match</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">([</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'fooLang'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'*'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">], </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 5</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// virtual document, e.g. from git-index</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">; </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 'git:/my/file.js'</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">languageId</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">; </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 'javascript'</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">match</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'javascript'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 10;</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">match</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">language:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'javascript'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">scheme:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'git'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> }, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 10;</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">match</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'*'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 5</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// notebook cell document</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">; </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// `vscode-notebook-cell:///my/notebook.ipynb#gl65s2pmha`;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">languageId</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">; </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 'python'</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">match</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">notebookType:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'jupyter-notebook'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> }, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 10</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">match</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">notebookType:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'fooNotebook'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">language:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'python'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> }, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 0</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">match</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">language:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'python'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> }, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 10</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">match</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">notebookType:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> '*'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> }, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// 5</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A document selector.</p>
</div></td></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>A text document.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A number <code>&gt;0</code> when the selector matches and <code>0</code> when the selector does not match.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerCallHierarchyProvider"></a><span class="ts" id=3638 data-target="#details-3638" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerCallHierarchyProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#CallHierarchyProvider">CallHierarchyProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3638">
<div class="comment"><p>Register a call hierarchy provider.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#CallHierarchyProvider">CallHierarchyProvider</a></td><td><div class="comment"><p>A call hierarchy provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerCodeActionsProvider"></a><span class="ts" id=3528 data-target="#details-3528" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerCodeActionsProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#CodeActionProvider&amp;lt;T&amp;gt;">CodeActionProvider</a>, <span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#CodeActionProviderMetadata">CodeActionProviderMetadata</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3528">
<div class="comment"><p>Register a code action provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#CodeActionProvider&amp;lt;T&amp;gt;">CodeActionProvider</a></td><td><div class="comment"><p>A code action provider.</p>
</div></td></tr>
<tr><td><span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#CodeActionProviderMetadata">CodeActionProviderMetadata</a></td><td><div class="comment"><p>Metadata about the kind of code actions the provider provides.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerCodeLensProvider"></a><span class="ts" id=3533 data-target="#details-3533" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerCodeLensProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#CodeLensProvider&amp;lt;T&amp;gt;">CodeLensProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3533">
<div class="comment"><p>Register a code lens provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#CodeLensProvider&amp;lt;T&amp;gt;">CodeLensProvider</a></td><td><div class="comment"><p>A code lens provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerColorProvider"></a><span class="ts" id=3622 data-target="#details-3622" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerColorProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentColorProvider">DocumentColorProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3622">
<div class="comment"><p>Register a color provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentColorProvider">DocumentColorProvider</a></td><td><div class="comment"><p>A color provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerCompletionItemProvider"></a><span class="ts" id=3519 data-target="#details-3519" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerCompletionItemProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#CompletionItemProvider&amp;lt;T&amp;gt;">CompletionItemProvider</a>, <span>...</span><span class="ident">triggerCharacters</span><span>: </span><span class="type-intrinsic">string</span>[]<span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3519">
<div class="comment"><p>Register a completion provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are sorted
by their <a href="#languages.match">score</a> and groups of equal score are sequentially asked for
completion items. The process stops when one or many providers of a group return a
result. A failing provider (rejected promise or exception) will not fail the whole
operation.</p>
<p>A completion item provider can be associated with a set of <code>triggerCharacters</code>. When trigger
characters are being typed, completions are requested but only from providers that registered
the typed character. Because of that trigger characters should be different than <a href="#LanguageConfiguration.wordPattern">word characters</a>,
a common trigger character is <code>.</code> to trigger member completions.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#CompletionItemProvider&amp;lt;T&amp;gt;">CompletionItemProvider</a></td><td><div class="comment"><p>A completion provider.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">triggerCharacters</span><span>: </span><span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>Trigger completion when the user types one of the characters.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerDeclarationProvider"></a><span class="ts" id=3549 data-target="#details-3549" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDeclarationProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#DeclarationProvider">DeclarationProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3549">
<div class="comment"><p>Register a declaration provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#DeclarationProvider">DeclarationProvider</a></td><td><div class="comment"><p>A declaration provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerDefinitionProvider"></a><span class="ts" id=3537 data-target="#details-3537" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDefinitionProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#DefinitionProvider">DefinitionProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3537">
<div class="comment"><p>Register a definition provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#DefinitionProvider">DefinitionProvider</a></td><td><div class="comment"><p>A definition provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerDocumentDropEditProvider"></a><span class="ts" id=3650 data-target="#details-3650" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDocumentDropEditProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentDropEditProvider&amp;lt;T&amp;gt;">DocumentDropEditProvider</a>, <span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#DocumentDropEditProviderMetadata">DocumentDropEditProviderMetadata</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3650">
<div class="comment"><p>Registers a new <a href="#DocumentDropEditProvider">DocumentDropEditProvider</a>.</p>
<p>Multiple drop providers can be registered for a language. When dropping content into an editor, all
registered providers for the editor&#39;s language will be invoked based on the mimetypes they handle
as specified by their <a href="#DocumentDropEditProviderMetadata">DocumentDropEditProviderMetadata</a>.</p>
<p>Each provider can return one or more <a href="#DocumentDropEdit">DocumentDropEdits</a>. The edits are sorted
using the <a href="#DocumentDropEdit.yieldTo">DocumentDropEdit.yieldTo</a> property. By default the first edit will be applied. If there
are any additional edits, these will be shown to the user as selectable drop options in the drop widget.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider applies to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentDropEditProvider&amp;lt;T&amp;gt;">DocumentDropEditProvider</a></td><td><div class="comment"><p>A drop provider.</p>
</div></td></tr>
<tr><td><span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#DocumentDropEditProviderMetadata">DocumentDropEditProviderMetadata</a></td><td><div class="comment"><p>Additional metadata about the provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when disposed of.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerDocumentFormattingEditProvider"></a><span class="ts" id=3595 data-target="#details-3595" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDocumentFormattingEditProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentFormattingEditProvider">DocumentFormattingEditProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3595">
<div class="comment"><p>Register a formatting provider for a document.</p>
<p>Multiple providers can be registered for a language. In that case providers are sorted
by their <a href="#languages.match">score</a> and the best-matching provider is used. Failure
of the selected provider will cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentFormattingEditProvider">DocumentFormattingEditProvider</a></td><td><div class="comment"><p>A document formatting edit provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerDocumentHighlightProvider"></a><span class="ts" id=3565 data-target="#details-3565" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDocumentHighlightProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentHighlightProvider">DocumentHighlightProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3565">
<div class="comment"><p>Register a document highlight provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are sorted
by their <a href="#languages.match">score</a> and groups sequentially asked for document highlights.
The process stops when a provider returns a <code>non-falsy</code> or <code>non-failure</code> result.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentHighlightProvider">DocumentHighlightProvider</a></td><td><div class="comment"><p>A document highlight provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerDocumentLinkProvider"></a><span class="ts" id=3618 data-target="#details-3618" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDocumentLinkProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentLinkProvider&amp;lt;T&amp;gt;">DocumentLinkProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3618">
<div class="comment"><p>Register a document link provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentLinkProvider&amp;lt;T&amp;gt;">DocumentLinkProvider</a></td><td><div class="comment"><p>A document link provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerDocumentPasteEditProvider"></a><span class="ts" id=3655 data-target="#details-3655" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDocumentPasteEditProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentPasteEditProvider&amp;lt;T&amp;gt;">DocumentPasteEditProvider</a>, <span class="ident">metadata</span><span>: </span><a class="type-ref" href="#DocumentPasteProviderMetadata">DocumentPasteProviderMetadata</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3655">
<div class="comment"><p>Registers a new <a href="#DocumentPasteEditProvider">DocumentPasteEditProvider</a>.</p>
<p>Multiple providers can be registered for a language. All registered providers for a language will be invoked
for copy and paste operations based on their handled mimetypes as specified by the <a href="#DocumentPasteProviderMetadata">DocumentPasteProviderMetadata</a>.</p>
<p>For <a href="#DocumentPasteEditProvider.prepareDocumentPaste">copy operations</a>, changes to the <a href="#DataTransfer">DataTransfer</a>
made by each provider will be merged into a single <a href="#DataTransfer">DataTransfer</a> that is used to populate the clipboard.</p>
<p>For [DocumentPasteEditProvider.providerDocumentPasteEdits paste operations](#DocumentPasteEditProvider.providerDocumentPasteEdits paste operations), each provider will be invoked
and can return one or more <a href="#DocumentPasteEdit">DocumentPasteEdits</a>. The edits are sorted using
the <a href="#DocumentPasteEdit.yieldTo">DocumentPasteEdit.yieldTo</a> property. By default the first edit will be applied
and the rest of the edits will be shown to the user as selectable paste options in the paste widget.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider applies to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentPasteEditProvider&amp;lt;T&amp;gt;">DocumentPasteEditProvider</a></td><td><div class="comment"><p>A paste editor provider.</p>
</div></td></tr>
<tr><td><span class="ident">metadata</span><span>: </span><a class="type-ref" href="#DocumentPasteProviderMetadata">DocumentPasteProviderMetadata</a></td><td><div class="comment"><p>Additional metadata about the provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when disposed of.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerDocumentRangeFormattingEditProvider"></a><span class="ts" id=3599 data-target="#details-3599" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDocumentRangeFormattingEditProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentRangeFormattingEditProvider">DocumentRangeFormattingEditProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3599">
<div class="comment"><p>Register a formatting provider for a document range.</p>
<p><em>Note:</em> A document range provider is also a <a href="#DocumentFormattingEditProvider">document formatter</a>
which means there is no need to <a href="#languages.registerDocumentFormattingEditProvider">register</a> a document
formatter when also registering a range provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are sorted
by their <a href="#languages.match">score</a> and the best-matching provider is used. Failure
of the selected provider will cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentRangeFormattingEditProvider">DocumentRangeFormattingEditProvider</a></td><td><div class="comment"><p>A document range formatting edit provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerDocumentRangeSemanticTokensProvider"></a><span class="ts" id=3590 data-target="#details-3590" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDocumentRangeSemanticTokensProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentRangeSemanticTokensProvider">DocumentRangeSemanticTokensProvider</a>, <span class="ident">legend</span><span>: </span><a class="type-ref" href="#SemanticTokensLegend">SemanticTokensLegend</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3590">
<div class="comment"><p>Register a semantic tokens provider for a document range.</p>
<p><em>Note:</em> If a document has both a <code>DocumentSemanticTokensProvider</code> and a <code>DocumentRangeSemanticTokensProvider</code>,
the range provider will be invoked only initially, for the time in which the full document provider takes
to resolve the first request. Once the full document provider resolves the first request, the semantic tokens
provided via the range provider will be discarded and from that point forward, only the document provider
will be used.</p>
<p>Multiple providers can be registered for a language. In that case providers are sorted
by their <a href="#languages.match">score</a> and the best-matching provider is used. Failure
of the selected provider will cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentRangeSemanticTokensProvider">DocumentRangeSemanticTokensProvider</a></td><td><div class="comment"><p>A document range semantic tokens provider.</p>
</div></td></tr>
<tr><td><span class="ident">legend</span><span>: </span><a class="type-ref" href="#SemanticTokensLegend">SemanticTokensLegend</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerDocumentSemanticTokensProvider"></a><span class="ts" id=3585 data-target="#details-3585" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDocumentSemanticTokensProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentSemanticTokensProvider">DocumentSemanticTokensProvider</a>, <span class="ident">legend</span><span>: </span><a class="type-ref" href="#SemanticTokensLegend">SemanticTokensLegend</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3585">
<div class="comment"><p>Register a semantic tokens provider for a whole document.</p>
<p>Multiple providers can be registered for a language. In that case providers are sorted
by their <a href="#languages.match">score</a> and the best-matching provider is used. Failure
of the selected provider will cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentSemanticTokensProvider">DocumentSemanticTokensProvider</a></td><td><div class="comment"><p>A document semantic tokens provider.</p>
</div></td></tr>
<tr><td><span class="ident">legend</span><span>: </span><a class="type-ref" href="#SemanticTokensLegend">SemanticTokensLegend</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerDocumentSymbolProvider"></a><span class="ts" id=3569 data-target="#details-3569" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerDocumentSymbolProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentSymbolProvider">DocumentSymbolProvider</a>, <span class="ident">metaData</span><span>?</span><span>: </span><a class="type-ref" href="#DocumentSymbolProviderMetadata">DocumentSymbolProviderMetadata</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3569">
<div class="comment"><p>Register a document symbol provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#DocumentSymbolProvider">DocumentSymbolProvider</a></td><td><div class="comment"><p>A document symbol provider.</p>
</div></td></tr>
<tr><td><span class="ident">metaData</span><span>?</span><span>: </span><a class="type-ref" href="#DocumentSymbolProviderMetadata">DocumentSymbolProviderMetadata</a></td><td><div class="comment"><p>metadata about the provider</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerEvaluatableExpressionProvider"></a><span class="ts" id=3557 data-target="#details-3557" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerEvaluatableExpressionProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#EvaluatableExpressionProvider">EvaluatableExpressionProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3557">
<div class="comment"><p>Register a provider that locates evaluatable expressions in text documents.
The editor will evaluate the expression in the active debug session and will show the result in the debug hover.</p>
<p>If multiple providers are registered for a language an arbitrary provider will be used.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#EvaluatableExpressionProvider">EvaluatableExpressionProvider</a></td><td><div class="comment"><p>An evaluatable expression provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerFoldingRangeProvider"></a><span class="ts" id=3630 data-target="#details-3630" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerFoldingRangeProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#FoldingRangeProvider">FoldingRangeProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3630">
<div class="comment"><p>Register a folding range provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged.
If multiple folding ranges start at the same position, only the range of the first registered provider is used.
If a folding range overlaps with an other range that has a smaller position, it is also ignored.</p>
<p>A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#FoldingRangeProvider">FoldingRangeProvider</a></td><td><div class="comment"><p>A folding range provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerHoverProvider"></a><span class="ts" id=3553 data-target="#details-3553" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerHoverProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#HoverProvider">HoverProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3553">
<div class="comment"><p>Register a hover provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#HoverProvider">HoverProvider</a></td><td><div class="comment"><p>A hover provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerImplementationProvider"></a><span class="ts" id=3541 data-target="#details-3541" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerImplementationProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#ImplementationProvider">ImplementationProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3541">
<div class="comment"><p>Register an implementation provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#ImplementationProvider">ImplementationProvider</a></td><td><div class="comment"><p>An implementation provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerInlayHintsProvider"></a><span class="ts" id=3626 data-target="#details-3626" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerInlayHintsProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#InlayHintsProvider&amp;lt;T&amp;gt;">InlayHintsProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3626">
<div class="comment"><p>Register a inlay hints provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#InlayHintsProvider&amp;lt;T&amp;gt;">InlayHintsProvider</a></td><td><div class="comment"><p>An inlay hints provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerInlineCompletionItemProvider"></a><span class="ts" id=3524 data-target="#details-3524" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerInlineCompletionItemProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#InlineCompletionItemProvider">InlineCompletionItemProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3524">
<div class="comment"><p>Registers an inline completion provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#InlineCompletionItemProvider">InlineCompletionItemProvider</a></td><td><div class="comment"><p>An inline completion provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerInlineValuesProvider"></a><span class="ts" id=3561 data-target="#details-3561" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerInlineValuesProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#InlineValuesProvider">InlineValuesProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3561">
<div class="comment"><p>Register a provider that returns data for the debugger&#39;s &#39;inline value&#39; feature.
Whenever the generic debugger has stopped in a source file, providers registered for the language of the file
are called to return textual data that will be shown in the editor at the end of lines.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#InlineValuesProvider">InlineValuesProvider</a></td><td><div class="comment"><p>An inline values provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerLinkedEditingRangeProvider"></a><span class="ts" id=3646 data-target="#details-3646" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerLinkedEditingRangeProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#LinkedEditingRangeProvider">LinkedEditingRangeProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3646">
<div class="comment"><p>Register a linked editing range provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are sorted
by their <a href="#languages.match">score</a> and the best-matching provider that has a result is used. Failure
of the selected provider will cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#LinkedEditingRangeProvider">LinkedEditingRangeProvider</a></td><td><div class="comment"><p>A linked editing range provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerOnTypeFormattingEditProvider"></a><span class="ts" id=3603 data-target="#details-3603" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerOnTypeFormattingEditProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#OnTypeFormattingEditProvider">OnTypeFormattingEditProvider</a>, <span class="ident">firstTriggerCharacter</span><span>: </span><span class="type-intrinsic">string</span>, <span>...</span><span class="ident">moreTriggerCharacter</span><span>: </span><span class="type-intrinsic">string</span>[]<span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3603">
<div class="comment"><p>Register a formatting provider that works on type. The provider is active when the user enables the setting <code>editor.formatOnType</code>.</p>
<p>Multiple providers can be registered for a language. In that case providers are sorted
by their <a href="#languages.match">score</a> and the best-matching provider is used. Failure
of the selected provider will cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#OnTypeFormattingEditProvider">OnTypeFormattingEditProvider</a></td><td><div class="comment"><p>An on type formatting edit provider.</p>
</div></td></tr>
<tr><td><span class="ident">firstTriggerCharacter</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A character on which formatting should be triggered, like <code>}</code>.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">moreTriggerCharacter</span><span>: </span><span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>More trigger characters.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerReferenceProvider"></a><span class="ts" id=3577 data-target="#details-3577" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerReferenceProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#ReferenceProvider">ReferenceProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3577">
<div class="comment"><p>Register a reference provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#ReferenceProvider">ReferenceProvider</a></td><td><div class="comment"><p>A reference provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerRenameProvider"></a><span class="ts" id=3581 data-target="#details-3581" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerRenameProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#RenameProvider">RenameProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3581">
<div class="comment"><p>Register a rename provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are sorted
by their <a href="#languages.match">score</a> and asked in sequence. The first provider producing a result
defines the result of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#RenameProvider">RenameProvider</a></td><td><div class="comment"><p>A rename provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerSelectionRangeProvider"></a><span class="ts" id=3634 data-target="#details-3634" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerSelectionRangeProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#SelectionRangeProvider">SelectionRangeProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3634">
<div class="comment"><p>Register a selection range provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#SelectionRangeProvider">SelectionRangeProvider</a></td><td><div class="comment"><p>A selection range provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerSignatureHelpProvider"></a><span class="ts" id=3609 data-target="#details-3609" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerSignatureHelpProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#SignatureHelpProvider">SignatureHelpProvider</a>, <span>...</span><span class="ident">triggerCharacters</span><span>: </span><span class="type-intrinsic">string</span>[]<span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3609">
<div class="comment"><p>Register a signature help provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are sorted
by their <a href="#languages.match">score</a> and called sequentially until a provider returns a
valid result.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#SignatureHelpProvider">SignatureHelpProvider</a></td><td><div class="comment"><p>A signature help provider.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">triggerCharacters</span><span>: </span><span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>Trigger signature help when the user types one of the characters, like <code>,</code> or <code>(</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerSignatureHelpProvider"></a><span class="ts" id=3613 data-target="#details-3613" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerSignatureHelpProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#SignatureHelpProvider">SignatureHelpProvider</a>, <span class="ident">metadata</span><span>: </span><a class="type-ref" href="#SignatureHelpProviderMetadata">SignatureHelpProviderMetadata</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3613">
<div class="comment"><p><em>See also</em>
<a href="#languages.registerSignatureHelpProvider">languages.registerSignatureHelpProvider</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#SignatureHelpProvider">SignatureHelpProvider</a></td><td><div class="comment"><p>A signature help provider.</p>
</div></td></tr>
<tr><td><span class="ident">metadata</span><span>: </span><a class="type-ref" href="#SignatureHelpProviderMetadata">SignatureHelpProviderMetadata</a></td><td><div class="comment"><p>Information about the provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerTypeDefinitionProvider"></a><span class="ts" id=3545 data-target="#details-3545" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerTypeDefinitionProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#TypeDefinitionProvider">TypeDefinitionProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3545">
<div class="comment"><p>Register a type definition provider.</p>
<p>Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#TypeDefinitionProvider">TypeDefinitionProvider</a></td><td><div class="comment"><p>A type definition provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerTypeHierarchyProvider"></a><span class="ts" id=3642 data-target="#details-3642" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerTypeHierarchyProvider</span><span>(</span><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#TypeHierarchyProvider">TypeHierarchyProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3642">
<div class="comment"><p>Register a type hierarchy provider.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></td><td><div class="comment"><p>A selector that defines the documents this provider is applicable to.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#TypeHierarchyProvider">TypeHierarchyProvider</a></td><td><div class="comment"><p>A type hierarchy provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.registerWorkspaceSymbolProvider"></a><span class="ts" id=3574 data-target="#details-3574" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerWorkspaceSymbolProvider</span><span>(</span><span class="ident">provider</span><span>: </span><a class="type-ref" href="#WorkspaceSymbolProvider&amp;lt;T&amp;gt;">WorkspaceSymbolProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3574">
<div class="comment"><p>Register a workspace symbol provider.</p>
<p>Multiple providers can be registered. In that case providers are asked in parallel and
the results are merged. A failing provider (rejected promise or exception) will not cause
a failure of the whole operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#WorkspaceSymbolProvider&amp;lt;T&amp;gt;">WorkspaceSymbolProvider</a></td><td><div class="comment"><p>A workspace symbol provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.setLanguageConfiguration"></a><span class="ts" id=3660 data-target="#details-3660" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">setLanguageConfiguration</span><span>(</span><span class="ident">language</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">configuration</span><span>: </span><a class="type-ref" href="#LanguageConfiguration">LanguageConfiguration</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3660">
<div class="comment"><p>Set a <a href="#LanguageConfiguration">language configuration</a> for a language.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">language</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A language identifier like <code>typescript</code>.</p>
</div></td></tr>
<tr><td><span class="ident">configuration</span><span>: </span><a class="type-ref" href="#LanguageConfiguration">LanguageConfiguration</a></td><td><div class="comment"><p>Language configuration.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unsets this configuration.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="languages.setTextDocumentLanguage"></a><span class="ts" id=3500 data-target="#details-3500" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">setTextDocumentLanguage</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">languageId</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextDocument">TextDocument</a>&gt;</span>
<div class="details collapse" id="details-3500">
<div class="comment"><p>Set (and change) the <a href="#TextDocument.languageId">language</a> that is associated
with the given document.</p>
<p><em>Note</em> that calling this function will trigger the <a href="#workspace.onDidCloseTextDocument">onDidCloseTextDocument</a> event
followed by the <a href="#workspace.onDidOpenTextDocument">onDidOpenTextDocument</a> event.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document which language is to be changed</p>
</div></td></tr>
<tr><td><span class="ident">languageId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The new language identifier.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextDocument">TextDocument</a>&gt;</td><td><div class="comment"><p>A thenable that resolves with the updated document.</p>
</div></td></tr>
</table>
</div>
</div>

## lm



<div class="comment"><p>Namespace for language model related functionality.</p>
</div>

#### Variables



<a name="lm.tools"></a><span class="ts" id=5098 data-target="#details-5098" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tools</span><span>: </span>readonly <a class="type-ref" href="#LanguageModelToolInformation">LanguageModelToolInformation</a>[]</span>
<div class="details collapse" id="details-5098">
<div class="comment"><p>A list of all available tools that were registered by all extensions using <a href="#lm.registerTool">lm.registerTool</a>. They can be called
with <a href="#lm.invokeTool">lm.invokeTool</a> with input that match their declared <code>inputSchema</code>.</p>
</div>
</div>

#### Events



<a name="lm.onDidChangeChatModels"></a><span class="ts" id=5097 data-target="#details-5097" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeChatModels</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-5097">
<div class="comment"><p>An event that is fired when the set of available chat models changes.</p>
</div>
</div>

#### Functions



<a name="lm.invokeTool"></a><span class="ts" id=5085 data-target="#details-5085" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">invokeTool</span><span>(</span><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>: </span><a class="type-ref" href="#LanguageModelToolInvocationOptions&amp;lt;T&amp;gt;">LanguageModelToolInvocationOptions</a>&lt;<span class="type-intrinsic">object</span>&gt;, <span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#LanguageModelToolResult">LanguageModelToolResult</a>&gt;</span>
<div class="details collapse" id="details-5085">
<div class="comment"><p>Invoke a tool listed in <a href="#lm.tools">lm.tools</a> by name with the given input. The input will be validated against
the schema declared by the tool</p>
<p>A tool can be invoked by a chat participant, in the context of handling a chat request, or globally by any extension in
any custom flow.</p>
<p>In the former case, the caller shall pass the
<a href="#LanguageModelToolInvocationOptions.toolInvocationToken">toolInvocationToken</a>, which comes from a
<a href="#ChatRequest.toolInvocationToken">chat request</a>. This makes sure the chat UI shows the tool invocation for the
correct conversation.</p>
<p>A tool <a href="#LanguageModelToolResult">result</a> is an array of <a href="#LanguageModelTextPart">text-</a> and
<a href="#LanguageModelPromptTsxPart">prompt-tsx</a>-parts. If the tool caller is using <code>vscode/prompt-tsx</code>, it can
incorporate the response parts into its prompt using a <code>ToolResult</code>. If not, the parts can be passed along to the
<a href="#LanguageModelChat">LanguageModelChat</a> via a user message with a <a href="#LanguageModelToolResultPart">LanguageModelToolResultPart</a>.</p>
<p>If a chat participant wants to preserve tool results for requests across multiple turns, it can store tool results in
the <a href="#ChatResult.metadata">ChatResult.metadata</a> returned from the handler and retrieve them on the next turn from
<a href="#ChatResponseTurn.result">ChatResponseTurn.result</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The name of the tool to call.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#LanguageModelToolInvocationOptions&amp;lt;T&amp;gt;">LanguageModelToolInvocationOptions</a>&lt;<span class="type-intrinsic">object</span>&gt;</td><td><div class="comment"><p>The options to use when invoking the tool.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token. See <a href="#CancellationTokenSource">CancellationTokenSource</a> for how to create one.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#LanguageModelToolResult">LanguageModelToolResult</a>&gt;</td><td><div class="comment"><p>The result of the tool invocation.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="lm.registerLanguageModelChatProvider"></a><span class="ts" id=5094 data-target="#details-5094" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerLanguageModelChatProvider</span><span>(</span><span class="ident">vendor</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#LanguageModelChatProvider&amp;lt;T&amp;gt;">LanguageModelChatProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-5094">
<div class="comment"><p>Registers a <a href="#LanguageModelChatProvider">LanguageModelChatProvider</a>
Note: You must also define the language model chat provider via the <code>languageModelChatProviders</code> contribution point in package.json</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">vendor</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The vendor for this provider. Must be globally unique. An example is <code>copilot</code> or <code>openai</code>.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#LanguageModelChatProvider&amp;lt;T&amp;gt;">LanguageModelChatProvider</a></td><td><div class="comment"><p>The provider to register</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A disposable that unregisters the provider when disposed</p>
</div></td></tr>
</table>
</div>
</div>



<a name="lm.registerMcpServerDefinitionProvider"></a><span class="ts" id=5090 data-target="#details-5090" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerMcpServerDefinitionProvider</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#McpServerDefinitionProvider&amp;lt;T&amp;gt;">McpServerDefinitionProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-5090">
<div class="comment"><p>Registers a provider that publishes Model Context Protocol servers for the editor to
consume. This allows MCP servers to be dynamically provided to the editor in
addition to those the user creates in their configuration files.</p>
<p>Before calling this method, extensions must register the <code>contributes.mcpServerDefinitionProviders</code>
extension point with the corresponding <a href="#lm.registerMcpServerDefinitionProvider.id">id</a>, for example:</p>
<pre class="shiki" data-lang="js" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">    "contributes"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">        "mcpServerDefinitionProviders"</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> [</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">            {</span></span>
<span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">                "id"</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> "cool-cloud-registry.mcp-servers"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">                "label"</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> "Cool Cloud Registry"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">            }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">        ]</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    }</span></span></code></pre>
<p>When a new McpServerDefinitionProvider is available, the editor will, by default,
automatically invoke it to discover new servers and tools when a chat message is
submitted. To enable this flow, extensions should call
<code>registerMcpServerDefinitionProvider</code> during activation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The ID of the provider, which is unique to the extension.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#McpServerDefinitionProvider&amp;lt;T&amp;gt;">McpServerDefinitionProvider</a></td><td><div class="comment"><p>The provider to register</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A disposable that unregisters the provider when disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="lm.registerTool"></a><span class="ts" id=5080 data-target="#details-5080" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerTool</span><span>&lt;</span>T<span>&gt;</span><span>(</span><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">tool</span><span>: </span><a class="type-ref" href="#LanguageModelTool&amp;lt;T&amp;gt;">LanguageModelTool</a>&lt;<span class="type-ref">T</span>&gt;<span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-5080">
<div class="comment"><p>Register a LanguageModelTool. The tool must also be registered in the package.json <code>languageModelTools</code> contribution
point. A registered tool is available in the <a href="#lm.tools">lm.tools</a> list for any extension to see. But in order for it to
be seen by a language model, it must be passed in the list of available tools in <a href="#LanguageModelChatRequestOptions.tools">LanguageModelChatRequestOptions.tools</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">tool</span><span>: </span><a class="type-ref" href="#LanguageModelTool&amp;lt;T&amp;gt;">LanguageModelTool</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters the tool when disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="lm.selectChatModels"></a><span class="ts" id=5077 data-target="#details-5077" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selectChatModels</span><span>(</span><span class="ident">selector</span><span>?</span><span>: </span><a class="type-ref" href="#LanguageModelChatSelector">LanguageModelChatSelector</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#LanguageModelChat">LanguageModelChat</a>[]&gt;</span>
<div class="details collapse" id="details-5077">
<div class="comment"><p>Select chat models by a <a href="#LanguageModelChatSelector">selector</a>. This can yield multiple or no chat models and
extensions must handle these cases, esp. when no chat model exists, gracefully.</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> models</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">await</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">lm</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">selectChatModels</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">family:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'gpt-3.5-turbo'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">models</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">length</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> > </span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">0</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">    const</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> [</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1">first</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">] = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">models</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">    const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> response</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">await</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> first</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">sendRequest</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(...)</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">    // ...</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">} </span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">else</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">    // NO chat models available</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span></code></pre>
<p>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.
Keep in mind that the available set of models will change over time, but also that prompts may perform differently in
different models.</p>
<p><em>Note</em> that extensions can hold on to the results returned by this function and use them later. However, when the
<a href="#lm.onDidChangeChatModels">onDidChangeChatModels</a>-event is fired the list of chat models might have changed and extensions should re-query.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">selector</span><span>?</span><span>: </span><a class="type-ref" href="#LanguageModelChatSelector">LanguageModelChatSelector</a></td><td><div class="comment"><p>A chat model selector. When omitted all chat models are returned.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#LanguageModelChat">LanguageModelChat</a>[]&gt;</td><td><div class="comment"><p>An array of chat models, can be empty!</p>
</div></td></tr>
</table>
</div>
</div>

## notebooks



<div class="comment"><p>Namespace for notebooks.</p>
<p>The notebooks functionality is composed of three loosely coupled components:</p>
<ol>
<li><a href="#NotebookSerializer">NotebookSerializer</a> enable the editor to open, show, and save notebooks</li>
<li><a href="#NotebookController">NotebookController</a> own the execution of notebooks, e.g they create output from code cells.</li>
<li>NotebookRenderer present notebook output in the editor. They run in a separate context.</li>
</ol>
</div>

#### Functions



<a name="notebooks.createNotebookController"></a><span class="ts" id=3939 data-target="#details-3939" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createNotebookController</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">handler</span><span>?</span><span>: </span>(cells: <a class="type-ref" href="#NotebookCell">NotebookCell</a>[], notebook: <a class="type-ref" href="#NotebookDocument">NotebookDocument</a>, controller: <a class="type-ref" href="#NotebookController">NotebookController</a>) =&gt; <span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;<span>)</span><span>: </span><a class="type-ref" href="#NotebookController">NotebookController</a></span>
<div class="details collapse" id="details-3939">
<div class="comment"><p>Creates a new notebook controller.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Identifier of the controller. Must be unique per extension.</p>
</div></td></tr>
<tr><td><span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A notebook type for which this controller is for.</p>
</div></td></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The label of the controller.</p>
</div></td></tr>
<tr><td><span class="ident">handler</span><span>?</span><span>: </span>(cells: <a class="type-ref" href="#NotebookCell">NotebookCell</a>[], notebook: <a class="type-ref" href="#NotebookDocument">NotebookDocument</a>, controller: <a class="type-ref" href="#NotebookController">NotebookController</a>) =&gt; <span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>The execute-handler of the controller.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookController">NotebookController</a></td><td><div class="comment"><p>A new notebook controller.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="notebooks.createRendererMessaging"></a><span class="ts" id=3954 data-target="#details-3954" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createRendererMessaging</span><span>(</span><span class="ident">rendererId</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#NotebookRendererMessaging">NotebookRendererMessaging</a></span>
<div class="details collapse" id="details-3954">
<div class="comment"><p>Creates a new messaging instance used to communicate with a specific renderer.</p>
<ul>
<li><em>Note 1:</em> Extensions can only create renderer that they have defined in their <code>package.json</code>-file</li>
<li><em>Note 2:</em> A renderer only has access to messaging if <code>requiresMessaging</code> is set to <code>always</code> or <code>optional</code> in
its <code>notebookRenderer</code> contribution.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">rendererId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The renderer ID to communicate with</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookRendererMessaging">NotebookRendererMessaging</a></td><td><div class="comment"><p>A new notebook renderer messaging object.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="notebooks.registerNotebookCellStatusBarItemProvider"></a><span class="ts" id=3950 data-target="#details-3950" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerNotebookCellStatusBarItemProvider</span><span>(</span><span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#NotebookCellStatusBarItemProvider">NotebookCellStatusBarItemProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3950">
<div class="comment"><p>Register a <a href="#NotebookCellStatusBarItemProvider">cell statusbar item provider</a> for the given notebook type.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The notebook type to register for.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#NotebookCellStatusBarItemProvider">NotebookCellStatusBarItemProvider</a></td><td><div class="comment"><p>A cell status bar provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>

## scm



<div class="comment"><p>Namespace for source control management.</p>
</div>

#### Variables



<a name="scm.inputBox"></a><span class="ts" id=4010 data-target="#details-4010" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">inputBox</span><span>: </span><a class="type-ref" href="#SourceControlInputBox">SourceControlInputBox</a></span>
<div class="details collapse" id="details-4010">
<div class="comment"><p>The <a href="#SourceControlInputBox">input box</a> for the last source control
created by the extension.</p>
<ul>
<li><em>deprecated</em> - Use SourceControl.inputBox instead</li>
</ul>
</div>
</div>

#### Functions



<a name="scm.createSourceControl"></a><span class="ts" id=4006 data-target="#details-4006" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createSourceControl</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">rootUri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#SourceControl">SourceControl</a></span>
<div class="details collapse" id="details-4006">
<div class="comment"><p>Creates a new <a href="#SourceControl">source control</a> instance.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>An <code>id</code> for the source control. Something short, e.g.: <code>git</code>.</p>
</div></td></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A human-readable string for the source control. E.g.: <code>Git</code>.</p>
</div></td></tr>
<tr><td><span class="ident">rootUri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>An optional Uri of the root of the source control. E.g.: <code>Uri.parse(workspaceRoot)</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SourceControl">SourceControl</a></td><td><div class="comment"><p>An instance of <a href="#SourceControl">source control</a>.</p>
</div></td></tr>
</table>
</div>
</div>

## tasks



<div class="comment"><p>Namespace for tasks functionality.</p>
</div>

#### Variables



<a name="tasks.taskExecutions"></a><span class="ts" id=2286 data-target="#details-2286" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">taskExecutions</span><span>: </span>readonly <a class="type-ref" href="#TaskExecution">TaskExecution</a>[]</span>
<div class="details collapse" id="details-2286">
<div class="comment"><p>The currently active task executions or an empty array.</p>
</div>
</div>

#### Events



<a name="tasks.onDidEndTask"></a><span class="ts" id=2288 data-target="#details-2288" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidEndTask</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TaskEndEvent">TaskEndEvent</a>&gt;</span>
<div class="details collapse" id="details-2288">
<div class="comment"><p>Fires when a task ends.</p>
</div>
</div>



<a name="tasks.onDidEndTaskProcess"></a><span class="ts" id=2290 data-target="#details-2290" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidEndTaskProcess</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TaskProcessEndEvent">TaskProcessEndEvent</a>&gt;</span>
<div class="details collapse" id="details-2290">
<div class="comment"><p>Fires when the underlying process has ended.
This event will not fire for tasks that don&#39;t
execute an underlying process.</p>
</div>
</div>



<a name="tasks.onDidStartTask"></a><span class="ts" id=2287 data-target="#details-2287" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidStartTask</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TaskStartEvent">TaskStartEvent</a>&gt;</span>
<div class="details collapse" id="details-2287">
<div class="comment"><p>Fires when a task starts.</p>
</div>
</div>



<a name="tasks.onDidStartTaskProcess"></a><span class="ts" id=2289 data-target="#details-2289" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidStartTaskProcess</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TaskProcessStartEvent">TaskProcessStartEvent</a>&gt;</span>
<div class="details collapse" id="details-2289">
<div class="comment"><p>Fires when the underlying process has been started.
This event will not fire for tasks that don&#39;t
execute an underlying process.</p>
</div>
</div>

#### Functions



<a name="tasks.executeTask"></a><span class="ts" id=2284 data-target="#details-2284" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executeTask</span><span>(</span><span class="ident">task</span><span>: </span><a class="type-ref" href="#Task">Task</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TaskExecution">TaskExecution</a>&gt;</span>
<div class="details collapse" id="details-2284">
<div class="comment"><p>Executes a task that is managed by the editor. The returned
task execution can be used to terminate the task.</p>
<ul>
<li><em>throws</em> - When running a ShellExecution or a ProcessExecution
task in an environment where a new process cannot be started.
In such an environment, only CustomExecution tasks can be run.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">task</span><span>: </span><a class="type-ref" href="#Task">Task</a></td><td><div class="comment"><p>the task to execute</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TaskExecution">TaskExecution</a>&gt;</td><td><div class="comment"><p>A thenable that resolves to a task execution.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="tasks.fetchTasks"></a><span class="ts" id=2281 data-target="#details-2281" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fetchTasks</span><span>(</span><span class="ident">filter</span><span>?</span><span>: </span><a class="type-ref" href="#TaskFilter">TaskFilter</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Task">Task</a>[]&gt;</span>
<div class="details collapse" id="details-2281">
<div class="comment"><p>Fetches all tasks available in the systems. This includes tasks
from <code>tasks.json</code> files as well as tasks from task providers
contributed through extensions.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">filter</span><span>?</span><span>: </span><a class="type-ref" href="#TaskFilter">TaskFilter</a></td><td><div class="comment"><p>Optional filter to select tasks of a certain type or version.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Task">Task</a>[]&gt;</td><td><div class="comment"><p>A thenable that resolves to an array of tasks.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="tasks.registerTaskProvider"></a><span class="ts" id=2277 data-target="#details-2277" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerTaskProvider</span><span>(</span><span class="ident">type</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#TaskProvider&amp;lt;T&amp;gt;">TaskProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2277">
<div class="comment"><p>Register a task provider.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">type</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The task kind type this provider is registered for.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#TaskProvider&amp;lt;T&amp;gt;">TaskProvider</a></td><td><div class="comment"><p>A task provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>

## tests



<div class="comment"><p>Namespace for testing functionality. Tests are published by registering
<a href="#TestController">TestController</a> instances, then adding <a href="#TestItem">TestItems</a>.
Controllers may also describe how to run tests by creating one or more
<a href="#TestRunProfile">TestRunProfile</a> instances.</p>
</div>

#### Functions



<a name="tests.createTestController"></a><span class="ts" id=4420 data-target="#details-4420" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createTestController</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#TestController">TestController</a></span>
<div class="details collapse" id="details-4420">
<div class="comment"><p>Creates a new test controller.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Identifier for the controller, must be globally unique.</p>
</div></td></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A human-readable label for the controller.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TestController">TestController</a></td><td><div class="comment"><p>An instance of the <a href="#TestController">TestController</a>.</p>
</div></td></tr>
</table>
</div>
</div>

## window



<div class="comment"><p>Namespace for dealing with the current window of the editor. That is visible
and active editors, as well as, UI elements to show messages, selections, and
asking for user input.</p>
</div>

#### Variables



<a name="window.activeColorTheme"></a><span class="ts" id=2895 data-target="#details-2895" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeColorTheme</span><span>: </span><a class="type-ref" href="#ColorTheme">ColorTheme</a></span>
<div class="details collapse" id="details-2895">
<div class="comment"><p>The currently active color theme as configured in the settings. The active
theme can be changed via the <code>workbench.colorTheme</code> setting.</p>
</div>
</div>



<a name="window.activeNotebookEditor"></a><span class="ts" id=2880 data-target="#details-2880" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeNotebookEditor</span><span>: </span><a class="type-ref" href="#NotebookEditor">NotebookEditor</a> &#124; <span class="type-intrinsic">undefined</span></span>
<div class="details collapse" id="details-2880">
<div class="comment"><p>The currently active <a href="#NotebookEditor">notebook editor</a> or <code>undefined</code>. The active editor is the one
that currently has focus or, when none has focus, the one that has changed
input most recently.</p>
</div>
</div>



<a name="window.activeTerminal"></a><span class="ts" id=2885 data-target="#details-2885" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeTerminal</span><span>: </span><a class="type-ref" href="#Terminal">Terminal</a> &#124; <span class="type-intrinsic">undefined</span></span>
<div class="details collapse" id="details-2885">
<div class="comment"><p>The currently active terminal or <code>undefined</code>. The active terminal is the one that
currently has focus or most recently had focus.</p>
</div>
</div>



<a name="window.activeTextEditor"></a><span class="ts" id=2870 data-target="#details-2870" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeTextEditor</span><span>: </span><a class="type-ref" href="#TextEditor">TextEditor</a> &#124; <span class="type-intrinsic">undefined</span></span>
<div class="details collapse" id="details-2870">
<div class="comment"><p>The currently active editor or <code>undefined</code>. The active editor is the one
that currently has focus or, when none has focus, the one that has changed
input most recently.</p>
</div>
</div>



<a name="window.state"></a><span class="ts" id=2893 data-target="#details-2893" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">state</span><span>: </span><a class="type-ref" href="#WindowState">WindowState</a></span>
<div class="details collapse" id="details-2893">
<div class="comment"><p>Represents the current window&#39;s state.</p>
</div>
</div>



<a name="window.tabGroups"></a><span class="ts" id=2869 data-target="#details-2869" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tabGroups</span><span>: </span><a class="type-ref" href="#TabGroups">TabGroups</a></span>
<div class="details collapse" id="details-2869">
<div class="comment"><p>Represents the grid widget within the main editor area</p>
</div>
</div>



<a name="window.terminals"></a><span class="ts" id=2884 data-target="#details-2884" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">terminals</span><span>: </span>readonly <a class="type-ref" href="#Terminal">Terminal</a>[]</span>
<div class="details collapse" id="details-2884">
<div class="comment"><p>The currently opened terminals or an empty array.</p>
</div>
</div>



<a name="window.visibleNotebookEditors"></a><span class="ts" id=2878 data-target="#details-2878" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">visibleNotebookEditors</span><span>: </span>readonly <a class="type-ref" href="#NotebookEditor">NotebookEditor</a>[]</span>
<div class="details collapse" id="details-2878">
<div class="comment"><p>The currently visible <a href="#NotebookEditor">notebook editors</a> or an empty array.</p>
</div>
</div>



<a name="window.visibleTextEditors"></a><span class="ts" id=2871 data-target="#details-2871" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">visibleTextEditors</span><span>: </span>readonly <a class="type-ref" href="#TextEditor">TextEditor</a>[]</span>
<div class="details collapse" id="details-2871">
<div class="comment"><p>The currently visible editors or an empty array.</p>
</div>
</div>

#### Events



<a name="window.onDidChangeActiveColorTheme"></a><span class="ts" id=2896 data-target="#details-2896" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeActiveColorTheme</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#ColorTheme">ColorTheme</a>&gt;</span>
<div class="details collapse" id="details-2896">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the active color theme is changed or has changes.</p>
</div>
</div>



<a name="window.onDidChangeActiveNotebookEditor"></a><span class="ts" id=2881 data-target="#details-2881" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeActiveNotebookEditor</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#NotebookEditor">NotebookEditor</a> &#124; <span class="type-intrinsic">undefined</span>&gt;</span>
<div class="details collapse" id="details-2881">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the <a href="#window.activeNotebookEditor">active notebook editor</a>
has changed. <em>Note</em> that the event also fires when the active editor changes
to <code>undefined</code>.</p>
</div>
</div>



<a name="window.onDidChangeActiveTerminal"></a><span class="ts" id=2886 data-target="#details-2886" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeActiveTerminal</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#Terminal">Terminal</a> &#124; <span class="type-intrinsic">undefined</span>&gt;</span>
<div class="details collapse" id="details-2886">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the <a href="#window.activeTerminal">active terminal</a>
has changed. <em>Note</em> that the event also fires when the active terminal changes
to <code>undefined</code>.</p>
</div>
</div>



<a name="window.onDidChangeActiveTextEditor"></a><span class="ts" id=2872 data-target="#details-2872" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeActiveTextEditor</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TextEditor">TextEditor</a> &#124; <span class="type-intrinsic">undefined</span>&gt;</span>
<div class="details collapse" id="details-2872">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the <a href="#window.activeTextEditor">active editor</a>
has changed. <em>Note</em> that the event also fires when the active editor changes
to <code>undefined</code>.</p>
</div>
</div>



<a name="window.onDidChangeNotebookEditorSelection"></a><span class="ts" id=2882 data-target="#details-2882" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeNotebookEditorSelection</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#NotebookEditorSelectionChangeEvent">NotebookEditorSelectionChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-2882">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the <a href="#NotebookEditor.selections">notebook editor selections</a>
have changed.</p>
</div>
</div>



<a name="window.onDidChangeNotebookEditorVisibleRanges"></a><span class="ts" id=2883 data-target="#details-2883" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeNotebookEditorVisibleRanges</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#NotebookEditorVisibleRangesChangeEvent">NotebookEditorVisibleRangesChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-2883">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the <a href="#NotebookEditor.visibleRanges">notebook editor visible ranges</a>
have changed.</p>
</div>
</div>



<a name="window.onDidChangeTerminalShellIntegration"></a><span class="ts" id=2890 data-target="#details-2890" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeTerminalShellIntegration</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TerminalShellIntegrationChangeEvent">TerminalShellIntegrationChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-2890">
<div class="comment"><p>Fires when shell integration activates or one of its properties changes in a terminal.</p>
</div>
</div>



<a name="window.onDidChangeTerminalState"></a><span class="ts" id=2889 data-target="#details-2889" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeTerminalState</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#Terminal">Terminal</a>&gt;</span>
<div class="details collapse" id="details-2889">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when a <a href="#Terminal.state">terminal&#39;s state</a> has changed.</p>
</div>
</div>



<a name="window.onDidChangeTextEditorOptions"></a><span class="ts" id=2876 data-target="#details-2876" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeTextEditorOptions</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TextEditorOptionsChangeEvent">TextEditorOptionsChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-2876">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the options of an editor have changed.</p>
</div>
</div>



<a name="window.onDidChangeTextEditorSelection"></a><span class="ts" id=2874 data-target="#details-2874" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeTextEditorSelection</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TextEditorSelectionChangeEvent">TextEditorSelectionChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-2874">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the selection in an editor has changed.</p>
</div>
</div>



<a name="window.onDidChangeTextEditorViewColumn"></a><span class="ts" id=2877 data-target="#details-2877" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeTextEditorViewColumn</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TextEditorViewColumnChangeEvent">TextEditorViewColumnChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-2877">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the view column of an editor has changed.</p>
</div>
</div>



<a name="window.onDidChangeTextEditorVisibleRanges"></a><span class="ts" id=2875 data-target="#details-2875" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeTextEditorVisibleRanges</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TextEditorVisibleRangesChangeEvent">TextEditorVisibleRangesChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-2875">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the visible ranges of an editor has changed.</p>
</div>
</div>



<a name="window.onDidChangeVisibleNotebookEditors"></a><span class="ts" id=2879 data-target="#details-2879" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeVisibleNotebookEditors</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;readonly <a class="type-ref" href="#NotebookEditor">NotebookEditor</a>[]&gt;</span>
<div class="details collapse" id="details-2879">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the <a href="#window.visibleNotebookEditors">visible notebook editors</a>
has changed.</p>
</div>
</div>



<a name="window.onDidChangeVisibleTextEditors"></a><span class="ts" id=2873 data-target="#details-2873" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeVisibleTextEditors</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;readonly <a class="type-ref" href="#TextEditor">TextEditor</a>[]&gt;</span>
<div class="details collapse" id="details-2873">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the array of <a href="#window.visibleTextEditors">visible editors</a>
has changed.</p>
</div>
</div>



<a name="window.onDidChangeWindowState"></a><span class="ts" id=2894 data-target="#details-2894" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeWindowState</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#WindowState">WindowState</a>&gt;</span>
<div class="details collapse" id="details-2894">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the focus or activity state of the current window
changes. The value of the event represents whether the window is focused.</p>
</div>
</div>



<a name="window.onDidCloseTerminal"></a><span class="ts" id=2888 data-target="#details-2888" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidCloseTerminal</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#Terminal">Terminal</a>&gt;</span>
<div class="details collapse" id="details-2888">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when a terminal is disposed.</p>
</div>
</div>



<a name="window.onDidEndTerminalShellExecution"></a><span class="ts" id=2892 data-target="#details-2892" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidEndTerminalShellExecution</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TerminalShellExecutionEndEvent">TerminalShellExecutionEndEvent</a>&gt;</span>
<div class="details collapse" id="details-2892">
<div class="comment"><p>This will be fired when a terminal command is ended. This event will fire only when
<a href="https://code.visualstudio.com/docs/terminal/shell-integration">shell integration</a> is
activated for the terminal.</p>
</div>
</div>



<a name="window.onDidOpenTerminal"></a><span class="ts" id=2887 data-target="#details-2887" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidOpenTerminal</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#Terminal">Terminal</a>&gt;</span>
<div class="details collapse" id="details-2887">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when a terminal has been created, either through the
<a href="#window.createTerminal">createTerminal</a> API or commands.</p>
</div>
</div>



<a name="window.onDidStartTerminalShellExecution"></a><span class="ts" id=2891 data-target="#details-2891" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidStartTerminalShellExecution</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TerminalShellExecutionStartEvent">TerminalShellExecutionStartEvent</a>&gt;</span>
<div class="details collapse" id="details-2891">
<div class="comment"><p>This will be fired when a terminal command is started. This event will fire only when
<a href="https://code.visualstudio.com/docs/terminal/shell-integration">shell integration</a> is
activated for the terminal.</p>
</div>
</div>

#### Functions



<a name="window.createInputBox"></a><span class="ts" id=2761 data-target="#details-2761" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createInputBox</span><span>(</span><span>)</span><span>: </span><a class="type-ref" href="#InputBox">InputBox</a></span>
<div class="details collapse" id="details-2761">
<div class="comment"><p>Creates a <a href="#InputBox">InputBox</a> to let the user enter some text input.</p>
<p>Note that in many cases the more convenient <a href="#window.showInputBox">window.showInputBox</a> is easier to use.
<a href="#window.createInputBox">window.createInputBox</a> should be used when <a href="#window.showInputBox">window.showInputBox</a> does not offer
the required flexibility.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#InputBox">InputBox</a></td><td><div class="comment"><p>A new <a href="#InputBox">InputBox</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.createOutputChannel"></a><span class="ts" id=2763 data-target="#details-2763" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createOutputChannel</span><span>(</span><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">languageId</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#OutputChannel">OutputChannel</a></span>
<div class="details collapse" id="details-2763">
<div class="comment"><p>Creates a new <a href="#OutputChannel">output channel</a> with the given name and language id
If language id is not provided, then <strong>Log</strong> is used as default language id.</p>
<p>You can access the visible or active output channel as a <a href="#TextDocument">text document</a> from <a href="#window.visibleTextEditors">visible editors</a> or <a href="#window.activeTextEditor">active editor</a>
and use the language id to contribute language features like syntax coloring, code lens etc.,</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Human-readable string which will be used to represent the channel in the UI.</p>
</div></td></tr>
<tr><td><span class="ident">languageId</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The identifier of the language associated with the channel.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#OutputChannel">OutputChannel</a></td><td><div class="comment"><p>A new output channel.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.createOutputChannel"></a><span class="ts" id=2766 data-target="#details-2766" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createOutputChannel</span><span>(</span><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>: </span>{log: <span class="type-literal">true</span>}<span>)</span><span>: </span><a class="type-ref" href="#LogOutputChannel">LogOutputChannel</a></span>
<div class="details collapse" id="details-2766">
<div class="comment"><p>Creates a new <a href="#LogOutputChannel">log output channel</a> with the given name.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Human-readable string which will be used to represent the channel in the UI.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span>{log: <span class="type-literal">true</span>}</td><td><div class="comment"><p>Options for the log output channel.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LogOutputChannel">LogOutputChannel</a></td><td><div class="comment"><p>A new log output channel.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.createQuickPick"></a><span class="ts" id=2758 data-target="#details-2758" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createQuickPick</span><span>&lt;</span>T extends <a class="type-ref" href="#QuickPickItem">QuickPickItem</a><span>&gt;</span><span>(</span><span>)</span><span>: </span><a class="type-ref" href="#QuickPick&amp;lt;T&amp;gt;">QuickPick</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2758">
<div class="comment"><p>Creates a <a href="#QuickPick">QuickPick</a> to let the user pick an item from a list of items of type <code>T</code>.</p>
<p>Note that in many cases the more convenient <a href="#window.showQuickPick">window.showQuickPick</a> is easier to use.
<a href="#window.createQuickPick">window.createQuickPick</a> should be used when <a href="#window.showQuickPick">window.showQuickPick</a> does not offer
the required flexibility.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#QuickPick&amp;lt;T&amp;gt;">QuickPick</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A new <a href="#QuickPick">QuickPick</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.createStatusBarItem"></a><span class="ts" id=2809 data-target="#details-2809" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createStatusBarItem</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">alignment</span><span>?</span><span>: </span><a class="type-ref" href="#StatusBarAlignment">StatusBarAlignment</a>, <span class="ident">priority</span><span>?</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#StatusBarItem">StatusBarItem</a></span>
<div class="details collapse" id="details-2809">
<div class="comment"><p>Creates a status bar <a href="#StatusBarItem">item</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The identifier of the item. Must be unique within the extension.</p>
</div></td></tr>
<tr><td><span class="ident">alignment</span><span>?</span><span>: </span><a class="type-ref" href="#StatusBarAlignment">StatusBarAlignment</a></td><td><div class="comment"><p>The alignment of the item.</p>
</div></td></tr>
<tr><td><span class="ident">priority</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The priority of the item. Higher values mean the item should be shown more to the left.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#StatusBarItem">StatusBarItem</a></td><td><div class="comment"><p>A new status bar item.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.createStatusBarItem"></a><span class="ts" id=2813 data-target="#details-2813" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createStatusBarItem</span><span>(</span><span class="ident">alignment</span><span>?</span><span>: </span><a class="type-ref" href="#StatusBarAlignment">StatusBarAlignment</a>, <span class="ident">priority</span><span>?</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#StatusBarItem">StatusBarItem</a></span>
<div class="details collapse" id="details-2813">
<div class="comment"><p>Creates a status bar <a href="#StatusBarItem">item</a>.</p>
<p><em>See also</em>
<a href="#window.createStatusBarItem">createStatusBarItem</a> for creating a status bar item with an identifier.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">alignment</span><span>?</span><span>: </span><a class="type-ref" href="#StatusBarAlignment">StatusBarAlignment</a></td><td><div class="comment"><p>The alignment of the item.</p>
</div></td></tr>
<tr><td><span class="ident">priority</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The priority of the item. Higher values mean the item should be shown more to the left.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#StatusBarItem">StatusBarItem</a></td><td><div class="comment"><p>A new status bar item.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.createTerminal"></a><span class="ts" id=2817 data-target="#details-2817" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createTerminal</span><span>(</span><span class="ident">name</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">shellPath</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">shellArgs</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; readonly <span class="type-intrinsic">string</span>[]<span>)</span><span>: </span><a class="type-ref" href="#Terminal">Terminal</a></span>
<div class="details collapse" id="details-2817">
<div class="comment"><p>Creates a <a href="#Terminal">Terminal</a> with a backing shell process. The cwd of the terminal will be the workspace
directory if it exists.</p>
<ul>
<li><em>throws</em> - When running in an environment where a new process cannot be started.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">name</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Optional human-readable string which will be used to represent the terminal in the UI.</p>
</div></td></tr>
<tr><td><span class="ident">shellPath</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Optional path to a custom shell executable to be used in the terminal.</p>
</div></td></tr>
<tr><td><span class="ident">shellArgs</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; readonly <span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>Optional args for the custom shell executable. A string can be used on Windows only which
allows specifying shell args in
<a href="https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6">command-line format</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Terminal">Terminal</a></td><td><div class="comment"><p>A new Terminal.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.createTerminal"></a><span class="ts" id=2821 data-target="#details-2821" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createTerminal</span><span>(</span><span class="ident">options</span><span>: </span><a class="type-ref" href="#TerminalOptions">TerminalOptions</a><span>)</span><span>: </span><a class="type-ref" href="#Terminal">Terminal</a></span>
<div class="details collapse" id="details-2821">
<div class="comment"><p>Creates a <a href="#Terminal">Terminal</a> with a backing shell process.</p>
<ul>
<li><em>throws</em> - When running in an environment where a new process cannot be started.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#TerminalOptions">TerminalOptions</a></td><td><div class="comment"><p>A TerminalOptions object describing the characteristics of the new terminal.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Terminal">Terminal</a></td><td><div class="comment"><p>A new Terminal.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.createTerminal"></a><span class="ts" id=2823 data-target="#details-2823" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createTerminal</span><span>(</span><span class="ident">options</span><span>: </span><a class="type-ref" href="#ExtensionTerminalOptions">ExtensionTerminalOptions</a><span>)</span><span>: </span><a class="type-ref" href="#Terminal">Terminal</a></span>
<div class="details collapse" id="details-2823">
<div class="comment"><p>Creates a <a href="#Terminal">Terminal</a> where an extension controls its input and output.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#ExtensionTerminalOptions">ExtensionTerminalOptions</a></td><td><div class="comment"><p>An <a href="#ExtensionTerminalOptions">ExtensionTerminalOptions</a> object describing
the characteristics of the new terminal.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Terminal">Terminal</a></td><td><div class="comment"><p>A new Terminal.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.createTextEditorDecorationType"></a><span class="ts" id=2662 data-target="#details-2662" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createTextEditorDecorationType</span><span>(</span><span class="ident">options</span><span>: </span><a class="type-ref" href="#DecorationRenderOptions">DecorationRenderOptions</a><span>)</span><span>: </span><a class="type-ref" href="#TextEditorDecorationType">TextEditorDecorationType</a></span>
<div class="details collapse" id="details-2662">
<div class="comment"><p>Create a TextEditorDecorationType that can be used to add decorations to text editors.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#DecorationRenderOptions">DecorationRenderOptions</a></td><td><div class="comment"><p>Rendering options for the decoration type.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TextEditorDecorationType">TextEditorDecorationType</a></td><td><div class="comment"><p>A new decoration type instance.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.createTreeView"></a><span class="ts" id=2831 data-target="#details-2831" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createTreeView</span><span>&lt;</span>T<span>&gt;</span><span>(</span><span class="ident">viewId</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>: </span><a class="type-ref" href="#TreeViewOptions&amp;lt;T&amp;gt;">TreeViewOptions</a>&lt;<span class="type-ref">T</span>&gt;<span>)</span><span>: </span><a class="type-ref" href="#TreeView&amp;lt;T&amp;gt;">TreeView</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2831">
<div class="comment"><p>Create a <a href="#TreeView">TreeView</a> for the view contributed using the extension point <code>views</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">viewId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Id of the view contributed using the extension point <code>views</code>.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#TreeViewOptions&amp;lt;T&amp;gt;">TreeViewOptions</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>Options for creating the <a href="#TreeView">TreeView</a></p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TreeView&amp;lt;T&amp;gt;">TreeView</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>a <a href="#TreeView">TreeView</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.createWebviewPanel"></a><span class="ts" id=2772 data-target="#details-2772" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createWebviewPanel</span><span>(</span><span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">showOptions</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a> &#124; {preserveFocus: <span class="type-intrinsic">boolean</span>, viewColumn: <a class="type-ref" href="#ViewColumn">ViewColumn</a>}, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#WebviewPanelOptions">WebviewPanelOptions</a> &#38; <a class="type-ref" href="#WebviewOptions">WebviewOptions</a><span>)</span><span>: </span><a class="type-ref" href="#WebviewPanel">WebviewPanel</a></span>
<div class="details collapse" id="details-2772">
<div class="comment"><p>Create and show a new webview panel.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Identifies the type of the webview panel.</p>
</div></td></tr>
<tr><td><span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Title of the panel.</p>
</div></td></tr>
<tr><td><span class="ident">showOptions</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a> &#124; {preserveFocus: <span class="type-intrinsic">boolean</span>, viewColumn: <a class="type-ref" href="#ViewColumn">ViewColumn</a>}</td><td><div class="comment"><p>Where to show the webview in the editor. If preserveFocus is set, the new webview will not take focus.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#WebviewPanelOptions">WebviewPanelOptions</a> &#38; <a class="type-ref" href="#WebviewOptions">WebviewOptions</a></td><td><div class="comment"><p>Settings for the new panel.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#WebviewPanel">WebviewPanel</a></td><td><div class="comment"><p>New webview panel.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.registerCustomEditorProvider"></a><span class="ts" id=2852 data-target="#details-2852" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerCustomEditorProvider</span><span>(</span><span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#CustomTextEditorProvider">CustomTextEditorProvider</a> &#124; <a class="type-ref" href="#CustomReadonlyEditorProvider&amp;lt;T&amp;gt;">CustomReadonlyEditorProvider</a>&lt;<a class="type-ref" href="#CustomDocument">CustomDocument</a>&gt; &#124; <a class="type-ref" href="#CustomEditorProvider&amp;lt;T&amp;gt;">CustomEditorProvider</a>&lt;<a class="type-ref" href="#CustomDocument">CustomDocument</a>&gt;, <span class="ident">options</span><span>?</span><span>: </span>{supportsMultipleEditorsPerDocument: <span class="type-intrinsic">boolean</span>, webviewOptions: <a class="type-ref" href="#WebviewPanelOptions">WebviewPanelOptions</a>}<span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2852">
<div class="comment"><p>Register a provider for custom editors for the <code>viewType</code> contributed by the <code>customEditors</code> extension point.</p>
<p>When a custom editor is opened, an <code>onCustomEditor:viewType</code> activation event is fired. Your extension
must register a <a href="#CustomTextEditorProvider">CustomTextEditorProvider</a>, <a href="#CustomReadonlyEditorProvider">CustomReadonlyEditorProvider</a>,
<a href="#CustomEditorProvider">CustomEditorProvider</a>for <code>viewType</code> as part of activation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Unique identifier for the custom editor provider. This should match the <code>viewType</code> from the
  <code>customEditors</code> contribution point.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#CustomTextEditorProvider">CustomTextEditorProvider</a> &#124; <a class="type-ref" href="#CustomReadonlyEditorProvider&amp;lt;T&amp;gt;">CustomReadonlyEditorProvider</a>&lt;<a class="type-ref" href="#CustomDocument">CustomDocument</a>&gt; &#124; <a class="type-ref" href="#CustomEditorProvider&amp;lt;T&amp;gt;">CustomEditorProvider</a>&lt;<a class="type-ref" href="#CustomDocument">CustomDocument</a>&gt;</td><td><div class="comment"><p>Provider that resolves custom editors.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{supportsMultipleEditorsPerDocument: <span class="type-intrinsic">boolean</span>, webviewOptions: <a class="type-ref" href="#WebviewPanelOptions">WebviewPanelOptions</a>}</td><td><div class="comment"><p>Options for the provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>Disposable that unregisters the provider.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.registerFileDecorationProvider"></a><span class="ts" id=2867 data-target="#details-2867" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerFileDecorationProvider</span><span>(</span><span class="ident">provider</span><span>: </span><a class="type-ref" href="#FileDecorationProvider">FileDecorationProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2867">
<div class="comment"><p>Register a file decoration provider.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#FileDecorationProvider">FileDecorationProvider</a></td><td><div class="comment"><p>A <a href="#FileDecorationProvider">FileDecorationProvider</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters the provider.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.registerTerminalLinkProvider"></a><span class="ts" id=2860 data-target="#details-2860" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerTerminalLinkProvider</span><span>(</span><span class="ident">provider</span><span>: </span><a class="type-ref" href="#TerminalLinkProvider&amp;lt;T&amp;gt;">TerminalLinkProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2860">
<div class="comment"><p>Register provider that enables the detection and handling of links within the terminal.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#TerminalLinkProvider&amp;lt;T&amp;gt;">TerminalLinkProvider</a></td><td><div class="comment"><p>The provider that provides the terminal links.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>Disposable that unregisters the provider.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.registerTerminalProfileProvider"></a><span class="ts" id=2863 data-target="#details-2863" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerTerminalProfileProvider</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#TerminalProfileProvider">TerminalProfileProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2863">
<div class="comment"><p>Registers a provider for a contributed terminal profile.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The ID of the contributed terminal profile.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#TerminalProfileProvider">TerminalProfileProvider</a></td><td><div class="comment"><p>The terminal profile provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">disposable</a> that unregisters the provider.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.registerTreeDataProvider"></a><span class="ts" id=2826 data-target="#details-2826" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerTreeDataProvider</span><span>&lt;</span>T<span>&gt;</span><span>(</span><span class="ident">viewId</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">treeDataProvider</span><span>: </span><a class="type-ref" href="#TreeDataProvider&amp;lt;T&amp;gt;">TreeDataProvider</a>&lt;<span class="type-ref">T</span>&gt;<span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2826">
<div class="comment"><p>Register a <a href="#TreeDataProvider">TreeDataProvider</a> for the view contributed using the extension point <code>views</code>.
This will allow you to contribute data to the <a href="#TreeView">TreeView</a> and update if the data changes.</p>
<p><strong>Note:</strong> To get access to the <a href="#TreeView">TreeView</a> and perform operations on it, use <a href="#window.createTreeView">createTreeView</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">viewId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Id of the view contributed using the extension point <code>views</code>.</p>
</div></td></tr>
<tr><td><span class="ident">treeDataProvider</span><span>: </span><a class="type-ref" href="#TreeDataProvider&amp;lt;T&amp;gt;">TreeDataProvider</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A <a href="#TreeDataProvider">TreeDataProvider</a> that provides tree data for the view</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">disposable</a> that unregisters the <a href="#TreeDataProvider">TreeDataProvider</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.registerUriHandler"></a><span class="ts" id=2836 data-target="#details-2836" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerUriHandler</span><span>(</span><span class="ident">handler</span><span>: </span><a class="type-ref" href="#UriHandler">UriHandler</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2836">
<div class="comment"><p>Registers a <a href="#UriHandler">uri handler</a> capable of handling system-wide <a href="#Uri">uris</a>.
In case there are multiple windows open, the topmost window will handle the uri.
A uri handler is scoped to the extension it is contributed from; it will only
be able to handle uris which are directed to the extension itself. A uri must respect
the following rules:</p>
<ul>
<li>The uri-scheme must be <code>vscode.env.uriScheme</code>;</li>
<li>The uri-authority must be the extension id (e.g. <code>my.extension</code>);</li>
<li>The uri-path, -query and -fragment parts are arbitrary.</li>
</ul>
<p>For example, if the <code>my.extension</code> extension registers a uri handler, it will only
be allowed to handle uris with the prefix <code>product-name://my.extension</code>.</p>
<p>An extension can only register a single uri handler in its entire activation lifetime.</p>
<ul>
<li><em>Note:</em> There is an activation event <code>onUri</code> that fires when a uri directed for
the current extension is about to be handled.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">handler</span><span>: </span><a class="type-ref" href="#UriHandler">UriHandler</a></td><td><div class="comment"><p>The uri handler to register for this extension.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">disposable</a> that unregisters the handler.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.registerWebviewPanelSerializer"></a><span class="ts" id=2839 data-target="#details-2839" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerWebviewPanelSerializer</span><span>(</span><span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">serializer</span><span>: </span><a class="type-ref" href="#WebviewPanelSerializer&amp;lt;T&amp;gt;">WebviewPanelSerializer</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2839">
<div class="comment"><p>Registers a webview panel serializer.</p>
<p>Extensions that support reviving should have an <code>&quot;onWebviewPanel:viewType&quot;</code> activation event and
make sure that <code>registerWebviewPanelSerializer</code> is called during activation.</p>
<p>Only a single serializer may be registered at a time for a given <code>viewType</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Type of the webview panel that can be serialized.</p>
</div></td></tr>
<tr><td><span class="ident">serializer</span><span>: </span><a class="type-ref" href="#WebviewPanelSerializer&amp;lt;T&amp;gt;">WebviewPanelSerializer</a></td><td><div class="comment"><p>Webview serializer.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">disposable</a> that unregisters the serializer.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.registerWebviewViewProvider"></a><span class="ts" id=2843 data-target="#details-2843" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerWebviewViewProvider</span><span>(</span><span class="ident">viewId</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#WebviewViewProvider">WebviewViewProvider</a>, <span class="ident">options</span><span>?</span><span>: </span>{webviewOptions: {retainContextWhenHidden: <span class="type-intrinsic">boolean</span>}}<span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2843">
<div class="comment"><p>Register a new provider for webview views.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">viewId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Unique id of the view. This should match the <code>id</code> from the
  <code>views</code> contribution in the package.json.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#WebviewViewProvider">WebviewViewProvider</a></td><td><div class="comment"><p>Provider for the webview views.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{webviewOptions: {retainContextWhenHidden: <span class="type-intrinsic">boolean</span>}}</td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>Disposable that unregisters the provider.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.setStatusBarMessage"></a><span class="ts" id=2781 data-target="#details-2781" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">setStatusBarMessage</span><span>(</span><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">hideAfterTimeout</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2781">
<div class="comment"><p>Set a message to the status bar. This is a short hand for the more powerful
status bar <a href="#window.createStatusBarItem">items</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show, supports icon substitution as in status bar <a href="#StatusBarItem.text">items</a>.</p>
</div></td></tr>
<tr><td><span class="ident">hideAfterTimeout</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>Timeout in milliseconds after which the message will be disposed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A disposable which hides the status bar message.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.setStatusBarMessage"></a><span class="ts" id=2784 data-target="#details-2784" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">setStatusBarMessage</span><span>(</span><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">hideWhenDone</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;<span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2784">
<div class="comment"><p>Set a message to the status bar. This is a short hand for the more powerful
status bar <a href="#window.createStatusBarItem">items</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show, supports icon substitution as in status bar <a href="#StatusBarItem.text">items</a>.</p>
</div></td></tr>
<tr><td><span class="ident">hideWhenDone</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;</td><td><div class="comment"><p>Thenable on which completion (resolve or reject) the message will be disposed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A disposable which hides the status bar message.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.setStatusBarMessage"></a><span class="ts" id=2787 data-target="#details-2787" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">setStatusBarMessage</span><span>(</span><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2787">
<div class="comment"><p>Set a message to the status bar. This is a short hand for the more powerful
status bar <a href="#window.createStatusBarItem">items</a>.</p>
<p><em>Note</em> that status bar messages stack and that they must be disposed when no
longer used.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show, supports icon substitution as in status bar <a href="#StatusBarItem.text">items</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A disposable which hides the status bar message.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showErrorMessage"></a><span class="ts" id=2703 data-target="#details-2703" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showErrorMessage</span><span>&lt;</span>T extends <span class="type-intrinsic">string</span><span>&gt;</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2703">
<div class="comment"><p>Show an error message.</p>
<p><em>See also</em>
<a href="#window.showInformationMessage">showInformationMessage</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]</td><td><div class="comment"><p>A set of items that will be rendered as actions in the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected item or <code>undefined</code> when being dismissed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showErrorMessage"></a><span class="ts" id=2707 data-target="#details-2707" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showErrorMessage</span><span>&lt;</span>T extends <span class="type-intrinsic">string</span><span>&gt;</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>: </span><a class="type-ref" href="#MessageOptions">MessageOptions</a>, <span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2707">
<div class="comment"><p>Show an error message.</p>
<p><em>See also</em>
<a href="#window.showInformationMessage">showInformationMessage</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#MessageOptions">MessageOptions</a></td><td><div class="comment"><p>Configures the behaviour of the message.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]</td><td><div class="comment"><p>A set of items that will be rendered as actions in the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected item or <code>undefined</code> when being dismissed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showErrorMessage"></a><span class="ts" id=2712 data-target="#details-2712" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showErrorMessage</span><span>&lt;</span>T extends <a class="type-ref" href="#MessageItem">MessageItem</a><span>&gt;</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2712">
<div class="comment"><p>Show an error message.</p>
<p><em>See also</em>
<a href="#window.showInformationMessage">showInformationMessage</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]</td><td><div class="comment"><p>A set of items that will be rendered as actions in the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected item or <code>undefined</code> when being dismissed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showErrorMessage"></a><span class="ts" id=2716 data-target="#details-2716" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showErrorMessage</span><span>&lt;</span>T extends <a class="type-ref" href="#MessageItem">MessageItem</a><span>&gt;</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>: </span><a class="type-ref" href="#MessageOptions">MessageOptions</a>, <span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2716">
<div class="comment"><p>Show an error message.</p>
<p><em>See also</em>
<a href="#window.showInformationMessage">showInformationMessage</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#MessageOptions">MessageOptions</a></td><td><div class="comment"><p>Configures the behaviour of the message.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]</td><td><div class="comment"><p>A set of items that will be rendered as actions in the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected item or <code>undefined</code> when being dismissed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showInformationMessage"></a><span class="ts" id=2665 data-target="#details-2665" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showInformationMessage</span><span>&lt;</span>T extends <span class="type-intrinsic">string</span><span>&gt;</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2665">
<div class="comment"><p>Show an information message to users. Optionally provide an array of items which will be presented as
clickable buttons.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]</td><td><div class="comment"><p>A set of items that will be rendered as actions in the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected item or <code>undefined</code> when being dismissed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showInformationMessage"></a><span class="ts" id=2669 data-target="#details-2669" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showInformationMessage</span><span>&lt;</span>T extends <span class="type-intrinsic">string</span><span>&gt;</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>: </span><a class="type-ref" href="#MessageOptions">MessageOptions</a>, <span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2669">
<div class="comment"><p>Show an information message to users. Optionally provide an array of items which will be presented as
clickable buttons.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#MessageOptions">MessageOptions</a></td><td><div class="comment"><p>Configures the behaviour of the message.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]</td><td><div class="comment"><p>A set of items that will be rendered as actions in the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected item or <code>undefined</code> when being dismissed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showInformationMessage"></a><span class="ts" id=2674 data-target="#details-2674" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showInformationMessage</span><span>&lt;</span>T extends <a class="type-ref" href="#MessageItem">MessageItem</a><span>&gt;</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2674">
<div class="comment"><p>Show an information message.</p>
<p><em>See also</em>
<a href="#window.showInformationMessage">showInformationMessage</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]</td><td><div class="comment"><p>A set of items that will be rendered as actions in the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected item or <code>undefined</code> when being dismissed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showInformationMessage"></a><span class="ts" id=2678 data-target="#details-2678" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showInformationMessage</span><span>&lt;</span>T extends <a class="type-ref" href="#MessageItem">MessageItem</a><span>&gt;</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>: </span><a class="type-ref" href="#MessageOptions">MessageOptions</a>, <span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2678">
<div class="comment"><p>Show an information message.</p>
<p><em>See also</em>
<a href="#window.showInformationMessage">showInformationMessage</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#MessageOptions">MessageOptions</a></td><td><div class="comment"><p>Configures the behaviour of the message.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]</td><td><div class="comment"><p>A set of items that will be rendered as actions in the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected item or <code>undefined</code> when being dismissed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showInputBox"></a><span class="ts" id=2754 data-target="#details-2754" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showInputBox</span><span>(</span><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#InputBoxOptions">InputBoxOptions</a>, <span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-2754">
<div class="comment"><p>Opens an input box to ask the user for input.</p>
<p>The returned value will be <code>undefined</code> if the input box was canceled (e.g., pressing ESC). Otherwise the
returned value will be the string typed by the user or an empty string if the user did not type
anything but dismissed the input box with OK.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#InputBoxOptions">InputBoxOptions</a></td><td><div class="comment"><p>Configures the behavior of the input box.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A token that can be used to signal cancellation.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to a string the user provided or to <code>undefined</code> in case of dismissal.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showNotebookDocument"></a><span class="ts" id=2658 data-target="#details-2658" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showNotebookDocument</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#NotebookDocument">NotebookDocument</a>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookDocumentShowOptions">NotebookDocumentShowOptions</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#NotebookEditor">NotebookEditor</a>&gt;</span>
<div class="details collapse" id="details-2658">
<div class="comment"><p>Show the given <a href="#NotebookDocument">NotebookDocument</a> in a <a href="#NotebookEditor">notebook editor</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#NotebookDocument">NotebookDocument</a></td><td><div class="comment"><p>A text document to be shown.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookDocumentShowOptions">NotebookDocumentShowOptions</a></td><td><div class="comment"><p><a href="#NotebookDocumentShowOptions">Editor options</a> to configure the behavior of showing the <a href="#NotebookEditor">notebook editor</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#NotebookEditor">NotebookEditor</a>&gt;</td><td><div class="comment"><p>A promise that resolves to an <a href="#NotebookEditor">notebook editor</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showOpenDialog"></a><span class="ts" id=2748 data-target="#details-2748" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showOpenDialog</span><span>(</span><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#OpenDialogOptions">OpenDialogOptions</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Uri">Uri</a>[]&gt;</span>
<div class="details collapse" id="details-2748">
<div class="comment"><p>Shows a file open dialog to the user which allows to select a file
for opening-purposes.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#OpenDialogOptions">OpenDialogOptions</a></td><td><div class="comment"><p>Options that control the dialog.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Uri">Uri</a>[]&gt;</td><td><div class="comment"><p>A promise that resolves to the selected resources or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showQuickPick"></a><span class="ts" id=2722 data-target="#details-2722" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showQuickPick</span><span>(</span><span class="ident">items</span><span>: </span>readonly <span class="type-intrinsic">string</span>[] &#124; <span class="type-ref">Thenable</span>&lt;readonly <span class="type-intrinsic">string</span>[]&gt;, <span class="ident">options</span><span>: </span><a class="type-ref" href="#QuickPickOptions">QuickPickOptions</a> &#38; {canPickMany: <span class="type-literal">true</span>}, <span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>[]&gt;</span>
<div class="details collapse" id="details-2722">
<div class="comment"><p>Shows a selection list allowing multiple selections.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">items</span><span>: </span>readonly <span class="type-intrinsic">string</span>[] &#124; <span class="type-ref">Thenable</span>&lt;readonly <span class="type-intrinsic">string</span>[]&gt;</td><td><div class="comment"><p>An array of strings, or a promise that resolves to an array of strings.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#QuickPickOptions">QuickPickOptions</a> &#38; {canPickMany: <span class="type-literal">true</span>}</td><td><div class="comment"><p>Configures the behavior of the selection list.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A token that can be used to signal cancellation.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>[]&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected items or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showQuickPick"></a><span class="ts" id=2728 data-target="#details-2728" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showQuickPick</span><span>(</span><span class="ident">items</span><span>: </span>readonly <span class="type-intrinsic">string</span>[] &#124; <span class="type-ref">Thenable</span>&lt;readonly <span class="type-intrinsic">string</span>[]&gt;, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#QuickPickOptions">QuickPickOptions</a>, <span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-2728">
<div class="comment"><p>Shows a selection list.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">items</span><span>: </span>readonly <span class="type-intrinsic">string</span>[] &#124; <span class="type-ref">Thenable</span>&lt;readonly <span class="type-intrinsic">string</span>[]&gt;</td><td><div class="comment"><p>An array of strings, or a promise that resolves to an array of strings.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#QuickPickOptions">QuickPickOptions</a></td><td><div class="comment"><p>Configures the behavior of the selection list.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A token that can be used to signal cancellation.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected string or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showQuickPick"></a><span class="ts" id=2732 data-target="#details-2732" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showQuickPick</span><span>&lt;</span>T extends <a class="type-ref" href="#QuickPickItem">QuickPickItem</a><span>&gt;</span><span>(</span><span class="ident">items</span><span>: </span>readonly <span class="type-ref">T</span>[] &#124; <span class="type-ref">Thenable</span>&lt;readonly <span class="type-ref">T</span>[]&gt;, <span class="ident">options</span><span>: </span><a class="type-ref" href="#QuickPickOptions">QuickPickOptions</a> &#38; {canPickMany: <span class="type-literal">true</span>}, <span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-2732">
<div class="comment"><p>Shows a selection list allowing multiple selections.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">items</span><span>: </span>readonly <span class="type-ref">T</span>[] &#124; <span class="type-ref">Thenable</span>&lt;readonly <span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>An array of items, or a promise that resolves to an array of items.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#QuickPickOptions">QuickPickOptions</a> &#38; {canPickMany: <span class="type-literal">true</span>}</td><td><div class="comment"><p>Configures the behavior of the selection list.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A token that can be used to signal cancellation.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected items or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showQuickPick"></a><span class="ts" id=2739 data-target="#details-2739" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showQuickPick</span><span>&lt;</span>T extends <a class="type-ref" href="#QuickPickItem">QuickPickItem</a><span>&gt;</span><span>(</span><span class="ident">items</span><span>: </span>readonly <span class="type-ref">T</span>[] &#124; <span class="type-ref">Thenable</span>&lt;readonly <span class="type-ref">T</span>[]&gt;, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#QuickPickOptions">QuickPickOptions</a>, <span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2739">
<div class="comment"><p>Shows a selection list.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">items</span><span>: </span>readonly <span class="type-ref">T</span>[] &#124; <span class="type-ref">Thenable</span>&lt;readonly <span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>An array of items, or a promise that resolves to an array of items.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#QuickPickOptions">QuickPickOptions</a></td><td><div class="comment"><p>Configures the behavior of the selection list.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A token that can be used to signal cancellation.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected item or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showSaveDialog"></a><span class="ts" id=2751 data-target="#details-2751" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showSaveDialog</span><span>(</span><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#SaveDialogOptions">SaveDialogOptions</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</span>
<div class="details collapse" id="details-2751">
<div class="comment"><p>Shows a file save dialog to the user which allows to select a file
for saving-purposes.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#SaveDialogOptions">SaveDialogOptions</a></td><td><div class="comment"><p>Options that control the dialog.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</td><td><div class="comment"><p>A promise that resolves to the selected resource or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showTextDocument"></a><span class="ts" id=2647 data-target="#details-2647" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showTextDocument</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">column</span><span>?</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a>, <span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextEditor">TextEditor</a>&gt;</span>
<div class="details collapse" id="details-2647">
<div class="comment"><p>Show the given document in a text editor. A <a href="#ViewColumn">column</a> can be provided
to control where the editor is being shown. Might change the <a href="#window.activeTextEditor">active editor</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>A text document to be shown.</p>
</div></td></tr>
<tr><td><span class="ident">column</span><span>?</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a></td><td><div class="comment"><p>A view column in which the <a href="#TextEditor">editor</a> should be shown. The default is the <a href="#ViewColumn.Active">active</a>.
Columns that do not exist will be created as needed up to the maximum of <a href="#ViewColumn.Nine">ViewColumn.Nine</a>. Use <a href="#ViewColumn.Beside">ViewColumn.Beside</a>
to open the editor to the side of the currently active one.</p>
</div></td></tr>
<tr><td><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>When <code>true</code> the editor will not take focus.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextEditor">TextEditor</a>&gt;</td><td><div class="comment"><p>A promise that resolves to an <a href="#TextEditor">editor</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showTextDocument"></a><span class="ts" id=2651 data-target="#details-2651" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showTextDocument</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#TextDocumentShowOptions">TextDocumentShowOptions</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextEditor">TextEditor</a>&gt;</span>
<div class="details collapse" id="details-2651">
<div class="comment"><p>Show the given document in a text editor. <a href="#TextDocumentShowOptions">Options</a> can be provided
to control options of the editor is being shown. Might change the <a href="#window.activeTextEditor">active editor</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>A text document to be shown.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#TextDocumentShowOptions">TextDocumentShowOptions</a></td><td><div class="comment"><p><a href="#TextDocumentShowOptions">Editor options</a> to configure the behavior of showing the <a href="#TextEditor">editor</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextEditor">TextEditor</a>&gt;</td><td><div class="comment"><p>A promise that resolves to an <a href="#TextEditor">editor</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showTextDocument"></a><span class="ts" id=2654 data-target="#details-2654" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showTextDocument</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#TextDocumentShowOptions">TextDocumentShowOptions</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextEditor">TextEditor</a>&gt;</span>
<div class="details collapse" id="details-2654">
<div class="comment"><p>A short-hand for <code>openTextDocument(uri).then(document =&gt; showTextDocument(document, options))</code>.</p>
<p><em>See also</em>
<a href="#workspace.openTextDocument">workspace.openTextDocument</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#TextDocumentShowOptions">TextDocumentShowOptions</a></td><td><div class="comment"><p><a href="#TextDocumentShowOptions">Editor options</a> to configure the behavior of showing the <a href="#TextEditor">editor</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextEditor">TextEditor</a>&gt;</td><td><div class="comment"><p>A promise that resolves to an <a href="#TextEditor">editor</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showWarningMessage"></a><span class="ts" id=2684 data-target="#details-2684" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showWarningMessage</span><span>&lt;</span>T extends <span class="type-intrinsic">string</span><span>&gt;</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2684">
<div class="comment"><p>Show a warning message.</p>
<p><em>See also</em>
<a href="#window.showInformationMessage">showInformationMessage</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]</td><td><div class="comment"><p>A set of items that will be rendered as actions in the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected item or <code>undefined</code> when being dismissed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showWarningMessage"></a><span class="ts" id=2688 data-target="#details-2688" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showWarningMessage</span><span>&lt;</span>T extends <span class="type-intrinsic">string</span><span>&gt;</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>: </span><a class="type-ref" href="#MessageOptions">MessageOptions</a>, <span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2688">
<div class="comment"><p>Show a warning message.</p>
<p><em>See also</em>
<a href="#window.showInformationMessage">showInformationMessage</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#MessageOptions">MessageOptions</a></td><td><div class="comment"><p>Configures the behaviour of the message.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]</td><td><div class="comment"><p>A set of items that will be rendered as actions in the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected item or <code>undefined</code> when being dismissed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showWarningMessage"></a><span class="ts" id=2693 data-target="#details-2693" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showWarningMessage</span><span>&lt;</span>T extends <a class="type-ref" href="#MessageItem">MessageItem</a><span>&gt;</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2693">
<div class="comment"><p>Show a warning message.</p>
<p><em>See also</em>
<a href="#window.showInformationMessage">showInformationMessage</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]</td><td><div class="comment"><p>A set of items that will be rendered as actions in the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected item or <code>undefined</code> when being dismissed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showWarningMessage"></a><span class="ts" id=2697 data-target="#details-2697" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showWarningMessage</span><span>&lt;</span>T extends <a class="type-ref" href="#MessageItem">MessageItem</a><span>&gt;</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>: </span><a class="type-ref" href="#MessageOptions">MessageOptions</a>, <span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2697">
<div class="comment"><p>Show a warning message.</p>
<p><em>See also</em>
<a href="#window.showInformationMessage">showInformationMessage</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message to show.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#MessageOptions">MessageOptions</a></td><td><div class="comment"><p>Configures the behaviour of the message.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]</td><td><div class="comment"><p>A set of items that will be rendered as actions in the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the selected item or <code>undefined</code> when being dismissed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.showWorkspaceFolderPick"></a><span class="ts" id=2745 data-target="#details-2745" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showWorkspaceFolderPick</span><span>(</span><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceFolderPickOptions">WorkspaceFolderPickOptions</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a>&gt;</span>
<div class="details collapse" id="details-2745">
<div class="comment"><p>Shows a selection list of <a href="#workspace.workspaceFolders">workspace folders</a> to pick from.
Returns <code>undefined</code> if no folder is open.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceFolderPickOptions">WorkspaceFolderPickOptions</a></td><td><div class="comment"><p>Configures the behavior of the workspace folder list.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a>&gt;</td><td><div class="comment"><p>A promise that resolves to the workspace folder or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.withProgress"></a><span class="ts" id=2797 data-target="#details-2797" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">withProgress</span><span>&lt;</span>R<span>&gt;</span><span>(</span><span class="ident">options</span><span>: </span><a class="type-ref" href="#ProgressOptions">ProgressOptions</a>, <span class="ident">task</span><span>: </span>(progress: <a class="type-ref" href="#Progress&amp;lt;T&amp;gt;">Progress</a>&lt;{increment: <span class="type-intrinsic">number</span>, message: <span class="type-intrinsic">string</span>}&gt;, token: <a class="type-ref" href="#CancellationToken">CancellationToken</a>) =&gt; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#R">R</a>&gt;<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#R">R</a>&gt;</span>
<div class="details collapse" id="details-2797">
<div class="comment"><p>Show progress in the editor. Progress is shown while running the given callback
and while the promise it returned isn&#39;t resolved nor rejected. The location at which
progress should show (and other details) is defined via the passed <a href="#ProgressOptions">ProgressOptions</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#ProgressOptions">ProgressOptions</a></td><td><div class="comment"><p>A <a href="#ProgressOptions">ProgressOptions</a>-object describing the options to use for showing progress, like its location</p>
</div></td></tr>
<tr><td><span class="ident">task</span><span>: </span>(progress: <a class="type-ref" href="#Progress&amp;lt;T&amp;gt;">Progress</a>&lt;{increment: <span class="type-intrinsic">number</span>, message: <span class="type-intrinsic">string</span>}&gt;, token: <a class="type-ref" href="#CancellationToken">CancellationToken</a>) =&gt; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#R">R</a>&gt;</td><td><div class="comment"><p>A callback returning a promise. Progress state can be reported with
the provided <a href="#Progress">Progress</a>-object.</p>
<p>To report discrete progress, use <code>increment</code> to indicate how much work has been completed. Each call with
a <code>increment</code> value will be summed up and reflected as overall progress until 100% is reached (a value of
e.g. <code>10</code> accounts for <code>10%</code> of work done).
Note that currently only <code>ProgressLocation.Notification</code> is capable of showing discrete progress.</p>
<p>To monitor if the operation has been cancelled by the user, use the provided <a href="#CancellationToken">CancellationToken</a>.
Note that currently only <code>ProgressLocation.Notification</code> is supporting to show a cancel button to cancel the
long running operation.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#R">R</a>&gt;</td><td><div class="comment"><p>The thenable the task-callback returned.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="window.withScmProgress"></a><span class="ts" id=2790 data-target="#details-2790" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">withScmProgress</span><span>&lt;</span>R<span>&gt;</span><span>(</span><span class="ident">task</span><span>: </span>(progress: <a class="type-ref" href="#Progress&amp;lt;T&amp;gt;">Progress</a>&lt;<span class="type-intrinsic">number</span>&gt;) =&gt; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#R">R</a>&gt;<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#R">R</a>&gt;</span>
<div class="details collapse" id="details-2790">
<div class="comment"><p>Show progress in the Source Control viewlet while running the given callback and while
its returned promise isn&#39;t resolve or rejected.</p>
<ul>
<li><em>deprecated</em> - Use <code>withProgress</code> instead.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">task</span><span>: </span>(progress: <a class="type-ref" href="#Progress&amp;lt;T&amp;gt;">Progress</a>&lt;<span class="type-intrinsic">number</span>&gt;) =&gt; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#R">R</a>&gt;</td><td><div class="comment"><p>A callback returning a promise. Progress increments can be reported with
the provided <a href="#Progress">Progress</a>-object.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#R">R</a>&gt;</td><td><div class="comment"><p>The thenable the task did return.</p>
</div></td></tr>
</table>
</div>
</div>

## workspace



<div class="comment"><p>Namespace for dealing with the current workspace. A workspace is the collection of one
or more folders that are opened in an editor window (instance).</p>
<p>It is also possible to open an editor without a workspace. For example, when you open a
new editor window by selecting a file from your platform&#39;s File menu, you will not be
inside a workspace. In this mode, some of the editor&#39;s capabilities are reduced but you can
still open text files and edit them.</p>
<p>Refer to <a href="https://code.visualstudio.com/docs/editor/workspaces">https://code.visualstudio.com/docs/editor/workspaces</a> for more information on
the concept of workspaces.</p>
<p>The workspace offers support for <a href="#workspace.createFileSystemWatcher">listening</a> to fs
events and for <a href="#workspace.findFiles">finding</a> files. Both perform well and run <em>outside</em>
the editor-process so that they should be always used instead of nodejs-equivalents.</p>
</div>

#### Variables



<a name="workspace.fs"></a><span class="ts" id=3460 data-target="#details-3460" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fs</span><span>: </span><a class="type-ref" href="#FileSystem">FileSystem</a></span>
<div class="details collapse" id="details-3460">
<div class="comment"><p>A <a href="#FileSystem">file system</a> instance that allows to interact with local and remote
files, e.g. <code>vscode.workspace.fs.readDirectory(someUri)</code> allows to retrieve all entries
of a directory or <code>vscode.workspace.fs.stat(anotherUri)</code> returns the meta data for a
file.</p>
</div>
</div>



<a name="workspace.isTrusted"></a><span class="ts" id=3485 data-target="#details-3485" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isTrusted</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3485">
<div class="comment"><p>When true, the user has explicitly trusted the contents of the workspace.</p>
</div>
</div>



<a name="workspace.name"></a><span class="ts" id=3463 data-target="#details-3463" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">undefined</span></span>
<div class="details collapse" id="details-3463">
<div class="comment"><p>The name of the workspace. <code>undefined</code> when no workspace
has been opened.</p>
<p>Refer to <a href="https://code.visualstudio.com/docs/editor/workspaces">https://code.visualstudio.com/docs/editor/workspaces</a> for more information on
the concept of workspaces.</p>
</div>
</div>



<a name="workspace.notebookDocuments"></a><span class="ts" id=3472 data-target="#details-3472" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">notebookDocuments</span><span>: </span>readonly <a class="type-ref" href="#NotebookDocument">NotebookDocument</a>[]</span>
<div class="details collapse" id="details-3472">
<div class="comment"><p>All notebook documents currently known to the editor.</p>
</div>
</div>



<a name="workspace.rootPath"></a><span class="ts" id=3461 data-target="#details-3461" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">rootPath</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">undefined</span></span>
<div class="details collapse" id="details-3461">
<div class="comment"><p>The uri of the first entry of <a href="#workspace.workspaceFolders">workspaceFolders</a>
as <code>string</code>. <code>undefined</code> if there is no first entry.</p>
<p>Refer to <a href="https://code.visualstudio.com/docs/editor/workspaces">https://code.visualstudio.com/docs/editor/workspaces</a> for more information
on workspaces.</p>
<ul>
<li><em>deprecated</em> - Use <a href="#workspace.workspaceFolders">workspaceFolders</a> instead.</li>
</ul>
</div>
</div>



<a name="workspace.textDocuments"></a><span class="ts" id=3466 data-target="#details-3466" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">textDocuments</span><span>: </span>readonly <a class="type-ref" href="#TextDocument">TextDocument</a>[]</span>
<div class="details collapse" id="details-3466">
<div class="comment"><p>All text documents currently known to the editor.</p>
</div>
</div>



<a name="workspace.workspaceFile"></a><span class="ts" id=3464 data-target="#details-3464" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">workspaceFile</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; <span class="type-intrinsic">undefined</span></span>
<div class="details collapse" id="details-3464">
<div class="comment"><p>The location of the workspace file, for example:</p>
<p><code>file:///Users/name/Development/myProject.code-workspace</code></p>
<p>or</p>
<p><code>untitled:1555503116870</code></p>
<p>for a workspace that is untitled and not yet saved.</p>
<p>Depending on the workspace that is opened, the value will be:</p>
<ul>
<li><code>undefined</code> when no workspace is opened</li>
<li>the path of the workspace file as <code>Uri</code> otherwise. if the workspace
is untitled, the returned URI will use the <code>untitled:</code> scheme</li>
</ul>
<p>The location can e.g. be used with the <code>vscode.openFolder</code> command to
open the workspace again after it has been closed.</p>
<p><strong>Example:</strong></p>
<pre class="shiki" data-lang="typescript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commands</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">executeCommand</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'vscode.openFolder'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uriOfWorkspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span></code></pre>
<p>Refer to <a href="https://code.visualstudio.com/docs/editor/workspaces">https://code.visualstudio.com/docs/editor/workspaces</a> for more information on
the concept of workspaces.</p>
<p><strong>Note:</strong> it is not advised to use <code>workspace.workspaceFile</code> to write
configuration data into the file. You can use <code>workspace.getConfiguration().update()</code>
for that purpose which will work both when a single folder is opened as
well as an untitled or saved workspace.</p>
</div>
</div>



<a name="workspace.workspaceFolders"></a><span class="ts" id=3462 data-target="#details-3462" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">workspaceFolders</span><span>: </span>readonly <a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a>[] &#124; <span class="type-intrinsic">undefined</span></span>
<div class="details collapse" id="details-3462">
<div class="comment"><p>List of workspace folders (0-N) that are open in the editor. <code>undefined</code> when no workspace
has been opened.</p>
<p>Refer to <a href="https://code.visualstudio.com/docs/editor/workspaces">https://code.visualstudio.com/docs/editor/workspaces</a> for more information
on workspaces.</p>
</div>
</div>

#### Events



<a name="workspace.onDidChangeConfiguration"></a><span class="ts" id=3484 data-target="#details-3484" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeConfiguration</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#ConfigurationChangeEvent">ConfigurationChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-3484">
<div class="comment"><p>An event that is emitted when the <a href="#WorkspaceConfiguration">configuration</a> changed.</p>
</div>
</div>



<a name="workspace.onDidChangeNotebookDocument"></a><span class="ts" id=3473 data-target="#details-3473" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeNotebookDocument</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#NotebookDocumentChangeEvent">NotebookDocumentChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-3473">
<div class="comment"><p>An event that is emitted when a <a href="#NotebookDocument">notebook</a> has changed.</p>
</div>
</div>



<a name="workspace.onDidChangeTextDocument"></a><span class="ts" id=3469 data-target="#details-3469" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeTextDocument</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TextDocumentChangeEvent">TextDocumentChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-3469">
<div class="comment"><p>An event that is emitted when a <a href="#TextDocument">text document</a> is changed. This usually happens
when the <a href="#TextDocument.getText">contents</a> changes but also when other things like the
<a href="#TextDocument.isDirty">dirty</a>-state changes.</p>
</div>
</div>



<a name="workspace.onDidChangeWorkspaceFolders"></a><span class="ts" id=3465 data-target="#details-3465" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeWorkspaceFolders</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#WorkspaceFoldersChangeEvent">WorkspaceFoldersChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-3465">
<div class="comment"><p>An event that is emitted when a workspace folder is added or removed.</p>
<p><strong>Note:</strong> this event will not fire if the first workspace folder is added, removed or changed,
because in that case the currently executing extensions (including the one that listens to this
event) will be terminated and restarted so that the (deprecated) <code>rootPath</code> property is updated
to point to the first workspace folder.</p>
</div>
</div>



<a name="workspace.onDidCloseNotebookDocument"></a><span class="ts" id=3477 data-target="#details-3477" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidCloseNotebookDocument</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#NotebookDocument">NotebookDocument</a>&gt;</span>
<div class="details collapse" id="details-3477">
<div class="comment"><p>An event that is emitted when a <a href="#NotebookDocument">notebook</a> is disposed.</p>
<p><em>Note 1:</em> There is no guarantee that this event fires when an editor tab is closed.</p>
<p><em>Note 2:</em> A notebook can be open but not shown in an editor which means this event can fire
for a notebook that has not been shown in an editor.</p>
</div>
</div>



<a name="workspace.onDidCloseTextDocument"></a><span class="ts" id=3468 data-target="#details-3468" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidCloseTextDocument</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TextDocument">TextDocument</a>&gt;</span>
<div class="details collapse" id="details-3468">
<div class="comment"><p>An event that is emitted when a <a href="#TextDocument">text document</a> is disposed or when the language id
of a text document <a href="#languages.setTextDocumentLanguage">has been changed</a>.</p>
<p><em>Note 1:</em> There is no guarantee that this event fires when an editor tab is closed, use the
<a href="#window.onDidChangeVisibleTextEditors">onDidChangeVisibleTextEditors</a>-event to know when editors change.</p>
<p><em>Note 2:</em> A document can be open but not shown in an editor which means this event can fire
for a document that has not been shown in an editor.</p>
</div>
</div>



<a name="workspace.onDidCreateFiles"></a><span class="ts" id=3479 data-target="#details-3479" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidCreateFiles</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#FileCreateEvent">FileCreateEvent</a>&gt;</span>
<div class="details collapse" id="details-3479">
<div class="comment"><p>An event that is emitted when files have been created.</p>
<p><em>Note:</em> This event is triggered by user gestures, like creating a file from the
explorer, or from the <a href="#workspace.applyEdit">workspace.applyEdit</a>-api, but this event is <em>not</em> fired when
files change on disk, e.g triggered by another application, or when using the
<a href="#FileSystem">workspace.fs</a>-api.</p>
</div>
</div>



<a name="workspace.onDidDeleteFiles"></a><span class="ts" id=3481 data-target="#details-3481" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidDeleteFiles</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#FileDeleteEvent">FileDeleteEvent</a>&gt;</span>
<div class="details collapse" id="details-3481">
<div class="comment"><p>An event that is emitted when files have been deleted.</p>
<p><em>Note 1:</em> This event is triggered by user gestures, like deleting a file from the
explorer, or from the <a href="#workspace.applyEdit">workspace.applyEdit</a>-api, but this event is <em>not</em> fired when
files change on disk, e.g triggered by another application, or when using the
<a href="#FileSystem">workspace.fs</a>-api.</p>
<p><em>Note 2:</em> When deleting a folder with children only one event is fired.</p>
</div>
</div>



<a name="workspace.onDidGrantWorkspaceTrust"></a><span class="ts" id=3486 data-target="#details-3486" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidGrantWorkspaceTrust</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3486">
<div class="comment"><p>Event that fires when the current workspace has been trusted.</p>
</div>
</div>



<a name="workspace.onDidOpenNotebookDocument"></a><span class="ts" id=3476 data-target="#details-3476" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidOpenNotebookDocument</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#NotebookDocument">NotebookDocument</a>&gt;</span>
<div class="details collapse" id="details-3476">
<div class="comment"><p>An event that is emitted when a <a href="#NotebookDocument">notebook</a> is opened.</p>
</div>
</div>



<a name="workspace.onDidOpenTextDocument"></a><span class="ts" id=3467 data-target="#details-3467" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidOpenTextDocument</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TextDocument">TextDocument</a>&gt;</span>
<div class="details collapse" id="details-3467">
<div class="comment"><p>An event that is emitted when a <a href="#TextDocument">text document</a> is opened or when the language id
of a text document <a href="#languages.setTextDocumentLanguage">has been changed</a>.</p>
<p>To add an event listener when a visible text document is opened, use the <a href="#TextEditor">TextEditor</a> events in the
<a href="#window">window</a> namespace. Note that:</p>
<ul>
<li>The event is emitted before the <a href="#TextDocument">document</a> is updated in the
<a href="#window.activeTextEditor">active text editor</a></li>
<li>When a <a href="#TextDocument">text document</a> is already open (e.g.: open in another <a href="#window.visibleTextEditors">visible text editor</a>) this event is not emitted</li>
</ul>
</div>
</div>



<a name="workspace.onDidRenameFiles"></a><span class="ts" id=3483 data-target="#details-3483" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidRenameFiles</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#FileRenameEvent">FileRenameEvent</a>&gt;</span>
<div class="details collapse" id="details-3483">
<div class="comment"><p>An event that is emitted when files have been renamed.</p>
<p><em>Note 1:</em> This event is triggered by user gestures, like renaming a file from the
explorer, and from the <a href="#workspace.applyEdit">workspace.applyEdit</a>-api, but this event is <em>not</em> fired when
files change on disk, e.g triggered by another application, or when using the
<a href="#FileSystem">workspace.fs</a>-api.</p>
<p><em>Note 2:</em> When renaming a folder with children only one event is fired.</p>
</div>
</div>



<a name="workspace.onDidSaveNotebookDocument"></a><span class="ts" id=3475 data-target="#details-3475" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidSaveNotebookDocument</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#NotebookDocument">NotebookDocument</a>&gt;</span>
<div class="details collapse" id="details-3475">
<div class="comment"><p>An event that is emitted when a <a href="#NotebookDocument">notebook</a> is saved.</p>
</div>
</div>



<a name="workspace.onDidSaveTextDocument"></a><span class="ts" id=3471 data-target="#details-3471" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidSaveTextDocument</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TextDocument">TextDocument</a>&gt;</span>
<div class="details collapse" id="details-3471">
<div class="comment"><p>An event that is emitted when a <a href="#TextDocument">text document</a> is saved to disk.</p>
</div>
</div>



<a name="workspace.onWillCreateFiles"></a><span class="ts" id=3478 data-target="#details-3478" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onWillCreateFiles</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#FileWillCreateEvent">FileWillCreateEvent</a>&gt;</span>
<div class="details collapse" id="details-3478">
<div class="comment"><p>An event that is emitted when files are being created.</p>
<p><em>Note 1:</em> This event is triggered by user gestures, like creating a file from the
explorer, or from the <a href="#workspace.applyEdit">workspace.applyEdit</a>-api. This event is <em>not</em> fired when
files change on disk, e.g triggered by another application, or when using the
<a href="#FileSystem">workspace.fs</a>-api.</p>
<p><em>Note 2:</em> When this event is fired, edits to files that are are being created cannot be applied.</p>
</div>
</div>



<a name="workspace.onWillDeleteFiles"></a><span class="ts" id=3480 data-target="#details-3480" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onWillDeleteFiles</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#FileWillDeleteEvent">FileWillDeleteEvent</a>&gt;</span>
<div class="details collapse" id="details-3480">
<div class="comment"><p>An event that is emitted when files are being deleted.</p>
<p><em>Note 1:</em> This event is triggered by user gestures, like deleting a file from the
explorer, or from the <a href="#workspace.applyEdit">workspace.applyEdit</a>-api, but this event is <em>not</em> fired when
files change on disk, e.g triggered by another application, or when using the
<a href="#FileSystem">workspace.fs</a>-api.</p>
<p><em>Note 2:</em> When deleting a folder with children only one event is fired.</p>
</div>
</div>



<a name="workspace.onWillRenameFiles"></a><span class="ts" id=3482 data-target="#details-3482" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onWillRenameFiles</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#FileWillRenameEvent">FileWillRenameEvent</a>&gt;</span>
<div class="details collapse" id="details-3482">
<div class="comment"><p>An event that is emitted when files are being renamed.</p>
<p><em>Note 1:</em> This event is triggered by user gestures, like renaming a file from the
explorer, and from the <a href="#workspace.applyEdit">workspace.applyEdit</a>-api, but this event is <em>not</em> fired when
files change on disk, e.g triggered by another application, or when using the
<a href="#FileSystem">workspace.fs</a>-api.</p>
<p><em>Note 2:</em> When renaming a folder with children only one event is fired.</p>
</div>
</div>



<a name="workspace.onWillSaveNotebookDocument"></a><span class="ts" id=3474 data-target="#details-3474" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onWillSaveNotebookDocument</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#NotebookDocumentWillSaveEvent">NotebookDocumentWillSaveEvent</a>&gt;</span>
<div class="details collapse" id="details-3474">
<div class="comment"><p>An event that is emitted when a <a href="#NotebookDocument">notebook document</a> will be saved to disk.</p>
<p><em>Note 1:</em> Subscribers can delay saving by registering asynchronous work. For the sake of data integrity the editor
might save without firing this event. For instance when shutting down with dirty files.</p>
<p><em>Note 2:</em> Subscribers are called sequentially and they can <a href="#NotebookDocumentWillSaveEvent.waitUntil">delay</a> saving
by registering asynchronous work. Protection against misbehaving listeners is implemented as such:</p>
<ul>
<li>there is an overall time budget that all listeners share and if that is exhausted no further listener is called</li>
<li>listeners that take a long time or produce errors frequently will not be called anymore</li>
</ul>
<p>The current thresholds are 1.5 seconds as overall time budget and a listener can misbehave 3 times before being ignored.</p>
</div>
</div>



<a name="workspace.onWillSaveTextDocument"></a><span class="ts" id=3470 data-target="#details-3470" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onWillSaveTextDocument</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TextDocumentWillSaveEvent">TextDocumentWillSaveEvent</a>&gt;</span>
<div class="details collapse" id="details-3470">
<div class="comment"><p>An event that is emitted when a <a href="#TextDocument">text document</a> will be saved to disk.</p>
<p><em>Note 1:</em> Subscribers can delay saving by registering asynchronous work. For the sake of data integrity the editor
might save without firing this event. For instance when shutting down with dirty files.</p>
<p><em>Note 2:</em> Subscribers are called sequentially and they can <a href="#TextDocumentWillSaveEvent.waitUntil">delay</a> saving
by registering asynchronous work. Protection against misbehaving listeners is implemented as such:</p>
<ul>
<li>there is an overall time budget that all listeners share and if that is exhausted no further listener is called</li>
<li>listeners that take a long time or produce errors frequently will not be called anymore</li>
</ul>
<p>The current thresholds are 1.5 seconds as overall time budget and a listener can misbehave 3 times before being ignored.</p>
</div>
</div>

#### Functions



<a name="workspace.applyEdit"></a><span class="ts" id=3383 data-target="#details-3383" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">applyEdit</span><span>(</span><span class="ident">edit</span><span>: </span><a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a>, <span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditMetadata">WorkspaceEditMetadata</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-3383">
<div class="comment"><p>Make changes to one or many resources or create, delete, and rename resources as defined by the given
<a href="#WorkspaceEdit">workspace edit</a>.</p>
<p>All changes of a workspace edit are applied in the same order in which they have been added. If
multiple textual inserts are made at the same position, these strings appear in the resulting text
in the order the &#39;inserts&#39; were made, unless that are interleaved with resource edits. Invalid sequences
like &#39;delete file a&#39; -&gt; &#39;insert text in file a&#39; cause failure of the operation.</p>
<p>When applying a workspace edit that consists only of text edits an &#39;all-or-nothing&#39;-strategy is used.
A workspace edit with resource creations or deletions aborts the operation, e.g. consecutive edits will
not be attempted, when a single edit fails.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">edit</span><span>: </span><a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a></td><td><div class="comment"><p>A workspace edit.</p>
</div></td></tr>
<tr><td><span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditMetadata">WorkspaceEditMetadata</a></td><td><div class="comment"><p>Optional <a href="#WorkspaceEditMetadata">metadata</a> for the edit.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>A thenable that resolves when the edit could be applied.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.asRelativePath"></a><span class="ts" id=3350 data-target="#details-3350" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">asRelativePath</span><span>(</span><span class="ident">pathOrUri</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a>, <span class="ident">includeWorkspaceFolder</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3350">
<div class="comment"><p>Returns a path that is relative to the workspace folder or folders.</p>
<p>When there are no <a href="#workspace.workspaceFolders">workspace folders</a> or when the path
is not contained in them, the input is returned.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">pathOrUri</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A path or uri. When a uri is given its <a href="#Uri.fsPath">fsPath</a> is used.</p>
</div></td></tr>
<tr><td><span class="ident">includeWorkspaceFolder</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>When <code>true</code> and when the given path is contained inside a
workspace folder the name of the workspace is prepended. Defaults to <code>true</code> when there are
multiple workspace folders and <code>false</code> otherwise.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A path relative to the root or the input.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.createFileSystemWatcher"></a><span class="ts" id=3362 data-target="#details-3362" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createFileSystemWatcher</span><span>(</span><span class="ident">globPattern</span><span>: </span><a class="type-ref" href="#GlobPattern">GlobPattern</a>, <span class="ident">ignoreCreateEvents</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span>, <span class="ident">ignoreChangeEvents</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span>, <span class="ident">ignoreDeleteEvents</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><a class="type-ref" href="#FileSystemWatcher">FileSystemWatcher</a></span>
<div class="details collapse" id="details-3362">
<div class="comment"><p>Creates a file system watcher that is notified on file events (create, change, delete)
depending on the parameters provided.</p>
<p>By default, all opened <a href="#workspace.workspaceFolders">workspace folders</a> will be watched
for file changes recursively.</p>
<p>Additional paths can be added for file watching by providing a <a href="#RelativePattern">RelativePattern</a> with
a <code>base</code> path to watch. If the path is a folder and the <code>pattern</code> is complex (e.g. contains
<code>**</code> or path segments), it will be watched recursively and otherwise will be watched
non-recursively (i.e. only changes to the first level of the path will be reported).</p>
<p><em>Note</em> that paths that do not exist in the file system will be monitored with a delay until
created and then watched depending on the parameters provided. If a watched path is deleted,
the watcher will suspend and not report any events until the path is created again.</p>
<p>If possible, keep the use of recursive watchers to a minimum because recursive file watching
is quite resource intense.</p>
<p>Providing a <code>string</code> as <code>globPattern</code> acts as convenience method for watching file events in
all opened workspace folders. It cannot be used to add more folders for file watching, nor will
it report any file events from folders that are not part of the opened workspace folders.</p>
<p><em>Note</em> that case-sensitivity of the <a href="#workspace.createFileSystemWatcher.globPattern">globPattern</a> parameter will depend on the file system
where the watcher is running: on Windows and macOS the matching will be case-insensitive and
on Linux it will be case-sensitive.</p>
<p>Optionally, flags to ignore certain kinds of events can be provided.</p>
<p>To stop listening to events the watcher must be disposed.</p>
<p><em>Note</em> that file events from deleting a folder may not include events for the contained files.
For example, when a folder is moved to the trash, only one event is reported because technically
this is a rename/move operation and not a delete operation for each files within.
On top of that, performance optimizations are in place to fold multiple events that all belong
to the same parent operation (e.g. delete folder) into one event for that parent. As such, if
you need to know about all deleted files, you have to watch with <code>**</code> and deal with all file
events yourself.</p>
<p><em>Note</em> that file events from recursive file watchers may be excluded based on user configuration.
The setting <code>files.watcherExclude</code> helps to reduce the overhead of file events from folders
that are known to produce many file changes at once (such as <code>.git</code> folders). As such,
it is highly recommended to watch with simple patterns that do not require recursive watchers
where the exclude settings are ignored and you have full control over the events.</p>
<p><em>Note</em> that symbolic links are not automatically followed for file watching unless the path to
watch itself is a symbolic link.</p>
<p><em>Note</em> that the file paths that are reported for having changed may have a different path casing
compared to the actual casing on disk on case-insensitive platforms (typically macOS and Windows
but not Linux). We allow a user to open a workspace folder with any desired path casing and try
to preserve that. This means:</p>
<ul>
<li>if the path is within any of the workspace folders, the path will match the casing of the
workspace folder up to that portion of the path and match the casing on disk for children</li>
<li>if the path is outside of any of the workspace folders, the casing will match the case of the
path that was provided for watching
In the same way, symbolic links are preserved, i.e. the file event will report the path of the
symbolic link as it was provided for watching and not the target.</li>
</ul>
<h3 id="examples">Examples</h3>
<p>The basic anatomy of a file watcher is as follows:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> watcher</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createFileSystemWatcher</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">RelativePattern</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">folder</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">>, &#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">pattern</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">>));</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">watcher</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onDidChange</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uri</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> { ... }); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// listen to files being changed</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">watcher</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onDidCreate</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uri</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> { ... }); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// listen to files/folders being created</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">watcher</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onDidDelete</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uri</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> { ... }); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// listen to files/folders getting deleted</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">watcher</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">dispose</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// dispose after usage</span></span></code></pre>
<h4 id="workspace-file-watching">Workspace file watching</h4>
<p>If you only care about file events in a specific workspace folder:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createFileSystemWatcher</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">  new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">RelativePattern</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspaceFolders</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">[</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">0</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">], </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'**/*.js'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">)</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span></code></pre>
<p>If you want to monitor file events across all opened workspace folders:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createFileSystemWatcher</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'**/*.js'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span></code></pre>
<p><em>Note:</em> the array of workspace folders can be empty if no workspace is opened (empty window).</p>
<h4 id="out-of-workspace-file-watching">Out of workspace file watching</h4>
<p>To watch a folder for changes to *.js files outside the workspace (non recursively), pass in a <code>Uri</code> to such
a folder:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createFileSystemWatcher</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">RelativePattern</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">Uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">file</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">path</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99"> to</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99"> folder</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99"> outside</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99"> workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">>), </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'*.js'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">));</span></span></code></pre>
<p>And use a complex glob pattern to watch recursively:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createFileSystemWatcher</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">RelativePattern</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">Uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">file</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">path</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99"> to</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99"> folder</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99"> outside</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99"> workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">>), </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'**/*.js'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">));</span></span></code></pre>
<p>Here is an example for watching the active editor for file changes:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createFileSystemWatcher</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">  new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">RelativePattern</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">activeTextEditor</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">document</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'*'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">)</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">globPattern</span><span>: </span><a class="type-ref" href="#GlobPattern">GlobPattern</a></td><td><div class="comment"><p>A <a href="#GlobPattern">glob pattern</a> that controls which file events the watcher should report.</p>
</div></td></tr>
<tr><td><span class="ident">ignoreCreateEvents</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Ignore when files have been created.</p>
</div></td></tr>
<tr><td><span class="ident">ignoreChangeEvents</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Ignore when files have been changed.</p>
</div></td></tr>
<tr><td><span class="ident">ignoreDeleteEvents</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Ignore when files have been deleted.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FileSystemWatcher">FileSystemWatcher</a></td><td><div class="comment"><p>A new file system watcher instance. Must be disposed when no longer needed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.decode"></a><span class="ts" id=3435 data-target="#details-3435" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">decode</span><span>(</span><span class="ident">content</span><span>: </span><span class="type-ref-ts">Uint8Array</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-3435">
<div class="comment"><p>Decodes the content from a <code>Uint8Array</code> to a <code>string</code>. You MUST
provide the entire content at once to ensure that the encoding
can properly apply. Do not use this method to decode content
in chunks, as that may lead to incorrect results.</p>
<p>Will pick an encoding based on settings and the content of the
buffer (for example byte order marks).</p>
<p><em>Note</em> that if you decode content that is unsupported by the
encoding, the result may contain substitution characters as
appropriate.</p>
<ul>
<li><em>throws</em> - This method will throw an error when the content is binary.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-ref-ts">Uint8Array</span></td><td><div class="comment"><p>The text content to decode as a <code>Uint8Array</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the decoded <code>string</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.decode"></a><span class="ts" id=3437 data-target="#details-3437" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">decode</span><span>(</span><span class="ident">content</span><span>: </span><span class="type-ref-ts">Uint8Array</span>, <span class="ident">options</span><span>: </span>{encoding: <span class="type-intrinsic">string</span>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-3437">
<div class="comment"><p>Decodes the content from a <code>Uint8Array</code> to a <code>string</code> using the
provided encoding. You MUST provide the entire content at once
to ensure that the encoding can properly apply. Do not use this
method to decode content in chunks, as that may lead to incorrect
results.</p>
<p><em>Note</em> that if you decode content that is unsupported by the
encoding, the result may contain substitution characters as
appropriate.</p>
<ul>
<li><em>throws</em> - This method will throw an error when the content is binary.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-ref-ts">Uint8Array</span></td><td><div class="comment"><p>The text content to decode as a <code>Uint8Array</code>.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span>{encoding: <span class="type-intrinsic">string</span>}</td><td><div class="comment"><p>Additional context for picking the encoding.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the decoded <code>string</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.decode"></a><span class="ts" id=3442 data-target="#details-3442" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">decode</span><span>(</span><span class="ident">content</span><span>: </span><span class="type-ref-ts">Uint8Array</span>, <span class="ident">options</span><span>: </span>{uri: <a class="type-ref" href="#Uri">Uri</a>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-3442">
<div class="comment"><p>Decodes the content from a <code>Uint8Array</code> to a <code>string</code>. You MUST
provide the entire content at once to ensure that the encoding
can properly apply. Do not use this method to decode content
in chunks, as that may lead to incorrect results.</p>
<p>The encoding is picked based on settings and the content
of the buffer (for example byte order marks).</p>
<p><em>Note</em> that if you decode content that is unsupported by the
encoding, the result may contain substitution characters as
appropriate.</p>
<ul>
<li><em>throws</em> - This method will throw an error when the content is binary.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-ref-ts">Uint8Array</span></td><td><div class="comment"><p>The content to decode as a <code>Uint8Array</code>.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span>{uri: <a class="type-ref" href="#Uri">Uri</a>}</td><td><div class="comment"><p>Additional context for picking the encoding.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the decoded <code>string</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.encode"></a><span class="ts" id=3448 data-target="#details-3448" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">encode</span><span>(</span><span class="ident">content</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</span>
<div class="details collapse" id="details-3448">
<div class="comment"><p>Encodes the content of a <code>string</code> to a <code>Uint8Array</code>.</p>
<p>Will pick an encoding based on settings.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The content to decode as a <code>string</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</td><td><div class="comment"><p>A thenable that resolves to the encoded <code>Uint8Array</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.encode"></a><span class="ts" id=3450 data-target="#details-3450" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">encode</span><span>(</span><span class="ident">content</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>: </span>{encoding: <span class="type-intrinsic">string</span>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</span>
<div class="details collapse" id="details-3450">
<div class="comment"><p>Encodes the content of a <code>string</code> to a <code>Uint8Array</code> using the
provided encoding.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The content to decode as a <code>string</code>.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span>{encoding: <span class="type-intrinsic">string</span>}</td><td><div class="comment"><p>Additional context for picking the encoding.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</td><td><div class="comment"><p>A thenable that resolves to the encoded <code>Uint8Array</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.encode"></a><span class="ts" id=3455 data-target="#details-3455" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">encode</span><span>(</span><span class="ident">content</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>: </span>{uri: <a class="type-ref" href="#Uri">Uri</a>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</span>
<div class="details collapse" id="details-3455">
<div class="comment"><p>Encodes the content of a <code>string</code> to a <code>Uint8Array</code>.</p>
<p>The encoding is picked based on settings.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The content to decode as a <code>string</code>.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span>{uri: <a class="type-ref" href="#Uri">Uri</a>}</td><td><div class="comment"><p>Additional context for picking the encoding.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</td><td><div class="comment"><p>A thenable that resolves to the encoded <code>Uint8Array</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.findFiles"></a><span class="ts" id=3368 data-target="#details-3368" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">findFiles</span><span>(</span><span class="ident">include</span><span>: </span><a class="type-ref" href="#GlobPattern">GlobPattern</a>, <span class="ident">exclude</span><span>?</span><span>: </span><a class="type-ref" href="#GlobPattern">GlobPattern</a>, <span class="ident">maxResults</span><span>?</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Uri">Uri</a>[]&gt;</span>
<div class="details collapse" id="details-3368">
<div class="comment"><p>Find files across all <a href="#workspace.workspaceFolders">workspace folders</a> in the workspace.</p>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">findFiles</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'**/*.js'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'**/node_modules/**'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">10</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">include</span><span>: </span><a class="type-ref" href="#GlobPattern">GlobPattern</a></td><td><div class="comment"><p>A <a href="#GlobPattern">glob pattern</a> that defines the files to search for. The glob pattern
will be matched against the file paths of resulting matches relative to their workspace. Use a <a href="#RelativePattern">relative pattern</a>
to restrict the search results to a <a href="#WorkspaceFolder">workspace folder</a>.</p>
</div></td></tr>
<tr><td><span class="ident">exclude</span><span>?</span><span>: </span><a class="type-ref" href="#GlobPattern">GlobPattern</a></td><td><div class="comment"><p>A <a href="#GlobPattern">glob pattern</a> that defines files and folders to exclude. The glob pattern
will be matched against the file paths of resulting matches relative to their workspace. When <code>undefined</code>, default file-excludes (e.g. the <code>files.exclude</code>-setting
but not <code>search.exclude</code>) will apply. When <code>null</code>, no excludes will apply.</p>
</div></td></tr>
<tr><td><span class="ident">maxResults</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>An upper-bound for the result.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A token that can be used to signal cancellation to the underlying search engine.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Uri">Uri</a>[]&gt;</td><td><div class="comment"><p>A thenable that resolves to an array of resource identifiers. Will return no results if no
<a href="#workspace.workspaceFolders">workspace folders</a> are opened.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.getConfiguration"></a><span class="ts" id=3419 data-target="#details-3419" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getConfiguration</span><span>(</span><span class="ident">section</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">scope</span><span>?</span><span>: </span><a class="type-ref" href="#ConfigurationScope">ConfigurationScope</a><span>)</span><span>: </span><a class="type-ref" href="#WorkspaceConfiguration">WorkspaceConfiguration</a></span>
<div class="details collapse" id="details-3419">
<div class="comment"><p>Get a workspace configuration object.</p>
<p>When a section-identifier is provided only that part of the configuration
is returned. Dots in the section-identifier are interpreted as child-access,
like <code>{ myExt: { setting: { doIt: true }}}</code> and <code>getConfiguration(&#39;myExt.setting&#39;).get(&#39;doIt&#39;) === true</code>.</p>
<p>When a scope is provided configuration confined to that scope is returned. Scope can be a resource or a language identifier or both.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">section</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A dot-separated identifier.</p>
</div></td></tr>
<tr><td><span class="ident">scope</span><span>?</span><span>: </span><a class="type-ref" href="#ConfigurationScope">ConfigurationScope</a></td><td><div class="comment"><p>A scope for which the configuration is asked for.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#WorkspaceConfiguration">WorkspaceConfiguration</a></td><td><div class="comment"><p>The full configuration or a subset.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.getWorkspaceFolder"></a><span class="ts" id=3347 data-target="#details-3347" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getWorkspaceFolder</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a></span>
<div class="details collapse" id="details-3347">
<div class="comment"><p>Returns the <a href="#WorkspaceFolder">workspace folder</a> that contains a given uri.</p>
<ul>
<li>returns <code>undefined</code> when the given uri doesn&#39;t match any workspace folder</li>
<li>returns the <em>input</em> when the given uri is a workspace folder itself</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>An uri.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a></td><td><div class="comment"><p>A workspace folder or <code>undefined</code></p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.openNotebookDocument"></a><span class="ts" id=3408 data-target="#details-3408" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">openNotebookDocument</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#NotebookDocument">NotebookDocument</a>&gt;</span>
<div class="details collapse" id="details-3408">
<div class="comment"><p>Open a notebook. Will return early if this notebook is already <a href="#workspace.notebookDocuments">loaded</a>. Otherwise
the notebook is loaded and the <a href="#workspace.onDidOpenNotebookDocument">onDidOpenNotebookDocument</a>-event fires.</p>
<p><em>Note</em> that the lifecycle of the returned notebook is owned by the editor and not by the extension. That means an
<a href="#workspace.onDidCloseNotebookDocument">onDidCloseNotebookDocument</a>-event can occur at any time after.</p>
<p><em>Note</em> that opening a notebook does not show a notebook editor. This function only returns a notebook document which
can be shown in a notebook editor but it can also be used for other things.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The resource to open.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#NotebookDocument">NotebookDocument</a>&gt;</td><td><div class="comment"><p>A promise that resolves to a <a href="#NotebookDocument">notebook</a></p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.openNotebookDocument"></a><span class="ts" id=3410 data-target="#details-3410" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">openNotebookDocument</span><span>(</span><span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">content</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookData">NotebookData</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#NotebookDocument">NotebookDocument</a>&gt;</span>
<div class="details collapse" id="details-3410">
<div class="comment"><p>Open an untitled notebook. The editor will prompt the user for a file
path when the document is to be saved.</p>
<p><em>See also</em>
<a href="#workspace.openNotebookDocument">workspace.openNotebookDocument</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The notebook type that should be used.</p>
</div></td></tr>
<tr><td><span class="ident">content</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookData">NotebookData</a></td><td><div class="comment"><p>The initial contents of the notebook.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#NotebookDocument">NotebookDocument</a>&gt;</td><td><div class="comment"><p>A promise that resolves to a <a href="#NotebookDocument">notebook</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.openTextDocument"></a><span class="ts" id=3387 data-target="#details-3387" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">openTextDocument</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">options</span><span>?</span><span>: </span>{encoding: <span class="type-intrinsic">string</span>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextDocument">TextDocument</a>&gt;</span>
<div class="details collapse" id="details-3387">
<div class="comment"><p>Opens a document. Will return early if this document is already open. Otherwise
the document is loaded and the <a href="#workspace.onDidOpenTextDocument">didOpen</a>-event fires.</p>
<p>The document is denoted by an <a href="#Uri">Uri</a>. Depending on the <a href="#Uri.scheme">scheme</a> the
following rules apply:</p>
<ul>
<li><code>file</code>-scheme: Open a file on disk (<code>openTextDocument(Uri.file(path))</code>). Will be rejected if the file
does not exist or cannot be loaded.</li>
<li><code>untitled</code>-scheme: Open a blank untitled file with associated path (<code>openTextDocument(Uri.file(path).with({ scheme: &#39;untitled&#39; }))</code>).
The language will be derived from the file name.</li>
<li>For all other schemes contributed <a href="#TextDocumentContentProvider">text document content providers</a> and
<a href="#FileSystemProvider">file system providers</a> are consulted.</li>
</ul>
<p><em>Note</em> that the lifecycle of the returned document is owned by the editor and not by the extension. That means an
<a href="#workspace.onDidCloseTextDocument">onDidClose</a>-event can occur at any time after opening it.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Identifies the resource to open.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{encoding: <span class="type-intrinsic">string</span>}</td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextDocument">TextDocument</a>&gt;</td><td><div class="comment"><p>A promise that resolves to a <a href="#TextDocument">document</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.openTextDocument"></a><span class="ts" id=3392 data-target="#details-3392" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">openTextDocument</span><span>(</span><span class="ident">path</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>?</span><span>: </span>{encoding: <span class="type-intrinsic">string</span>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextDocument">TextDocument</a>&gt;</span>
<div class="details collapse" id="details-3392">
<div class="comment"><p>A short-hand for <code>openTextDocument(Uri.file(path))</code>.</p>
<p><em>See also</em>
<a href="#workspace.openTextDocument">workspace.openTextDocument</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">path</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A path of a file on disk.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{encoding: <span class="type-intrinsic">string</span>}</td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextDocument">TextDocument</a>&gt;</td><td><div class="comment"><p>A promise that resolves to a <a href="#TextDocument">document</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.openTextDocument"></a><span class="ts" id=3397 data-target="#details-3397" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">openTextDocument</span><span>(</span><span class="ident">options</span><span>?</span><span>: </span>{content: <span class="type-intrinsic">string</span>, encoding: <span class="type-intrinsic">string</span>, language: <span class="type-intrinsic">string</span>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextDocument">TextDocument</a>&gt;</span>
<div class="details collapse" id="details-3397">
<div class="comment"><p>Opens an untitled text document. The editor will prompt the user for a file
path when the document is to be saved. The <code>options</code> parameter allows to
specify the <em>language</em> and/or the <em>content</em> of the document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{content: <span class="type-intrinsic">string</span>, encoding: <span class="type-intrinsic">string</span>, language: <span class="type-intrinsic">string</span>}</td><td><div class="comment"><p>Options to control how the document will be created.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TextDocument">TextDocument</a>&gt;</td><td><div class="comment"><p>A promise that resolves to a <a href="#TextDocument">document</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.registerFileSystemProvider"></a><span class="ts" id=3427 data-target="#details-3427" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerFileSystemProvider</span><span>(</span><span class="ident">scheme</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#FileSystemProvider">FileSystemProvider</a>, <span class="ident">options</span><span>?</span><span>: </span>{isCaseSensitive: <span class="type-intrinsic">boolean</span>, isReadonly: <span class="type-intrinsic">boolean</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a>}<span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3427">
<div class="comment"><p>Register a filesystem provider for a given scheme, e.g. <code>ftp</code>.</p>
<p>There can only be one provider per scheme and an error is being thrown when a scheme
has been claimed by another provider or when it is reserved.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">scheme</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The uri-<a href="#Uri.scheme">scheme</a> the provider registers for.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#FileSystemProvider">FileSystemProvider</a></td><td><div class="comment"><p>The filesystem provider.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{isCaseSensitive: <span class="type-intrinsic">boolean</span>, isReadonly: <span class="type-intrinsic">boolean</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a>}</td><td><div class="comment"><p>Immutable metadata about the provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.registerNotebookSerializer"></a><span class="ts" id=3414 data-target="#details-3414" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerNotebookSerializer</span><span>(</span><span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">serializer</span><span>: </span><a class="type-ref" href="#NotebookSerializer">NotebookSerializer</a>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookDocumentContentOptions">NotebookDocumentContentOptions</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3414">
<div class="comment"><p>Register a <a href="#NotebookSerializer">notebook serializer</a>.</p>
<p>A notebook serializer must be contributed through the <code>notebooks</code> extension point. When opening a notebook file, the editor will send
the <code>onNotebook:&lt;notebookType&gt;</code> activation event, and extensions must register their serializer in return.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A notebook.</p>
</div></td></tr>
<tr><td><span class="ident">serializer</span><span>: </span><a class="type-ref" href="#NotebookSerializer">NotebookSerializer</a></td><td><div class="comment"><p>A notebook serializer.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookDocumentContentOptions">NotebookDocumentContentOptions</a></td><td><div class="comment"><p>Optional context options that define what parts of a notebook should be persisted</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this serializer when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.registerTaskProvider"></a><span class="ts" id=3423 data-target="#details-3423" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerTaskProvider</span><span>(</span><span class="ident">type</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#TaskProvider&amp;lt;T&amp;gt;">TaskProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3423">
<div class="comment"><p>Register a task provider.</p>
<ul>
<li><em>deprecated</em> - Use the corresponding function on the <code>tasks</code> namespace instead</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">type</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The task kind type this provider is registered for.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#TaskProvider&amp;lt;T&amp;gt;">TaskProvider</a></td><td><div class="comment"><p>A task provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.registerTextDocumentContentProvider"></a><span class="ts" id=3404 data-target="#details-3404" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">registerTextDocumentContentProvider</span><span>(</span><span class="ident">scheme</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">provider</span><span>: </span><a class="type-ref" href="#TextDocumentContentProvider">TextDocumentContentProvider</a><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-3404">
<div class="comment"><p>Register a text document content provider.</p>
<p>Only one provider can be registered per scheme.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">scheme</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The uri-scheme to register for.</p>
</div></td></tr>
<tr><td><span class="ident">provider</span><span>: </span><a class="type-ref" href="#TextDocumentContentProvider">TextDocumentContentProvider</a></td><td><div class="comment"><p>A content provider.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A <a href="#Disposable">Disposable</a> that unregisters this provider when being disposed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.save"></a><span class="ts" id=3374 data-target="#details-3374" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">save</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</span>
<div class="details collapse" id="details-3374">
<div class="comment"><p>Saves the editor identified by the given resource and returns the resulting resource or <code>undefined</code>
if save was not successful or no editor with the given resource was found.</p>
<p><strong>Note</strong> that an editor with the provided resource must be opened in order to be saved.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>the associated uri for the opened editor to save.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</td><td><div class="comment"><p>A thenable that resolves when the save operation has finished.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.saveAll"></a><span class="ts" id=3380 data-target="#details-3380" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">saveAll</span><span>(</span><span class="ident">includeUntitled</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-3380">
<div class="comment"><p>Save all dirty files.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">includeUntitled</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Also save files that have been created during this session.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>A thenable that resolves when the files have been saved. Will return <code>false</code>
for any file that failed to save.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.saveAs"></a><span class="ts" id=3377 data-target="#details-3377" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">saveAs</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</span>
<div class="details collapse" id="details-3377">
<div class="comment"><p>Saves the editor identified by the given resource to a new file name as provided by the user and
returns the resulting resource or <code>undefined</code> if save was not successful or cancelled or no editor
with the given resource was found.</p>
<p><strong>Note</strong> that an editor with the provided resource must be opened in order to be saved as.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>the associated uri for the opened editor to save as.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</td><td><div class="comment"><p>A thenable that resolves when the save-as operation has finished.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="workspace.updateWorkspaceFolders"></a><span class="ts" id=3354 data-target="#details-3354" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">updateWorkspaceFolders</span><span>(</span><span class="ident">start</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">deleteCount</span><span>: </span><span class="type-intrinsic">number</span>, <span>...</span><span class="ident">workspaceFoldersToAdd</span><span>: </span>Array&lt;{name: <span class="type-intrinsic">string</span>, uri: <a class="type-ref" href="#Uri">Uri</a>}&gt;<span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3354">
<div class="comment"><p>This method replaces <code>deleteCount</code> <a href="#workspace.workspaceFolders">workspace folders</a> starting at index <code>start</code>
by an optional set of <code>workspaceFoldersToAdd</code> on the <code>vscode.workspace.workspaceFolders</code> array. This &quot;splice&quot;
behavior can be used to add, remove and change workspace folders in a single operation.</p>
<p><strong>Note:</strong> in some cases calling this method may result in the currently executing extensions (including the
one that called this method) to be terminated and restarted. For example when the first workspace folder is
added, removed or changed the (deprecated) <code>rootPath</code> property is updated to point to the first workspace
folder. Another case is when transitioning from an empty or single-folder workspace into a multi-folder
workspace (see also: <a href="https://code.visualstudio.com/docs/editor/workspaces">https://code.visualstudio.com/docs/editor/workspaces</a>).</p>
<p>Use the <a href="#workspace.onDidChangeWorkspaceFolders">onDidChangeWorkspaceFolders()</a> event to get notified when the
workspace folders have been updated.</p>
<p><strong>Example:</strong> adding a new workspace folder at the end of workspace folders</p>
<pre class="shiki" data-lang="typescript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">updateWorkspaceFolders</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspaceFolders</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> ? </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspaceFolders</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">length</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> : </span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">0</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">null</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, { </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uri:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> ...});</span></span></code></pre>
<p><strong>Example:</strong> removing the first workspace folder</p>
<pre class="shiki" data-lang="typescript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">updateWorkspaceFolders</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">0</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">1</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span></code></pre>
<p><strong>Example:</strong> replacing an existing workspace folder with a new one</p>
<pre class="shiki" data-lang="typescript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">updateWorkspaceFolders</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">0</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">1</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, { </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uri:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> ...});</span></span></code></pre>
<p>It is valid to remove an existing workspace folder and add it again with a different name
to rename that folder.</p>
<p><strong>Note:</strong> it is not valid to call <a href="#workspace.updateWorkspaceFolders">updateWorkspaceFolders()</a> multiple times
without waiting for the <a href="#workspace.onDidChangeWorkspaceFolders">onDidChangeWorkspaceFolders()</a> to fire.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">start</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>the zero-based location in the list of currently opened <a href="#WorkspaceFolder">workspace folders</a>
from which to start deleting workspace folders.</p>
</div></td></tr>
<tr><td><span class="ident">deleteCount</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>the optional number of workspace folders to remove.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">workspaceFoldersToAdd</span><span>: </span>Array&lt;{name: <span class="type-intrinsic">string</span>, uri: <a class="type-ref" href="#Uri">Uri</a>}&gt;</td><td><div class="comment"><p>the optional variable set of workspace folders to add in place of the deleted ones.
Each workspace is identified with a mandatory URI and an optional name.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>true if the operation was successfully started and false otherwise if arguments were used that would result
in invalid workspace folder state (e.g. 2 folders with the same URI).</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="AccessibilityInformation"></a><span class="code-item" id=1907>AccessibilityInformation</span>



<div class="comment"><p>Accessibility information which controls screen reader behavior.</p>
</div>

#### Properties



<a name="AccessibilityInformation.label"></a><span class="ts" id=1908 data-target="#details-1908" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1908">
<div class="comment"><p>Label to be read out by a screen reader once the item has focus.</p>
</div>
</div>



<a name="AccessibilityInformation.role"></a><span class="ts" id=1909 data-target="#details-1909" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">role</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1909">
<div class="comment"><p>Role of the widget which defines how a screen reader interacts with it.
The role should be set in special cases when for example a tree-like element behaves like a checkbox.
If role is not specified the editor will pick the appropriate role automatically.
More about aria roles can be found here <a href="https://w3c.github.io/aria/#widget_roles">https://w3c.github.io/aria/#widget_roles</a></p>
</div>
</div>

### <a name="AuthenticationForceNewSessionOptions"></a><span class="code-item" id=4335>AuthenticationForceNewSessionOptions</span>



<div class="comment"><p>Optional options to be used when calling <a href="#authentication.getSession">authentication.getSession</a> with the flag <code>forceNewSession</code>.</p>
<ul>
<li><em>deprecated</em> - Use <a href="#AuthenticationGetSessionPresentationOptions">AuthenticationGetSessionPresentationOptions</a> instead.</li>
</ul>
</div>



<a name="AuthenticationForceNewSessionOptions"></a><span class="ts" id=4335 data-target="#details-4335" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">AuthenticationForceNewSessionOptions</span><span>: </span><a class="type-ref" href="#AuthenticationGetSessionPresentationOptions">AuthenticationGetSessionPresentationOptions</a></span>

### <a name="AuthenticationGetSessionOptions"></a><span class="code-item" id=4336>AuthenticationGetSessionOptions</span>



<div class="comment"><p>Options to be used when getting an <a href="#AuthenticationSession">AuthenticationSession</a> from an <a href="#AuthenticationProvider">AuthenticationProvider</a>.</p>
</div>

#### Properties



<a name="AuthenticationGetSessionOptions.account"></a><span class="ts" id=4341 data-target="#details-4341" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">account</span><span>?</span><span>: </span><a class="type-ref" href="#AuthenticationSessionAccountInformation">AuthenticationSessionAccountInformation</a></span>
<div class="details collapse" id="details-4341">
<div class="comment"><p>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.</p>
</div>
</div>



<a name="AuthenticationGetSessionOptions.clearSessionPreference"></a><span class="ts" id=4337 data-target="#details-4337" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">clearSessionPreference</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4337">
<div class="comment"><p>Whether the existing session preference should be cleared.</p>
<p>For authentication providers that support being signed into multiple accounts at once, the user will be
prompted to select an account to use when <a href="#authentication.getSession">getSession</a> is called. This preference
is remembered until <a href="#authentication.getSession">getSession</a> is called with this flag.</p>
<p>Note:
The preference is extension specific. So if one extension calls <a href="#authentication.getSession">getSession</a>, it will not
affect the session preference for another extension calling <a href="#authentication.getSession">getSession</a>. Additionally,
the preference is set for the current workspace and also globally. This means that new workspaces will use the &quot;global&quot;
value at first and then when this flag is provided, a new value can be set for that workspace. This also means
that pre-existing workspaces will not lose their preference if a new workspace sets this flag.</p>
<p>Defaults to false.</p>
</div>
</div>



<a name="AuthenticationGetSessionOptions.createIfNone"></a><span class="ts" id=4338 data-target="#details-4338" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createIfNone</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span> &#124; <a class="type-ref" href="#AuthenticationGetSessionPresentationOptions">AuthenticationGetSessionPresentationOptions</a></span>
<div class="details collapse" id="details-4338">
<div class="comment"><p>Whether login should be performed if there is no matching session.</p>
<p>If true, a modal dialog will be shown asking the user to sign in. If false, a numbered badge will be shown
on the accounts activity bar icon. An entry for the extension will be added under the menu to sign in. This
allows quietly prompting the user to sign in.</p>
<p>If you provide options, you will also see the dialog but with the additional context provided.</p>
<p>If there is a matching session but the extension has not been granted access to it, setting this to true
will also result in an immediate modal dialog, and false will add a numbered badge to the accounts icon.</p>
<p>Defaults to false.</p>
<p>Note: you cannot use this option with <a href="#AuthenticationGetSessionOptions.silent">silent</a>.</p>
</div>
</div>



<a name="AuthenticationGetSessionOptions.forceNewSession"></a><span class="ts" id=4339 data-target="#details-4339" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">forceNewSession</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span> &#124; <a class="type-ref" href="#AuthenticationGetSessionPresentationOptions">AuthenticationGetSessionPresentationOptions</a></span>
<div class="details collapse" id="details-4339">
<div class="comment"><p>Whether we should attempt to reauthenticate even if there is already a session available.</p>
<p>If true, a modal dialog will be shown asking the user to sign in again. This is mostly used for scenarios
where the token needs to be re minted because it has lost some authorization.</p>
<p>If you provide options, you will also see the dialog but with the additional context provided.</p>
<p>If there are no existing sessions and forceNewSession is true, it will behave identically to
<a href="#AuthenticationGetSessionOptions.createIfNone">createIfNone</a>.</p>
<p>This defaults to false.</p>
</div>
</div>



<a name="AuthenticationGetSessionOptions.silent"></a><span class="ts" id=4340 data-target="#details-4340" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">silent</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4340">
<div class="comment"><p>Whether we should show the indication to sign in in the Accounts menu.</p>
<p>If false, the user will be shown a badge on the Accounts menu with an option to sign in for the extension.
If true, no indication will be shown.</p>
<p>Defaults to false.</p>
<p>Note: you cannot use this option with any other options that prompt the user like <a href="#AuthenticationGetSessionOptions.createIfNone">createIfNone</a>.</p>
</div>
</div>

### <a name="AuthenticationGetSessionPresentationOptions"></a><span class="code-item" id=4333>AuthenticationGetSessionPresentationOptions</span>



<div class="comment"><p>Optional options to be used when calling <a href="#authentication.getSession">authentication.getSession</a> with interactive options <code>forceNewSession</code> &amp; <code>createIfNone</code>.</p>
</div>

#### Properties



<a name="AuthenticationGetSessionPresentationOptions.detail"></a><span class="ts" id=4334 data-target="#details-4334" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">detail</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4334">
<div class="comment"><p>An optional message that will be displayed to the user when we ask to re-authenticate. Providing additional context
as to why you are asking a user to re-authenticate can help increase the odds that they will accept.</p>
</div>
</div>

### <a name="AuthenticationProvider"></a><span class="code-item" id=4358>AuthenticationProvider</span>



<div class="comment"><p>A provider for performing authentication to a service.</p>
</div>

#### Events



<a name="AuthenticationProvider.onDidChangeSessions"></a><span class="ts" id=4359 data-target="#details-4359" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeSessions</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#AuthenticationProviderAuthenticationSessionsChangeEvent">AuthenticationProviderAuthenticationSessionsChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-4359">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the array of sessions has changed, or data
within a session has changed.</p>
</div>
</div>

#### Methods



<a name="AuthenticationProvider.createSession"></a><span class="ts" id=4365 data-target="#details-4365" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createSession</span><span>(</span><span class="ident">scopes</span><span>: </span>readonly <span class="type-intrinsic">string</span>[], <span class="ident">options</span><span>: </span><a class="type-ref" href="#AuthenticationProviderSessionOptions">AuthenticationProviderSessionOptions</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#AuthenticationSession">AuthenticationSession</a>&gt;</span>
<div class="details collapse" id="details-4365">
<div class="comment"><p>Prompts a user to login.</p>
<p>If login is successful, the onDidChangeSessions event should be fired.</p>
<p>If login fails, a rejected promise should be returned.</p>
<p>If the provider has specified that it does not support multiple accounts,
then this should never be called if there is already an existing session matching these
scopes.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">scopes</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>A list of scopes, permissions, that the new session should be created with.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#AuthenticationProviderSessionOptions">AuthenticationProviderSessionOptions</a></td><td><div class="comment"><p>Additional options for creating a session.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#AuthenticationSession">AuthenticationSession</a>&gt;</td><td><div class="comment"><p>A promise that resolves to an authentication session.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="AuthenticationProvider.getSessions"></a><span class="ts" id=4361 data-target="#details-4361" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getSessions</span><span>(</span><span class="ident">scopes</span><span>: </span>readonly <span class="type-intrinsic">string</span>[], <span class="ident">options</span><span>: </span><a class="type-ref" href="#AuthenticationProviderSessionOptions">AuthenticationProviderSessionOptions</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#AuthenticationSession">AuthenticationSession</a>[]&gt;</span>
<div class="details collapse" id="details-4361">
<div class="comment"><p>Get a list of sessions.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">scopes</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>An optional list of scopes. If provided, the sessions returned should match
these permissions, otherwise all sessions should be returned.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#AuthenticationProviderSessionOptions">AuthenticationProviderSessionOptions</a></td><td><div class="comment"><p>Additional options for getting sessions.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#AuthenticationSession">AuthenticationSession</a>[]&gt;</td><td><div class="comment"><p>A promise that resolves to an array of authentication sessions.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="AuthenticationProvider.removeSession"></a><span class="ts" id=4369 data-target="#details-4369" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">removeSession</span><span>(</span><span class="ident">sessionId</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-4369">
<div class="comment"><p>Removes the session corresponding to session id.</p>
<p>If the removal is successful, the onDidChangeSessions event should be fired.</p>
<p>If a session cannot be removed, the provider should reject with an error message.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">sessionId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The id of the session to remove.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="AuthenticationProviderAuthenticationSessionsChangeEvent"></a><span class="code-item" id=4352>AuthenticationProviderAuthenticationSessionsChangeEvent</span>



<div class="comment"><p>An <a href="#Event">Event</a> which fires when an <a href="#AuthenticationSession">AuthenticationSession</a> is added, removed, or changed.</p>
</div>

#### Properties



<a name="AuthenticationProviderAuthenticationSessionsChangeEvent.added"></a><span class="ts" id=4353 data-target="#details-4353" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">added</span><span>: </span>readonly <a class="type-ref" href="#AuthenticationSession">AuthenticationSession</a>[]</span>
<div class="details collapse" id="details-4353">
<div class="comment"><p>The <a href="#AuthenticationSession">AuthenticationSessions</a> of the <a href="#AuthenticationProvider">AuthenticationProvider</a> that have been added.</p>
</div>
</div>



<a name="AuthenticationProviderAuthenticationSessionsChangeEvent.changed"></a><span class="ts" id=4355 data-target="#details-4355" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">changed</span><span>: </span>readonly <a class="type-ref" href="#AuthenticationSession">AuthenticationSession</a>[]</span>
<div class="details collapse" id="details-4355">
<div class="comment"><p>The <a href="#AuthenticationSession">AuthenticationSessions</a> of the <a href="#AuthenticationProvider">AuthenticationProvider</a> that have been changed.
A session changes when its data excluding the id are updated. An example of this is a session refresh that results in a new
access token being set for the session.</p>
</div>
</div>



<a name="AuthenticationProviderAuthenticationSessionsChangeEvent.removed"></a><span class="ts" id=4354 data-target="#details-4354" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">removed</span><span>: </span>readonly <a class="type-ref" href="#AuthenticationSession">AuthenticationSession</a>[]</span>
<div class="details collapse" id="details-4354">
<div class="comment"><p>The <a href="#AuthenticationSession">AuthenticationSessions</a> of the <a href="#AuthenticationProvider">AuthenticationProvider</a> that have been removed.</p>
</div>
</div>

### <a name="AuthenticationProviderInformation"></a><span class="code-item" id=4345>AuthenticationProviderInformation</span>



<div class="comment"><p>Basic information about an <a href="#AuthenticationProvider">AuthenticationProvider</a></p>
</div>

#### Properties



<a name="AuthenticationProviderInformation.id"></a><span class="ts" id=4346 data-target="#details-4346" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4346">
<div class="comment"><p>The unique identifier of the authentication provider.</p>
</div>
</div>



<a name="AuthenticationProviderInformation.label"></a><span class="ts" id=4347 data-target="#details-4347" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4347">
<div class="comment"><p>The human-readable name of the authentication provider.</p>
</div>
</div>

### <a name="AuthenticationProviderOptions"></a><span class="code-item" id=4350>AuthenticationProviderOptions</span>



<div class="comment"><p>Options for creating an <a href="#AuthenticationProvider">AuthenticationProvider</a>.</p>
</div>

#### Properties



<a name="AuthenticationProviderOptions.supportsMultipleAccounts"></a><span class="ts" id=4351 data-target="#details-4351" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">supportsMultipleAccounts</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4351">
<div class="comment"><p>Whether it is possible to be signed into multiple accounts at once with this provider.
If not specified, will default to false.</p>
</div>
</div>

### <a name="AuthenticationProviderSessionOptions"></a><span class="code-item" id=4356>AuthenticationProviderSessionOptions</span>



<div class="comment"><p>The options passed in to the <a href="#AuthenticationProvider.getSessions">AuthenticationProvider.getSessions</a> and
<a href="#AuthenticationProvider.createSession">AuthenticationProvider.createSession</a> call.</p>
</div>

#### Properties



<a name="AuthenticationProviderSessionOptions.account"></a><span class="ts" id=4357 data-target="#details-4357" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">account</span><span>?</span><span>: </span><a class="type-ref" href="#AuthenticationSessionAccountInformation">AuthenticationSessionAccountInformation</a></span>
<div class="details collapse" id="details-4357">
<div class="comment"><p>The account that is being asked about. If this is passed in, the provider should
attempt to return the sessions that are only related to this account.</p>
</div>
</div>

### <a name="AuthenticationSession"></a><span class="code-item" id=4324>AuthenticationSession</span>



<div class="comment"><p>Represents a session of a currently logged in user.</p>
</div>

#### Properties



<a name="AuthenticationSession.accessToken"></a><span class="ts" id=4326 data-target="#details-4326" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">accessToken</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4326">
<div class="comment"><p>The access token. This token should be used to authenticate requests to a service. Popularized by OAuth.</p>
<ul>
<li><em>reference</em> - <a href="https://oauth.net/2/access-tokens/">https://oauth.net/2/access-tokens/</a></li>
</ul>
</div>
</div>



<a name="AuthenticationSession.account"></a><span class="ts" id=4328 data-target="#details-4328" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">account</span><span>: </span><a class="type-ref" href="#AuthenticationSessionAccountInformation">AuthenticationSessionAccountInformation</a></span>
<div class="details collapse" id="details-4328">
<div class="comment"><p>The account associated with the session.</p>
</div>
</div>



<a name="AuthenticationSession.id"></a><span class="ts" id=4325 data-target="#details-4325" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4325">
<div class="comment"><p>The identifier of the authentication session.</p>
</div>
</div>



<a name="AuthenticationSession.idToken"></a><span class="ts" id=4327 data-target="#details-4327" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">idToken</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4327">
<div class="comment"><p>The ID token. This token contains identity information about the user. Popularized by OpenID Connect.</p>
<ul>
<li><em>reference</em> - <a href="https://openid.net/specs/openid-connect-core-1_0.html#IDToken">https://openid.net/specs/openid-connect-core-1_0.html#IDToken</a></li>
</ul>
</div>
</div>



<a name="AuthenticationSession.scopes"></a><span class="ts" id=4329 data-target="#details-4329" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">scopes</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-4329">
<div class="comment"><p>The permissions granted by the session&#39;s access token. Available scopes
are defined by the <a href="#AuthenticationProvider">AuthenticationProvider</a>.</p>
</div>
</div>

### <a name="AuthenticationSessionAccountInformation"></a><span class="code-item" id=4330>AuthenticationSessionAccountInformation</span>



<div class="comment"><p>The information of an account associated with an <a href="#AuthenticationSession">AuthenticationSession</a>.</p>
</div>

#### Properties



<a name="AuthenticationSessionAccountInformation.id"></a><span class="ts" id=4331 data-target="#details-4331" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4331">
<div class="comment"><p>The unique identifier of the account.</p>
</div>
</div>



<a name="AuthenticationSessionAccountInformation.label"></a><span class="ts" id=4332 data-target="#details-4332" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4332">
<div class="comment"><p>The human-readable name of the account.</p>
</div>
</div>

### <a name="AuthenticationSessionsChangeEvent"></a><span class="code-item" id=4348>AuthenticationSessionsChangeEvent</span>



<div class="comment"><p>An <a href="#Event">Event</a> which fires when an <a href="#AuthenticationSession">AuthenticationSession</a> is added, removed, or changed.</p>
</div>

#### Properties



<a name="AuthenticationSessionsChangeEvent.provider"></a><span class="ts" id=4349 data-target="#details-4349" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provider</span><span>: </span><a class="type-ref" href="#AuthenticationProviderInformation">AuthenticationProviderInformation</a></span>
<div class="details collapse" id="details-4349">
<div class="comment"><p>The <a href="#AuthenticationProvider">AuthenticationProvider</a> that has had its sessions change.</p>
</div>
</div>

### <a name="AuthenticationWwwAuthenticateRequest"></a><span class="code-item" id=4342>AuthenticationWwwAuthenticateRequest</span>



<div class="comment"><p>Represents parameters for creating a session based on a WWW-Authenticate header value.
This is used when an API returns a 401 with a WWW-Authenticate header indicating
that additional authentication is required. The details of which will be passed down
to the authentication provider to create a session.</p>
<ul>
<li><em>note</em> - The authorization provider must support handling challenges and specifically
the challenges in this WWW-Authenticate value.</li>
</ul>
<ul>
<li><em>note</em> - For more information on WWW-Authenticate please see <a href="https://developer.mozilla.org/docs/Web/HTTP/Reference/Headers/WWW-Authenticate">https://developer.mozilla.org/docs/Web/HTTP/Reference/Headers/WWW-Authenticate</a></li>
</ul>
</div>

#### Properties



<a name="AuthenticationWwwAuthenticateRequest.fallbackScopes"></a><span class="ts" id=4344 data-target="#details-4344" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fallbackScopes</span><span>?</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-4344">
<div class="comment"><p>The fallback scopes to use if no scopes are found in the WWW-Authenticate header.</p>
</div>
</div>



<a name="AuthenticationWwwAuthenticateRequest.wwwAuthenticate"></a><span class="ts" id=4343 data-target="#details-4343" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">wwwAuthenticate</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4343">
<div class="comment"><p>The raw WWW-Authenticate header value that triggered this challenge.
This will be parsed by the authentication provider to extract the necessary
challenge information.</p>
</div>
</div>

### <a name="AutoClosingPair"></a><span class="code-item" id=1670>AutoClosingPair</span>



<div class="comment"><p>Describes pairs of strings where the close string will be automatically inserted when typing the opening string.</p>
</div>

#### Properties



<a name="AutoClosingPair.close"></a><span class="ts" id=1672 data-target="#details-1672" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">close</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1672">
<div class="comment"><p>The closing string that will be automatically inserted when typing the opening string.</p>
</div>
</div>



<a name="AutoClosingPair.notIn"></a><span class="ts" id=1673 data-target="#details-1673" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">notIn</span><span>?</span><span>: </span><a class="type-ref" href="#SyntaxTokenType">SyntaxTokenType</a>[]</span>
<div class="details collapse" id="details-1673">
<div class="comment"><p>A set of tokens where the pair should not be auto closed.</p>
</div>
</div>



<a name="AutoClosingPair.open"></a><span class="ts" id=1671 data-target="#details-1671" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">open</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1671">
<div class="comment"><p>The string that will trigger the automatic insertion of the closing string.</p>
</div>
</div>

### <a name="BranchCoverage"></a><span class="code-item" id=4644>BranchCoverage</span>



<div class="comment"><p>Contains coverage information for a branch of a <a href="#StatementCoverage">StatementCoverage</a>.</p>
</div>

#### Constructors



<a name="BranchCoverage.BranchCoverage"></a><span class="ts" id=4646 data-target="#details-4646" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">BranchCoverage</span><span>(</span><span class="ident">executed</span><span>: </span><span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span>, <span class="ident">location</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a>, <span class="ident">label</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#BranchCoverage">BranchCoverage</a></span>
<div class="details collapse" id="details-4646">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">executed</span><span>: </span><span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>The number of times this branch was executed, or a
boolean indicating  whether it was executed if the exact count is
unknown. If zero or false, the branch will be marked as un-covered.</p>
</div></td></tr>
<tr><td><span class="ident">location</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The branch position.</p>
</div></td></tr>
<tr><td><span class="ident">label</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#BranchCoverage">BranchCoverage</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="BranchCoverage.executed"></a><span class="ts" id=4650 data-target="#details-4650" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executed</span><span>: </span><span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4650">
<div class="comment"><p>The number of times this branch was executed, or a boolean indicating
whether it was executed if the exact count is unknown. If zero or false,
the branch will be marked as un-covered.</p>
</div>
</div>



<a name="BranchCoverage.label"></a><span class="ts" id=4652 data-target="#details-4652" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4652">
<div class="comment"><p>Label for the branch, used in the context of &quot;the ${label} branch was
not taken,&quot; for example.</p>
</div>
</div>



<a name="BranchCoverage.location"></a><span class="ts" id=4651 data-target="#details-4651" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">location</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-4651">
<div class="comment"><p>Branch location.</p>
</div>
</div>

### <a name="Breakpoint"></a><span class="code-item" id=4130>Breakpoint</span>



<div class="comment"><p>The base class of all breakpoint types.</p>
</div>

#### Constructors



<a name="Breakpoint.Breakpoint"></a><span class="ts" id=4132 data-target="#details-4132" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Breakpoint</span><span>(</span><span class="ident">enabled</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span>, <span class="ident">condition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">hitCondition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">logMessage</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#Breakpoint">Breakpoint</a></span>
<div class="details collapse" id="details-4132">
<div class="comment"><p>Creates a new breakpoint</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">enabled</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Is breakpoint enabled.</p>
</div></td></tr>
<tr><td><span class="ident">condition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Expression for conditional breakpoints</p>
</div></td></tr>
<tr><td><span class="ident">hitCondition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Expression that controls how many hits of the breakpoint are ignored</p>
</div></td></tr>
<tr><td><span class="ident">logMessage</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Log message to display when breakpoint is hit</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Breakpoint">Breakpoint</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="Breakpoint.condition"></a><span class="ts" id=4139 data-target="#details-4139" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">condition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4139">
<div class="comment"><p>An optional expression for conditional breakpoints.</p>
</div>
</div>



<a name="Breakpoint.enabled"></a><span class="ts" id=4138 data-target="#details-4138" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">enabled</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4138">
<div class="comment"><p>Is breakpoint enabled.</p>
</div>
</div>



<a name="Breakpoint.hitCondition"></a><span class="ts" id=4140 data-target="#details-4140" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hitCondition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4140">
<div class="comment"><p>An optional expression that controls how many hits of the breakpoint are ignored.</p>
</div>
</div>



<a name="Breakpoint.id"></a><span class="ts" id=4137 data-target="#details-4137" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4137">
<div class="comment"><p>The unique ID of the breakpoint.</p>
</div>
</div>



<a name="Breakpoint.logMessage"></a><span class="ts" id=4141 data-target="#details-4141" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">logMessage</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4141">
<div class="comment"><p>An optional message that gets logged when this breakpoint is hit. Embedded expressions within {} are interpolated by the debug adapter.</p>
</div>
</div>

### <a name="BreakpointsChangeEvent"></a><span class="code-item" id=4126>BreakpointsChangeEvent</span>



<div class="comment"><p>An event describing the changes to the set of <a href="#Breakpoint">breakpoints</a>.</p>
</div>

#### Properties



<a name="BreakpointsChangeEvent.added"></a><span class="ts" id=4127 data-target="#details-4127" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">added</span><span>: </span>readonly <a class="type-ref" href="#Breakpoint">Breakpoint</a>[]</span>
<div class="details collapse" id="details-4127">
<div class="comment"><p>Added breakpoints.</p>
</div>
</div>



<a name="BreakpointsChangeEvent.changed"></a><span class="ts" id=4129 data-target="#details-4129" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">changed</span><span>: </span>readonly <a class="type-ref" href="#Breakpoint">Breakpoint</a>[]</span>
<div class="details collapse" id="details-4129">
<div class="comment"><p>Changed breakpoints.</p>
</div>
</div>



<a name="BreakpointsChangeEvent.removed"></a><span class="ts" id=4128 data-target="#details-4128" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">removed</span><span>: </span>readonly <a class="type-ref" href="#Breakpoint">Breakpoint</a>[]</span>
<div class="details collapse" id="details-4128">
<div class="comment"><p>Removed breakpoints.</p>
</div>
</div>

### <a name="CallHierarchyIncomingCall"></a><span class="code-item" id=1485>CallHierarchyIncomingCall</span>



<div class="comment"><p>Represents an incoming call, e.g. a caller of a method or constructor.</p>
</div>

#### Constructors



<a name="CallHierarchyIncomingCall.CallHierarchyIncomingCall"></a><span class="ts" id=1487 data-target="#details-1487" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">CallHierarchyIncomingCall</span><span>(</span><span class="ident">item</span><span>: </span><a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a>, <span class="ident">fromRanges</span><span>: </span><a class="type-ref" href="#Range">Range</a>[]<span>)</span><span>: </span><a class="type-ref" href="#CallHierarchyIncomingCall">CallHierarchyIncomingCall</a></span>
<div class="details collapse" id="details-1487">
<div class="comment"><p>Create a new call object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">item</span><span>: </span><a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a></td><td><div class="comment"><p>The item making the call.</p>
</div></td></tr>
<tr><td><span class="ident">fromRanges</span><span>: </span><a class="type-ref" href="#Range">Range</a>[]</td><td><div class="comment"><p>The ranges at which the calls appear.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#CallHierarchyIncomingCall">CallHierarchyIncomingCall</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="CallHierarchyIncomingCall.from"></a><span class="ts" id=1490 data-target="#details-1490" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">from</span><span>: </span><a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a></span>
<div class="details collapse" id="details-1490">
<div class="comment"><p>The item that makes the call.</p>
</div>
</div>



<a name="CallHierarchyIncomingCall.fromRanges"></a><span class="ts" id=1491 data-target="#details-1491" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fromRanges</span><span>: </span><a class="type-ref" href="#Range">Range</a>[]</span>
<div class="details collapse" id="details-1491">
<div class="comment"><p>The range at which at which the calls appears. This is relative to the caller
denoted by <a href="#CallHierarchyIncomingCall.from">this.from</a>.</p>
</div>
</div>

### <a name="CallHierarchyItem"></a><span class="code-item" id=1469>CallHierarchyItem</span>



<div class="comment"><p>Represents programming constructs like functions or constructors in the context
of call hierarchy.</p>
</div>

#### Constructors



<a name="CallHierarchyItem.CallHierarchyItem"></a><span class="ts" id=1471 data-target="#details-1471" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">CallHierarchyItem</span><span>(</span><span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a>, <span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">detail</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">selectionRange</span><span>: </span><a class="type-ref" href="#Range">Range</a><span>)</span><span>: </span><a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a></span>
<div class="details collapse" id="details-1471">
<div class="comment"><p>Creates a new call hierarchy item.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">detail</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">selectionRange</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="CallHierarchyItem.detail"></a><span class="ts" id=1481 data-target="#details-1481" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">detail</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1481">
<div class="comment"><p>More detail for this item, e.g. the signature of a function.</p>
</div>
</div>



<a name="CallHierarchyItem.kind"></a><span class="ts" id=1479 data-target="#details-1479" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a></span>
<div class="details collapse" id="details-1479">
<div class="comment"><p>The kind of this item.</p>
</div>
</div>



<a name="CallHierarchyItem.name"></a><span class="ts" id=1478 data-target="#details-1478" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1478">
<div class="comment"><p>The name of this item.</p>
</div>
</div>



<a name="CallHierarchyItem.range"></a><span class="ts" id=1483 data-target="#details-1483" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1483">
<div class="comment"><p>The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.</p>
</div>
</div>



<a name="CallHierarchyItem.selectionRange"></a><span class="ts" id=1484 data-target="#details-1484" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selectionRange</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1484">
<div class="comment"><p>The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function.
Must be contained by the <a href="#CallHierarchyItem.range">range</a>.</p>
</div>
</div>



<a name="CallHierarchyItem.tags"></a><span class="ts" id=1480 data-target="#details-1480" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tags</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#SymbolTag">SymbolTag</a>[]</span>
<div class="details collapse" id="details-1480">
<div class="comment"><p>Tags for this item.</p>
</div>
</div>



<a name="CallHierarchyItem.uri"></a><span class="ts" id=1482 data-target="#details-1482" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-1482">
<div class="comment"><p>The resource identifier of this item.</p>
</div>
</div>

### <a name="CallHierarchyOutgoingCall"></a><span class="code-item" id=1492>CallHierarchyOutgoingCall</span>



<div class="comment"><p>Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc.</p>
</div>

#### Constructors



<a name="CallHierarchyOutgoingCall.CallHierarchyOutgoingCall"></a><span class="ts" id=1494 data-target="#details-1494" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">CallHierarchyOutgoingCall</span><span>(</span><span class="ident">item</span><span>: </span><a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a>, <span class="ident">fromRanges</span><span>: </span><a class="type-ref" href="#Range">Range</a>[]<span>)</span><span>: </span><a class="type-ref" href="#CallHierarchyOutgoingCall">CallHierarchyOutgoingCall</a></span>
<div class="details collapse" id="details-1494">
<div class="comment"><p>Create a new call object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">item</span><span>: </span><a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a></td><td><div class="comment"><p>The item being called</p>
</div></td></tr>
<tr><td><span class="ident">fromRanges</span><span>: </span><a class="type-ref" href="#Range">Range</a>[]</td><td><div class="comment"><p>The ranges at which the calls appear.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#CallHierarchyOutgoingCall">CallHierarchyOutgoingCall</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="CallHierarchyOutgoingCall.fromRanges"></a><span class="ts" id=1498 data-target="#details-1498" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fromRanges</span><span>: </span><a class="type-ref" href="#Range">Range</a>[]</span>
<div class="details collapse" id="details-1498">
<div class="comment"><p>The range at which this item is called. This is the range relative to the caller, e.g the item
passed to <a href="#CallHierarchyProvider.provideCallHierarchyOutgoingCalls">provideCallHierarchyOutgoingCalls</a>
and not <a href="#CallHierarchyOutgoingCall.to">this.to</a>.</p>
</div>
</div>



<a name="CallHierarchyOutgoingCall.to"></a><span class="ts" id=1497 data-target="#details-1497" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">to</span><span>: </span><a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a></span>
<div class="details collapse" id="details-1497">
<div class="comment"><p>The item that is called.</p>
</div>
</div>

### <a name="CallHierarchyProvider"></a><span class="code-item" id=1499>CallHierarchyProvider</span>



<div class="comment"><p>The call hierarchy provider interface describes the contract between extensions
and the call hierarchy feature which allows to browse calls and caller of function,
methods, constructor etc.</p>
</div>

#### Methods



<a name="CallHierarchyProvider.prepareCallHierarchy"></a><span class="ts" id=1501 data-target="#details-1501" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prepareCallHierarchy</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a> &#124; <a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a>[]&gt;</span>
<div class="details collapse" id="details-1501">
<div class="comment"><p>Bootstraps call hierarchy by returning the item that is denoted by the given document
and position. This item will be used as entry into the call graph. Providers should
return <code>undefined</code> or <code>null</code> when there is no item at the given location.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a> &#124; <a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a>[]&gt;</td><td><div class="comment"><p>One or multiple call hierarchy items or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="CallHierarchyProvider.provideCallHierarchyIncomingCalls"></a><span class="ts" id=1506 data-target="#details-1506" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideCallHierarchyIncomingCalls</span><span>(</span><span class="ident">item</span><span>: </span><a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#CallHierarchyIncomingCall">CallHierarchyIncomingCall</a>[]&gt;</span>
<div class="details collapse" id="details-1506">
<div class="comment"><p>Provide all incoming calls for an item, e.g all callers for a method. In graph terms this describes directed
and annotated edges inside the call graph, e.g the given item is the starting node and the result is the nodes
that can be reached.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">item</span><span>: </span><a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a></td><td><div class="comment"><p>The hierarchy item for which incoming calls should be computed.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#CallHierarchyIncomingCall">CallHierarchyIncomingCall</a>[]&gt;</td><td><div class="comment"><p>A set of incoming calls or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="CallHierarchyProvider.provideCallHierarchyOutgoingCalls"></a><span class="ts" id=1510 data-target="#details-1510" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideCallHierarchyOutgoingCalls</span><span>(</span><span class="ident">item</span><span>: </span><a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#CallHierarchyOutgoingCall">CallHierarchyOutgoingCall</a>[]&gt;</span>
<div class="details collapse" id="details-1510">
<div class="comment"><p>Provide all outgoing calls for an item, e.g call calls to functions, methods, or constructors from the given item. In
graph terms this describes directed and annotated edges inside the call graph, e.g the given item is the starting
node and the result is the nodes that can be reached.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">item</span><span>: </span><a class="type-ref" href="#CallHierarchyItem">CallHierarchyItem</a></td><td><div class="comment"><p>The hierarchy item for which outgoing calls should be computed.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#CallHierarchyOutgoingCall">CallHierarchyOutgoingCall</a>[]&gt;</td><td><div class="comment"><p>A set of outgoing calls or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="CancellationError"></a><span class="code-item" id=450>CancellationError</span>



<div class="comment"><p>An error type that should be used to signal cancellation of an operation.</p>
<p>This type can be used in response to a <a href="#CancellationToken">cancellation token</a>
being cancelled or when an operation is being cancelled by the
executor of that operation.</p>
</div>

#### Constructors



<a name="CancellationError.CancellationError"></a><span class="ts" id=452 data-target="#details-452" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">CancellationError</span><span>(</span><span>)</span><span>: </span><a class="type-ref" href="#CancellationError">CancellationError</a></span>
<div class="details collapse" id="details-452">
<div class="comment"><p>Creates a new cancellation error.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#CancellationError">CancellationError</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="CancellationToken"></a><span class="code-item" id=439>CancellationToken</span>



<div class="comment"><p>A cancellation token is passed to an asynchronous or long running
operation to request cancellation, like cancelling a request
for completion items because the user continued to type.</p>
<p>To get an instance of a <code>CancellationToken</code> use a
<a href="#CancellationTokenSource">CancellationTokenSource</a>.</p>
</div>

#### Properties



<a name="CancellationToken.isCancellationRequested"></a><span class="ts" id=440 data-target="#details-440" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isCancellationRequested</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-440">
<div class="comment"><p>Is <code>true</code> when the token has been cancelled, <code>false</code> otherwise.</p>
</div>
</div>



<a name="CancellationToken.onCancellationRequested"></a><span class="ts" id=441 data-target="#details-441" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onCancellationRequested</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">any</span>&gt;</span>
<div class="details collapse" id="details-441">
<div class="comment"><p>An <a href="#Event">Event</a> which fires upon cancellation.</p>
</div>
</div>

### <a name="CancellationTokenSource"></a><span class="code-item" id=442>CancellationTokenSource</span>



<div class="comment"><p>A cancellation source creates and controls a <a href="#CancellationToken">cancellation token</a>.</p>
</div>

#### Constructors



<a name="CancellationTokenSource.CancellationTokenSource"></a><span class="ts" id=444 data-target="#details-444" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">CancellationTokenSource</span><span>(</span><span>)</span><span>: </span><a class="type-ref" href="#CancellationTokenSource">CancellationTokenSource</a></span>
<div class="details collapse" id="details-444">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#CancellationTokenSource">CancellationTokenSource</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="CancellationTokenSource.token"></a><span class="ts" id=445 data-target="#details-445" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></span>
<div class="details collapse" id="details-445">
<div class="comment"><p>The cancellation token of this source.</p>
</div>
</div>

#### Methods



<a name="CancellationTokenSource.cancel"></a><span class="ts" id=447 data-target="#details-447" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cancel</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-447">
<div class="comment"><p>Signal cancellation on the token.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="CancellationTokenSource.dispose"></a><span class="ts" id=449 data-target="#details-449" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-449">
<div class="comment"><p>Dispose object and free resources.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="CharacterPair"></a><span class="code-item" id=1639>CharacterPair</span>



<div class="comment"><p>A tuple of two characters, like a pair of
opening and closing brackets.</p>
</div>



<a name="CharacterPair"></a><span class="ts" id=1639 data-target="#details-1639" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">CharacterPair</span><span>: </span>[<span class="type-intrinsic">string</span>, <span class="type-intrinsic">string</span>]</span>

### <a name="ChatContext"></a><span class="code-item" id=4801>ChatContext</span>



<div class="comment"><p>Extra context passed to a participant.</p>
</div>

#### Properties



<a name="ChatContext.history"></a><span class="ts" id=4802 data-target="#details-4802" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">history</span><span>: </span>ReadonlyArray&lt;<a class="type-ref" href="#ChatRequestTurn">ChatRequestTurn</a> &#124; <a class="type-ref" href="#ChatResponseTurn">ChatResponseTurn</a>&gt;</span>
<div class="details collapse" id="details-4802">
<div class="comment"><p>All of the chat messages so far in the current chat session. Currently, only chat messages for the current participant are included.</p>
</div>
</div>

### <a name="ChatErrorDetails"></a><span class="code-item" id=4803>ChatErrorDetails</span>



<div class="comment"><p>Represents an error result from a chat request.</p>
</div>

#### Properties



<a name="ChatErrorDetails.message"></a><span class="ts" id=4804 data-target="#details-4804" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4804">
<div class="comment"><p>An error message that is shown to the user.</p>
</div>
</div>



<a name="ChatErrorDetails.responseIsFiltered"></a><span class="ts" id=4805 data-target="#details-4805" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">responseIsFiltered</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4805">
<div class="comment"><p>If set to true, the response will be partly blurred out.</p>
</div>
</div>

### <a name="ChatFollowup"></a><span class="code-item" id=4818>ChatFollowup</span>



<div class="comment"><p>A followup question suggested by the participant.</p>
</div>

#### Properties



<a name="ChatFollowup.command"></a><span class="ts" id=4822 data-target="#details-4822" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4822">
<div class="comment"><p>By default, the followup goes to the same participant/command. But this property can be set to invoke a different command.</p>
</div>
</div>



<a name="ChatFollowup.label"></a><span class="ts" id=4820 data-target="#details-4820" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4820">
<div class="comment"><p>A title to show the user. The prompt will be shown by default, when this is unspecified.</p>
</div>
</div>



<a name="ChatFollowup.participant"></a><span class="ts" id=4821 data-target="#details-4821" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">participant</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4821">
<div class="comment"><p>By default, the followup goes to the same participant/command. But this property can be set to invoke a different participant by ID.
Followups can only invoke a participant that was contributed by the same extension.</p>
</div>
</div>



<a name="ChatFollowup.prompt"></a><span class="ts" id=4819 data-target="#details-4819" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prompt</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4819">
<div class="comment"><p>The message to send to the chat.</p>
</div>
</div>

### <a name="ChatFollowupProvider"></a><span class="code-item" id=4823>ChatFollowupProvider</span>



<div class="comment"><p>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.</p>
</div>

#### Methods



<a name="ChatFollowupProvider.provideFollowups"></a><span class="ts" id=4825 data-target="#details-4825" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideFollowups</span><span>(</span><span class="ident">result</span><span>: </span><a class="type-ref" href="#ChatResult">ChatResult</a>, <span class="ident">context</span><span>: </span><a class="type-ref" href="#ChatContext">ChatContext</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#ChatFollowup">ChatFollowup</a>[]&gt;</span>
<div class="details collapse" id="details-4825">
<div class="comment"><p>Provide followups for the given result.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">result</span><span>: </span><a class="type-ref" href="#ChatResult">ChatResult</a></td><td><div class="comment"><p>This object has the same properties as the result returned from the participant callback, including <code>metadata</code>, but is not the same instance.</p>
</div></td></tr>
<tr><td><span class="ident">context</span><span>: </span><a class="type-ref" href="#ChatContext">ChatContext</a></td><td><div class="comment"><p>Extra context passed to a participant.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#ChatFollowup">ChatFollowup</a>[]&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="ChatLanguageModelToolReference"></a><span class="code-item" id=5197>ChatLanguageModelToolReference</span>



<div class="comment"><p>A reference to a tool that the user manually attached to their request, either using the <code>#</code>-syntax inline, or as an
attachment via the paperclip button.</p>
</div>

#### Properties



<a name="ChatLanguageModelToolReference.name"></a><span class="ts" id=5198 data-target="#details-5198" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5198">
<div class="comment"><p>The tool name. Refers to a tool listed in <a href="#lm.tools">lm.tools</a>.</p>
</div>
</div>



<a name="ChatLanguageModelToolReference.range"></a><span class="ts" id=5199 data-target="#details-5199" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>?</span><span>: </span>[start: <span class="type-intrinsic">number</span>, end: <span class="type-intrinsic">number</span>]</span>
<div class="details collapse" id="details-5199">
<div class="comment"><p>The start and end index of the reference in the <a href="#ChatRequest.prompt">prompt</a>. When undefined, the reference was
not part of the prompt text.</p>
<p><em>Note</em> that the indices take the leading <code>#</code>-character into account which means they can be used to modify the prompt
as-is.</p>
</div>
</div>

### <a name="ChatParticipant"></a><span class="code-item" id=4836>ChatParticipant</span>



<div class="comment"><p>A chat participant can be invoked by the user in a chat session, using the <code></code> prefix. When it is invoked, it handles the chat request and is solely
responsible for providing a response to the user. A ChatParticipant is created using <a href="#chat.createChatParticipant">chat.createChatParticipant</a>.</p>
</div>

#### Events



<a name="ChatParticipant.onDidReceiveFeedback"></a><span class="ts" id=4841 data-target="#details-4841" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidReceiveFeedback</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#ChatResultFeedback">ChatResultFeedback</a>&gt;</span>
<div class="details collapse" id="details-4841">
<div class="comment"><p>An event that fires whenever feedback for a result is received, e.g. when a user up- or down-votes
a result.</p>
<p>The passed <a href="#ChatResultFeedback.result">result</a> is guaranteed to have the same properties as the result that was
previously returned from this chat participant&#39;s handler.</p>
</div>
</div>

#### Properties



<a name="ChatParticipant.followupProvider"></a><span class="ts" id=4840 data-target="#details-4840" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">followupProvider</span><span>?</span><span>: </span><a class="type-ref" href="#ChatFollowupProvider">ChatFollowupProvider</a></span>
<div class="details collapse" id="details-4840">
<div class="comment"><p>This provider will be called once after each request to retrieve suggested followup questions.</p>
</div>
</div>



<a name="ChatParticipant.iconPath"></a><span class="ts" id=4838 data-target="#details-4838" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">iconPath</span><span>?</span><span>: </span><a class="type-ref" href="#IconPath">IconPath</a></span>
<div class="details collapse" id="details-4838">
<div class="comment"><p>An icon for the participant shown in UI.</p>
</div>
</div>



<a name="ChatParticipant.id"></a><span class="ts" id=4837 data-target="#details-4837" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4837">
<div class="comment"><p>A unique ID for this participant.</p>
</div>
</div>



<a name="ChatParticipant.requestHandler"></a><span class="ts" id=4839 data-target="#details-4839" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">requestHandler</span><span>: </span><a class="type-ref" href="#ChatRequestHandler">ChatRequestHandler</a></span>
<div class="details collapse" id="details-4839">
<div class="comment"><p>The handler for requests to this participant.</p>
</div>
</div>

#### Methods



<a name="ChatParticipant.dispose"></a><span class="ts" id=4843 data-target="#details-4843" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4843">
<div class="comment"><p>Dispose this participant and free resources.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="ChatParticipantToolToken"></a><span class="code-item" id=5161>ChatParticipantToolToken</span>



<div class="comment"><p>A token that can be passed to <a href="#lm.invokeTool">lm.invokeTool</a> when invoking a tool inside the context of handling a chat request.</p>
</div>



<a name="ChatParticipantToolToken"></a><span class="ts" id=5161 data-target="#details-5161" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ChatParticipantToolToken</span><span>: </span><span class="type-intrinsic">never</span></span>

### <a name="ChatPromptReference"></a><span class="code-item" id=4844>ChatPromptReference</span>



<div class="comment"><p>A reference to a value that the user added to their chat request.</p>
</div>

#### Properties



<a name="ChatPromptReference.id"></a><span class="ts" id=4845 data-target="#details-4845" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4845">
<div class="comment"><p>A unique identifier for this kind of reference.</p>
</div>
</div>



<a name="ChatPromptReference.modelDescription"></a><span class="ts" id=4847 data-target="#details-4847" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">modelDescription</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4847">
<div class="comment"><p>A description of this value that could be used in an LLM prompt.</p>
</div>
</div>



<a name="ChatPromptReference.range"></a><span class="ts" id=4846 data-target="#details-4846" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>?</span><span>: </span>[start: <span class="type-intrinsic">number</span>, end: <span class="type-intrinsic">number</span>]</span>
<div class="details collapse" id="details-4846">
<div class="comment"><p>The start and end index of the reference in the <a href="#ChatRequest.prompt">prompt</a>. When undefined, the reference was not part of the prompt text.</p>
<p><em>Note</em> that the indices take the leading <code>#</code>-character into account which means they can
used to modify the prompt as-is.</p>
</div>
</div>



<a name="ChatPromptReference.value"></a><span class="ts" id=4848 data-target="#details-4848" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">unknown</span></span>
<div class="details collapse" id="details-4848">
<div class="comment"><p>The value of this reference. The <code>string | Uri | Location</code> types are used today, but this could expand in the future.</p>
</div>
</div>

### <a name="ChatRequest"></a><span class="code-item" id=4849>ChatRequest</span>



<div class="comment"><p>A request to a chat participant.</p>
</div>

#### Properties



<a name="ChatRequest.command"></a><span class="ts" id=4851 data-target="#details-4851" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4851">
<div class="comment"><p>The name of the [ChatCommand command](#ChatCommand command) that was selected for this request.</p>
</div>
</div>



<a name="ChatRequest.model"></a><span class="ts" id=4855 data-target="#details-4855" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">model</span><span>: </span><a class="type-ref" href="#LanguageModelChat">LanguageModelChat</a></span>
<div class="details collapse" id="details-4855">
<div class="comment"><p>This is the model that is currently selected in the UI. Extensions can use this or use <a href="#lm.selectChatModels">lm.selectChatModels</a> to
pick another model. Don&#39;t hold onto this past the lifetime of the request.</p>
</div>
</div>



<a name="ChatRequest.prompt"></a><span class="ts" id=4850 data-target="#details-4850" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prompt</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4850">
<div class="comment"><p>The prompt as entered by the user.</p>
<p>Information about references used in this request is stored in <a href="#ChatRequest.references">ChatRequest.references</a>.</p>
<p><em>Note</em> that the [ChatParticipant.name name](#ChatParticipant.name name) of the participant and the [ChatCommand.name command](#ChatCommand.name command)
are not part of the prompt.</p>
</div>
</div>



<a name="ChatRequest.references"></a><span class="ts" id=4852 data-target="#details-4852" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">references</span><span>: </span>readonly <a class="type-ref" href="#ChatPromptReference">ChatPromptReference</a>[]</span>
<div class="details collapse" id="details-4852">
<div class="comment"><p>The list of references and their values that are referenced in the prompt.</p>
<p><em>Note</em> that the prompt contains references as authored and that it is up to the participant
to further modify the prompt, for instance by inlining reference values or creating links to
headings which contain the resolved values. References are sorted in reverse by their range
in the prompt. That means the last reference in the prompt is the first in this list. This simplifies
string-manipulation of the prompt.</p>
</div>
</div>



<a name="ChatRequest.toolInvocationToken"></a><span class="ts" id=4854 data-target="#details-4854" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">toolInvocationToken</span><span>: </span><span class="type-intrinsic">never</span></span>
<div class="details collapse" id="details-4854">
<div class="comment"><p>A token that can be passed to <a href="#lm.invokeTool">lm.invokeTool</a> when invoking a tool inside the context of handling a chat request.
This associates the tool invocation to a chat session.</p>
</div>
</div>



<a name="ChatRequest.toolReferences"></a><span class="ts" id=4853 data-target="#details-4853" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">toolReferences</span><span>: </span>readonly <a class="type-ref" href="#ChatLanguageModelToolReference">ChatLanguageModelToolReference</a>[]</span>
<div class="details collapse" id="details-4853">
<div class="comment"><p>The list of tools that the user attached to their request.</p>
<p>When a tool reference is present, the chat participant should make a chat request using
<a href="#LanguageModelChatToolMode.Required">LanguageModelChatToolMode.Required</a> to force the language model to generate input for the tool. Then, the
participant can use <a href="#lm.invokeTool">lm.invokeTool</a> to use the tool attach the result to its request for the user&#39;s prompt. The
tool may contribute useful extra context for the user&#39;s request.</p>
</div>
</div>

### <a name="ChatRequestHandler"></a><span class="code-item" id=4829>ChatRequestHandler</span>



<div class="comment"><p>A chat request handler is a callback that will be invoked when a request is made to a chat participant.</p>
</div>



<a name="ChatRequestHandler"></a><span class="ts" id=4829 data-target="#details-4829" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ChatRequestHandler</span><span>: </span>(request: <a class="type-ref" href="#ChatRequest">ChatRequest</a>, context: <a class="type-ref" href="#ChatContext">ChatContext</a>, response: <a class="type-ref" href="#ChatResponseStream">ChatResponseStream</a>, token: <a class="type-ref" href="#CancellationToken">CancellationToken</a>) =&gt; <a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#ChatResult">ChatResult</a> &#124; <span class="type-intrinsic">void</span>&gt;</span>

### <a name="ChatRequestTurn"></a><span class="code-item" id=4778>ChatRequestTurn</span>



<div class="comment"><p>Represents a user request in chat history.</p>
</div>

#### Properties



<a name="ChatRequestTurn.command"></a><span class="ts" id=4788 data-target="#details-4788" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4788">
<div class="comment"><p>The name of the [ChatCommand command](#ChatCommand command) that was selected for this request.</p>
</div>
</div>



<a name="ChatRequestTurn.participant"></a><span class="ts" id=4787 data-target="#details-4787" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">participant</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4787">
<div class="comment"><p>The id of the chat participant to which this request was directed.</p>
</div>
</div>



<a name="ChatRequestTurn.prompt"></a><span class="ts" id=4786 data-target="#details-4786" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prompt</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4786">
<div class="comment"><p>The prompt as entered by the user.</p>
<p>Information about references used in this request is stored in <a href="#ChatRequestTurn.references">ChatRequestTurn.references</a>.</p>
<p><em>Note</em> that the [ChatParticipant.name name](#ChatParticipant.name name) of the participant and the [ChatCommand.name command](#ChatCommand.name command)
are not part of the prompt.</p>
</div>
</div>



<a name="ChatRequestTurn.references"></a><span class="ts" id=4789 data-target="#details-4789" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">references</span><span>: </span><a class="type-ref" href="#ChatPromptReference">ChatPromptReference</a>[]</span>
<div class="details collapse" id="details-4789">
<div class="comment"><p>The references that were used in this message.</p>
</div>
</div>



<a name="ChatRequestTurn.toolReferences"></a><span class="ts" id=4790 data-target="#details-4790" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">toolReferences</span><span>: </span>readonly <a class="type-ref" href="#ChatLanguageModelToolReference">ChatLanguageModelToolReference</a>[]</span>
<div class="details collapse" id="details-4790">
<div class="comment"><p>The list of tools were attached to this request.</p>
</div>
</div>

### <a name="ChatResponseAnchorPart"></a><span class="code-item" id=4896>ChatResponseAnchorPart</span>



<div class="comment"><p>Represents a part of a chat response that is an anchor, that is rendered as a link to a target.</p>
</div>

#### Constructors



<a name="ChatResponseAnchorPart.ChatResponseAnchorPart"></a><span class="ts" id=4898 data-target="#details-4898" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ChatResponseAnchorPart</span><span>(</span><span class="ident">value</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#Location">Location</a>, <span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#ChatResponseAnchorPart">ChatResponseAnchorPart</a></span>
<div class="details collapse" id="details-4898">
<div class="comment"><p>Create a new ChatResponseAnchorPart.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#Location">Location</a></td><td><div class="comment"><p>A uri or location.</p>
</div></td></tr>
<tr><td><span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>An optional title that is rendered with value.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ChatResponseAnchorPart">ChatResponseAnchorPart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="ChatResponseAnchorPart.title"></a><span class="ts" id=4902 data-target="#details-4902" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4902">
<div class="comment"><p>An optional title that is rendered with value.</p>
</div>
</div>



<a name="ChatResponseAnchorPart.value"></a><span class="ts" id=4901 data-target="#details-4901" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#Location">Location</a></span>
<div class="details collapse" id="details-4901">
<div class="comment"><p>The target of this anchor.</p>
</div>
</div>

### <a name="ChatResponseCommandButtonPart"></a><span class="code-item" id=4915>ChatResponseCommandButtonPart</span>



<div class="comment"><p>Represents a part of a chat response that is a button that executes a command.</p>
</div>

#### Constructors



<a name="ChatResponseCommandButtonPart.ChatResponseCommandButtonPart"></a><span class="ts" id=4917 data-target="#details-4917" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ChatResponseCommandButtonPart</span><span>(</span><span class="ident">value</span><span>: </span><a class="type-ref" href="#Command">Command</a><span>)</span><span>: </span><a class="type-ref" href="#ChatResponseCommandButtonPart">ChatResponseCommandButtonPart</a></span>
<div class="details collapse" id="details-4917">
<div class="comment"><p>Create a new ChatResponseCommandButtonPart.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><a class="type-ref" href="#Command">Command</a></td><td><div class="comment"><p>A Command that will be executed when the button is clicked.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ChatResponseCommandButtonPart">ChatResponseCommandButtonPart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="ChatResponseCommandButtonPart.value"></a><span class="ts" id=4919 data-target="#details-4919" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><a class="type-ref" href="#Command">Command</a></span>
<div class="details collapse" id="details-4919">
<div class="comment"><p>The command that will be executed when the button is clicked.</p>
</div>
</div>

### <a name="ChatResponseFileTree"></a><span class="code-item" id=4886>ChatResponseFileTree</span>



<div class="comment"><p>Represents a file tree structure in a chat response.</p>
</div>

#### Properties



<a name="ChatResponseFileTree.children"></a><span class="ts" id=4888 data-target="#details-4888" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">children</span><span>?</span><span>: </span><a class="type-ref" href="#ChatResponseFileTree">ChatResponseFileTree</a>[]</span>
<div class="details collapse" id="details-4888">
<div class="comment"><p>An array of child file trees, if the current file tree is a directory.</p>
</div>
</div>



<a name="ChatResponseFileTree.name"></a><span class="ts" id=4887 data-target="#details-4887" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4887">
<div class="comment"><p>The name of the file or directory.</p>
</div>
</div>

### <a name="ChatResponseFileTreePart"></a><span class="code-item" id=4889>ChatResponseFileTreePart</span>



<div class="comment"><p>Represents a part of a chat response that is a file tree.</p>
</div>

#### Constructors



<a name="ChatResponseFileTreePart.ChatResponseFileTreePart"></a><span class="ts" id=4891 data-target="#details-4891" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ChatResponseFileTreePart</span><span>(</span><span class="ident">value</span><span>: </span><a class="type-ref" href="#ChatResponseFileTree">ChatResponseFileTree</a>[], <span class="ident">baseUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#ChatResponseFileTreePart">ChatResponseFileTreePart</a></span>
<div class="details collapse" id="details-4891">
<div class="comment"><p>Create a new ChatResponseFileTreePart.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><a class="type-ref" href="#ChatResponseFileTree">ChatResponseFileTree</a>[]</td><td><div class="comment"><p>File tree data.</p>
</div></td></tr>
<tr><td><span class="ident">baseUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The base uri to which this file tree is relative.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ChatResponseFileTreePart">ChatResponseFileTreePart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="ChatResponseFileTreePart.baseUri"></a><span class="ts" id=4895 data-target="#details-4895" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">baseUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4895">
<div class="comment"><p>The base uri to which this file tree is relative</p>
</div>
</div>



<a name="ChatResponseFileTreePart.value"></a><span class="ts" id=4894 data-target="#details-4894" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><a class="type-ref" href="#ChatResponseFileTree">ChatResponseFileTree</a>[]</span>
<div class="details collapse" id="details-4894">
<div class="comment"><p>File tree data.</p>
</div>
</div>

### <a name="ChatResponseMarkdownPart"></a><span class="code-item" id=4881>ChatResponseMarkdownPart</span>



<div class="comment"><p>Represents a part of a chat response that is formatted as Markdown.</p>
</div>

#### Constructors



<a name="ChatResponseMarkdownPart.ChatResponseMarkdownPart"></a><span class="ts" id=4883 data-target="#details-4883" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ChatResponseMarkdownPart</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a><span>)</span><span>: </span><a class="type-ref" href="#ChatResponseMarkdownPart">ChatResponseMarkdownPart</a></span>
<div class="details collapse" id="details-4883">
<div class="comment"><p>Create a new ChatResponseMarkdownPart.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></td><td><div class="comment"><p>A markdown string or a string that should be interpreted as markdown. The boolean form of <a href="#MarkdownString.isTrusted">MarkdownString.isTrusted</a> is NOT supported.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ChatResponseMarkdownPart">ChatResponseMarkdownPart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="ChatResponseMarkdownPart.value"></a><span class="ts" id=4885 data-target="#details-4885" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-4885">
<div class="comment"><p>A markdown string or a string that should be interpreted as markdown.</p>
</div>
</div>

### <a name="ChatResponsePart"></a><span class="code-item" id=4920>ChatResponsePart</span>



<div class="comment"><p>Represents the different chat response types.</p>
</div>



<a name="ChatResponsePart"></a><span class="ts" id=4920 data-target="#details-4920" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ChatResponsePart</span><span>: </span><a class="type-ref" href="#ChatResponseMarkdownPart">ChatResponseMarkdownPart</a> &#124; <a class="type-ref" href="#ChatResponseFileTreePart">ChatResponseFileTreePart</a> &#124; <a class="type-ref" href="#ChatResponseAnchorPart">ChatResponseAnchorPart</a> &#124; <a class="type-ref" href="#ChatResponseProgressPart">ChatResponseProgressPart</a> &#124; <a class="type-ref" href="#ChatResponseReferencePart">ChatResponseReferencePart</a> &#124; <a class="type-ref" href="#ChatResponseCommandButtonPart">ChatResponseCommandButtonPart</a></span>

### <a name="ChatResponseProgressPart"></a><span class="code-item" id=4903>ChatResponseProgressPart</span>



<div class="comment"><p>Represents a part of a chat response that is a progress message.</p>
</div>

#### Constructors



<a name="ChatResponseProgressPart.ChatResponseProgressPart"></a><span class="ts" id=4905 data-target="#details-4905" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ChatResponseProgressPart</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#ChatResponseProgressPart">ChatResponseProgressPart</a></span>
<div class="details collapse" id="details-4905">
<div class="comment"><p>Create a new ChatResponseProgressPart.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A progress message</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ChatResponseProgressPart">ChatResponseProgressPart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="ChatResponseProgressPart.value"></a><span class="ts" id=4907 data-target="#details-4907" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4907">
<div class="comment"><p>The progress message</p>
</div>
</div>

### <a name="ChatResponseReferencePart"></a><span class="code-item" id=4908>ChatResponseReferencePart</span>



<div class="comment"><p>Represents a part of a chat response that is a reference, rendered separately from the content.</p>
</div>

#### Constructors



<a name="ChatResponseReferencePart.ChatResponseReferencePart"></a><span class="ts" id=4910 data-target="#details-4910" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ChatResponseReferencePart</span><span>(</span><span class="ident">value</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#Location">Location</a>, <span class="ident">iconPath</span><span>?</span><span>: </span><a class="type-ref" href="#IconPath">IconPath</a><span>)</span><span>: </span><a class="type-ref" href="#ChatResponseReferencePart">ChatResponseReferencePart</a></span>
<div class="details collapse" id="details-4910">
<div class="comment"><p>Create a new ChatResponseReferencePart.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#Location">Location</a></td><td><div class="comment"><p>A uri or location</p>
</div></td></tr>
<tr><td><span class="ident">iconPath</span><span>?</span><span>: </span><a class="type-ref" href="#IconPath">IconPath</a></td><td><div class="comment"><p>Icon for the reference shown in UI</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ChatResponseReferencePart">ChatResponseReferencePart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="ChatResponseReferencePart.iconPath"></a><span class="ts" id=4914 data-target="#details-4914" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">iconPath</span><span>?</span><span>: </span><a class="type-ref" href="#IconPath">IconPath</a></span>
<div class="details collapse" id="details-4914">
<div class="comment"><p>The icon for the reference.</p>
</div>
</div>



<a name="ChatResponseReferencePart.value"></a><span class="ts" id=4913 data-target="#details-4913" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#Location">Location</a></span>
<div class="details collapse" id="details-4913">
<div class="comment"><p>The reference target.</p>
</div>
</div>

### <a name="ChatResponseStream"></a><span class="code-item" id=4856>ChatResponseStream</span>



<div class="comment"><p>The ChatResponseStream is how a participant is able to return content to the chat view. It provides several methods for streaming different types of content
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 it
can instantiate a <a href="#ChatResponsePart">ChatResponsePart</a> and use the generic <a href="#ChatResponseStream.push">ChatResponseStream.push</a> method to return it.</p>
</div>

#### Methods



<a name="ChatResponseStream.anchor"></a><span class="ts" id=4861 data-target="#details-4861" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">anchor</span><span>(</span><span class="ident">value</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#Location">Location</a>, <span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4861">
<div class="comment"><p>Push an anchor part to this stream. Short-hand for
<code>push(new ChatResponseAnchorPart(value, title))</code>.
An anchor is an inline reference to some type of resource.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#Location">Location</a></td><td><div class="comment"><p>A uri or location.</p>
</div></td></tr>
<tr><td><span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>An optional title that is rendered with value.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="ChatResponseStream.button"></a><span class="ts" id=4865 data-target="#details-4865" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">button</span><span>(</span><span class="ident">command</span><span>: </span><a class="type-ref" href="#Command">Command</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4865">
<div class="comment"><p>Push a command button part to this stream. Short-hand for
<code>push(new ChatResponseCommandButtonPart(value, title))</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">command</span><span>: </span><a class="type-ref" href="#Command">Command</a></td><td><div class="comment"><p>A Command that will be executed when the button is clicked.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="ChatResponseStream.filetree"></a><span class="ts" id=4868 data-target="#details-4868" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">filetree</span><span>(</span><span class="ident">value</span><span>: </span><a class="type-ref" href="#ChatResponseFileTree">ChatResponseFileTree</a>[], <span class="ident">baseUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4868">
<div class="comment"><p>Push a filetree part to this stream. Short-hand for
<code>push(new ChatResponseFileTreePart(value))</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><a class="type-ref" href="#ChatResponseFileTree">ChatResponseFileTree</a>[]</td><td><div class="comment"><p>File tree data.</p>
</div></td></tr>
<tr><td><span class="ident">baseUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The base uri to which this file tree is relative.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="ChatResponseStream.markdown"></a><span class="ts" id=4858 data-target="#details-4858" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">markdown</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4858">
<div class="comment"><p>Push a markdown part to this stream. Short-hand for
<code>push(new ChatResponseMarkdownPart(value))</code>.</p>
<p><em>See also</em>
<a href="#ChatResponseStream.push">ChatResponseStream.push</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></td><td><div class="comment"><p>A markdown string or a string that should be interpreted as markdown. The boolean form of <a href="#MarkdownString.isTrusted">MarkdownString.isTrusted</a> is NOT supported.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="ChatResponseStream.progress"></a><span class="ts" id=4872 data-target="#details-4872" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">progress</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4872">
<div class="comment"><p>Push a progress part to this stream. Short-hand for
<code>push(new ChatResponseProgressPart(value))</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A progress message</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="ChatResponseStream.push"></a><span class="ts" id=4879 data-target="#details-4879" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">push</span><span>(</span><span class="ident">part</span><span>: </span><a class="type-ref" href="#ChatResponsePart">ChatResponsePart</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4879">
<div class="comment"><p>Pushes a part to this stream.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">part</span><span>: </span><a class="type-ref" href="#ChatResponsePart">ChatResponsePart</a></td><td><div class="comment"><p>A response part, rendered or metadata</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="ChatResponseStream.reference"></a><span class="ts" id=4875 data-target="#details-4875" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">reference</span><span>(</span><span class="ident">value</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#Location">Location</a>, <span class="ident">iconPath</span><span>?</span><span>: </span><a class="type-ref" href="#IconPath">IconPath</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4875">
<div class="comment"><p>Push a reference to this stream. Short-hand for
<code>push(new ChatResponseReferencePart(value))</code>.</p>
<p><em>Note</em> that the reference is not rendered inline with the response.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#Location">Location</a></td><td><div class="comment"><p>A uri or location</p>
</div></td></tr>
<tr><td><span class="ident">iconPath</span><span>?</span><span>: </span><a class="type-ref" href="#IconPath">IconPath</a></td><td><div class="comment"><p>Icon for the reference shown in UI</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="ChatResponseTurn"></a><span class="code-item" id=4791>ChatResponseTurn</span>



<div class="comment"><p>Represents a chat participant&#39;s response in chat history.</p>
</div>

#### Properties



<a name="ChatResponseTurn.command"></a><span class="ts" id=4800 data-target="#details-4800" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4800">
<div class="comment"><p>The name of the command that this response came from.</p>
</div>
</div>



<a name="ChatResponseTurn.participant"></a><span class="ts" id=4799 data-target="#details-4799" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">participant</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4799">
<div class="comment"><p>The id of the chat participant that this response came from.</p>
</div>
</div>



<a name="ChatResponseTurn.response"></a><span class="ts" id=4797 data-target="#details-4797" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">response</span><span>: </span>ReadonlyArray&lt;<a class="type-ref" href="#ChatResponseMarkdownPart">ChatResponseMarkdownPart</a> &#124; <a class="type-ref" href="#ChatResponseFileTreePart">ChatResponseFileTreePart</a> &#124; <a class="type-ref" href="#ChatResponseAnchorPart">ChatResponseAnchorPart</a> &#124; <a class="type-ref" href="#ChatResponseCommandButtonPart">ChatResponseCommandButtonPart</a>&gt;</span>
<div class="details collapse" id="details-4797">
<div class="comment"><p>The content that was received from the chat participant. Only the stream parts that represent actual content (not metadata) are represented.</p>
</div>
</div>



<a name="ChatResponseTurn.result"></a><span class="ts" id=4798 data-target="#details-4798" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">result</span><span>: </span><a class="type-ref" href="#ChatResult">ChatResult</a></span>
<div class="details collapse" id="details-4798">
<div class="comment"><p>The result that was received from the chat participant.</p>
</div>
</div>

### <a name="ChatResult"></a><span class="code-item" id=4806>ChatResult</span>



<div class="comment"><p>The result of a chat request.</p>
</div>

#### Properties



<a name="ChatResult.errorDetails"></a><span class="ts" id=4807 data-target="#details-4807" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">errorDetails</span><span>?</span><span>: </span><a class="type-ref" href="#ChatErrorDetails">ChatErrorDetails</a></span>
<div class="details collapse" id="details-4807">
<div class="comment"><p>If the request resulted in an error, this property defines the error details.</p>
</div>
</div>



<a name="ChatResult.metadata"></a><span class="ts" id=4808 data-target="#details-4808" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">metadata</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-4808">
<div class="comment"><p>Arbitrary metadata for this result. Can be anything, but must be JSON-stringifyable.</p>
</div>
</div>

### <a name="ChatResultFeedback"></a><span class="code-item" id=4815>ChatResultFeedback</span>



<div class="comment"><p>Represents user feedback for a result.</p>
</div>

#### Properties



<a name="ChatResultFeedback.kind"></a><span class="ts" id=4817 data-target="#details-4817" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>: </span><a class="type-ref" href="#ChatResultFeedbackKind">ChatResultFeedbackKind</a></span>
<div class="details collapse" id="details-4817">
<div class="comment"><p>The kind of feedback that was received.</p>
</div>
</div>



<a name="ChatResultFeedback.result"></a><span class="ts" id=4816 data-target="#details-4816" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">result</span><span>: </span><a class="type-ref" href="#ChatResult">ChatResult</a></span>
<div class="details collapse" id="details-4816">
<div class="comment"><p>The ChatResult for which the user is providing feedback.
This object has the same properties as the result returned from the participant callback, including <code>metadata</code>, but is not the same instance.</p>
</div>
</div>

### <a name="ChatResultFeedbackKind"></a><span class="code-item" id=4812>ChatResultFeedbackKind</span>



<div class="comment"><p>Represents the type of user feedback received.</p>
</div>

#### Enumeration Members



<a name="ChatResultFeedbackKind.Unhelpful"></a><span class="ts" id=4813 data-target="#details-4813" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Unhelpful</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-4813">
<div class="comment"><p>The user marked the result as unhelpful.</p>
</div>
</div>



<a name="ChatResultFeedbackKind.Helpful"></a><span class="ts" id=4814 data-target="#details-4814" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Helpful</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-4814">
<div class="comment"><p>The user marked the result as helpful.</p>
</div>
</div>

### <a name="Clipboard"></a><span class="code-item" id=2566>Clipboard</span>



<div class="comment"><p>The clipboard provides read and write access to the system&#39;s clipboard.</p>
</div>

#### Methods



<a name="Clipboard.readText"></a><span class="ts" id=2568 data-target="#details-2568" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">readText</span><span>(</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-2568">
<div class="comment"><p>Read the current clipboard contents as text.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to a string.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Clipboard.writeText"></a><span class="ts" id=2570 data-target="#details-2570" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">writeText</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2570">
<div class="comment"><p>Writes text into the clipboard.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>A thenable that resolves when writing happened.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="CodeAction"></a><span class="code-item" id=622>CodeAction</span>



<div class="comment"><p>A code action represents a change that can be performed in code, e.g. to fix a problem or
to refactor code.</p>
<p>A CodeAction must set either <a href="#CodeAction.edit">edit</a> and/or a <a href="#CodeAction.command">command</a>. If both are supplied, the <code>edit</code> is applied first, then the command is executed.</p>
</div>

#### Constructors



<a name="CodeAction.CodeAction"></a><span class="ts" id=624 data-target="#details-624" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">CodeAction</span><span>(</span><span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a><span>)</span><span>: </span><a class="type-ref" href="#CodeAction">CodeAction</a></span>
<div class="details collapse" id="details-624">
<div class="comment"><p>Creates a new code action.</p>
<p>A code action must have at least a <a href="#CodeAction.title">title</a> and <a href="#CodeAction.edit">edits</a>
and/or a <a href="#CodeAction.command">command</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The title of the code action.</p>
</div></td></tr>
<tr><td><span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></td><td><div class="comment"><p>The kind of the code action.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#CodeAction">CodeAction</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="CodeAction.command"></a><span class="ts" id=630 data-target="#details-630" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>?</span><span>: </span><a class="type-ref" href="#Command">Command</a></span>
<div class="details collapse" id="details-630">
<div class="comment"><p>A <a href="#Command">Command</a> this code action executes.</p>
<p>If this command throws an exception, the editor displays the exception message to users in the editor at the
current cursor position.</p>
</div>
</div>



<a name="CodeAction.diagnostics"></a><span class="ts" id=629 data-target="#details-629" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">diagnostics</span><span>?</span><span>: </span><a class="type-ref" href="#Diagnostic">Diagnostic</a>[]</span>
<div class="details collapse" id="details-629">
<div class="comment"><p><a href="#Diagnostic">Diagnostics</a> that this code action resolves.</p>
</div>
</div>



<a name="CodeAction.disabled"></a><span class="ts" id=633 data-target="#details-633" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">disabled</span><span>?</span><span>: </span>{reason: <span class="type-intrinsic">string</span>}</span>
<div class="details collapse" id="details-633">
<div class="comment"><p>Marks that the code action cannot currently be applied.</p>
<ul>
<li><p>Disabled code actions are not shown in automatic <a href="https://code.visualstudio.com/docs/editor/editingevolved#_code-action">lightbulb</a>
code action menu.</p>
</li>
<li><p>Disabled actions are shown as faded out in the code action menu when the user request a more specific type
of code action, such as refactorings.</p>
</li>
<li><p>If the user has a <a href="https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions">keybinding</a>
that auto applies a code action and only a disabled code actions are returned, the editor will show the user an
error message with <code>reason</code> in the editor.</p>
</li>
</ul>
</div>
<div class="signature variable-declaration-child">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td>reason: <span class="type-intrinsic">string</span></td><td><div class="comment"><p>Human readable description of why the code action is currently disabled.</p>
<p>This is displayed in the code actions UI.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="CodeAction.edit"></a><span class="ts" id=628 data-target="#details-628" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">edit</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a></span>
<div class="details collapse" id="details-628">
<div class="comment"><p>A <a href="#WorkspaceEdit">workspace edit</a> this code action performs.</p>
</div>
</div>



<a name="CodeAction.isPreferred"></a><span class="ts" id=632 data-target="#details-632" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isPreferred</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-632">
<div class="comment"><p>Marks this as a preferred action. Preferred actions are used by the <code>auto fix</code> command and can be targeted
by keybindings.</p>
<p>A quick fix should be marked preferred if it properly addresses the underlying error.
A refactoring should be marked preferred if it is the most reasonable choice of actions to take.</p>
</div>
</div>



<a name="CodeAction.kind"></a><span class="ts" id=631 data-target="#details-631" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-631">
<div class="comment"><p><a href="#CodeActionKind">Kind</a> of the code action.</p>
<p>Used to filter code actions.</p>
</div>
</div>



<a name="CodeAction.title"></a><span class="ts" id=627 data-target="#details-627" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-627">
<div class="comment"><p>A short, human-readable, title for this code action.</p>
</div>
</div>

### <a name="CodeActionContext"></a><span class="code-item" id=618>CodeActionContext</span>



<div class="comment"><p>Contains additional diagnostic information about the context in which
a <a href="#CodeActionProvider.provideCodeActions">code action</a> is run.</p>
</div>

#### Properties



<a name="CodeActionContext.diagnostics"></a><span class="ts" id=620 data-target="#details-620" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">diagnostics</span><span>: </span>readonly <a class="type-ref" href="#Diagnostic">Diagnostic</a>[]</span>
<div class="details collapse" id="details-620">
<div class="comment"><p>An array of diagnostics.</p>
</div>
</div>



<a name="CodeActionContext.only"></a><span class="ts" id=621 data-target="#details-621" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">only</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-621">
<div class="comment"><p>Requested kind of actions to return.</p>
<p>Actions not of this kind are filtered out before being shown by the <a href="https://code.visualstudio.com/docs/editor/editingevolved#_code-action">lightbulb</a>.</p>
</div>
</div>



<a name="CodeActionContext.triggerKind"></a><span class="ts" id=619 data-target="#details-619" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">triggerKind</span><span>: </span><a class="type-ref" href="#CodeActionTriggerKind">CodeActionTriggerKind</a></span>
<div class="details collapse" id="details-619">
<div class="comment"><p>The reason why code actions were requested.</p>
</div>
</div>

### <a name="CodeActionKind"></a><span class="code-item" id=590>CodeActionKind</span>



<div class="comment"><p>Kind of a code action.</p>
<p>Kinds are a hierarchical list of identifiers separated by <code>.</code>, e.g. <code>&quot;refactor.extract.function&quot;</code>.</p>
<p>Code action kinds are used by the editor for UI elements such as the refactoring context menu. Users
can also trigger code actions with a specific kind with the <code>editor.action.codeAction</code> command.</p>
</div>

#### Static



<a name="CodeActionKind.Empty"></a><span class="ts" id=591 data-target="#details-591" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Empty</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-591">
<div class="comment"><p>Empty kind.</p>
</div>
</div>



<a name="CodeActionKind.Notebook"></a><span class="ts" id=601 data-target="#details-601" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Notebook</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-601">
<div class="comment"><p>Base kind for all code actions applying to the entire notebook&#39;s scope. CodeActionKinds using
this should always begin with <code>notebook.</code></p>
<p>This requires that new CodeActions be created for it and contributed via extensions.
Pre-existing kinds can not just have the new <code>notebook.</code> prefix added to them, as the functionality
is unique to the full-notebook scope.</p>
<p>Notebook CodeActionKinds can be initialized as either of the following (both resulting in <code>notebook.source.xyz</code>):</p>
<ul>
<li><code>const newKind =  CodeActionKind.Notebook.append(CodeActionKind.Source.append(&#39;xyz&#39;).value)</code></li>
<li><code>const newKind =  CodeActionKind.Notebook.append(&#39;source.xyz&#39;)</code></li>
</ul>
<p>Example Kinds/Actions:</p>
<ul>
<li><code>notebook.source.organizeImports</code> (might move all imports to a new top cell)</li>
<li><code>notebook.source.normalizeVariableNames</code> (might rename all variables to a standardized casing format)</li>
</ul>
</div>
</div>



<a name="CodeActionKind.QuickFix"></a><span class="ts" id=592 data-target="#details-592" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">QuickFix</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-592">
<div class="comment"><p>Base kind for quickfix actions: <code>quickfix</code>.</p>
<p>Quick fix actions address a problem in the code and are shown in the normal code action context menu.</p>
</div>
</div>



<a name="CodeActionKind.Refactor"></a><span class="ts" id=593 data-target="#details-593" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Refactor</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-593">
<div class="comment"><p>Base kind for refactoring actions: <code>refactor</code></p>
<p>Refactoring actions are shown in the refactoring context menu.</p>
</div>
</div>



<a name="CodeActionKind.RefactorExtract"></a><span class="ts" id=594 data-target="#details-594" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">RefactorExtract</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-594">
<div class="comment"><p>Base kind for refactoring extraction actions: <code>refactor.extract</code></p>
<p>Example extract actions:</p>
<ul>
<li>Extract method</li>
<li>Extract function</li>
<li>Extract variable</li>
<li>Extract interface from class</li>
<li>...</li>
</ul>
</div>
</div>



<a name="CodeActionKind.RefactorInline"></a><span class="ts" id=595 data-target="#details-595" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">RefactorInline</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-595">
<div class="comment"><p>Base kind for refactoring inline actions: <code>refactor.inline</code></p>
<p>Example inline actions:</p>
<ul>
<li>Inline function</li>
<li>Inline variable</li>
<li>Inline constant</li>
<li>...</li>
</ul>
</div>
</div>



<a name="CodeActionKind.RefactorMove"></a><span class="ts" id=596 data-target="#details-596" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">RefactorMove</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-596">
<div class="comment"><p>Base kind for refactoring move actions: <code>refactor.move</code></p>
<p>Example move actions:</p>
<ul>
<li>Move a function to a new file</li>
<li>Move a property between classes</li>
<li>Move method to base class</li>
<li>...</li>
</ul>
</div>
</div>



<a name="CodeActionKind.RefactorRewrite"></a><span class="ts" id=597 data-target="#details-597" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">RefactorRewrite</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-597">
<div class="comment"><p>Base kind for refactoring rewrite actions: <code>refactor.rewrite</code></p>
<p>Example rewrite actions:</p>
<ul>
<li>Convert JavaScript function to class</li>
<li>Add or remove parameter</li>
<li>Encapsulate field</li>
<li>Make method static</li>
<li>...</li>
</ul>
</div>
</div>



<a name="CodeActionKind.Source"></a><span class="ts" id=598 data-target="#details-598" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Source</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-598">
<div class="comment"><p>Base kind for source actions: <code>source</code></p>
<p>Source code actions apply to the entire file. They must be explicitly requested and will not show in the
normal <a href="https://code.visualstudio.com/docs/editor/editingevolved#_code-action">lightbulb</a> menu. Source actions
can be run on save using <code>editor.codeActionsOnSave</code> and are also shown in the <code>source</code> context menu.</p>
</div>
</div>



<a name="CodeActionKind.SourceFixAll"></a><span class="ts" id=600 data-target="#details-600" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SourceFixAll</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-600">
<div class="comment"><p>Base kind for auto-fix source actions: <code>source.fixAll</code>.</p>
<p>Fix all actions automatically fix errors that have a clear fix that do not require user input.
They should not suppress errors or perform unsafe fixes such as generating new types or classes.</p>
</div>
</div>



<a name="CodeActionKind.SourceOrganizeImports"></a><span class="ts" id=599 data-target="#details-599" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SourceOrganizeImports</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-599">
<div class="comment"><p>Base kind for an organize imports source action: <code>source.organizeImports</code>.</p>
</div>
</div>

#### Properties



<a name="CodeActionKind.value"></a><span class="ts" id=605 data-target="#details-605" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-605">
<div class="comment"><p>String value of the kind, e.g. <code>&quot;refactor.extract.function&quot;</code>.</p>
</div>
</div>

#### Methods



<a name="CodeActionKind.append"></a><span class="ts" id=607 data-target="#details-607" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">append</span><span>(</span><span class="ident">parts</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></span>
<div class="details collapse" id="details-607">
<div class="comment"><p>Create a new kind by appending a more specific selector to the current kind.</p>
<p>Does not modify the current kind.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">parts</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="CodeActionKind.contains"></a><span class="ts" id=613 data-target="#details-613" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contains</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-613">
<div class="comment"><p>Checks if <code>other</code> is a sub-kind of this <code>CodeActionKind</code>.</p>
<p>The kind <code>&quot;refactor.extract&quot;</code> for example contains <code>&quot;refactor.extract&quot;</code> and ``&quot;refactor.extract.function&quot;<code>, but not </code>&quot;unicorn.refactor.extract&quot;<code>, or </code>&quot;refactor.extractAll&quot;<code>or</code>refactor`.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></td><td><div class="comment"><p>Kind to check.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="CodeActionKind.intersects"></a><span class="ts" id=610 data-target="#details-610" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">intersects</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-610">
<div class="comment"><p>Checks if this code action kind intersects <code>other</code>.</p>
<p>The kind <code>&quot;refactor.extract&quot;</code> for example intersects <code>refactor</code>, <code>&quot;refactor.extract&quot;</code> and <code>&quot;refactor.extract.function&quot;</code>,
but not <code>&quot;unicorn.refactor.extract&quot;</code>, or <code>&quot;refactor.extractAll&quot;</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#CodeActionKind">CodeActionKind</a></td><td><div class="comment"><p>Kind to check.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="CodeActionProvider"></a><span class="code-item" id=636>CodeActionProvider&lt;T&gt;</span>



<div class="comment"><p>Provides contextual actions for code. Code actions typically either fix problems or beautify/refactor code.</p>
<p>Code actions are surfaced to users in a few different ways:</p>
<ul>
<li>The <a href="https://code.visualstudio.com/docs/editor/editingevolved#_code-action">lightbulb</a> feature, which shows
a list of code actions at the current cursor position. The lightbulb&#39;s list of actions includes both quick fixes
and refactorings.</li>
<li>As commands that users can run, such as <code>Refactor</code>. Users can run these from the command palette or with keybindings.</li>
<li>As source actions, such <code>Organize Imports</code>.</li>
<li><a href="#CodeActionKind.QuickFix">Quick fixes</a> are shown in the problems view.</li>
<li>Change applied on save by the <code>editor.codeActionsOnSave</code> setting.</li>
</ul>
</div>

#### Methods



<a name="CodeActionProvider.provideCodeActions"></a><span class="ts" id=639 data-target="#details-639" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideCodeActions</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Selection">Selection</a>, <span class="ident">context</span><span>: </span><a class="type-ref" href="#CodeActionContext">CodeActionContext</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;Array&lt;<a class="type-ref" href="#Command">Command</a> &#124; <span class="type-ref">T</span>&gt;&gt;</span>
<div class="details collapse" id="details-639">
<div class="comment"><p>Get code actions for a given range in a document.</p>
<p>Only return code actions that are relevant to user for the requested range. Also keep in mind how the
returned code actions will appear in the UI. The lightbulb widget and <code>Refactor</code> commands for instance show
returned code actions as a list, so do not return a large number of code actions that will overwhelm the user.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Selection">Selection</a></td><td><div class="comment"><p>The selector or range for which the command was invoked. This will always be a
<a href="#Selection">selection</a> if the actions are being requested in the currently active editor.</p>
</div></td></tr>
<tr><td><span class="ident">context</span><span>: </span><a class="type-ref" href="#CodeActionContext">CodeActionContext</a></td><td><div class="comment"><p>Provides additional information about what code actions are being requested. You can use this
to see what specific type of code actions are being requested by the editor in order to return more relevant
actions and avoid returning irrelevant code actions that the editor will discard.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;Array&lt;<a class="type-ref" href="#Command">Command</a> &#124; <span class="type-ref">T</span>&gt;&gt;</td><td><div class="comment"><p>An array of code actions, such as quick fixes or refactorings. The lack of a result can be signaled
by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
<p>We also support returning <code>Command</code> for legacy reasons, however all new extensions should return
<code>CodeAction</code> object instead.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="CodeActionProvider.resolveCodeAction"></a><span class="ts" id=645 data-target="#details-645" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveCodeAction</span><span>(</span><span class="ident">codeAction</span><span>: </span><span class="type-ref">T</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-645">
<div class="comment"><p>Given a code action fill in its <a href="#CodeAction.edit">edit</a>-property. Changes to
all other properties, like title, are ignored. A code action that has an edit
will not be resolved.</p>
<p><em>Note</em> that a code action provider that returns commands, not code actions, cannot successfully
implement this function. Returning commands is deprecated and instead code actions should be
returned.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">codeAction</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>A code action.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>The resolved code action or a thenable that resolves to such. It is OK to return the given
<code>item</code>. When no result is returned, the given <code>item</code> will be used.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="CodeActionProviderMetadata"></a><span class="code-item" id=648>CodeActionProviderMetadata</span>



<div class="comment"><p>Metadata about the type of code actions that a <a href="#CodeActionProvider">CodeActionProvider</a> provides.</p>
</div>

#### Properties



<a name="CodeActionProviderMetadata.documentation"></a><span class="ts" id=650 data-target="#details-650" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">documentation</span><span>?</span><span>: </span>ReadonlyArray&lt;{command: <a class="type-ref" href="#Command">Command</a>, kind: <a class="type-ref" href="#CodeActionKind">CodeActionKind</a>}&gt;</span>
<div class="details collapse" id="details-650">
<div class="comment"><p>Static documentation for a class of code actions.</p>
<p>Documentation from the provider is shown in the code actions menu if either:</p>
<ul>
<li><p>Code actions of <code>kind</code> are requested by the editor. In this case, the editor will show the documentation that
most closely matches the requested code action kind. For example, if a provider has documentation for
both <code>Refactor</code> and <code>RefactorExtract</code>, when the user requests code actions for <code>RefactorExtract</code>,
the editor will use the documentation for <code>RefactorExtract</code> instead of the documentation for <code>Refactor</code>.</p>
</li>
<li><p>Any code actions of <code>kind</code> are returned by the provider.</p>
</li>
</ul>
<p>At most one documentation entry will be shown per provider.</p>
</div>
</div>



<a name="CodeActionProviderMetadata.providedCodeActionKinds"></a><span class="ts" id=649 data-target="#details-649" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">providedCodeActionKinds</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#CodeActionKind">CodeActionKind</a>[]</span>
<div class="details collapse" id="details-649">
<div class="comment"><p>List of <a href="#CodeActionKind">CodeActionKinds</a> that a <a href="#CodeActionProvider">CodeActionProvider</a> may return.</p>
<p>This list is used to determine if a given <code>CodeActionProvider</code> should be invoked or not.
To avoid unnecessary computation, every <code>CodeActionProvider</code> should list use <code>providedCodeActionKinds</code>. The
list of kinds may either be generic, such as <code>[CodeActionKind.Refactor]</code>, or list out every kind provided,
such as <code>[CodeActionKind.Refactor.Extract.append(&#39;function&#39;), CodeActionKind.Refactor.Extract.append(&#39;constant&#39;), ...]</code>.</p>
</div>
</div>

### <a name="CodeActionTriggerKind"></a><span class="code-item" id=615>CodeActionTriggerKind</span>



<div class="comment"><p>The reason why code actions were requested.</p>
</div>

#### Enumeration Members



<a name="CodeActionTriggerKind.Invoke"></a><span class="ts" id=616 data-target="#details-616" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Invoke</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-616">
<div class="comment"><p>Code actions were explicitly requested by the user or by an extension.</p>
</div>
</div>



<a name="CodeActionTriggerKind.Automatic"></a><span class="ts" id=617 data-target="#details-617" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Automatic</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-617">
<div class="comment"><p>Code actions were requested automatically.</p>
<p>This typically happens when current selection in a file changes, but can
also be triggered when file content changes.</p>
</div>
</div>

### <a name="CodeLens"></a><span class="code-item" id=654>CodeLens</span>



<div class="comment"><p>A code lens represents a <a href="#Command">Command</a> that should be shown along with
source text, like the number of references, a way to run tests, etc.</p>
<p>A code lens is <em>unresolved</em> when no command is associated to it. For performance
reasons the creation of a code lens and resolving should be done to two stages.</p>
<p><em>See also</em></p>
<ul>
<li><a href="#CodeLensProvider.provideCodeLenses">CodeLensProvider.provideCodeLenses</a></li>
<li><a href="#CodeLensProvider.resolveCodeLens">CodeLensProvider.resolveCodeLens</a></li>
</ul>
</div>

#### Constructors



<a name="CodeLens.CodeLens"></a><span class="ts" id=656 data-target="#details-656" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">CodeLens</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">command</span><span>?</span><span>: </span><a class="type-ref" href="#Command">Command</a><span>)</span><span>: </span><a class="type-ref" href="#CodeLens">CodeLens</a></span>
<div class="details collapse" id="details-656">
<div class="comment"><p>Creates a new code lens object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range to which this code lens applies.</p>
</div></td></tr>
<tr><td><span class="ident">command</span><span>?</span><span>: </span><a class="type-ref" href="#Command">Command</a></td><td><div class="comment"><p>The command associated to this code lens.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#CodeLens">CodeLens</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="CodeLens.command"></a><span class="ts" id=660 data-target="#details-660" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>?</span><span>: </span><a class="type-ref" href="#Command">Command</a></span>
<div class="details collapse" id="details-660">
<div class="comment"><p>The command this code lens represents.</p>
</div>
</div>



<a name="CodeLens.isResolved"></a><span class="ts" id=661 data-target="#details-661" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isResolved</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-661">
<div class="comment"><p><code>true</code> when there is a command associated.</p>
</div>
</div>



<a name="CodeLens.range"></a><span class="ts" id=659 data-target="#details-659" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-659">
<div class="comment"><p>The range in which this code lens is valid. Should only span a single line.</p>
</div>
</div>

### <a name="CodeLensProvider"></a><span class="code-item" id=662>CodeLensProvider&lt;T&gt;</span>



<div class="comment"><p>A code lens provider adds <a href="#Command">commands</a> to source text. The commands will be shown
as dedicated horizontal lines in between the source text.</p>
</div>

#### Events



<a name="CodeLensProvider.onDidChangeCodeLenses"></a><span class="ts" id=664 data-target="#details-664" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeCodeLenses</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-664">
<div class="comment"><p>An optional event to signal that the code lenses from this provider have changed.</p>
</div>
</div>

#### Methods



<a name="CodeLensProvider.provideCodeLenses"></a><span class="ts" id=666 data-target="#details-666" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideCodeLenses</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-666">
<div class="comment"><p>Compute a list of <a href="#CodeLens">lenses</a>. This call should return as fast as possible and if
computing the commands is expensive implementors should only return code lens objects with the
range set and implement <a href="#CodeLensProvider.resolveCodeLens">resolve</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>An array of code lenses or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="CodeLensProvider.resolveCodeLens"></a><span class="ts" id=670 data-target="#details-670" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveCodeLens</span><span>(</span><span class="ident">codeLens</span><span>: </span><span class="type-ref">T</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-670">
<div class="comment"><p>This function will be called for each visible code lens, usually when scrolling and after
calls to <a href="#CodeLensProvider.provideCodeLenses">compute</a>-lenses.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">codeLens</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>Code lens that must be resolved.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>The given, resolved code lens or thenable that resolves to such.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="Color"></a><span class="code-item" id=1361>Color</span>



<div class="comment"><p>Represents a color in RGBA space.</p>
</div>

#### Constructors



<a name="Color.Color"></a><span class="ts" id=1363 data-target="#details-1363" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Color</span><span>(</span><span class="ident">red</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">green</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">blue</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">alpha</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#Color">Color</a></span>
<div class="details collapse" id="details-1363">
<div class="comment"><p>Creates a new color instance.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">red</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The red component.</p>
</div></td></tr>
<tr><td><span class="ident">green</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The green component.</p>
</div></td></tr>
<tr><td><span class="ident">blue</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The blue component.</p>
</div></td></tr>
<tr><td><span class="ident">alpha</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The alpha component.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Color">Color</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="Color.alpha"></a><span class="ts" id=1371 data-target="#details-1371" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">alpha</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1371">
<div class="comment"><p>The alpha component of this color in the range <code>[0-1]</code>.</p>
</div>
</div>



<a name="Color.blue"></a><span class="ts" id=1370 data-target="#details-1370" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">blue</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1370">
<div class="comment"><p>The blue component of this color in the range <code>[0-1]</code>.</p>
</div>
</div>



<a name="Color.green"></a><span class="ts" id=1369 data-target="#details-1369" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">green</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1369">
<div class="comment"><p>The green component of this color in the range <code>[0-1]</code>.</p>
</div>
</div>



<a name="Color.red"></a><span class="ts" id=1368 data-target="#details-1368" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">red</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1368">
<div class="comment"><p>The red component of this color in the range <code>[0-1]</code>.</p>
</div>
</div>

### <a name="ColorInformation"></a><span class="code-item" id=1372>ColorInformation</span>



<div class="comment"><p>Represents a color range from a document.</p>
</div>

#### Constructors



<a name="ColorInformation.ColorInformation"></a><span class="ts" id=1374 data-target="#details-1374" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ColorInformation</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">color</span><span>: </span><a class="type-ref" href="#Color">Color</a><span>)</span><span>: </span><a class="type-ref" href="#ColorInformation">ColorInformation</a></span>
<div class="details collapse" id="details-1374">
<div class="comment"><p>Creates a new color range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range the color appears in. Must not be empty.</p>
</div></td></tr>
<tr><td><span class="ident">color</span><span>: </span><a class="type-ref" href="#Color">Color</a></td><td><div class="comment"><p>The value of the color.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ColorInformation">ColorInformation</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="ColorInformation.color"></a><span class="ts" id=1378 data-target="#details-1378" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">color</span><span>: </span><a class="type-ref" href="#Color">Color</a></span>
<div class="details collapse" id="details-1378">
<div class="comment"><p>The actual color value for this color range.</p>
</div>
</div>



<a name="ColorInformation.range"></a><span class="ts" id=1377 data-target="#details-1377" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1377">
<div class="comment"><p>The range in the document where this color appears.</p>
</div>
</div>

### <a name="ColorPresentation"></a><span class="code-item" id=1379>ColorPresentation</span>



<div class="comment"><p>A color presentation object describes how a <a href="#Color">Color</a> should be represented as text and what
edits are required to refer to it from source code.</p>
<p>For some languages one color can have multiple presentations, e.g. css can represent the color red with
the constant <code>Red</code>, the hex-value <code>#ff0000</code>, or in rgba and hsla forms. In csharp other representations
apply, e.g. <code>System.Drawing.Color.Red</code>.</p>
</div>

#### Constructors



<a name="ColorPresentation.ColorPresentation"></a><span class="ts" id=1381 data-target="#details-1381" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ColorPresentation</span><span>(</span><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#ColorPresentation">ColorPresentation</a></span>
<div class="details collapse" id="details-1381">
<div class="comment"><p>Creates a new color presentation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The label of this color presentation.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ColorPresentation">ColorPresentation</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="ColorPresentation.additionalTextEdits"></a><span class="ts" id=1385 data-target="#details-1385" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">additionalTextEdits</span><span>?</span><span>: </span><a class="type-ref" href="#TextEdit">TextEdit</a>[]</span>
<div class="details collapse" id="details-1385">
<div class="comment"><p>An optional array of additional <a href="#TextEdit">text edits</a> that are applied when
selecting this color presentation. Edits must not overlap with the main <a href="#ColorPresentation.textEdit">edit</a> nor with themselves.</p>
</div>
</div>



<a name="ColorPresentation.label"></a><span class="ts" id=1383 data-target="#details-1383" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1383">
<div class="comment"><p>The label of this color presentation. It will be shown on the color
picker header. By default this is also the text that is inserted when selecting
this color presentation.</p>
</div>
</div>



<a name="ColorPresentation.textEdit"></a><span class="ts" id=1384 data-target="#details-1384" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">textEdit</span><span>?</span><span>: </span><a class="type-ref" href="#TextEdit">TextEdit</a></span>
<div class="details collapse" id="details-1384">
<div class="comment"><p>An <a href="#TextEdit">edit</a> which is applied to a document when selecting
this presentation for the color.  When <code>falsy</code> the <a href="#ColorPresentation.label">label</a>
is used.</p>
</div>
</div>

### <a name="ColorTheme"></a><span class="code-item" id=2124>ColorTheme</span>



<div class="comment"><p>Represents a color theme.</p>
</div>

#### Properties



<a name="ColorTheme.kind"></a><span class="ts" id=2125 data-target="#details-2125" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>: </span><a class="type-ref" href="#ColorThemeKind">ColorThemeKind</a></span>
<div class="details collapse" id="details-2125">
<div class="comment"><p>The kind of this color theme: light, dark, high contrast dark and high contrast light.</p>
</div>
</div>

### <a name="ColorThemeKind"></a><span class="code-item" id=2119>ColorThemeKind</span>



<div class="comment"><p>Represents a color theme kind.</p>
</div>

#### Enumeration Members



<a name="ColorThemeKind.Light"></a><span class="ts" id=2120 data-target="#details-2120" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Light</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-2120">
<div class="comment"><p>A light color theme.</p>
</div>
</div>



<a name="ColorThemeKind.Dark"></a><span class="ts" id=2121 data-target="#details-2121" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Dark</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-2121">
<div class="comment"><p>A dark color theme.</p>
</div>
</div>



<a name="ColorThemeKind.HighContrast"></a><span class="ts" id=2122 data-target="#details-2122" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">HighContrast</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-2122">
<div class="comment"><p>A dark high contrast color theme.</p>
</div>
</div>



<a name="ColorThemeKind.HighContrastLight"></a><span class="ts" id=2123 data-target="#details-2123" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">HighContrastLight</span><span>: </span><span class="type-literal">4</span></span>
<div class="details collapse" id="details-2123">
<div class="comment"><p>A light high contrast color theme.</p>
</div>
</div>

### <a name="Command"></a><span class="code-item" id=3>Command</span>



<div class="comment"><p>Represents a reference to a command. Provides a title which
will be used to represent a command in the UI and, optionally,
an array of arguments which will be passed to the command handler
function when invoked.</p>
</div>

#### Properties



<a name="Command.arguments"></a><span class="ts" id=7 data-target="#details-7" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">arguments</span><span>?</span><span>: </span><span class="type-intrinsic">any</span>[]</span>
<div class="details collapse" id="details-7">
<div class="comment"><p>Arguments that the command handler should be
invoked with.</p>
</div>
</div>



<a name="Command.command"></a><span class="ts" id=5 data-target="#details-5" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5">
<div class="comment"><p>The identifier of the actual command handler.</p>
<p><em>See also</em>
<a href="#commands.registerCommand">commands.registerCommand</a></p>
</div>
</div>



<a name="Command.title"></a><span class="ts" id=4 data-target="#details-4" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4">
<div class="comment"><p>Title of the command, like <code>save</code>.</p>
</div>
</div>



<a name="Command.tooltip"></a><span class="ts" id=6 data-target="#details-6" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-6">
<div class="comment"><p>A tooltip for the command, when represented in the UI.</p>
</div>
</div>

### <a name="Comment"></a><span class="code-item" id=4280>Comment</span>



<div class="comment"><p>A comment is displayed within the editor or the Comments Panel, depending on how it is provided.</p>
</div>

#### Properties



<a name="Comment.author"></a><span class="ts" id=4283 data-target="#details-4283" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">author</span><span>: </span><a class="type-ref" href="#CommentAuthorInformation">CommentAuthorInformation</a></span>
<div class="details collapse" id="details-4283">
<div class="comment"><p>The <a href="#CommentAuthorInformation">author information</a> of the comment</p>
</div>
</div>



<a name="Comment.body"></a><span class="ts" id=4281 data-target="#details-4281" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">body</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-4281">
<div class="comment"><p>The human-readable comment body</p>
</div>
</div>



<a name="Comment.contextValue"></a><span class="ts" id=4284 data-target="#details-4284" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contextValue</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4284">
<div class="comment"><p>Context value of the comment. This can be used to contribute comment specific actions.
For example, a comment is given a context value as <code>editable</code>. When contributing actions to <code>comments/comment/title</code>
using <code>menus</code> extension point, you can specify context value for key <code>comment</code> in <code>when</code> expression like <code>comment == editable</code>.</p>
<pre class="shiki" data-lang="json" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">    "contributes"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">        "menus"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">            "comments/comment/title"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: [</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">                {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">                    "command"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"extension.deleteComment"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">                    "when"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"comment == editable"</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">                }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">            ]</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">        }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    }</span></span></code></pre>
<p>This will show action <code>extension.deleteComment</code> only for comments with <code>contextValue</code> is <code>editable</code>.</p>
</div>
</div>



<a name="Comment.label"></a><span class="ts" id=4286 data-target="#details-4286" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4286">
<div class="comment"><p>Optional label describing the <a href="#Comment">Comment</a>
Label will be rendered next to authorName if exists.</p>
</div>
</div>



<a name="Comment.mode"></a><span class="ts" id=4282 data-target="#details-4282" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">mode</span><span>: </span><a class="type-ref" href="#CommentMode">CommentMode</a></span>
<div class="details collapse" id="details-4282">
<div class="comment"><p><a href="#CommentMode">Comment mode</a> of the comment</p>
</div>
</div>



<a name="Comment.reactions"></a><span class="ts" id=4285 data-target="#details-4285" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">reactions</span><span>?</span><span>: </span><a class="type-ref" href="#CommentReaction">CommentReaction</a>[]</span>
<div class="details collapse" id="details-4285">
<div class="comment"><p>Optional reactions of the <a href="#Comment">Comment</a></p>
</div>
</div>



<a name="Comment.timestamp"></a><span class="ts" id=4287 data-target="#details-4287" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">timestamp</span><span>?</span><span>: </span><span class="type-ref-ts">Date</span></span>
<div class="details collapse" id="details-4287">
<div class="comment"><p>Optional timestamp that will be displayed in comments.
The date will be formatted according to the user&#39;s locale and settings.</p>
</div>
</div>

### <a name="CommentAuthorInformation"></a><span class="code-item" id=4272>CommentAuthorInformation</span>



<div class="comment"><p>Author information of a <a href="#Comment">Comment</a></p>
</div>

#### Properties



<a name="CommentAuthorInformation.iconPath"></a><span class="ts" id=4274 data-target="#details-4274" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">iconPath</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4274">
<div class="comment"><p>The optional icon path for the author</p>
</div>
</div>



<a name="CommentAuthorInformation.name"></a><span class="ts" id=4273 data-target="#details-4273" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4273">
<div class="comment"><p>The display name of the author of the comment</p>
</div>
</div>

### <a name="CommentController"></a><span class="code-item" id=4302>CommentController</span>



<div class="comment"><p>A comment controller is able to provide <a href="#CommentThread">comments</a> support to the editor and
provide users various ways to interact with comments.</p>
</div>

#### Properties



<a name="CommentController.commentingRangeProvider"></a><span class="ts" id=4306 data-target="#details-4306" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">commentingRangeProvider</span><span>?</span><span>: </span><a class="type-ref" href="#CommentingRangeProvider">CommentingRangeProvider</a></span>
<div class="details collapse" id="details-4306">
<div class="comment"><p>Optional commenting range provider. Provide a list <a href="#Range">ranges</a> which support commenting to any given resource uri.</p>
<p>If not provided, users cannot leave any comments.</p>
</div>
</div>



<a name="CommentController.id"></a><span class="ts" id=4303 data-target="#details-4303" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4303">
<div class="comment"><p>The id of this comment controller.</p>
</div>
</div>



<a name="CommentController.label"></a><span class="ts" id=4304 data-target="#details-4304" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4304">
<div class="comment"><p>The human-readable label of this comment controller.</p>
</div>
</div>



<a name="CommentController.options"></a><span class="ts" id=4305 data-target="#details-4305" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#CommentOptions">CommentOptions</a></span>
<div class="details collapse" id="details-4305">
<div class="comment"><p>Comment controller options</p>
</div>
</div>



<a name="CommentController.reactionHandler"></a><span class="ts" id=4312 data-target="#details-4312" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">reactionHandler</span><span>?</span><span>: </span>(comment: <a class="type-ref" href="#Comment">Comment</a>, reaction: <a class="type-ref" href="#CommentReaction">CommentReaction</a>) =&gt; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-4312">
<div class="comment"><p>Optional reaction handler for creating and deleting reactions on a <a href="#Comment">Comment</a>.</p>
</div>
<div class="comment"></div>
<div class="signature variable-declaration-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">comment</span><span>: </span><a class="type-ref" href="#Comment">Comment</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">reaction</span><span>: </span><a class="type-ref" href="#CommentReaction">CommentReaction</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Methods



<a name="CommentController.createCommentThread"></a><span class="ts" id=4308 data-target="#details-4308" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createCommentThread</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">comments</span><span>: </span>readonly <a class="type-ref" href="#Comment">Comment</a>[]<span>)</span><span>: </span><a class="type-ref" href="#CommentThread">CommentThread</a></span>
<div class="details collapse" id="details-4308">
<div class="comment"><p>Create a <a href="#CommentThread">comment thread</a>. The comment thread will be displayed in visible text editors (if the resource matches)
and Comments Panel once created.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the document the thread has been created on.</p>
</div></td></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range the comment thread is located within the document.</p>
</div></td></tr>
<tr><td><span class="ident">comments</span><span>: </span>readonly <a class="type-ref" href="#Comment">Comment</a>[]</td><td><div class="comment"><p>The ordered comments of the thread.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#CommentThread">CommentThread</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="CommentController.dispose"></a><span class="ts" id=4318 data-target="#details-4318" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4318">
<div class="comment"><p>Dispose this comment controller.</p>
<p>Once disposed, all <a href="#CommentThread">comment threads</a> created by this comment controller will also be removed from the editor
and Comments Panel.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="CommentingRangeProvider"></a><span class="code-item" id=4294>CommentingRangeProvider</span>



<div class="comment"><p>Commenting range provider for a <a href="#CommentController">comment controller</a>.</p>
</div>

#### Methods



<a name="CommentingRangeProvider.provideCommentingRanges"></a><span class="ts" id=4296 data-target="#details-4296" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideCommentingRanges</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Range">Range</a>[] &#124; <a class="type-ref" href="#CommentingRanges">CommentingRanges</a>&gt;</span>
<div class="details collapse" id="details-4296">
<div class="comment"><p>Provide a list of ranges which allow new comment threads creation or null for a given document</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Range">Range</a>[] &#124; <a class="type-ref" href="#CommentingRanges">CommentingRanges</a>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="CommentingRanges"></a><span class="code-item" id=4291>CommentingRanges</span>



<div class="comment"><p>The ranges a CommentingRangeProvider enables commenting on.</p>
</div>

#### Properties



<a name="CommentingRanges.enableFileComments"></a><span class="ts" id=4292 data-target="#details-4292" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">enableFileComments</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4292">
<div class="comment"><p>Enables comments to be added to a file without a specific range.</p>
</div>
</div>



<a name="CommentingRanges.ranges"></a><span class="ts" id=4293 data-target="#details-4293" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ranges</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a>[]</span>
<div class="details collapse" id="details-4293">
<div class="comment"><p>The ranges which allow new comment threads creation.</p>
</div>
</div>

### <a name="CommentMode"></a><span class="code-item" id=4255>CommentMode</span>



<div class="comment"><p>Comment mode of a <a href="#Comment">Comment</a></p>
</div>

#### Enumeration Members



<a name="CommentMode.Editing"></a><span class="ts" id=4256 data-target="#details-4256" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Editing</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-4256">
<div class="comment"><p>Displays the comment editor</p>
</div>
</div>



<a name="CommentMode.Preview"></a><span class="ts" id=4257 data-target="#details-4257" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Preview</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-4257">
<div class="comment"><p>Displays the preview of the comment</p>
</div>
</div>

### <a name="CommentOptions"></a><span class="code-item" id=4299>CommentOptions</span>



<div class="comment"><p>Represents a <a href="#CommentController">comment controller</a>&#39;s <a href="#CommentController.options">options</a>.</p>
</div>

#### Properties



<a name="CommentOptions.placeHolder"></a><span class="ts" id=4301 data-target="#details-4301" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">placeHolder</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4301">
<div class="comment"><p>An optional string to show as placeholder in the comment input box when it&#39;s focused.</p>
</div>
</div>



<a name="CommentOptions.prompt"></a><span class="ts" id=4300 data-target="#details-4300" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prompt</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4300">
<div class="comment"><p>An optional string to show on the comment input box when it&#39;s collapsed.</p>
</div>
</div>

### <a name="CommentReaction"></a><span class="code-item" id=4275>CommentReaction</span>



<div class="comment"><p>Reactions of a <a href="#Comment">Comment</a></p>
</div>

#### Properties



<a name="CommentReaction.authorHasReacted"></a><span class="ts" id=4279 data-target="#details-4279" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">authorHasReacted</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4279">
<div class="comment"><p>Whether the <a href="#CommentAuthorInformation">author</a> of the comment has reacted to this reaction</p>
</div>
</div>



<a name="CommentReaction.count"></a><span class="ts" id=4278 data-target="#details-4278" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">count</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-4278">
<div class="comment"><p>The number of users who have reacted to this reaction</p>
</div>
</div>



<a name="CommentReaction.iconPath"></a><span class="ts" id=4277 data-target="#details-4277" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">iconPath</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4277">
<div class="comment"><p>Icon for the reaction shown in UI.</p>
</div>
</div>



<a name="CommentReaction.label"></a><span class="ts" id=4276 data-target="#details-4276" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4276">
<div class="comment"><p>The human-readable label for the reaction</p>
</div>
</div>

### <a name="CommentReply"></a><span class="code-item" id=4288>CommentReply</span>



<div class="comment"><p>Command argument for actions registered in <code>comments/commentThread/context</code>.</p>
</div>

#### Properties



<a name="CommentReply.text"></a><span class="ts" id=4290 data-target="#details-4290" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4290">
<div class="comment"><p>The value in the comment editor</p>
</div>
</div>



<a name="CommentReply.thread"></a><span class="ts" id=4289 data-target="#details-4289" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">thread</span><span>: </span><a class="type-ref" href="#CommentThread">CommentThread</a></span>
<div class="details collapse" id="details-4289">
<div class="comment"><p>The active <a href="#CommentThread">comment thread</a></p>
</div>
</div>

### <a name="CommentRule"></a><span class="code-item" id=1643>CommentRule</span>



<div class="comment"><p>Describes how comments for a language work.</p>
</div>

#### Properties



<a name="CommentRule.blockComment"></a><span class="ts" id=1645 data-target="#details-1645" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">blockComment</span><span>?</span><span>: </span><a class="type-ref" href="#CharacterPair">CharacterPair</a></span>
<div class="details collapse" id="details-1645">
<div class="comment"><p>The block comment character pair, like <code>/* block comment *&amp;#47;</code></p>
</div>
</div>



<a name="CommentRule.lineComment"></a><span class="ts" id=1644 data-target="#details-1644" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">lineComment</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#LineCommentRule">LineCommentRule</a></span>
<div class="details collapse" id="details-1644">
<div class="comment"><p>The line comment token, like <code>// this is a comment</code></p>
</div>
</div>

### <a name="CommentThread"></a><span class="code-item" id=4261>CommentThread</span>



<div class="comment"><p>A collection of <a href="#Comment">comments</a> representing a conversation at a particular range in a document.</p>
</div>

#### Properties



<a name="CommentThread.canReply"></a><span class="ts" id=4266 data-target="#details-4266" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">canReply</span><span>: </span><span class="type-intrinsic">boolean</span> &#124; <a class="type-ref" href="#CommentAuthorInformation">CommentAuthorInformation</a></span>
<div class="details collapse" id="details-4266">
<div class="comment"><p>Whether the thread supports reply.
Defaults to true.</p>
</div>
</div>



<a name="CommentThread.collapsibleState"></a><span class="ts" id=4265 data-target="#details-4265" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">collapsibleState</span><span>: </span><a class="type-ref" href="#CommentThreadCollapsibleState">CommentThreadCollapsibleState</a></span>
<div class="details collapse" id="details-4265">
<div class="comment"><p>Whether the thread should be collapsed or expanded when opening the document.
Defaults to Collapsed.</p>
</div>
</div>



<a name="CommentThread.comments"></a><span class="ts" id=4264 data-target="#details-4264" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">comments</span><span>: </span>readonly <a class="type-ref" href="#Comment">Comment</a>[]</span>
<div class="details collapse" id="details-4264">
<div class="comment"><p>The ordered comments of the thread.</p>
</div>
</div>



<a name="CommentThread.contextValue"></a><span class="ts" id=4267 data-target="#details-4267" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contextValue</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4267">
<div class="comment"><p>Context value of the comment thread. This can be used to contribute thread specific actions.
For example, a comment thread is given a context value as <code>editable</code>. When contributing actions to <code>comments/commentThread/title</code>
using <code>menus</code> extension point, you can specify context value for key <code>commentThread</code> in <code>when</code> expression like <code>commentThread == editable</code>.</p>
<pre class="shiki" data-lang="json" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"contributes"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">  "menus"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">    "comments/commentThread/title"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: [</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">      {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">        "command"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"extension.deleteCommentThread"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">        "when"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"commentThread == editable"</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">      }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    ]</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span></code></pre>
<p>This will show action <code>extension.deleteCommentThread</code> only for comment threads with <code>contextValue</code> is <code>editable</code>.</p>
</div>
</div>



<a name="CommentThread.label"></a><span class="ts" id=4268 data-target="#details-4268" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4268">
<div class="comment"><p>The optional human-readable label describing the <a href="#CommentThread">Comment Thread</a></p>
</div>
</div>



<a name="CommentThread.range"></a><span class="ts" id=4263 data-target="#details-4263" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-4263">
<div class="comment"><p>The range the comment thread is located within the document. The thread icon will be shown
at the last line of the range. When set to undefined, the comment will be associated with the
file, and not a specific range.</p>
</div>
</div>



<a name="CommentThread.state"></a><span class="ts" id=4269 data-target="#details-4269" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">state</span><span>?</span><span>: </span><a class="type-ref" href="#CommentThreadState">CommentThreadState</a></span>
<div class="details collapse" id="details-4269">
<div class="comment"><p>The optional state of a comment thread, which may affect how the comment is displayed.</p>
</div>
</div>



<a name="CommentThread.uri"></a><span class="ts" id=4262 data-target="#details-4262" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4262">
<div class="comment"><p>The uri of the document the thread has been created on.</p>
</div>
</div>

#### Methods



<a name="CommentThread.dispose"></a><span class="ts" id=4271 data-target="#details-4271" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4271">
<div class="comment"><p>Dispose this comment thread.</p>
<p>Once disposed, this comment thread will be removed from visible editors and Comment Panel when appropriate.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="CommentThreadCollapsibleState"></a><span class="code-item" id=4252>CommentThreadCollapsibleState</span>



<div class="comment"><p>Collapsible state of a <a href="#CommentThread">comment thread</a></p>
</div>

#### Enumeration Members



<a name="CommentThreadCollapsibleState.Collapsed"></a><span class="ts" id=4253 data-target="#details-4253" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Collapsed</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-4253">
<div class="comment"><p>Determines an item is collapsed</p>
</div>
</div>



<a name="CommentThreadCollapsibleState.Expanded"></a><span class="ts" id=4254 data-target="#details-4254" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Expanded</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-4254">
<div class="comment"><p>Determines an item is expanded</p>
</div>
</div>

### <a name="CommentThreadState"></a><span class="code-item" id=4258>CommentThreadState</span>



<div class="comment"><p>The state of a comment thread.</p>
</div>

#### Enumeration Members



<a name="CommentThreadState.Unresolved"></a><span class="ts" id=4259 data-target="#details-4259" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Unresolved</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-4259">
<div class="comment"><p>Unresolved thread state</p>
</div>
</div>



<a name="CommentThreadState.Resolved"></a><span class="ts" id=4260 data-target="#details-4260" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Resolved</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-4260">
<div class="comment"><p>Resolved thread state</p>
</div>
</div>

### <a name="CompletionContext"></a><span class="code-item" id=1297>CompletionContext</span>



<div class="comment"><p>Contains additional information about the context in which
<a href="#CompletionItemProvider.provideCompletionItems">completion provider</a> is triggered.</p>
</div>

#### Properties



<a name="CompletionContext.triggerCharacter"></a><span class="ts" id=1299 data-target="#details-1299" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">triggerCharacter</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1299">
<div class="comment"><p>Character that triggered the completion item provider.</p>
<p><code>undefined</code> if the provider was not triggered by a character.</p>
<p>The trigger character is already in the document when the completion provider is triggered.</p>
</div>
</div>



<a name="CompletionContext.triggerKind"></a><span class="ts" id=1298 data-target="#details-1298" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">triggerKind</span><span>: </span><a class="type-ref" href="#CompletionTriggerKind">CompletionTriggerKind</a></span>
<div class="details collapse" id="details-1298">
<div class="comment"><p>How the completion was triggered.</p>
</div>
</div>

### <a name="CompletionItem"></a><span class="code-item" id=1261>CompletionItem</span>



<div class="comment"><p>A completion item represents a text snippet that is proposed to complete text that is being typed.</p>
<p>It is sufficient to create a completion item from just a <a href="#CompletionItem.label">label</a>. In that
case the completion item will replace the <a href="#TextDocument.getWordRangeAtPosition">word</a>
until the cursor with the given label or <a href="#CompletionItem.insertText">insertText</a>. Otherwise the
given <a href="#CompletionItem.textEdit">edit</a> is used.</p>
<p>When selecting a completion item in the editor its defined or synthesized text edit will be applied
to <em>all</em> cursors/selections whereas <a href="#CompletionItem.additionalTextEdits">additionalTextEdits</a> will be
applied as provided.</p>
<p><em>See also</em></p>
<ul>
<li><a href="#CompletionItemProvider.provideCompletionItems">CompletionItemProvider.provideCompletionItems</a></li>
<li><a href="#CompletionItemProvider.resolveCompletionItem">CompletionItemProvider.resolveCompletionItem</a></li>
</ul>
</div>

#### Constructors



<a name="CompletionItem.CompletionItem"></a><span class="ts" id=1263 data-target="#details-1263" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">CompletionItem</span><span>(</span><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#CompletionItemLabel">CompletionItemLabel</a>, <span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#CompletionItemKind">CompletionItemKind</a><span>)</span><span>: </span><a class="type-ref" href="#CompletionItem">CompletionItem</a></span>
<div class="details collapse" id="details-1263">
<div class="comment"><p>Creates a new completion item.</p>
<p>Completion items must have at least a <a href="#CompletionItem.label">label</a> which then
will be used as insert text as well as for sorting and filtering.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#CompletionItemLabel">CompletionItemLabel</a></td><td><div class="comment"><p>The label of the completion.</p>
</div></td></tr>
<tr><td><span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#CompletionItemKind">CompletionItemKind</a></td><td><div class="comment"><p>The <a href="#CompletionItemKind">kind</a> of the completion.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#CompletionItem">CompletionItem</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="CompletionItem.additionalTextEdits"></a><span class="ts" id=1282 data-target="#details-1282" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">additionalTextEdits</span><span>?</span><span>: </span><a class="type-ref" href="#TextEdit">TextEdit</a>[]</span>
<div class="details collapse" id="details-1282">
<div class="comment"><p>An optional array of additional <a href="#TextEdit">text edits</a> that are applied when
selecting this completion. Edits must not overlap with the main <a href="#CompletionItem.textEdit">edit</a>
nor with themselves.</p>
</div>
</div>



<a name="CompletionItem.command"></a><span class="ts" id=1283 data-target="#details-1283" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>?</span><span>: </span><a class="type-ref" href="#Command">Command</a></span>
<div class="details collapse" id="details-1283">
<div class="comment"><p>An optional <a href="#Command">Command</a> that is executed <em>after</em> inserting this completion. <em>Note</em> that
additional modifications to the current document should be described with the
<a href="#CompletionItem.additionalTextEdits">additionalTextEdits</a>-property.</p>
</div>
</div>



<a name="CompletionItem.commitCharacters"></a><span class="ts" id=1279 data-target="#details-1279" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">commitCharacters</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-1279">
<div class="comment"><p>An optional set of characters that when pressed while this completion is active will accept it first and
then type that character. <em>Note</em> that all commit characters should have <code>length=1</code> and that superfluous
characters will be ignored.</p>
</div>
</div>



<a name="CompletionItem.detail"></a><span class="ts" id=1269 data-target="#details-1269" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">detail</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1269">
<div class="comment"><p>A human-readable string with additional information
about this item, like type or symbol information.</p>
</div>
</div>



<a name="CompletionItem.documentation"></a><span class="ts" id=1270 data-target="#details-1270" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">documentation</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-1270">
<div class="comment"><p>A human-readable string that represents a doc-comment.</p>
</div>
</div>



<a name="CompletionItem.filterText"></a><span class="ts" id=1272 data-target="#details-1272" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">filterText</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1272">
<div class="comment"><p>A string that should be used when filtering a set of
completion items. When <code>falsy</code> the <a href="#CompletionItem.label">label</a>
is used.</p>
<p>Note that the filter text is matched against the leading word (prefix) which is defined
by the <a href="#CompletionItem.range">range</a>-property.</p>
</div>
</div>



<a name="CompletionItem.insertText"></a><span class="ts" id=1274 data-target="#details-1274" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">insertText</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#SnippetString">SnippetString</a></span>
<div class="details collapse" id="details-1274">
<div class="comment"><p>A string or snippet that should be inserted in a document when selecting
this completion. When <code>falsy</code> the <a href="#CompletionItem.label">label</a>
is used.</p>
</div>
</div>



<a name="CompletionItem.keepWhitespace"></a><span class="ts" id=1280 data-target="#details-1280" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">keepWhitespace</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1280">
<div class="comment"><p>Keep whitespace of the <a href="#CompletionItem.insertText">insertText</a> as is. By default, the editor adjusts leading
whitespace of new lines so that they match the indentation of the line for which the item is accepted - setting
this to <code>true</code> will prevent that.</p>
</div>
</div>



<a name="CompletionItem.kind"></a><span class="ts" id=1267 data-target="#details-1267" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#CompletionItemKind">CompletionItemKind</a></span>
<div class="details collapse" id="details-1267">
<div class="comment"><p>The kind of this completion item. Based on the kind
an icon is chosen by the editor.</p>
</div>
</div>



<a name="CompletionItem.label"></a><span class="ts" id=1266 data-target="#details-1266" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#CompletionItemLabel">CompletionItemLabel</a></span>
<div class="details collapse" id="details-1266">
<div class="comment"><p>The label of this completion item. By default
this is also the text that is inserted when selecting
this completion.</p>
</div>
</div>



<a name="CompletionItem.preselect"></a><span class="ts" id=1273 data-target="#details-1273" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">preselect</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1273">
<div class="comment"><p>Select this item when showing. <em>Note</em> that only one completion item can be selected and
that the editor decides which item that is. The rule is that the <em>first</em> item of those
that match best is selected.</p>
</div>
</div>



<a name="CompletionItem.range"></a><span class="ts" id=1275 data-target="#details-1275" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; {inserting: <a class="type-ref" href="#Range">Range</a>, replacing: <a class="type-ref" href="#Range">Range</a>}</span>
<div class="details collapse" id="details-1275">
<div class="comment"><p>A range or a insert and replace range selecting the text that should be replaced by this completion item.</p>
<p>When omitted, the range of the <a href="#TextDocument.getWordRangeAtPosition">current word</a> is used as replace-range
and as insert-range the start of the <a href="#TextDocument.getWordRangeAtPosition">current word</a> to the
current position is used.</p>
<p><em>Note 1:</em> A range must be a <a href="#Range.isSingleLine">single line</a> and it must
<a href="#Range.contains">contain</a> the position at which completion has been <a href="#CompletionItemProvider.provideCompletionItems">requested</a>.
<em>Note 2:</em> A insert range must be a prefix of a replace range, that means it must be contained and starting at the same position.</p>
</div>
</div>



<a name="CompletionItem.sortText"></a><span class="ts" id=1271 data-target="#details-1271" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">sortText</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1271">
<div class="comment"><p>A string that should be used when comparing this item
with other items. When <code>falsy</code> the <a href="#CompletionItem.label">label</a>
is used.</p>
<p>Note that <code>sortText</code> is only used for the initial ordering of completion
items. When having a leading word (prefix) ordering is based on how
well completions match that prefix and the initial ordering is only used
when completions match equally well. The prefix is defined by the
<a href="#CompletionItem.range">range</a>-property and can therefore be different
for each completion.</p>
</div>
</div>



<a name="CompletionItem.tags"></a><span class="ts" id=1268 data-target="#details-1268" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tags</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#CompletionItemTag">CompletionItemTag</a>[]</span>
<div class="details collapse" id="details-1268">
<div class="comment"><p>Tags for this completion item.</p>
</div>
</div>



<a name="CompletionItem.textEdit"></a><span class="ts" id=1281 data-target="#details-1281" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">textEdit</span><span>?</span><span>: </span><a class="type-ref" href="#TextEdit">TextEdit</a></span>
<div class="details collapse" id="details-1281">
<div class="comment"><ul>
<li><em>deprecated</em> - Use <code>CompletionItem.insertText</code> and <code>CompletionItem.range</code> instead.</li>
</ul>
<p>An <a href="#TextEdit">edit</a> which is applied to a document when selecting
this completion. When an edit is provided the value of
<a href="#CompletionItem.insertText">insertText</a> is ignored.</p>
<p>The <a href="#Range">Range</a> of the edit must be single-line and on the same
line completions were <a href="#CompletionItemProvider.provideCompletionItems">requested</a> at.</p>
</div>
</div>

### <a name="CompletionItemKind"></a><span class="code-item" id=1231>CompletionItemKind</span>



<div class="comment"><p>Completion item kinds.</p>
</div>

#### Enumeration Members



<a name="CompletionItemKind.Text"></a><span class="ts" id=1232 data-target="#details-1232" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Text</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-1232">
<div class="comment"><p>The <code>Text</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Method"></a><span class="ts" id=1233 data-target="#details-1233" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Method</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1233">
<div class="comment"><p>The <code>Method</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Function"></a><span class="ts" id=1234 data-target="#details-1234" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Function</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1234">
<div class="comment"><p>The <code>Function</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Constructor"></a><span class="ts" id=1235 data-target="#details-1235" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Constructor</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-1235">
<div class="comment"><p>The <code>Constructor</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Field"></a><span class="ts" id=1236 data-target="#details-1236" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Field</span><span>: </span><span class="type-literal">4</span></span>
<div class="details collapse" id="details-1236">
<div class="comment"><p>The <code>Field</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Variable"></a><span class="ts" id=1237 data-target="#details-1237" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Variable</span><span>: </span><span class="type-literal">5</span></span>
<div class="details collapse" id="details-1237">
<div class="comment"><p>The <code>Variable</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Class"></a><span class="ts" id=1238 data-target="#details-1238" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Class</span><span>: </span><span class="type-literal">6</span></span>
<div class="details collapse" id="details-1238">
<div class="comment"><p>The <code>Class</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Interface"></a><span class="ts" id=1239 data-target="#details-1239" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Interface</span><span>: </span><span class="type-literal">7</span></span>
<div class="details collapse" id="details-1239">
<div class="comment"><p>The <code>Interface</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Module"></a><span class="ts" id=1240 data-target="#details-1240" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Module</span><span>: </span><span class="type-literal">8</span></span>
<div class="details collapse" id="details-1240">
<div class="comment"><p>The <code>Module</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Property"></a><span class="ts" id=1241 data-target="#details-1241" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Property</span><span>: </span><span class="type-literal">9</span></span>
<div class="details collapse" id="details-1241">
<div class="comment"><p>The <code>Property</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Unit"></a><span class="ts" id=1242 data-target="#details-1242" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Unit</span><span>: </span><span class="type-literal">10</span></span>
<div class="details collapse" id="details-1242">
<div class="comment"><p>The <code>Unit</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Value"></a><span class="ts" id=1243 data-target="#details-1243" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Value</span><span>: </span><span class="type-literal">11</span></span>
<div class="details collapse" id="details-1243">
<div class="comment"><p>The <code>Value</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Enum"></a><span class="ts" id=1244 data-target="#details-1244" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Enum</span><span>: </span><span class="type-literal">12</span></span>
<div class="details collapse" id="details-1244">
<div class="comment"><p>The <code>Enum</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Keyword"></a><span class="ts" id=1245 data-target="#details-1245" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Keyword</span><span>: </span><span class="type-literal">13</span></span>
<div class="details collapse" id="details-1245">
<div class="comment"><p>The <code>Keyword</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Snippet"></a><span class="ts" id=1246 data-target="#details-1246" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Snippet</span><span>: </span><span class="type-literal">14</span></span>
<div class="details collapse" id="details-1246">
<div class="comment"><p>The <code>Snippet</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Color"></a><span class="ts" id=1247 data-target="#details-1247" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Color</span><span>: </span><span class="type-literal">15</span></span>
<div class="details collapse" id="details-1247">
<div class="comment"><p>The <code>Color</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.File"></a><span class="ts" id=1248 data-target="#details-1248" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">File</span><span>: </span><span class="type-literal">16</span></span>
<div class="details collapse" id="details-1248">
<div class="comment"><p>The <code>File</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Reference"></a><span class="ts" id=1249 data-target="#details-1249" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Reference</span><span>: </span><span class="type-literal">17</span></span>
<div class="details collapse" id="details-1249">
<div class="comment"><p>The <code>Reference</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Folder"></a><span class="ts" id=1250 data-target="#details-1250" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Folder</span><span>: </span><span class="type-literal">18</span></span>
<div class="details collapse" id="details-1250">
<div class="comment"><p>The <code>Folder</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.EnumMember"></a><span class="ts" id=1251 data-target="#details-1251" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">EnumMember</span><span>: </span><span class="type-literal">19</span></span>
<div class="details collapse" id="details-1251">
<div class="comment"><p>The <code>EnumMember</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Constant"></a><span class="ts" id=1252 data-target="#details-1252" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Constant</span><span>: </span><span class="type-literal">20</span></span>
<div class="details collapse" id="details-1252">
<div class="comment"><p>The <code>Constant</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Struct"></a><span class="ts" id=1253 data-target="#details-1253" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Struct</span><span>: </span><span class="type-literal">21</span></span>
<div class="details collapse" id="details-1253">
<div class="comment"><p>The <code>Struct</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Event"></a><span class="ts" id=1254 data-target="#details-1254" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Event</span><span>: </span><span class="type-literal">22</span></span>
<div class="details collapse" id="details-1254">
<div class="comment"><p>The <code>Event</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Operator"></a><span class="ts" id=1255 data-target="#details-1255" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Operator</span><span>: </span><span class="type-literal">23</span></span>
<div class="details collapse" id="details-1255">
<div class="comment"><p>The <code>Operator</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.TypeParameter"></a><span class="ts" id=1256 data-target="#details-1256" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TypeParameter</span><span>: </span><span class="type-literal">24</span></span>
<div class="details collapse" id="details-1256">
<div class="comment"><p>The <code>TypeParameter</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.User"></a><span class="ts" id=1257 data-target="#details-1257" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">User</span><span>: </span><span class="type-literal">25</span></span>
<div class="details collapse" id="details-1257">
<div class="comment"><p>The <code>User</code> completion item kind.</p>
</div>
</div>



<a name="CompletionItemKind.Issue"></a><span class="ts" id=1258 data-target="#details-1258" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Issue</span><span>: </span><span class="type-literal">26</span></span>
<div class="details collapse" id="details-1258">
<div class="comment"><p>The <code>Issue</code> completion item kind.</p>
</div>
</div>

### <a name="CompletionItemLabel"></a><span class="code-item" id=1227>CompletionItemLabel</span>



<div class="comment"><p>A structured label for a <a href="#CompletionItem">completion item</a>.</p>
</div>

#### Properties



<a name="CompletionItemLabel.description"></a><span class="ts" id=1230 data-target="#details-1230" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">description</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1230">
<div class="comment"><p>An optional string which is rendered less prominently after <a href="#CompletionItemLabel.detail">CompletionItemLabel.detail</a>. Should be used
for fully qualified names or file path.</p>
</div>
</div>



<a name="CompletionItemLabel.detail"></a><span class="ts" id=1229 data-target="#details-1229" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">detail</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1229">
<div class="comment"><p>An optional string which is rendered less prominently directly after <a href="#CompletionItemLabel.label">label</a>,
without any spacing. Should be used for function signatures or type annotations.</p>
</div>
</div>



<a name="CompletionItemLabel.label"></a><span class="ts" id=1228 data-target="#details-1228" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1228">
<div class="comment"><p>The label of this completion item.</p>
<p>By default this is also the text that is inserted when this completion is selected.</p>
</div>
</div>

### <a name="CompletionItemProvider"></a><span class="code-item" id=1300>CompletionItemProvider&lt;T&gt;</span>



<div class="comment"><p>The completion item provider interface defines the contract between extensions and
<a href="https://code.visualstudio.com/docs/editor/intellisense">IntelliSense</a>.</p>
<p>Providers can delay the computation of the <a href="#CompletionItem.detail">detail</a>
and <a href="#CompletionItem.documentation">documentation</a> properties by implementing the
<a href="#CompletionItemProvider.resolveCompletionItem">resolveCompletionItem</a>-function. However, properties that
are needed for the initial sorting and filtering, like <code>sortText</code>, <code>filterText</code>, <code>insertText</code>, and <code>range</code>, must
not be changed during resolve.</p>
<p>Providers are asked for completions either explicitly by a user gesture or -depending on the configuration-
implicitly when typing words or trigger characters.</p>
</div>

#### Methods



<a name="CompletionItemProvider.provideCompletionItems"></a><span class="ts" id=1303 data-target="#details-1303" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideCompletionItems</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a>, <span class="ident">context</span><span>: </span><a class="type-ref" href="#CompletionContext">CompletionContext</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#CompletionList&amp;lt;T&amp;gt;">CompletionList</a>&lt;<span class="type-ref">T</span>&gt; &#124; <span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-1303">
<div class="comment"><p>Provide completion items for the given position and document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><td><span class="ident">context</span><span>: </span><a class="type-ref" href="#CompletionContext">CompletionContext</a></td><td><div class="comment"><p>How the completion was triggered.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#CompletionList&amp;lt;T&amp;gt;">CompletionList</a>&lt;<span class="type-ref">T</span>&gt; &#124; <span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>An array of completions, a <a href="#CompletionList">completion list</a>, or a thenable that resolves to either.
The lack of a result can be signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="CompletionItemProvider.resolveCompletionItem"></a><span class="ts" id=1309 data-target="#details-1309" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveCompletionItem</span><span>(</span><span class="ident">item</span><span>: </span><span class="type-ref">T</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-1309">
<div class="comment"><p>Given a completion item fill in more data, like <a href="#CompletionItem.documentation">doc-comment</a>
or <a href="#CompletionItem.detail">details</a>.</p>
<p>The editor will only resolve a completion item once.</p>
<p><em>Note</em> that this function is called when completion items are already showing in the UI or when an item has been
selected for insertion. Because of that, no property that changes the presentation (label, sorting, filtering etc)
or the (primary) insert behaviour (<a href="#CompletionItem.insertText">insertText</a>) can be changed.</p>
<p>This function may fill in <a href="#CompletionItem.additionalTextEdits">additionalTextEdits</a>. However, that means an item might be
inserted <em>before</em> resolving is done and in that case the editor will do a best effort to still apply those additional
text edits.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">item</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>A completion item currently active in the UI.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>The resolved completion item or a thenable that resolves to of such. It is OK to return the given
<code>item</code>. When no result is returned, the given <code>item</code> will be used.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="CompletionItemTag"></a><span class="code-item" id=1259>CompletionItemTag</span>



<div class="comment"><p>Completion item tags are extra annotations that tweak the rendering of a completion
item.</p>
</div>

#### Enumeration Members



<a name="CompletionItemTag.Deprecated"></a><span class="ts" id=1260 data-target="#details-1260" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Deprecated</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1260">
<div class="comment"><p>Render a completion as obsolete, usually using a strike-out.</p>
</div>
</div>

### <a name="CompletionList"></a><span class="code-item" id=1284>CompletionList&lt;T&gt;</span>



<div class="comment"><p>Represents a collection of <a href="#CompletionItem">completion items</a> to be presented
in the editor.</p>
</div>

#### Constructors



<a name="CompletionList.CompletionList"></a><span class="ts" id=1287 data-target="#details-1287" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">CompletionList</span><span>&lt;</span>T extends <a class="type-ref" href="#CompletionItem">CompletionItem</a><span>&gt;</span><span>(</span><span class="ident">items</span><span>?</span><span>: </span><span class="type-ref">T</span>[], <span class="ident">isIncomplete</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><a class="type-ref" href="#CompletionList&amp;lt;T&amp;gt;">CompletionList</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-1287">
<div class="comment"><p>Creates a new completion list.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">items</span><span>?</span><span>: </span><span class="type-ref">T</span>[]</td><td><div class="comment"><p>The completion items.</p>
</div></td></tr>
<tr><td><span class="ident">isIncomplete</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>The list is not complete.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#CompletionList&amp;lt;T&amp;gt;">CompletionList</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="CompletionList.isIncomplete"></a><span class="ts" id=1291 data-target="#details-1291" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isIncomplete</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1291">
<div class="comment"><p>This list is not complete. Further typing should result in recomputing
this list.</p>
</div>
</div>



<a name="CompletionList.items"></a><span class="ts" id=1292 data-target="#details-1292" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">items</span><span>: </span><span class="type-ref">T</span>[]</span>
<div class="details collapse" id="details-1292">
<div class="comment"><p>The completion items.</p>
</div>
</div>

### <a name="CompletionTriggerKind"></a><span class="code-item" id=1293>CompletionTriggerKind</span>



<div class="comment"><p>How a <a href="#CompletionItemProvider">completion provider</a> was triggered</p>
</div>

#### Enumeration Members



<a name="CompletionTriggerKind.Invoke"></a><span class="ts" id=1294 data-target="#details-1294" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Invoke</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-1294">
<div class="comment"><p>Completion was triggered normally.</p>
</div>
</div>



<a name="CompletionTriggerKind.TriggerCharacter"></a><span class="ts" id=1295 data-target="#details-1295" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TriggerCharacter</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1295">
<div class="comment"><p>Completion was triggered by a trigger character.</p>
</div>
</div>



<a name="CompletionTriggerKind.TriggerForIncompleteCompletions"></a><span class="ts" id=1296 data-target="#details-1296" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TriggerForIncompleteCompletions</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1296">
<div class="comment"><p>Completion was re-triggered as current completion list is incomplete</p>
</div>
</div>

### <a name="ConfigurationChangeEvent"></a><span class="code-item" id=3491>ConfigurationChangeEvent</span>



<div class="comment"><p>An event describing the change in Configuration</p>
</div>

#### Methods



<a name="ConfigurationChangeEvent.affectsConfiguration"></a><span class="ts" id=3493 data-target="#details-3493" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">affectsConfiguration</span><span>(</span><span class="ident">section</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">scope</span><span>?</span><span>: </span><a class="type-ref" href="#ConfigurationScope">ConfigurationScope</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3493">
<div class="comment"><p>Checks if the given section has changed.
If scope is provided, checks if the section has changed for resources under the given scope.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">section</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Configuration name, supports <em>dotted</em> names.</p>
</div></td></tr>
<tr><td><span class="ident">scope</span><span>?</span><span>: </span><a class="type-ref" href="#ConfigurationScope">ConfigurationScope</a></td><td><div class="comment"><p>A scope in which to check.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> if the given section has changed.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="ConfigurationScope"></a><span class="code-item" id=3487>ConfigurationScope</span>



<div class="comment"><p>The configuration scope which can be:</p>
<ul>
<li>a <a href="#Uri">Uri</a> representing a resource</li>
<li>a <a href="#TextDocument">TextDocument</a> representing an open text document</li>
<li>a <a href="#WorkspaceFolder">WorkspaceFolder</a> representing a workspace folder</li>
<li>an object containing:<ul>
<li><code>uri</code>: an optional <a href="#Uri">Uri</a> of a text document</li>
<li><code>languageId</code>: the language identifier of a text document</li>
</ul>
</li>
</ul>
</div>



<a name="ConfigurationScope"></a><span class="ts" id=3487 data-target="#details-3487" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ConfigurationScope</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#TextDocument">TextDocument</a> &#124; <a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a> &#124; {languageId: <span class="type-intrinsic">string</span>, uri: <a class="type-ref" href="#Uri">Uri</a>}</span>

### <a name="ConfigurationTarget"></a><span class="code-item" id=1697>ConfigurationTarget</span>



<div class="comment"><p>The configuration target</p>
</div>

#### Enumeration Members



<a name="ConfigurationTarget.Global"></a><span class="ts" id=1698 data-target="#details-1698" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Global</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1698">
<div class="comment"><p>Global configuration</p>
</div>
</div>



<a name="ConfigurationTarget.Workspace"></a><span class="ts" id=1699 data-target="#details-1699" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Workspace</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1699">
<div class="comment"><p>Workspace configuration</p>
</div>
</div>



<a name="ConfigurationTarget.WorkspaceFolder"></a><span class="ts" id=1700 data-target="#details-1700" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">WorkspaceFolder</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-1700">
<div class="comment"><p>Workspace folder configuration</p>
</div>
</div>

### <a name="CustomDocument"></a><span class="code-item" id=2499>CustomDocument</span>



<div class="comment"><p>Represents a custom document used by a <a href="#CustomEditorProvider">CustomEditorProvider</a>.</p>
<p>Custom documents are only used within a given <code>CustomEditorProvider</code>. The lifecycle of a <code>CustomDocument</code> is
managed by the editor. When no more references remain to a <code>CustomDocument</code>, it is disposed of.</p>
</div>

#### Properties



<a name="CustomDocument.uri"></a><span class="ts" id=2500 data-target="#details-2500" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-2500">
<div class="comment"><p>The associated uri for this document.</p>
</div>
</div>

#### Methods



<a name="CustomDocument.dispose"></a><span class="ts" id=2502 data-target="#details-2502" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-2502">
<div class="comment"><p>Dispose of the custom document.</p>
<p>This is invoked by the editor when there are no more references to a given <code>CustomDocument</code> (for example when
all editors associated with the document have been closed.)</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="CustomDocumentBackup"></a><span class="code-item" id=2514>CustomDocumentBackup</span>



<div class="comment"><p>A backup for an <a href="#CustomDocument">CustomDocument</a>.</p>
</div>

#### Properties



<a name="CustomDocumentBackup.id"></a><span class="ts" id=2515 data-target="#details-2515" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2515">
<div class="comment"><p>Unique identifier for the backup.</p>
<p>This id is passed back to your extension in <a href="#CustomReadonlyEditorProvider.openCustomDocument">openCustomDocument</a> when opening a custom editor from a backup.</p>
</div>
</div>

#### Methods



<a name="CustomDocumentBackup.delete"></a><span class="ts" id=2517 data-target="#details-2517" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">delete</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-2517">
<div class="comment"><p>Delete the current backup.</p>
<p>This is called by the editor when it is clear the current backup is no longer needed, such as when a new backup
is made or when the file is saved.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="CustomDocumentBackupContext"></a><span class="code-item" id=2518>CustomDocumentBackupContext</span>



<div class="comment"><p>Additional information used to implement <a href="#CustomDocumentBackup">CustomDocumentBackup</a>.</p>
</div>

#### Properties



<a name="CustomDocumentBackupContext.destination"></a><span class="ts" id=2519 data-target="#details-2519" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">destination</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-2519">
<div class="comment"><p>Suggested file location to write the new backup.</p>
<p>Note that your extension is free to ignore this and use its own strategy for backup.</p>
<p>If the editor is for a resource from the current workspace, <code>destination</code> will point to a file inside
<code>ExtensionContext.storagePath</code>. The parent folder of <code>destination</code> may not exist, so make sure to created it
before writing the backup to this location.</p>
</div>
</div>

### <a name="CustomDocumentContentChangeEvent"></a><span class="code-item" id=2511>CustomDocumentContentChangeEvent&lt;T&gt;</span>



<div class="comment"><p>Event triggered by extensions to signal to the editor that the content of a <a href="#CustomDocument">CustomDocument</a>
has changed.</p>
<p><em>See also</em>
<a href="#CustomEditorProvider.onDidChangeCustomDocument">CustomEditorProvider.onDidChangeCustomDocument</a>.</p>
</div>

#### Properties



<a name="CustomDocumentContentChangeEvent.document"></a><span class="ts" id=2513 data-target="#details-2513" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">document</span><span>: </span><span class="type-ref">T</span></span>
<div class="details collapse" id="details-2513">
<div class="comment"><p>The document that the change is for.</p>
</div>
</div>

### <a name="CustomDocumentEditEvent"></a><span class="code-item" id=2503>CustomDocumentEditEvent&lt;T&gt;</span>



<div class="comment"><p>Event triggered by extensions to signal to the editor that an edit has occurred on an <a href="#CustomDocument">CustomDocument</a>.</p>
<p><em>See also</em>
<a href="#CustomEditorProvider.onDidChangeCustomDocument">CustomEditorProvider.onDidChangeCustomDocument</a>.</p>
</div>

#### Properties



<a name="CustomDocumentEditEvent.document"></a><span class="ts" id=2505 data-target="#details-2505" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">document</span><span>: </span><span class="type-ref">T</span></span>
<div class="details collapse" id="details-2505">
<div class="comment"><p>The document that the edit is for.</p>
</div>
</div>



<a name="CustomDocumentEditEvent.label"></a><span class="ts" id=2510 data-target="#details-2510" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2510">
<div class="comment"><p>Display name describing the edit.</p>
<p>This will be shown to users in the UI for undo/redo operations.</p>
</div>
</div>

#### Methods



<a name="CustomDocumentEditEvent.redo"></a><span class="ts" id=2509 data-target="#details-2509" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">redo</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2509">
<div class="comment"><p>Redo the edit operation.</p>
<p>This is invoked by the editor when the user redoes this edit. To implement <code>redo</code>, your
extension should restore the document and editor to the state they were in just after this
edit was added to the editor&#39;s internal edit stack by <a href="#CustomEditorProvider.onDidChangeCustomDocument">CustomEditorProvider.onDidChangeCustomDocument</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="CustomDocumentEditEvent.undo"></a><span class="ts" id=2507 data-target="#details-2507" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">undo</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2507">
<div class="comment"><p>Undo the edit operation.</p>
<p>This is invoked by the editor when the user undoes this edit. To implement <code>undo</code>, your
extension should restore the document and editor to the state they were in just before this
edit was added to the editor&#39;s internal edit stack by <a href="#CustomEditorProvider.onDidChangeCustomDocument">CustomEditorProvider.onDidChangeCustomDocument</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="CustomDocumentOpenContext"></a><span class="code-item" id=2520>CustomDocumentOpenContext</span>



<div class="comment"><p>Additional information about the opening custom document.</p>
</div>

#### Properties



<a name="CustomDocumentOpenContext.backupId"></a><span class="ts" id=2521 data-target="#details-2521" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">backupId</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2521">
<div class="comment"><p>The id of the backup to restore the document from or <code>undefined</code> if there is no backup.</p>
<p>If this is provided, your extension should restore the editor from the backup instead of reading the file
from the user&#39;s workspace.</p>
</div>
</div>



<a name="CustomDocumentOpenContext.untitledDocumentData"></a><span class="ts" id=2522 data-target="#details-2522" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">untitledDocumentData</span><span>: </span><span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;</span>
<div class="details collapse" id="details-2522">
<div class="comment"><p>If the URI is an untitled file, this will be populated with the byte data of that file</p>
<p>If this is provided, your extension should utilize this byte data rather than executing fs APIs on the URI passed in</p>
</div>
</div>

### <a name="CustomEditorProvider"></a><span class="code-item" id=2535>CustomEditorProvider&lt;T&gt;</span>



<div class="comment"><p>Provider for editable custom editors that use a custom document model.</p>
<p>Custom editors use <a href="#CustomDocument">CustomDocument</a> as their document model instead of a <a href="#TextDocument">TextDocument</a>.
This gives extensions full control over actions such as edit, save, and backup.</p>
<p>You should use this type of custom editor when dealing with binary files or more complex scenarios. For simple
text based documents, use <a href="#CustomTextEditorProvider">CustomTextEditorProvider</a> instead.</p>
</div>

#### Events



<a name="CustomEditorProvider.onDidChangeCustomDocument"></a><span class="ts" id=2537 data-target="#details-2537" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeCustomDocument</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#CustomDocumentEditEvent&amp;lt;T&amp;gt;">CustomDocumentEditEvent</a>&lt;<span class="type-ref">T</span>&gt;&gt; &#124; <a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#CustomDocumentContentChangeEvent&amp;lt;T&amp;gt;">CustomDocumentContentChangeEvent</a>&lt;<span class="type-ref">T</span>&gt;&gt;</span>
<div class="details collapse" id="details-2537">
<div class="comment"><p>Signal that an edit has occurred inside a custom editor.</p>
<p>This event must be fired by your extension whenever an edit happens in a custom editor. An edit can be
anything from changing some text, to cropping an image, to reordering a list. Your extension is free to
define what an edit is and what data is stored on each edit.</p>
<p>Firing <a href="#CustomEditorProvider.onDidChangeCustomDocument">onDidChangeCustomDocument</a> causes the
editors to be marked as being dirty. This is cleared when the user either saves or reverts the file.</p>
<p>Editors that support undo/redo must fire a <a href="#CustomDocumentEditEvent">CustomDocumentEditEvent</a> whenever an edit happens. This allows
users to undo and redo the edit using the editor&#39;s standard keyboard shortcuts. The editor will also mark
the editor as no longer being dirty if the user undoes all edits to the last saved state.</p>
<p>Editors that support editing but cannot use the editor&#39;s standard undo/redo mechanism must fire a <a href="#CustomDocumentContentChangeEvent">CustomDocumentContentChangeEvent</a>.
The only way for a user to clear the dirty state of an editor that does not support undo/redo is to either
<code>save</code> or <code>revert</code> the file.</p>
<p>An editor should only ever fire <a href="#CustomDocumentEditEvent">CustomDocumentEditEvent</a> events, or only ever fire <a href="#CustomDocumentContentChangeEvent">CustomDocumentContentChangeEvent</a> events.</p>
</div>
</div>

#### Methods



<a name="CustomEditorProvider.backupCustomDocument"></a><span class="ts" id=2552 data-target="#details-2552" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">backupCustomDocument</span><span>(</span><span class="ident">document</span><span>: </span><span class="type-ref">T</span>, <span class="ident">context</span><span>: </span><a class="type-ref" href="#CustomDocumentBackupContext">CustomDocumentBackupContext</a>, <span class="ident">cancellation</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#CustomDocumentBackup">CustomDocumentBackup</a>&gt;</span>
<div class="details collapse" id="details-2552">
<div class="comment"><p>Back up a dirty custom document.</p>
<p>Backups are used for hot exit and to prevent data loss. Your <a href="#CustomEditorProvider.backupCustomDocument">backupCustomDocument</a> method should persist the resource in
its current state, i.e. with the edits applied. Most commonly this means saving the resource to disk in
the <code>ExtensionContext.storagePath</code>. When the editor reloads and your custom editor is opened for a resource,
your extension should first check to see if any backups exist for the resource. If there is a backup, your
extension should load the file contents from there instead of from the resource in the workspace.</p>
<p><a href="#CustomEditorProvider.backupCustomDocument">backupCustomDocument</a> is triggered approximately one second after the user stops editing the document. If the user
rapidly edits the document, <a href="#CustomEditorProvider.backupCustomDocument">backupCustomDocument</a> will not be invoked until the editing stops.</p>
<p><a href="#CustomEditorProvider.backupCustomDocument">backupCustomDocument</a> is not invoked when <code>auto save</code> is enabled (since auto save already persists the resource).</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>Document to backup.</p>
</div></td></tr>
<tr><td><span class="ident">context</span><span>: </span><a class="type-ref" href="#CustomDocumentBackupContext">CustomDocumentBackupContext</a></td><td><div class="comment"><p>Information that can be used to backup the document.</p>
</div></td></tr>
<tr><td><span class="ident">cancellation</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>Token that signals the current backup since a new backup is coming in. It is up to your
extension to decided how to respond to cancellation. If for example your extension is backing up a large file
in an operation that takes time to complete, your extension may decide to finish the ongoing backup rather
than cancelling it to ensure that the editor has some valid backup.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#CustomDocumentBackup">CustomDocumentBackup</a>&gt;</td><td><div class="comment"><p>A <a href="#Thenable">Thenable</a> signaling that the backup has completed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="CustomEditorProvider.openCustomDocument"></a><span class="ts" id=2557 data-target="#details-2557" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">openCustomDocument</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">openContext</span><span>: </span><a class="type-ref" href="#CustomDocumentOpenContext">CustomDocumentOpenContext</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">T</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2557">
<div class="comment"><p>Create a new document for a given resource.</p>
<p><code>openCustomDocument</code> is called when the first time an editor for a given resource is opened. The opened
document is then passed to <a href="#CustomReadonlyEditorProvider.resolveCustomEditor">resolveCustomEditor</a> so that the editor can be shown to the user.</p>
<p>Already opened <a href="#CustomDocument">CustomDocuments</a> are re-used if the user opened additional editors. When all editors for a
given resource are closed, the <a href="#CustomDocument">CustomDocuments</a> is disposed of. Opening an editor at this point will
trigger another call to <code>openCustomDocument</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Uri of the document to open.</p>
</div></td></tr>
<tr><td><span class="ident">openContext</span><span>: </span><a class="type-ref" href="#CustomDocumentOpenContext">CustomDocumentOpenContext</a></td><td><div class="comment"><p>Additional information about the opening custom document.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token that indicates the result is no longer needed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">T</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>The custom document.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="CustomEditorProvider.resolveCustomEditor"></a><span class="ts" id=2562 data-target="#details-2562" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveCustomEditor</span><span>(</span><span class="ident">document</span><span>: </span><span class="type-ref">T</span>, <span class="ident">webviewPanel</span><span>: </span><a class="type-ref" href="#WebviewPanel">WebviewPanel</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2562">
<div class="comment"><p>Resolve a custom editor for a given resource.</p>
<p>This is called whenever the user opens a new editor for this <code>CustomEditorProvider</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>Document for the resource being resolved.</p>
</div></td></tr>
<tr><td><span class="ident">webviewPanel</span><span>: </span><a class="type-ref" href="#WebviewPanel">WebviewPanel</a></td><td><div class="comment"><p>The webview panel used to display the editor UI for this resource.</p>
<p>During resolve, the provider must fill in the initial html for the content webview panel and hook up all
the event listeners on it that it is interested in. The provider can also hold onto the <code>WebviewPanel</code> to
use later for example in a command. See <a href="#WebviewPanel">WebviewPanel</a> for additional details.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token that indicates the result is no longer needed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>Optional thenable indicating that the custom editor has been resolved.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="CustomEditorProvider.revertCustomDocument"></a><span class="ts" id=2548 data-target="#details-2548" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">revertCustomDocument</span><span>(</span><span class="ident">document</span><span>: </span><span class="type-ref">T</span>, <span class="ident">cancellation</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2548">
<div class="comment"><p>Revert a custom document to its last saved state.</p>
<p>This method is invoked by the editor when the user triggers <code>File: Revert File</code> in a custom editor. (Note that
this is only used using the editor&#39;s <code>File: Revert File</code> command and not on a <code>git revert</code> of the file).</p>
<p>The implementer must make sure all editor instances (webviews) for <a href="#CustomEditorProvider.revertCustomDocument.document">document</a>
are displaying the document in the same state is saved in. This usually means reloading the file from the
workspace.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>Document to revert.</p>
</div></td></tr>
<tr><td><span class="ident">cancellation</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>Token that signals the revert is no longer required.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>A <a href="#Thenable">Thenable</a> signaling that the revert has completed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="CustomEditorProvider.saveCustomDocument"></a><span class="ts" id=2539 data-target="#details-2539" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">saveCustomDocument</span><span>(</span><span class="ident">document</span><span>: </span><span class="type-ref">T</span>, <span class="ident">cancellation</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2539">
<div class="comment"><p>Save a custom document.</p>
<p>This method is invoked by the editor when the user saves a custom editor. This can happen when the user
triggers save while the custom editor is active, by commands such as <code>save all</code>, or by auto save if enabled.</p>
<p>The implementer must persist the custom editor. This usually means writing the
file data for the custom document to disk. After <a href="#CustomEditorProvider.saveCustomDocument">saveCustomDocument</a> completes, any associated
editor instances will no longer be marked as dirty.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>Document to save.</p>
</div></td></tr>
<tr><td><span class="ident">cancellation</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>Token that signals the save is no longer required (for example, if another save was triggered).</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>A <a href="#Thenable">Thenable</a> that saving has completed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="CustomEditorProvider.saveCustomDocumentAs"></a><span class="ts" id=2543 data-target="#details-2543" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">saveCustomDocumentAs</span><span>(</span><span class="ident">document</span><span>: </span><span class="type-ref">T</span>, <span class="ident">destination</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">cancellation</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2543">
<div class="comment"><p>Save a custom document to a different location.</p>
<p>This method is invoked by the editor when the user triggers &#39;save as&#39; on a custom editor. The implementer must
persist the custom editor to <a href="#CustomEditorProvider.saveCustomDocumentAs.destination">destination</a>.</p>
<p>When the user accepts save as, the current editor is be replaced by an non-dirty editor for the newly saved file.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>Document to save.</p>
</div></td></tr>
<tr><td><span class="ident">destination</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Location to save to.</p>
</div></td></tr>
<tr><td><span class="ident">cancellation</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>Token that signals the save is no longer required.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>A <a href="#Thenable">Thenable</a> signaling that saving has completed.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="CustomExecution"></a><span class="code-item" id=2211>CustomExecution</span>



<div class="comment"><p>Class used to execute an extension callback as a task.</p>
</div>

#### Constructors



<a name="CustomExecution.CustomExecution"></a><span class="ts" id=2213 data-target="#details-2213" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">CustomExecution</span><span>(</span><span class="ident">callback</span><span>: </span>(resolvedDefinition: <a class="type-ref" href="#TaskDefinition">TaskDefinition</a>) =&gt; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Pseudoterminal">Pseudoterminal</a>&gt;<span>)</span><span>: </span><a class="type-ref" href="#CustomExecution">CustomExecution</a></span>
<div class="details collapse" id="details-2213">
<div class="comment"><p>Constructs a CustomExecution task object. The callback will be executed when the task is run, at which point the
extension should return the Pseudoterminal it will &quot;run in&quot;. The task should wait to do further execution until
<a href="#Pseudoterminal.open">Pseudoterminal.open</a> is called. Task cancellation should be handled using
<a href="#Pseudoterminal.close">Pseudoterminal.close</a>. When the task is complete fire
<a href="#Pseudoterminal.onDidClose">Pseudoterminal.onDidClose</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">callback</span><span>: </span>(resolvedDefinition: <a class="type-ref" href="#TaskDefinition">TaskDefinition</a>) =&gt; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#Pseudoterminal">Pseudoterminal</a>&gt;</td><td><div class="comment"><p>The callback that will be called when the task is started by a user. Any ${} style variables that
were in the task definition will be resolved and passed into the callback as <code>resolvedDefinition</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#CustomExecution">CustomExecution</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="CustomReadonlyEditorProvider"></a><span class="code-item" id=2523>CustomReadonlyEditorProvider&lt;T&gt;</span>



<div class="comment"><p>Provider for readonly custom editors that use a custom document model.</p>
<p>Custom editors use <a href="#CustomDocument">CustomDocument</a> as their document model instead of a <a href="#TextDocument">TextDocument</a>.</p>
<p>You should use this type of custom editor when dealing with binary files or more complex scenarios. For simple
text based documents, use <a href="#CustomTextEditorProvider">CustomTextEditorProvider</a> instead.</p>
</div>

#### Methods



<a name="CustomReadonlyEditorProvider.openCustomDocument"></a><span class="ts" id=2526 data-target="#details-2526" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">openCustomDocument</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">openContext</span><span>: </span><a class="type-ref" href="#CustomDocumentOpenContext">CustomDocumentOpenContext</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">T</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2526">
<div class="comment"><p>Create a new document for a given resource.</p>
<p><code>openCustomDocument</code> is called when the first time an editor for a given resource is opened. The opened
document is then passed to <a href="#CustomReadonlyEditorProvider.resolveCustomEditor">resolveCustomEditor</a> so that the editor can be shown to the user.</p>
<p>Already opened <a href="#CustomDocument">CustomDocuments</a> are re-used if the user opened additional editors. When all editors for a
given resource are closed, the <a href="#CustomDocument">CustomDocuments</a> is disposed of. Opening an editor at this point will
trigger another call to <code>openCustomDocument</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Uri of the document to open.</p>
</div></td></tr>
<tr><td><span class="ident">openContext</span><span>: </span><a class="type-ref" href="#CustomDocumentOpenContext">CustomDocumentOpenContext</a></td><td><div class="comment"><p>Additional information about the opening custom document.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token that indicates the result is no longer needed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">T</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>The custom document.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="CustomReadonlyEditorProvider.resolveCustomEditor"></a><span class="ts" id=2531 data-target="#details-2531" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveCustomEditor</span><span>(</span><span class="ident">document</span><span>: </span><span class="type-ref">T</span>, <span class="ident">webviewPanel</span><span>: </span><a class="type-ref" href="#WebviewPanel">WebviewPanel</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2531">
<div class="comment"><p>Resolve a custom editor for a given resource.</p>
<p>This is called whenever the user opens a new editor for this <code>CustomEditorProvider</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>Document for the resource being resolved.</p>
</div></td></tr>
<tr><td><span class="ident">webviewPanel</span><span>: </span><a class="type-ref" href="#WebviewPanel">WebviewPanel</a></td><td><div class="comment"><p>The webview panel used to display the editor UI for this resource.</p>
<p>During resolve, the provider must fill in the initial html for the content webview panel and hook up all
the event listeners on it that it is interested in. The provider can also hold onto the <code>WebviewPanel</code> to
use later for example in a command. See <a href="#WebviewPanel">WebviewPanel</a> for additional details.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token that indicates the result is no longer needed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>Optional thenable indicating that the custom editor has been resolved.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="CustomTextEditorProvider"></a><span class="code-item" id=2493>CustomTextEditorProvider</span>



<div class="comment"><p>Provider for text based custom editors.</p>
<p>Text based custom editors use a <a href="#TextDocument">TextDocument</a> as their data model. This considerably simplifies
implementing a custom editor as it allows the editor to handle many common operations such as
undo and backup. The provider is responsible for synchronizing text changes between the webview and the <a href="#TextDocument">TextDocument</a>.</p>
</div>

#### Methods



<a name="CustomTextEditorProvider.resolveCustomTextEditor"></a><span class="ts" id=2495 data-target="#details-2495" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveCustomTextEditor</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">webviewPanel</span><span>: </span><a class="type-ref" href="#WebviewPanel">WebviewPanel</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2495">
<div class="comment"><p>Resolve a custom editor for a given text resource.</p>
<p>This is called when a user first opens a resource for a <code>CustomTextEditorProvider</code>, or if they reopen an
existing editor using this <code>CustomTextEditorProvider</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>Document for the resource to resolve.</p>
</div></td></tr>
<tr><td><span class="ident">webviewPanel</span><span>: </span><a class="type-ref" href="#WebviewPanel">WebviewPanel</a></td><td><div class="comment"><p>The webview panel used to display the editor UI for this resource.</p>
<p>During resolve, the provider must fill in the initial html for the content webview panel and hook up all
the event listeners on it that it is interested in. The provider can also hold onto the <a href="#WebviewPanel">WebviewPanel</a> to
use later for example in a command. See <a href="#WebviewPanel">WebviewPanel</a> for additional details.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token that indicates the result is no longer needed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>Thenable indicating that the custom editor has been resolved.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="DataTransfer"></a><span class="code-item" id=2926>DataTransfer</span>



<div class="comment"><p>A map containing a mapping of the mime type of the corresponding transferred data.</p>
<p>Drag and drop controllers that implement <a href="#TreeDragAndDropController.handleDrag"><code>handleDrag</code></a> can add additional mime types to the
data transfer. These additional mime types will only be included in the <code>handleDrop</code> when the drag was initiated from
an element in the same drag and drop controller.</p>
</div>

#### Constructors



<a name="DataTransfer.DataTransfer"></a><span class="ts" id=2928 data-target="#details-2928" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DataTransfer</span><span>(</span><span>)</span><span>: </span><a class="type-ref" href="#DataTransfer">DataTransfer</a></span>
<div class="details collapse" id="details-2928">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DataTransfer">DataTransfer</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Methods



<a name="DataTransfer.[iterator]"></a><span class="ts" id=2946 data-target="#details-2946" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">[iterator]</span><span>(</span><span>)</span><span>: </span><span class="type-ref-ts">IterableIterator</span>&lt;[mimeType: <span class="type-intrinsic">string</span>, item: <a class="type-ref" href="#DataTransferItem">DataTransferItem</a>]&gt;</span>
<div class="details collapse" id="details-2946">
<div class="comment"><p>Get a new iterator with the <code>[mime, item]</code> pairs for each element in this data transfer.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref-ts">IterableIterator</span>&lt;[mimeType: <span class="type-intrinsic">string</span>, item: <a class="type-ref" href="#DataTransferItem">DataTransferItem</a>]&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DataTransfer.forEach"></a><span class="ts" id=2937 data-target="#details-2937" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">forEach</span><span>(</span><span class="ident">callbackfn</span><span>: </span>(item: <a class="type-ref" href="#DataTransferItem">DataTransferItem</a>, mimeType: <span class="type-intrinsic">string</span>, dataTransfer: <a class="type-ref" href="#DataTransfer">DataTransfer</a>) =&gt; <span class="type-intrinsic">void</span>, <span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-2937">
<div class="comment"><p>Allows iteration through the data transfer items.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">callbackfn</span><span>: </span>(item: <a class="type-ref" href="#DataTransferItem">DataTransferItem</a>, mimeType: <span class="type-intrinsic">string</span>, dataTransfer: <a class="type-ref" href="#DataTransfer">DataTransfer</a>) =&gt; <span class="type-intrinsic">void</span></td><td><div class="comment"><p>Callback for iteration through the data transfer items.</p>
</div></td></tr>
<tr><td><span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>The <code>this</code> context used when invoking the handler function.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DataTransfer.get"></a><span class="ts" id=2930 data-target="#details-2930" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">get</span><span>(</span><span class="ident">mimeType</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#DataTransferItem">DataTransferItem</a></span>
<div class="details collapse" id="details-2930">
<div class="comment"><p>Retrieves the data transfer item for a given mime type.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">mimeType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The mime type to get the data transfer item for, such as <code>text/plain</code> or <code>image/png</code>.
Mimes type look ups are case-insensitive.</p>
<p>Special mime types:</p>
<ul>
<li><code>text/uri-list</code> — A string with <code>toString()</code>ed Uris separated by <code>\r\n</code>. To specify a cursor position in the file,
set the Uri&#39;s fragment to <code>L3,5</code>, where 3 is the line number and 5 is the column number.</li>
</ul>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DataTransferItem">DataTransferItem</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DataTransfer.set"></a><span class="ts" id=2933 data-target="#details-2933" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">set</span><span>(</span><span class="ident">mimeType</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">value</span><span>: </span><a class="type-ref" href="#DataTransferItem">DataTransferItem</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-2933">
<div class="comment"><p>Sets a mime type to data transfer item mapping.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">mimeType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The mime type to set the data for. Mimes types stored in lower case, with case-insensitive looks up.</p>
</div></td></tr>
<tr><td><span class="ident">value</span><span>: </span><a class="type-ref" href="#DataTransferItem">DataTransferItem</a></td><td><div class="comment"><p>The data transfer item for the given mime type.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="DataTransferFile"></a><span class="code-item" id=2912>DataTransferFile</span>



<div class="comment"><p>A file associated with a <a href="#DataTransferItem">DataTransferItem</a>.</p>
<p>Instances of this type can only be created by the editor and not by extensions.</p>
</div>

#### Properties



<a name="DataTransferFile.name"></a><span class="ts" id=2913 data-target="#details-2913" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2913">
<div class="comment"><p>The name of the file.</p>
</div>
</div>



<a name="DataTransferFile.uri"></a><span class="ts" id=2914 data-target="#details-2914" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-2914">
<div class="comment"><p>The full file path of the file.</p>
<p>May be <code>undefined</code> on web.</p>
</div>
</div>

#### Methods



<a name="DataTransferFile.data"></a><span class="ts" id=2916 data-target="#details-2916" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">data</span><span>(</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</span>
<div class="details collapse" id="details-2916">
<div class="comment"><p>The full file contents of the file.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="DataTransferItem"></a><span class="code-item" id=2917>DataTransferItem</span>



<div class="comment"><p>Encapsulates data transferred during drag and drop operations.</p>
</div>

#### Constructors



<a name="DataTransferItem.DataTransferItem"></a><span class="ts" id=2919 data-target="#details-2919" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DataTransferItem</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">any</span><span>)</span><span>: </span><a class="type-ref" href="#DataTransferItem">DataTransferItem</a></span>
<div class="details collapse" id="details-2919">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>Custom data stored on this item. Can be retrieved using <a href="#DataTransferItem.value">DataTransferItem.value</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DataTransferItem">DataTransferItem</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="DataTransferItem.value"></a><span class="ts" id=2925 data-target="#details-2925" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">any</span></span>
<div class="details collapse" id="details-2925">
<div class="comment"><p>Custom data stored on this item.</p>
<p>You can use <code>value</code> to share data across operations. The original object can be retrieved so long as the extension that
created the <code>DataTransferItem</code> runs in the same extension host.</p>
</div>
</div>

#### Methods



<a name="DataTransferItem.asFile"></a><span class="ts" id=2924 data-target="#details-2924" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">asFile</span><span>(</span><span>)</span><span>: </span><a class="type-ref" href="#DataTransferFile">DataTransferFile</a></span>
<div class="details collapse" id="details-2924">
<div class="comment"><p>Try getting the <a href="#DataTransferFile">file</a> associated with this data transfer item.</p>
<p>Note that the file object is only valid for the scope of the drag and drop operation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DataTransferFile">DataTransferFile</a></td><td><div class="comment"><p>The file for the data transfer or <code>undefined</code> if the item is either not a file or the
file data cannot be accessed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="DataTransferItem.asString"></a><span class="ts" id=2922 data-target="#details-2922" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">asString</span><span>(</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-2922">
<div class="comment"><p>Get a string representation of this item.</p>
<p>If <a href="#DataTransferItem.value">DataTransferItem.value</a> is an object, this returns the result of json stringifying <a href="#DataTransferItem.value">DataTransferItem.value</a> value.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="DebugAdapter"></a><span class="code-item" id=4080>DebugAdapter</span>



<div class="comment"><p>A debug adapter that implements the Debug Adapter Protocol can be registered with the editor if it implements the DebugAdapter interface.</p>
</div>

#### Events



<a name="DebugAdapter.onDidSendMessage"></a><span class="ts" id=4081 data-target="#details-4081" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidSendMessage</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#DebugProtocolMessage">DebugProtocolMessage</a>&gt;</span>
<div class="details collapse" id="details-4081">
<div class="comment"><p>An event which fires after the debug adapter has sent a Debug Adapter Protocol message to the editor.
Messages can be requests, responses, or events.</p>
</div>
</div>

#### Methods



<a name="DebugAdapter.dispose"></a><span class="ts" id=4086 data-target="#details-4086" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">any</span></span>
<div class="details collapse" id="details-4086">
<div class="comment"><p>Dispose this object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">any</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DebugAdapter.handleMessage"></a><span class="ts" id=4083 data-target="#details-4083" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">handleMessage</span><span>(</span><span class="ident">message</span><span>: </span><a class="type-ref" href="#DebugProtocolMessage">DebugProtocolMessage</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4083">
<div class="comment"><p>Handle a Debug Adapter Protocol message.
Messages can be requests, responses, or events.
Results or errors are returned via onSendMessage events.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><a class="type-ref" href="#DebugProtocolMessage">DebugProtocolMessage</a></td><td><div class="comment"><p>A Debug Adapter Protocol message</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="DebugAdapterDescriptor"></a><span class="code-item" id=4091>DebugAdapterDescriptor</span>



<div class="comment"><p>Represents the different types of debug adapters</p>
</div>



<a name="DebugAdapterDescriptor"></a><span class="ts" id=4091 data-target="#details-4091" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DebugAdapterDescriptor</span><span>: </span><a class="type-ref" href="#DebugAdapterExecutable">DebugAdapterExecutable</a> &#124; <a class="type-ref" href="#DebugAdapterServer">DebugAdapterServer</a> &#124; <a class="type-ref" href="#DebugAdapterNamedPipeServer">DebugAdapterNamedPipeServer</a> &#124; <a class="type-ref" href="#DebugAdapterInlineImplementation">DebugAdapterInlineImplementation</a></span>

### <a name="DebugAdapterDescriptorFactory"></a><span class="code-item" id=4092>DebugAdapterDescriptorFactory</span>



<div class="comment"><p>A debug adapter factory that creates <a href="#DebugAdapterDescriptor">debug adapter descriptors</a>.</p>
</div>

#### Methods



<a name="DebugAdapterDescriptorFactory.createDebugAdapterDescriptor"></a><span class="ts" id=4094 data-target="#details-4094" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createDebugAdapterDescriptor</span><span>(</span><span class="ident">session</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a>, <span class="ident">executable</span><span>: </span><a class="type-ref" href="#DebugAdapterExecutable">DebugAdapterExecutable</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DebugAdapterDescriptor">DebugAdapterDescriptor</a>&gt;</span>
<div class="details collapse" id="details-4094">
<div class="comment"><p>&#39;createDebugAdapterDescriptor&#39; is called at the start of a debug session to provide details about the debug adapter to use.
These details must be returned as objects of type <a href="#DebugAdapterDescriptor">DebugAdapterDescriptor</a>.
Currently two types of debug adapters are supported:</p>
<ul>
<li>a debug adapter executable is specified as a command path and arguments (see <a href="#DebugAdapterExecutable">DebugAdapterExecutable</a>),</li>
<li>a debug adapter server reachable via a communication port (see <a href="#DebugAdapterServer">DebugAdapterServer</a>).
If the method is not implemented the default behavior is this:
createDebugAdapter(session: DebugSession, executable: DebugAdapterExecutable) {
   if (typeof session.configuration.debugServer === &#39;number&#39;) {
  return new DebugAdapterServer(session.configuration.debugServer);
   }
   return executable;
}</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">session</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a></td><td><div class="comment"><p>The <a href="#DebugSession">debug session</a> for which the debug adapter will be used.</p>
</div></td></tr>
<tr><td><span class="ident">executable</span><span>: </span><a class="type-ref" href="#DebugAdapterExecutable">DebugAdapterExecutable</a></td><td><div class="comment"><p>The debug adapter&#39;s executable information as specified in the package.json (or undefined if no such information exists).</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DebugAdapterDescriptor">DebugAdapterDescriptor</a>&gt;</td><td><div class="comment"><p>a <a href="#DebugAdapterDescriptor">debug adapter descriptor</a> or undefined.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="DebugAdapterExecutable"></a><span class="code-item" id=4053>DebugAdapterExecutable</span>



<div class="comment"><p>Represents a debug adapter executable and optional arguments and runtime options passed to it.</p>
</div>

#### Constructors



<a name="DebugAdapterExecutable.DebugAdapterExecutable"></a><span class="ts" id=4055 data-target="#details-4055" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DebugAdapterExecutable</span><span>(</span><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">args</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>[], <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#DebugAdapterExecutableOptions">DebugAdapterExecutableOptions</a><span>)</span><span>: </span><a class="type-ref" href="#DebugAdapterExecutable">DebugAdapterExecutable</a></span>
<div class="details collapse" id="details-4055">
<div class="comment"><p>Creates a description for a debug adapter based on an executable program.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The command or executable path that implements the debug adapter.</p>
</div></td></tr>
<tr><td><span class="ident">args</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>Optional arguments to be passed to the command or executable.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#DebugAdapterExecutableOptions">DebugAdapterExecutableOptions</a></td><td><div class="comment"><p>Optional options to be used when starting the command or executable.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DebugAdapterExecutable">DebugAdapterExecutable</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="DebugAdapterExecutable.args"></a><span class="ts" id=4060 data-target="#details-4060" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">args</span><span>: </span><span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-4060">
<div class="comment"><p>The arguments passed to the debug adapter executable. Defaults to an empty array.</p>
</div>
</div>



<a name="DebugAdapterExecutable.command"></a><span class="ts" id=4059 data-target="#details-4059" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4059">
<div class="comment"><p>The command or path of the debug adapter executable.
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.
The special value &#39;node&#39; will be mapped to the editor&#39;s built-in Node.js runtime.</p>
</div>
</div>



<a name="DebugAdapterExecutable.options"></a><span class="ts" id=4061 data-target="#details-4061" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#DebugAdapterExecutableOptions">DebugAdapterExecutableOptions</a></span>
<div class="details collapse" id="details-4061">
<div class="comment"><p>Optional options to be used when the debug adapter is started.
Defaults to undefined.</p>
</div>
</div>

### <a name="DebugAdapterExecutableOptions"></a><span class="code-item" id=4062>DebugAdapterExecutableOptions</span>



<div class="comment"><p>Options for a debug adapter executable.</p>
</div>

#### Properties



<a name="DebugAdapterExecutableOptions.cwd"></a><span class="ts" id=4067 data-target="#details-4067" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cwd</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4067">
<div class="comment"><p>The current working directory for the executed debug adapter.</p>
</div>
</div>



<a name="DebugAdapterExecutableOptions.env"></a><span class="ts" id=4063 data-target="#details-4063" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">env</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-4063">
<div class="comment"><p>The additional environment of the executed program or shell. If omitted
the parent process&#39; environment is used. If provided it is merged with
the parent process&#39; environment.</p>
</div>
</div>

### <a name="DebugAdapterInlineImplementation"></a><span class="code-item" id=4087>DebugAdapterInlineImplementation</span>



<div class="comment"><p>A debug adapter descriptor for an inline implementation.</p>
</div>

#### Constructors



<a name="DebugAdapterInlineImplementation.DebugAdapterInlineImplementation"></a><span class="ts" id=4089 data-target="#details-4089" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DebugAdapterInlineImplementation</span><span>(</span><span class="ident">implementation</span><span>: </span><a class="type-ref" href="#DebugAdapter">DebugAdapter</a><span>)</span><span>: </span><a class="type-ref" href="#DebugAdapterInlineImplementation">DebugAdapterInlineImplementation</a></span>
<div class="details collapse" id="details-4089">
<div class="comment"><p>Create a descriptor for an inline implementation of a debug adapter.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">implementation</span><span>: </span><a class="type-ref" href="#DebugAdapter">DebugAdapter</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DebugAdapterInlineImplementation">DebugAdapterInlineImplementation</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="DebugAdapterNamedPipeServer"></a><span class="code-item" id=4075>DebugAdapterNamedPipeServer</span>



<div class="comment"><p>Represents a debug adapter running as a Named Pipe (on Windows)/UNIX Domain Socket (on non-Windows) based server.</p>
</div>

#### Constructors



<a name="DebugAdapterNamedPipeServer.DebugAdapterNamedPipeServer"></a><span class="ts" id=4077 data-target="#details-4077" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DebugAdapterNamedPipeServer</span><span>(</span><span class="ident">path</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#DebugAdapterNamedPipeServer">DebugAdapterNamedPipeServer</a></span>
<div class="details collapse" id="details-4077">
<div class="comment"><p>Create a description for a debug adapter running as a Named Pipe (on Windows)/UNIX Domain Socket (on non-Windows) based server.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">path</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DebugAdapterNamedPipeServer">DebugAdapterNamedPipeServer</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="DebugAdapterNamedPipeServer.path"></a><span class="ts" id=4079 data-target="#details-4079" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">path</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4079">
<div class="comment"><p>The path to the NamedPipe/UNIX Domain Socket.</p>
</div>
</div>

### <a name="DebugAdapterServer"></a><span class="code-item" id=4068>DebugAdapterServer</span>



<div class="comment"><p>Represents a debug adapter running as a socket based server.</p>
</div>

#### Constructors



<a name="DebugAdapterServer.DebugAdapterServer"></a><span class="ts" id=4070 data-target="#details-4070" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DebugAdapterServer</span><span>(</span><span class="ident">port</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">host</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#DebugAdapterServer">DebugAdapterServer</a></span>
<div class="details collapse" id="details-4070">
<div class="comment"><p>Create a description for a debug adapter running as a socket based server.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">port</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">host</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DebugAdapterServer">DebugAdapterServer</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="DebugAdapterServer.host"></a><span class="ts" id=4074 data-target="#details-4074" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">host</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4074">
<div class="comment"><p>The host.</p>
</div>
</div>



<a name="DebugAdapterServer.port"></a><span class="ts" id=4073 data-target="#details-4073" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">port</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-4073">
<div class="comment"><p>The port.</p>
</div>
</div>

### <a name="DebugAdapterTracker"></a><span class="code-item" id=4097>DebugAdapterTracker</span>



<div class="comment"><p>A Debug Adapter Tracker is a means to track the communication between the editor and a Debug Adapter.</p>
</div>

#### Events



<a name="DebugAdapterTracker.onDidSendMessage"></a><span class="ts" id=4104 data-target="#details-4104" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidSendMessage</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">any</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4104">
<div class="comment"><p>The debug adapter has sent a Debug Adapter Protocol message to the editor.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DebugAdapterTracker.onWillReceiveMessage"></a><span class="ts" id=4101 data-target="#details-4101" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onWillReceiveMessage</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">any</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4101">
<div class="comment"><p>The debug adapter is about to receive a Debug Adapter Protocol message from the editor.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DebugAdapterTracker.onWillStartSession"></a><span class="ts" id=4099 data-target="#details-4099" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onWillStartSession</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4099">
<div class="comment"><p>A session with the debug adapter is about to be started.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DebugAdapterTracker.onWillStopSession"></a><span class="ts" id=4107 data-target="#details-4107" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onWillStopSession</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4107">
<div class="comment"><p>The debug adapter session is about to be stopped.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Methods



<a name="DebugAdapterTracker.onError"></a><span class="ts" id=4109 data-target="#details-4109" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onError</span><span>(</span><span class="ident">error</span><span>: </span><span class="type-ref-ts">Error</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4109">
<div class="comment"><p>An error with the debug adapter has occurred.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">error</span><span>: </span><span class="type-ref-ts">Error</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DebugAdapterTracker.onExit"></a><span class="ts" id=4112 data-target="#details-4112" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onExit</span><span>(</span><span class="ident">code</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">signal</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4112">
<div class="comment"><p>The debug adapter has exited with the given exit code or signal.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">code</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">signal</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="DebugAdapterTrackerFactory"></a><span class="code-item" id=4115>DebugAdapterTrackerFactory</span>



<div class="comment"><p>A debug adapter factory that creates <a href="#DebugAdapterTracker">debug adapter trackers</a>.</p>
</div>

#### Methods



<a name="DebugAdapterTrackerFactory.createDebugAdapterTracker"></a><span class="ts" id=4117 data-target="#details-4117" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createDebugAdapterTracker</span><span>(</span><span class="ident">session</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DebugAdapterTracker">DebugAdapterTracker</a>&gt;</span>
<div class="details collapse" id="details-4117">
<div class="comment"><p>The method &#39;createDebugAdapterTracker&#39; is called at the start of a debug session in order
to return a &quot;tracker&quot; object that provides read-access to the communication between the editor and a debug adapter.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">session</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a></td><td><div class="comment"><p>The <a href="#DebugSession">debug session</a> for which the debug adapter tracker will be used.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DebugAdapterTracker">DebugAdapterTracker</a>&gt;</td><td><div class="comment"><p>A <a href="#DebugAdapterTracker">debug adapter tracker</a> or undefined.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="DebugConfiguration"></a><span class="code-item" id=4014>DebugConfiguration</span>



<div class="comment"><p>Configuration for a debug session.</p>
</div>

#### Properties



<a name="DebugConfiguration.name"></a><span class="ts" id=4016 data-target="#details-4016" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4016">
<div class="comment"><p>The name of the debug session.</p>
</div>
</div>



<a name="DebugConfiguration.request"></a><span class="ts" id=4017 data-target="#details-4017" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">request</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4017">
<div class="comment"><p>The request type of the debug session.</p>
</div>
</div>



<a name="DebugConfiguration.type"></a><span class="ts" id=4015 data-target="#details-4015" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">type</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4015">
<div class="comment"><p>The type of the debug session.</p>
</div>
</div>

### <a name="DebugConfigurationProvider"></a><span class="code-item" id=4038>DebugConfigurationProvider</span>



<div class="comment"><p>A debug configuration provider allows to add debug configurations to the debug service
and to resolve launch configurations before they are used to start a debug session.
A debug configuration provider is registered via <a href="#debug.registerDebugConfigurationProvider">debug.registerDebugConfigurationProvider</a>.</p>
</div>

#### Methods



<a name="DebugConfigurationProvider.provideDebugConfigurations"></a><span class="ts" id=4040 data-target="#details-4040" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDebugConfigurations</span><span>(</span><span class="ident">folder</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a>, <span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DebugConfiguration">DebugConfiguration</a>[]&gt;</span>
<div class="details collapse" id="details-4040">
<div class="comment"><p>Provides <a href="#DebugConfiguration">debug configuration</a> to the debug service. If more than one debug configuration provider is
registered for the same type, debug configurations are concatenated in arbitrary order.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">folder</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a></td><td><div class="comment"><p>The workspace folder for which the configurations are used or <code>undefined</code> for a folderless setup.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DebugConfiguration">DebugConfiguration</a>[]&gt;</td><td><div class="comment"><p>An array of <a href="#DebugConfiguration">debug configurations</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="DebugConfigurationProvider.resolveDebugConfiguration"></a><span class="ts" id=4044 data-target="#details-4044" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveDebugConfiguration</span><span>(</span><span class="ident">folder</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a>, <span class="ident">debugConfiguration</span><span>: </span><a class="type-ref" href="#DebugConfiguration">DebugConfiguration</a>, <span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DebugConfiguration">DebugConfiguration</a>&gt;</span>
<div class="details collapse" id="details-4044">
<div class="comment"><p>Resolves a <a href="#DebugConfiguration">debug configuration</a> by filling in missing values or by adding/changing/removing attributes.
If more than one debug configuration provider is registered for the same type, the resolveDebugConfiguration calls are chained
in arbitrary order and the initial debug configuration is piped through the chain.
Returning the value &#39;undefined&#39; prevents the debug session from starting.
Returning the value &#39;null&#39; prevents the debug session from starting and opens the underlying debug configuration instead.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">folder</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a></td><td><div class="comment"><p>The workspace folder from which the configuration originates from or <code>undefined</code> for a folderless setup.</p>
</div></td></tr>
<tr><td><span class="ident">debugConfiguration</span><span>: </span><a class="type-ref" href="#DebugConfiguration">DebugConfiguration</a></td><td><div class="comment"><p>The <a href="#DebugConfiguration">debug configuration</a> to resolve.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DebugConfiguration">DebugConfiguration</a>&gt;</td><td><div class="comment"><p>The resolved debug configuration or undefined or null.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="DebugConfigurationProvider.resolveDebugConfigurationWithSubstitutedVariables"></a><span class="ts" id=4049 data-target="#details-4049" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveDebugConfigurationWithSubstitutedVariables</span><span>(</span><span class="ident">folder</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a>, <span class="ident">debugConfiguration</span><span>: </span><a class="type-ref" href="#DebugConfiguration">DebugConfiguration</a>, <span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DebugConfiguration">DebugConfiguration</a>&gt;</span>
<div class="details collapse" id="details-4049">
<div class="comment"><p>This hook is directly called after &#39;resolveDebugConfiguration&#39; but with all variables substituted.
It can be used to resolve or verify a <a href="#DebugConfiguration">debug configuration</a> by filling in missing values or by adding/changing/removing attributes.
If more than one debug configuration provider is registered for the same type, the &#39;resolveDebugConfigurationWithSubstitutedVariables&#39; calls are chained
in arbitrary order and the initial debug configuration is piped through the chain.
Returning the value &#39;undefined&#39; prevents the debug session from starting.
Returning the value &#39;null&#39; prevents the debug session from starting and opens the underlying debug configuration instead.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">folder</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a></td><td><div class="comment"><p>The workspace folder from which the configuration originates from or <code>undefined</code> for a folderless setup.</p>
</div></td></tr>
<tr><td><span class="ident">debugConfiguration</span><span>: </span><a class="type-ref" href="#DebugConfiguration">DebugConfiguration</a></td><td><div class="comment"><p>The <a href="#DebugConfiguration">debug configuration</a> to resolve.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DebugConfiguration">DebugConfiguration</a>&gt;</td><td><div class="comment"><p>The resolved debug configuration or undefined or null.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="DebugConfigurationProviderTriggerKind"></a><span class="code-item" id=4184>DebugConfigurationProviderTriggerKind</span>



<div class="comment"><p>A DebugConfigurationProviderTriggerKind specifies when the <code>provideDebugConfigurations</code> method of a <code>DebugConfigurationProvider</code> is triggered.
Currently there are two situations: to provide the initial debug configurations for a newly created launch.json or
to provide dynamically generated debug configurations when the user asks for them through the UI (e.g. via the &quot;Select and Start Debugging&quot; command).
A trigger kind is used when registering a <code>DebugConfigurationProvider</code> with <a href="#debug.registerDebugConfigurationProvider">debug.registerDebugConfigurationProvider</a>.</p>
</div>

#### Enumeration Members



<a name="DebugConfigurationProviderTriggerKind.Initial"></a><span class="ts" id=4185 data-target="#details-4185" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Initial</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-4185">
<div class="comment"><p><code>DebugConfigurationProvider.provideDebugConfigurations</code> is called to provide the initial debug configurations for a newly created launch.json.</p>
</div>
</div>



<a name="DebugConfigurationProviderTriggerKind.Dynamic"></a><span class="ts" id=4186 data-target="#details-4186" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Dynamic</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-4186">
<div class="comment"><p><code>DebugConfigurationProvider.provideDebugConfigurations</code> is called to provide dynamically generated debug configurations when the user asks for them through the UI (e.g. via the &quot;Select and Start Debugging&quot; command).</p>
</div>
</div>

### <a name="DebugConsole"></a><span class="code-item" id=4119>DebugConsole</span>



<div class="comment"><p>Represents the debug console.</p>
</div>

#### Methods



<a name="DebugConsole.append"></a><span class="ts" id=4121 data-target="#details-4121" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">append</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4121">
<div class="comment"><p>Append the given value to the debug console.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string, falsy values will not be printed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DebugConsole.appendLine"></a><span class="ts" id=4124 data-target="#details-4124" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendLine</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4124">
<div class="comment"><p>Append the given value and a line feed character
to the debug console.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string, falsy values will be printed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="DebugConsoleMode"></a><span class="code-item" id=4170>DebugConsoleMode</span>



<div class="comment"><p>Debug console mode used by debug session, see <a href="#DebugSessionOptions">options</a>.</p>
</div>

#### Enumeration Members



<a name="DebugConsoleMode.Separate"></a><span class="ts" id=4171 data-target="#details-4171" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Separate</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-4171">
<div class="comment"><p>Debug session should have a separate debug console.</p>
</div>
</div>



<a name="DebugConsoleMode.MergeWithParent"></a><span class="ts" id=4172 data-target="#details-4172" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">MergeWithParent</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-4172">
<div class="comment"><p>Debug session should share debug console with its parent session.
This value has no effect for sessions which do not have a parent session.</p>
</div>
</div>

### <a name="DebugProtocolBreakpoint"></a><span class="code-item" id=4013>DebugProtocolBreakpoint</span>



<div class="comment"><p>A DebugProtocolBreakpoint is an opaque stand-in type for the <a href="https://microsoft.github.io/debug-adapter-protocol/specification#Types_Breakpoint">Breakpoint</a> type defined in the Debug Adapter Protocol.</p>
</div>

### <a name="DebugProtocolMessage"></a><span class="code-item" id=4011>DebugProtocolMessage</span>



<div class="comment"><p>A DebugProtocolMessage is an opaque stand-in type for the <a href="https://microsoft.github.io/debug-adapter-protocol/specification#Base_Protocol_ProtocolMessage">ProtocolMessage</a> type defined in the Debug Adapter Protocol.</p>
</div>

### <a name="DebugProtocolSource"></a><span class="code-item" id=4012>DebugProtocolSource</span>



<div class="comment"><p>A DebugProtocolSource is an opaque stand-in type for the <a href="https://microsoft.github.io/debug-adapter-protocol/specification#Types_Source">Source</a> type defined in the Debug Adapter Protocol.</p>
</div>

### <a name="DebugSession"></a><span class="code-item" id=4020>DebugSession</span>



<div class="comment"><p>A debug session.</p>
</div>

#### Properties



<a name="DebugSession.configuration"></a><span class="ts" id=4026 data-target="#details-4026" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">configuration</span><span>: </span><a class="type-ref" href="#DebugConfiguration">DebugConfiguration</a></span>
<div class="details collapse" id="details-4026">
<div class="comment"><p>The &quot;resolved&quot; <a href="#DebugConfiguration">debug configuration</a> of this session.
&quot;Resolved&quot; means that</p>
<ul>
<li>all variables have been substituted and</li>
<li>platform specific attribute sections have been &quot;flattened&quot; for the matching platform and removed for non-matching platforms.</li>
</ul>
</div>
</div>



<a name="DebugSession.id"></a><span class="ts" id=4021 data-target="#details-4021" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4021">
<div class="comment"><p>The unique ID of this debug session.</p>
</div>
</div>



<a name="DebugSession.name"></a><span class="ts" id=4024 data-target="#details-4024" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4024">
<div class="comment"><p>The debug session&#39;s name is initially taken from the <a href="#DebugConfiguration">debug configuration</a>.
Any changes will be properly reflected in the UI.</p>
</div>
</div>



<a name="DebugSession.parentSession"></a><span class="ts" id=4023 data-target="#details-4023" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">parentSession</span><span>?</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a></span>
<div class="details collapse" id="details-4023">
<div class="comment"><p>The parent session of this debug session, if it was created as a child.</p>
<p><em>See also</em>
DebugSessionOptions.parentSession</p>
</div>
</div>



<a name="DebugSession.type"></a><span class="ts" id=4022 data-target="#details-4022" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">type</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4022">
<div class="comment"><p>The debug session&#39;s type from the <a href="#DebugConfiguration">debug configuration</a>.</p>
</div>
</div>



<a name="DebugSession.workspaceFolder"></a><span class="ts" id=4025 data-target="#details-4025" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">workspaceFolder</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a></span>
<div class="details collapse" id="details-4025">
<div class="comment"><p>The workspace folder of this session or <code>undefined</code> for a folderless setup.</p>
</div>
</div>

#### Methods



<a name="DebugSession.customRequest"></a><span class="ts" id=4028 data-target="#details-4028" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">customRequest</span><span>(</span><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">args</span><span>?</span><span>: </span><span class="type-intrinsic">any</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;</span>
<div class="details collapse" id="details-4028">
<div class="comment"><p>Send a custom request to the debug adapter.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">args</span><span>?</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DebugSession.getDebugProtocolBreakpoint"></a><span class="ts" id=4032 data-target="#details-4032" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getDebugProtocolBreakpoint</span><span>(</span><span class="ident">breakpoint</span><span>: </span><a class="type-ref" href="#Breakpoint">Breakpoint</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#DebugProtocolBreakpoint">DebugProtocolBreakpoint</a>&gt;</span>
<div class="details collapse" id="details-4032">
<div class="comment"><p>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.
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 <code>undefined</code> is returned.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">breakpoint</span><span>: </span><a class="type-ref" href="#Breakpoint">Breakpoint</a></td><td><div class="comment"><p>A <a href="#Breakpoint">Breakpoint</a> in the editor.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#DebugProtocolBreakpoint">DebugProtocolBreakpoint</a>&gt;</td><td><div class="comment"><p>A promise that resolves to the Debug Adapter Protocol breakpoint or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="DebugSessionCustomEvent"></a><span class="code-item" id=4034>DebugSessionCustomEvent</span>



<div class="comment"><p>A custom Debug Adapter Protocol event received from a <a href="#DebugSession">debug session</a>.</p>
</div>

#### Properties



<a name="DebugSessionCustomEvent.body"></a><span class="ts" id=4037 data-target="#details-4037" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">body</span><span>: </span><span class="type-intrinsic">any</span></span>
<div class="details collapse" id="details-4037">
<div class="comment"><p>Event specific information.</p>
</div>
</div>



<a name="DebugSessionCustomEvent.event"></a><span class="ts" id=4036 data-target="#details-4036" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">event</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4036">
<div class="comment"><p>Type of event.</p>
</div>
</div>



<a name="DebugSessionCustomEvent.session"></a><span class="ts" id=4035 data-target="#details-4035" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">session</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a></span>
<div class="details collapse" id="details-4035">
<div class="comment"><p>The <a href="#DebugSession">debug session</a> for which the custom event was received.</p>
</div>
</div>

### <a name="DebugSessionOptions"></a><span class="code-item" id=4173>DebugSessionOptions</span>



<div class="comment"><p>Options for <a href="#debug.startDebugging">starting a debug session</a>.</p>
</div>

#### Properties



<a name="DebugSessionOptions.compact"></a><span class="ts" id=4178 data-target="#details-4178" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">compact</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4178">
<div class="comment"><p>Controls if the debug session&#39;s parent session is shown in the CALL STACK view even if it has only a single child.
By default, the debug session will never hide its parent.
If compact is true, debug sessions with a single child are hidden in the CALL STACK view to make the tree more compact.</p>
</div>
</div>



<a name="DebugSessionOptions.consoleMode"></a><span class="ts" id=4176 data-target="#details-4176" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">consoleMode</span><span>?</span><span>: </span><a class="type-ref" href="#DebugConsoleMode">DebugConsoleMode</a></span>
<div class="details collapse" id="details-4176">
<div class="comment"><p>Controls whether this session should have a separate debug console or share it
with the parent session. Has no effect for sessions which do not have a parent session.
Defaults to Separate.</p>
</div>
</div>



<a name="DebugSessionOptions.lifecycleManagedByParent"></a><span class="ts" id=4175 data-target="#details-4175" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">lifecycleManagedByParent</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4175">
<div class="comment"><p>Controls whether lifecycle requests like &#39;restart&#39; are sent to the newly created session or its parent session.
By default (if the property is false or missing), lifecycle requests are sent to the new session.
This property is ignored if the session has no parent session.</p>
</div>
</div>



<a name="DebugSessionOptions.noDebug"></a><span class="ts" id=4177 data-target="#details-4177" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">noDebug</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4177">
<div class="comment"><p>Controls whether this session should run without debugging, thus ignoring breakpoints.
When this property is not specified, the value from the parent session (if there is one) is used.</p>
</div>
</div>



<a name="DebugSessionOptions.parentSession"></a><span class="ts" id=4174 data-target="#details-4174" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">parentSession</span><span>?</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a></span>
<div class="details collapse" id="details-4174">
<div class="comment"><p>When specified the newly created debug session is registered as a &quot;child&quot; session of this
&quot;parent&quot; debug session.</p>
</div>
</div>



<a name="DebugSessionOptions.suppressDebugStatusbar"></a><span class="ts" id=4181 data-target="#details-4181" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">suppressDebugStatusbar</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4181">
<div class="comment"><p>When true, the window statusbar color will not be changed for this session.</p>
</div>
</div>



<a name="DebugSessionOptions.suppressDebugToolbar"></a><span class="ts" id=4180 data-target="#details-4180" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">suppressDebugToolbar</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4180">
<div class="comment"><p>When true, the debug toolbar will not be shown for this session.</p>
</div>
</div>



<a name="DebugSessionOptions.suppressDebugView"></a><span class="ts" id=4182 data-target="#details-4182" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">suppressDebugView</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4182">
<div class="comment"><p>When true, the debug viewlet will not be automatically revealed for this session.</p>
</div>
</div>



<a name="DebugSessionOptions.suppressSaveBeforeStart"></a><span class="ts" id=4179 data-target="#details-4179" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">suppressSaveBeforeStart</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4179">
<div class="comment"><p>When true, a save will not be triggered for open editors when starting a debug session, regardless of the value of the <code>debug.saveBeforeStart</code> setting.</p>
</div>
</div>



<a name="DebugSessionOptions.testRun"></a><span class="ts" id=4183 data-target="#details-4183" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">testRun</span><span>?</span><span>: </span><a class="type-ref" href="#TestRun">TestRun</a></span>
<div class="details collapse" id="details-4183">
<div class="comment"><p>Signals to the editor that the debug session was started from a test run
request. This is used to link the lifecycle of the debug session and
test run in UI actions.</p>
</div>
</div>

### <a name="DebugStackFrame"></a><span class="code-item" id=4194>DebugStackFrame</span>



<div class="comment"><p>Represents a stack frame in a debug session.</p>
</div>

#### Properties



<a name="DebugStackFrame.frameId"></a><span class="ts" id=4202 data-target="#details-4202" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">frameId</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-4202">
<div class="comment"><p>ID of the stack frame in the debug protocol.</p>
</div>
</div>



<a name="DebugStackFrame.session"></a><span class="ts" id=4200 data-target="#details-4200" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">session</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a></span>
<div class="details collapse" id="details-4200">
<div class="comment"><p>Debug session for thread.</p>
</div>
</div>



<a name="DebugStackFrame.threadId"></a><span class="ts" id=4201 data-target="#details-4201" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">threadId</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-4201">
<div class="comment"><p>ID of the associated thread in the debug protocol.</p>
</div>
</div>

### <a name="DebugThread"></a><span class="code-item" id=4187>DebugThread</span>



<div class="comment"><p>Represents a thread in a debug session.</p>
</div>

#### Properties



<a name="DebugThread.session"></a><span class="ts" id=4192 data-target="#details-4192" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">session</span><span>: </span><a class="type-ref" href="#DebugSession">DebugSession</a></span>
<div class="details collapse" id="details-4192">
<div class="comment"><p>Debug session for thread.</p>
</div>
</div>



<a name="DebugThread.threadId"></a><span class="ts" id=4193 data-target="#details-4193" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">threadId</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-4193">
<div class="comment"><p>ID of the associated thread in the debug protocol.</p>
</div>
</div>

### <a name="Declaration"></a><span class="code-item" id=693>Declaration</span>



<div class="comment"><p>The declaration of a symbol representation as one or many <a href="#Location">locations</a>
or <a href="#LocationLink">location links</a>.</p>
</div>



<a name="Declaration"></a><span class="ts" id=693 data-target="#details-693" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Declaration</span><span>: </span><a class="type-ref" href="#Location">Location</a> &#124; <a class="type-ref" href="#Location">Location</a>[] &#124; <a class="type-ref" href="#LocationLink">LocationLink</a>[]</span>

### <a name="DeclarationCoverage"></a><span class="code-item" id=4653>DeclarationCoverage</span>



<div class="comment"><p>Contains coverage information for a declaration. Depending on the reporter
and language, this may be types such as functions, methods, or namespaces.</p>
</div>

#### Constructors



<a name="DeclarationCoverage.DeclarationCoverage"></a><span class="ts" id=4655 data-target="#details-4655" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DeclarationCoverage</span><span>(</span><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">executed</span><span>: </span><span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span>, <span class="ident">location</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><a class="type-ref" href="#DeclarationCoverage">DeclarationCoverage</a></span>
<div class="details collapse" id="details-4655">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">executed</span><span>: </span><span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>The number of times this declaration was executed, or a
boolean indicating  whether it was executed if the exact count is
unknown. If zero or false, the declaration will be marked as un-covered.</p>
</div></td></tr>
<tr><td><span class="ident">location</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The declaration position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DeclarationCoverage">DeclarationCoverage</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="DeclarationCoverage.executed"></a><span class="ts" id=4660 data-target="#details-4660" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executed</span><span>: </span><span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4660">
<div class="comment"><p>The number of times this declaration was executed, or a boolean
indicating whether it was executed if the exact count is unknown. If
zero or false, the declaration will be marked as un-covered.</p>
</div>
</div>



<a name="DeclarationCoverage.location"></a><span class="ts" id=4661 data-target="#details-4661" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">location</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-4661">
<div class="comment"><p>Declaration location.</p>
</div>
</div>



<a name="DeclarationCoverage.name"></a><span class="ts" id=4659 data-target="#details-4659" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4659">
<div class="comment"><p>Name of the declaration.</p>
</div>
</div>

### <a name="DeclarationProvider"></a><span class="code-item" id=694>DeclarationProvider</span>



<div class="comment"><p>The declaration provider interface defines the contract between extensions and
the go to declaration feature.</p>
</div>

#### Methods



<a name="DeclarationProvider.provideDeclaration"></a><span class="ts" id=696 data-target="#details-696" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDeclaration</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Declaration">Declaration</a>&gt;</span>
<div class="details collapse" id="details-696">
<div class="comment"><p>Provide the declaration of the symbol at the given position and document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Declaration">Declaration</a>&gt;</td><td><div class="comment"><p>A declaration or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="DecorationInstanceRenderOptions"></a><span class="code-item" id=329>DecorationInstanceRenderOptions</span>



<div class="comment"><p>Represents render options for decoration instances. See <a href="#DecorationOptions.renderOptions">DecorationOptions.renderOptions</a>.</p>
</div>

#### Properties



<a name="DecorationInstanceRenderOptions.after"></a><span class="ts" id=333 data-target="#details-333" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">after</span><span>?</span><span>: </span><a class="type-ref" href="#ThemableDecorationAttachmentRenderOptions">ThemableDecorationAttachmentRenderOptions</a></span>
<div class="details collapse" id="details-333">
<div class="comment"><p>Defines the rendering options of the attachment that is inserted after the decorated text.</p>
</div>
</div>



<a name="DecorationInstanceRenderOptions.before"></a><span class="ts" id=332 data-target="#details-332" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">before</span><span>?</span><span>: </span><a class="type-ref" href="#ThemableDecorationAttachmentRenderOptions">ThemableDecorationAttachmentRenderOptions</a></span>
<div class="details collapse" id="details-332">
<div class="comment"><p>Defines the rendering options of the attachment that is inserted before the decorated text.</p>
</div>
</div>



<a name="DecorationInstanceRenderOptions.dark"></a><span class="ts" id=331 data-target="#details-331" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dark</span><span>?</span><span>: </span><a class="type-ref" href="#ThemableDecorationInstanceRenderOptions">ThemableDecorationInstanceRenderOptions</a></span>
<div class="details collapse" id="details-331">
<div class="comment"><p>Overwrite options for dark themes.</p>
</div>
</div>



<a name="DecorationInstanceRenderOptions.light"></a><span class="ts" id=330 data-target="#details-330" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">light</span><span>?</span><span>: </span><a class="type-ref" href="#ThemableDecorationInstanceRenderOptions">ThemableDecorationInstanceRenderOptions</a></span>
<div class="details collapse" id="details-330">
<div class="comment"><p>Overwrite options for light themes.</p>
</div>
</div>

### <a name="DecorationOptions"></a><span class="code-item" id=322>DecorationOptions</span>



<div class="comment"><p>Represents options for a specific decoration in a <a href="#TextEditorDecorationType">decoration set</a>.</p>
</div>

#### Properties



<a name="DecorationOptions.hoverMessage"></a><span class="ts" id=324 data-target="#details-324" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hoverMessage</span><span>?</span><span>: </span><a class="type-ref" href="#MarkdownString">MarkdownString</a> &#124; <a class="type-ref" href="#MarkedString">MarkedString</a> &#124; Array&lt;<span class="type-unknown">MarkdownString | MarkedString</span>&gt;</span>
<div class="details collapse" id="details-324">
<div class="comment"><p>A message that should be rendered when hovering over the decoration.</p>
</div>
</div>



<a name="DecorationOptions.range"></a><span class="ts" id=323 data-target="#details-323" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-323">
<div class="comment"><p>Range to which this decoration is applied. The range must not be empty.</p>
</div>
</div>



<a name="DecorationOptions.renderOptions"></a><span class="ts" id=325 data-target="#details-325" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">renderOptions</span><span>?</span><span>: </span><a class="type-ref" href="#DecorationInstanceRenderOptions">DecorationInstanceRenderOptions</a></span>
<div class="details collapse" id="details-325">
<div class="comment"><p>Render options applied to the current decoration. For performance reasons, keep the
number of decoration specific options small, and use decoration types wherever possible.</p>
</div>
</div>

### <a name="DecorationRangeBehavior"></a><span class="code-item" id=217>DecorationRangeBehavior</span>



<div class="comment"><p>Describes the behavior of decorations when typing/editing at their edges.</p>
</div>

#### Enumeration Members



<a name="DecorationRangeBehavior.OpenOpen"></a><span class="ts" id=218 data-target="#details-218" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">OpenOpen</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-218">
<div class="comment"><p>The decoration&#39;s range will widen when edits occur at the start or end.</p>
</div>
</div>



<a name="DecorationRangeBehavior.ClosedClosed"></a><span class="ts" id=219 data-target="#details-219" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ClosedClosed</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-219">
<div class="comment"><p>The decoration&#39;s range will not widen when edits occur at the start or end.</p>
</div>
</div>



<a name="DecorationRangeBehavior.OpenClosed"></a><span class="ts" id=220 data-target="#details-220" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">OpenClosed</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-220">
<div class="comment"><p>The decoration&#39;s range will widen when edits occur at the start, but not at the end.</p>
</div>
</div>



<a name="DecorationRangeBehavior.ClosedOpen"></a><span class="ts" id=221 data-target="#details-221" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ClosedOpen</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-221">
<div class="comment"><p>The decoration&#39;s range will widen when edits occur at the end, but not at the start.</p>
</div>
</div>

### <a name="DecorationRenderOptions"></a><span class="code-item" id=293>DecorationRenderOptions</span>



<div class="comment"><p>Represents rendering styles for a <a href="#TextEditorDecorationType">text editor decoration</a>.</p>
</div>

#### Properties



<a name="DecorationRenderOptions.after"></a><span class="ts" id=321 data-target="#details-321" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">after</span><span>?</span><span>: </span><a class="type-ref" href="#ThemableDecorationAttachmentRenderOptions">ThemableDecorationAttachmentRenderOptions</a></span>
<div class="details collapse" id="details-321">
<div class="comment"><p>Defines the rendering options of the attachment that is inserted after the decorated text.</p>
</div>
</div>



<a name="DecorationRenderOptions.backgroundColor"></a><span class="ts" id=299 data-target="#details-299" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">backgroundColor</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-299">
<div class="comment"><p>Background color of the decoration. Use rgba() and define transparent background colors to play well with other decorations.
Alternatively a color from the color registry can be <a href="#ThemeColor">referenced</a>.</p>
</div>
</div>



<a name="DecorationRenderOptions.before"></a><span class="ts" id=320 data-target="#details-320" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">before</span><span>?</span><span>: </span><a class="type-ref" href="#ThemableDecorationAttachmentRenderOptions">ThemableDecorationAttachmentRenderOptions</a></span>
<div class="details collapse" id="details-320">
<div class="comment"><p>Defines the rendering options of the attachment that is inserted before the decorated text.</p>
</div>
</div>



<a name="DecorationRenderOptions.border"></a><span class="ts" id=304 data-target="#details-304" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">border</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-304">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="DecorationRenderOptions.borderColor"></a><span class="ts" id=305 data-target="#details-305" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">borderColor</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-305">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;border&#39; for setting one or more of the individual border properties.</p>
</div>
</div>



<a name="DecorationRenderOptions.borderRadius"></a><span class="ts" id=306 data-target="#details-306" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">borderRadius</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-306">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;border&#39; for setting one or more of the individual border properties.</p>
</div>
</div>



<a name="DecorationRenderOptions.borderSpacing"></a><span class="ts" id=307 data-target="#details-307" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">borderSpacing</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-307">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;border&#39; for setting one or more of the individual border properties.</p>
</div>
</div>



<a name="DecorationRenderOptions.borderStyle"></a><span class="ts" id=308 data-target="#details-308" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">borderStyle</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-308">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;border&#39; for setting one or more of the individual border properties.</p>
</div>
</div>



<a name="DecorationRenderOptions.borderWidth"></a><span class="ts" id=309 data-target="#details-309" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">borderWidth</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-309">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;border&#39; for setting one or more of the individual border properties.</p>
</div>
</div>



<a name="DecorationRenderOptions.color"></a><span class="ts" id=314 data-target="#details-314" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">color</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-314">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="DecorationRenderOptions.cursor"></a><span class="ts" id=313 data-target="#details-313" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cursor</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-313">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="DecorationRenderOptions.dark"></a><span class="ts" id=298 data-target="#details-298" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dark</span><span>?</span><span>: </span><a class="type-ref" href="#ThemableDecorationRenderOptions">ThemableDecorationRenderOptions</a></span>
<div class="details collapse" id="details-298">
<div class="comment"><p>Overwrite options for dark themes.</p>
</div>
</div>



<a name="DecorationRenderOptions.fontStyle"></a><span class="ts" id=310 data-target="#details-310" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fontStyle</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-310">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="DecorationRenderOptions.fontWeight"></a><span class="ts" id=311 data-target="#details-311" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fontWeight</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-311">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="DecorationRenderOptions.gutterIconPath"></a><span class="ts" id=317 data-target="#details-317" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">gutterIconPath</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-317">
<div class="comment"><p>An <strong>absolute path</strong> or an URI to an image to be rendered in the gutter.</p>
</div>
</div>



<a name="DecorationRenderOptions.gutterIconSize"></a><span class="ts" id=318 data-target="#details-318" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">gutterIconSize</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-318">
<div class="comment"><p>Specifies the size of the gutter icon.
Available values are &#39;auto&#39;, &#39;contain&#39;, &#39;cover&#39; and any percentage value.
For further information: <a href="https://msdn.microsoft.com/en-us/library/jj127316(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/jj127316(v=vs.85).aspx</a></p>
</div>
</div>



<a name="DecorationRenderOptions.isWholeLine"></a><span class="ts" id=294 data-target="#details-294" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isWholeLine</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-294">
<div class="comment"><p>Should the decoration be rendered also on the whitespace after the line text.
Defaults to <code>false</code>.</p>
</div>
</div>



<a name="DecorationRenderOptions.letterSpacing"></a><span class="ts" id=316 data-target="#details-316" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">letterSpacing</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-316">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="DecorationRenderOptions.light"></a><span class="ts" id=297 data-target="#details-297" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">light</span><span>?</span><span>: </span><a class="type-ref" href="#ThemableDecorationRenderOptions">ThemableDecorationRenderOptions</a></span>
<div class="details collapse" id="details-297">
<div class="comment"><p>Overwrite options for light themes.</p>
</div>
</div>



<a name="DecorationRenderOptions.opacity"></a><span class="ts" id=315 data-target="#details-315" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">opacity</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-315">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="DecorationRenderOptions.outline"></a><span class="ts" id=300 data-target="#details-300" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">outline</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-300">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="DecorationRenderOptions.outlineColor"></a><span class="ts" id=301 data-target="#details-301" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">outlineColor</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-301">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;outline&#39; for setting one or more of the individual outline properties.</p>
</div>
</div>



<a name="DecorationRenderOptions.outlineStyle"></a><span class="ts" id=302 data-target="#details-302" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">outlineStyle</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-302">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;outline&#39; for setting one or more of the individual outline properties.</p>
</div>
</div>



<a name="DecorationRenderOptions.outlineWidth"></a><span class="ts" id=303 data-target="#details-303" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">outlineWidth</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-303">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;outline&#39; for setting one or more of the individual outline properties.</p>
</div>
</div>



<a name="DecorationRenderOptions.overviewRulerColor"></a><span class="ts" id=319 data-target="#details-319" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">overviewRulerColor</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-319">
<div class="comment"><p>The color of the decoration in the overview ruler. Use rgba() and define transparent colors to play well with other decorations.</p>
</div>
</div>



<a name="DecorationRenderOptions.overviewRulerLane"></a><span class="ts" id=296 data-target="#details-296" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">overviewRulerLane</span><span>?</span><span>: </span><a class="type-ref" href="#OverviewRulerLane">OverviewRulerLane</a></span>
<div class="details collapse" id="details-296">
<div class="comment"><p>The position in the overview ruler where the decoration should be rendered.</p>
</div>
</div>



<a name="DecorationRenderOptions.rangeBehavior"></a><span class="ts" id=295 data-target="#details-295" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">rangeBehavior</span><span>?</span><span>: </span><a class="type-ref" href="#DecorationRangeBehavior">DecorationRangeBehavior</a></span>
<div class="details collapse" id="details-295">
<div class="comment"><p>Customize the growing behavior of the decoration when edits occur at the edges of the decoration&#39;s range.
Defaults to <code>DecorationRangeBehavior.OpenOpen</code>.</p>
</div>
</div>



<a name="DecorationRenderOptions.textDecoration"></a><span class="ts" id=312 data-target="#details-312" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">textDecoration</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-312">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>

### <a name="Definition"></a><span class="code-item" id=674>Definition</span>



<div class="comment"><p>The definition of a symbol represented as one or many <a href="#Location">locations</a>.
For most programming languages there is only one location at which a symbol is
defined.</p>
</div>



<a name="Definition"></a><span class="ts" id=674 data-target="#details-674" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Definition</span><span>: </span><a class="type-ref" href="#Location">Location</a> &#124; <a class="type-ref" href="#Location">Location</a>[]</span>

### <a name="DefinitionLink"></a><span class="code-item" id=673>DefinitionLink</span>



<div class="comment"><p>Information about where a symbol is defined.</p>
<p>Provides additional metadata over normal <a href="#Location">Location</a> definitions, including the range of
the defining symbol</p>
</div>



<a name="DefinitionLink"></a><span class="ts" id=673 data-target="#details-673" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DefinitionLink</span><span>: </span><a class="type-ref" href="#LocationLink">LocationLink</a></span>

### <a name="DefinitionProvider"></a><span class="code-item" id=675>DefinitionProvider</span>



<div class="comment"><p>The definition provider interface defines the contract between extensions and
the <a href="https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition">go to definition</a>
and peek definition features.</p>
</div>

#### Methods



<a name="DefinitionProvider.provideDefinition"></a><span class="ts" id=677 data-target="#details-677" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDefinition</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Definition">Definition</a> &#124; <a class="type-ref" href="#LocationLink">LocationLink</a>[]&gt;</span>
<div class="details collapse" id="details-677">
<div class="comment"><p>Provide the definition of the symbol at the given position and document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Definition">Definition</a> &#124; <a class="type-ref" href="#LocationLink">LocationLink</a>[]&gt;</td><td><div class="comment"><p>A definition or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="Diagnostic"></a><span class="code-item" id=1765>Diagnostic</span>



<div class="comment"><p>Represents a diagnostic, such as a compiler error or warning. Diagnostic objects
are only valid in the scope of a file.</p>
</div>

#### Constructors



<a name="Diagnostic.Diagnostic"></a><span class="ts" id=1767 data-target="#details-1767" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Diagnostic</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">severity</span><span>?</span><span>: </span><a class="type-ref" href="#DiagnosticSeverity">DiagnosticSeverity</a><span>)</span><span>: </span><a class="type-ref" href="#Diagnostic">Diagnostic</a></span>
<div class="details collapse" id="details-1767">
<div class="comment"><p>Creates a new diagnostic object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range to which this diagnostic applies.</p>
</div></td></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The human-readable message.</p>
</div></td></tr>
<tr><td><span class="ident">severity</span><span>?</span><span>: </span><a class="type-ref" href="#DiagnosticSeverity">DiagnosticSeverity</a></td><td><div class="comment"><p>The severity, default is <a href="#DiagnosticSeverity.Error">error</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Diagnostic">Diagnostic</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="Diagnostic.code"></a><span class="ts" id=1775 data-target="#details-1775" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">code</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span> &#124; {target: <a class="type-ref" href="#Uri">Uri</a>, value: <span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span>}</span>
<div class="details collapse" id="details-1775">
<div class="comment"><p>A code or identifier for this diagnostic.
Should be used for later processing, e.g. when providing <a href="#CodeActionContext">code actions</a>.</p>
</div>
</div>



<a name="Diagnostic.message"></a><span class="ts" id=1772 data-target="#details-1772" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1772">
<div class="comment"><p>The human-readable message.</p>
</div>
</div>



<a name="Diagnostic.range"></a><span class="ts" id=1771 data-target="#details-1771" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1771">
<div class="comment"><p>The range to which this diagnostic applies.</p>
</div>
</div>



<a name="Diagnostic.relatedInformation"></a><span class="ts" id=1779 data-target="#details-1779" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">relatedInformation</span><span>?</span><span>: </span><a class="type-ref" href="#DiagnosticRelatedInformation">DiagnosticRelatedInformation</a>[]</span>
<div class="details collapse" id="details-1779">
<div class="comment"><p>An array of related diagnostic information, e.g. when symbol-names within
a scope collide all definitions can be marked via this property.</p>
</div>
</div>



<a name="Diagnostic.severity"></a><span class="ts" id=1773 data-target="#details-1773" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">severity</span><span>: </span><a class="type-ref" href="#DiagnosticSeverity">DiagnosticSeverity</a></span>
<div class="details collapse" id="details-1773">
<div class="comment"><p>The severity, default is <a href="#DiagnosticSeverity.Error">error</a>.</p>
</div>
</div>



<a name="Diagnostic.source"></a><span class="ts" id=1774 data-target="#details-1774" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">source</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1774">
<div class="comment"><p>A human-readable string describing the source of this
diagnostic, e.g. &#39;typescript&#39; or &#39;super lint&#39;.</p>
</div>
</div>



<a name="Diagnostic.tags"></a><span class="ts" id=1780 data-target="#details-1780" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tags</span><span>?</span><span>: </span><a class="type-ref" href="#DiagnosticTag">DiagnosticTag</a>[]</span>
<div class="details collapse" id="details-1780">
<div class="comment"><p>Additional metadata about the diagnostic.</p>
</div>
</div>

### <a name="DiagnosticChangeEvent"></a><span class="code-item" id=1748>DiagnosticChangeEvent</span>



<div class="comment"><p>The event that is fired when diagnostics change.</p>
</div>

#### Properties



<a name="DiagnosticChangeEvent.uris"></a><span class="ts" id=1749 data-target="#details-1749" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uris</span><span>: </span>readonly <a class="type-ref" href="#Uri">Uri</a>[]</span>
<div class="details collapse" id="details-1749">
<div class="comment"><p>An array of resources for which diagnostics have changed.</p>
</div>
</div>

### <a name="DiagnosticCollection"></a><span class="code-item" id=1781>DiagnosticCollection</span>



<div class="comment"><p>A diagnostics collection is a container that manages a set of
<a href="#Diagnostic">diagnostics</a>. Diagnostics are always scopes to a
diagnostics collection and a resource.</p>
<p>To get an instance of a <code>DiagnosticCollection</code> use
<a href="#languages.createDiagnosticCollection">createDiagnosticCollection</a>.</p>
</div>

#### Properties



<a name="DiagnosticCollection.name"></a><span class="ts" id=1782 data-target="#details-1782" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1782">
<div class="comment"><p>The name of this diagnostic collection, for instance <code>typescript</code>. Every diagnostic
from this collection will be associated with this name. Also, the task framework uses this
name when defining <a href="https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher">problem matchers</a>.</p>
</div>
</div>

#### Methods



<a name="DiagnosticCollection.clear"></a><span class="ts" id=1793 data-target="#details-1793" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">clear</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1793">
<div class="comment"><p>Remove all diagnostics from this collection. The same
as calling <code>#set(undefined)</code>;</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DiagnosticCollection.delete"></a><span class="ts" id=1790 data-target="#details-1790" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">delete</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1790">
<div class="comment"><p>Remove all diagnostics from this collection that belong
to the provided <code>uri</code>. The same as <code>#set(uri, undefined)</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DiagnosticCollection.dispose"></a><span class="ts" id=1810 data-target="#details-1810" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1810">
<div class="comment"><p>Dispose and free associated resources. Calls
<a href="#DiagnosticCollection.clear">clear</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DiagnosticCollection.forEach"></a><span class="ts" id=1795 data-target="#details-1795" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">forEach</span><span>(</span><span class="ident">callback</span><span>: </span>(uri: <a class="type-ref" href="#Uri">Uri</a>, diagnostics: readonly <a class="type-ref" href="#Diagnostic">Diagnostic</a>[], collection: <a class="type-ref" href="#DiagnosticCollection">DiagnosticCollection</a>) =&gt; <span class="type-intrinsic">any</span>, <span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1795">
<div class="comment"><p>Iterate over each entry in this collection.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">callback</span><span>: </span>(uri: <a class="type-ref" href="#Uri">Uri</a>, diagnostics: readonly <a class="type-ref" href="#Diagnostic">Diagnostic</a>[], collection: <a class="type-ref" href="#DiagnosticCollection">DiagnosticCollection</a>) =&gt; <span class="type-intrinsic">any</span></td><td><div class="comment"><p>Function to execute for each entry.</p>
</div></td></tr>
<tr><td><span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>The <code>this</code> context used when invoking the handler function.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DiagnosticCollection.get"></a><span class="ts" id=1804 data-target="#details-1804" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">get</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span>readonly <a class="type-ref" href="#Diagnostic">Diagnostic</a>[]</span>
<div class="details collapse" id="details-1804">
<div class="comment"><p>Get the diagnostics for a given resource. <em>Note</em> that you cannot
modify the diagnostics-array returned from this call.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td>readonly <a class="type-ref" href="#Diagnostic">Diagnostic</a>[]</td><td><div class="comment"><p>An immutable array of <a href="#Diagnostic">diagnostics</a> or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="DiagnosticCollection.has"></a><span class="ts" id=1807 data-target="#details-1807" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">has</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1807">
<div class="comment"><p>Check if this collection contains diagnostics for a
given resource.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> if this collection has diagnostic for the given resource.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="DiagnosticCollection.set"></a><span class="ts" id=1784 data-target="#details-1784" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">set</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">diagnostics</span><span>: </span>readonly <a class="type-ref" href="#Diagnostic">Diagnostic</a>[]<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1784">
<div class="comment"><p>Assign diagnostics for given resource. Will replace
existing diagnostics for that resource.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><td><span class="ident">diagnostics</span><span>: </span>readonly <a class="type-ref" href="#Diagnostic">Diagnostic</a>[]</td><td><div class="comment"><p>Array of diagnostics or <code>undefined</code></p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DiagnosticCollection.set"></a><span class="ts" id=1787 data-target="#details-1787" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">set</span><span>(</span><span class="ident">entries</span><span>: </span>ReadonlyArray&lt;[<a class="type-ref" href="#Uri">Uri</a>, readonly <a class="type-ref" href="#Diagnostic">Diagnostic</a>[]]&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1787">
<div class="comment"><p>Replace diagnostics for multiple resources in this collection.</p>
<p> <em>Note</em> that multiple tuples of the same uri will be merged, e.g
<code>[[file1, [d1]], [file1, [d2]]]</code> is equivalent to <code>[[file1, [d1, d2]]]</code>.
If a diagnostics item is <code>undefined</code> as in <code>[file1, undefined]</code>
all previous but not subsequent diagnostics are removed.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">entries</span><span>: </span>ReadonlyArray&lt;[<a class="type-ref" href="#Uri">Uri</a>, readonly <a class="type-ref" href="#Diagnostic">Diagnostic</a>[]]&gt;</td><td><div class="comment"><p>An array of tuples, like <code>[[file1, [d1, d2]], [file2, [d3, d4, d5]]]</code>, or <code>undefined</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="DiagnosticRelatedInformation"></a><span class="code-item" id=1755>DiagnosticRelatedInformation</span>



<div class="comment"><p>Represents a related message and source code location for a diagnostic. This should be
used to point to code locations that cause or related to a diagnostics, e.g. when duplicating
a symbol in a scope.</p>
</div>

#### Constructors



<a name="DiagnosticRelatedInformation.DiagnosticRelatedInformation"></a><span class="ts" id=1757 data-target="#details-1757" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DiagnosticRelatedInformation</span><span>(</span><span class="ident">location</span><span>: </span><a class="type-ref" href="#Location">Location</a>, <span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#DiagnosticRelatedInformation">DiagnosticRelatedInformation</a></span>
<div class="details collapse" id="details-1757">
<div class="comment"><p>Creates a new related diagnostic information object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">location</span><span>: </span><a class="type-ref" href="#Location">Location</a></td><td><div class="comment"><p>The location.</p>
</div></td></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DiagnosticRelatedInformation">DiagnosticRelatedInformation</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="DiagnosticRelatedInformation.location"></a><span class="ts" id=1760 data-target="#details-1760" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">location</span><span>: </span><a class="type-ref" href="#Location">Location</a></span>
<div class="details collapse" id="details-1760">
<div class="comment"><p>The location of this related diagnostic information.</p>
</div>
</div>



<a name="DiagnosticRelatedInformation.message"></a><span class="ts" id=1761 data-target="#details-1761" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1761">
<div class="comment"><p>The message of this related diagnostic information.</p>
</div>
</div>

### <a name="DiagnosticSeverity"></a><span class="code-item" id=1750>DiagnosticSeverity</span>



<div class="comment"><p>Represents the severity of diagnostics.</p>
</div>

#### Enumeration Members



<a name="DiagnosticSeverity.Error"></a><span class="ts" id=1751 data-target="#details-1751" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Error</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-1751">
<div class="comment"><p>Something not allowed by the rules of a language or other means.</p>
</div>
</div>



<a name="DiagnosticSeverity.Warning"></a><span class="ts" id=1752 data-target="#details-1752" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Warning</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1752">
<div class="comment"><p>Something suspicious but allowed.</p>
</div>
</div>



<a name="DiagnosticSeverity.Information"></a><span class="ts" id=1753 data-target="#details-1753" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Information</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1753">
<div class="comment"><p>Something to inform about but not a problem.</p>
</div>
</div>



<a name="DiagnosticSeverity.Hint"></a><span class="ts" id=1754 data-target="#details-1754" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Hint</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-1754">
<div class="comment"><p>Something to hint to a better way of doing it, like proposing
a refactoring.</p>
</div>
</div>

### <a name="DiagnosticTag"></a><span class="code-item" id=1762>DiagnosticTag</span>



<div class="comment"><p>Additional metadata about the type of a diagnostic.</p>
</div>

#### Enumeration Members



<a name="DiagnosticTag.Unnecessary"></a><span class="ts" id=1763 data-target="#details-1763" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Unnecessary</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1763">
<div class="comment"><p>Unused or unnecessary code.</p>
<p>Diagnostics with this tag are rendered faded out. The amount of fading
is controlled by the <code>&quot;editorUnnecessaryCode.opacity&quot;</code> theme color. For
example, <code>&quot;editorUnnecessaryCode.opacity&quot;: &quot;#000000c0&quot;</code> will render the
code with 75% opacity. For high contrast themes, use the
<code>&quot;editorUnnecessaryCode.border&quot;</code> theme color to underline unnecessary code
instead of fading it out.</p>
</div>
</div>



<a name="DiagnosticTag.Deprecated"></a><span class="ts" id=1764 data-target="#details-1764" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Deprecated</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1764">
<div class="comment"><p>Deprecated or obsolete code.</p>
<p>Diagnostics with this tag are rendered with a strike through.</p>
</div>
</div>

### <a name="Disposable"></a><span class="code-item" id=453>Disposable</span>



<div class="comment"><p>Represents a type which can release resources, such
as event listening or a timer.</p>
</div>

#### Static



<a name="Disposable.from"></a><span class="ts" id=455 data-target="#details-455" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">from</span><span>(</span><span>...</span><span class="ident">disposableLikes</span><span>: </span>Array&lt;{dispose: () =&gt; <span class="type-intrinsic">any</span>}&gt;<span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-455">
<div class="comment"><p>Combine many disposable-likes into one. You can use this method when having objects with
a dispose function which aren&#39;t instances of <code>Disposable</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span>...</span><span class="ident">disposableLikes</span><span>: </span>Array&lt;{dispose: () =&gt; <span class="type-intrinsic">any</span>}&gt;</td><td><div class="comment"><p>Objects that have at least a <code>dispose</code>-function member. Note that asynchronous
dispose-functions aren&#39;t awaited.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>Returns a new disposable which, upon dispose, will
dispose all provided disposables.</p>
</div></td></tr>
</table>
</div>
</div>

#### Constructors



<a name="Disposable.Disposable"></a><span class="ts" id=462 data-target="#details-462" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Disposable</span><span>(</span><span class="ident">callOnDispose</span><span>: </span>() =&gt; <span class="type-intrinsic">any</span><span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-462">
<div class="comment"><p>Creates a new disposable that calls the provided function
on dispose.</p>
<p><em>Note</em> that an asynchronous function is not awaited.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">callOnDispose</span><span>: </span>() =&gt; <span class="type-intrinsic">any</span></td><td><div class="comment"><p>Function that disposes something.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Methods



<a name="Disposable.dispose"></a><span class="ts" id=467 data-target="#details-467" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">any</span></span>
<div class="details collapse" id="details-467">
<div class="comment"><p>Dispose this object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">any</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="DocumentColorProvider"></a><span class="code-item" id=1386>DocumentColorProvider</span>



<div class="comment"><p>The document color provider defines the contract between extensions and feature of
picking and modifying colors in the editor.</p>
</div>

#### Methods



<a name="DocumentColorProvider.provideColorPresentations"></a><span class="ts" id=1392 data-target="#details-1392" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideColorPresentations</span><span>(</span><span class="ident">color</span><span>: </span><a class="type-ref" href="#Color">Color</a>, <span class="ident">context</span><span>: </span>{document: <a class="type-ref" href="#TextDocument">TextDocument</a>, range: <a class="type-ref" href="#Range">Range</a>}, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#ColorPresentation">ColorPresentation</a>[]&gt;</span>
<div class="details collapse" id="details-1392">
<div class="comment"><p>Provide <a href="#ColorPresentation">representations</a> for a color.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">color</span><span>: </span><a class="type-ref" href="#Color">Color</a></td><td><div class="comment"><p>The color to show and insert.</p>
</div></td></tr>
<tr><td><span class="ident">context</span><span>: </span>{document: <a class="type-ref" href="#TextDocument">TextDocument</a>, range: <a class="type-ref" href="#Range">Range</a>}</td><td><div class="comment"><p>A context object with additional information</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#ColorPresentation">ColorPresentation</a>[]&gt;</td><td><div class="comment"><p>An array of color presentations or a thenable that resolves to such. The lack of a result
can be signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="DocumentColorProvider.provideDocumentColors"></a><span class="ts" id=1388 data-target="#details-1388" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDocumentColors</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#ColorInformation">ColorInformation</a>[]&gt;</span>
<div class="details collapse" id="details-1388">
<div class="comment"><p>Provide colors for the given document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#ColorInformation">ColorInformation</a>[]&gt;</td><td><div class="comment"><p>An array of <a href="#ColorInformation">color information</a> or a thenable that resolves to such. The lack of a result
can be signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="DocumentDropEdit"></a><span class="code-item" id=1573>DocumentDropEdit</span>



<div class="comment"><p>An edit operation applied <a href="#DocumentDropEditProvider">on drop</a>.</p>
</div>

#### Constructors



<a name="DocumentDropEdit.DocumentDropEdit"></a><span class="ts" id=1575 data-target="#details-1575" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DocumentDropEdit</span><span>(</span><span class="ident">insertText</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#SnippetString">SnippetString</a>, <span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a><span>)</span><span>: </span><a class="type-ref" href="#DocumentDropEdit">DocumentDropEdit</a></span>
<div class="details collapse" id="details-1575">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">insertText</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#SnippetString">SnippetString</a></td><td><div class="comment"><p>The text or snippet to insert at the drop location.</p>
</div></td></tr>
<tr><td><span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Human readable label that describes the edit.</p>
</div></td></tr>
<tr><td><span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a></td><td><div class="comment"><p><a href="#DocumentDropOrPasteEditKind">Kind</a> of the edit.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DocumentDropEdit">DocumentDropEdit</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="DocumentDropEdit.additionalEdit"></a><span class="ts" id=1583 data-target="#details-1583" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">additionalEdit</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a></span>
<div class="details collapse" id="details-1583">
<div class="comment"><p>An optional additional edit to apply on drop.</p>
</div>
</div>



<a name="DocumentDropEdit.insertText"></a><span class="ts" id=1582 data-target="#details-1582" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">insertText</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#SnippetString">SnippetString</a></span>
<div class="details collapse" id="details-1582">
<div class="comment"><p>The text or snippet to insert at the drop location.</p>
</div>
</div>



<a name="DocumentDropEdit.kind"></a><span class="ts" id=1580 data-target="#details-1580" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a></span>
<div class="details collapse" id="details-1580">
<div class="comment"><p><a href="#DocumentDropOrPasteEditKind">Kind</a> of the edit.</p>
</div>
</div>



<a name="DocumentDropEdit.title"></a><span class="ts" id=1579 data-target="#details-1579" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1579">
<div class="comment"><p>Human readable label that describes the edit.</p>
</div>
</div>



<a name="DocumentDropEdit.yieldTo"></a><span class="ts" id=1581 data-target="#details-1581" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">yieldTo</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a>[]</span>
<div class="details collapse" id="details-1581">
<div class="comment"><p>Controls the ordering or multiple edits. If this provider yield to edits, it will be shown lower in the list.</p>
</div>
</div>

### <a name="DocumentDropEditProvider"></a><span class="code-item" id=1584>DocumentDropEditProvider&lt;T&gt;</span>



<div class="comment"><p>Provider which handles dropping of resources into a text editor.</p>
<p>This allows users to drag and drop resources (including resources from external apps) into the editor. While dragging
and dropping files, users can hold down <code>shift</code> to drop the file into the editor instead of opening it.
Requires <code>editor.dropIntoEditor.enabled</code> to be on.</p>
</div>

#### Methods



<a name="DocumentDropEditProvider.provideDocumentDropEdits"></a><span class="ts" id=1587 data-target="#details-1587" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDocumentDropEdits</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">dataTransfer</span><span>: </span><a class="type-ref" href="#DataTransfer">DataTransfer</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span> &#124; <span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-1587">
<div class="comment"><p>Provide edits which inserts the content being dragged and dropped into the document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the drop occurred.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position in the document where the drop occurred.</p>
</div></td></tr>
<tr><td><span class="ident">dataTransfer</span><span>: </span><a class="type-ref" href="#DataTransfer">DataTransfer</a></td><td><div class="comment"><p>A <a href="#DataTransfer">DataTransfer</a> object that holds data about what is being dragged and dropped.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span> &#124; <span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>A <a href="#DocumentDropEdit">DocumentDropEdit</a> or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="DocumentDropEditProvider.resolveDocumentDropEdit"></a><span class="ts" id=1593 data-target="#details-1593" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveDocumentDropEdit</span><span>(</span><span class="ident">edit</span><span>: </span><span class="type-ref">T</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-1593">
<div class="comment"><p>Optional method which fills in the <a href="#DocumentDropEdit.additionalEdit">DocumentDropEdit.additionalEdit</a> before the edit is applied.</p>
<p>This is called once per edit and should be used if generating the complete edit may take a long time.
Resolve can only be used to change <a href="#DocumentDropEdit.additionalEdit">DocumentDropEdit.additionalEdit</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">edit</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The <a href="#DocumentDropEdit">DocumentDropEdit</a> to resolve.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>The resolved edit or a thenable that resolves to such. It is OK to return the given
<code>edit</code>. If no result is returned, the given <code>edit</code> is used.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="DocumentDropEditProviderMetadata"></a><span class="code-item" id=1596>DocumentDropEditProviderMetadata</span>



<div class="comment"><p>Provides additional metadata about how a <a href="#DocumentDropEditProvider">DocumentDropEditProvider</a> works.</p>
</div>

#### Properties



<a name="DocumentDropEditProviderMetadata.dropMimeTypes"></a><span class="ts" id=1598 data-target="#details-1598" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dropMimeTypes</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-1598">
<div class="comment"><p>List of <a href="#DataTransfer">DataTransfer</a> mime types that the provider can handle.</p>
<p>This can either be an exact mime type such as <code>image/png</code>, or a wildcard pattern such as <code>image/*</code>.</p>
<p>Use <code>text/uri-list</code> for resources dropped from the explorer or other tree views in the workbench.</p>
<p>Use <code>files</code> to indicate that the provider should be invoked if any <a href="#DataTransferFile">files</a> are present in the <a href="#DataTransfer">DataTransfer</a>.
Note that <a href="#DataTransferFile">DataTransferFile</a> entries are only created when dropping content from outside the editor, such as
from the operating system.</p>
</div>
</div>



<a name="DocumentDropEditProviderMetadata.providedDropEditKinds"></a><span class="ts" id=1597 data-target="#details-1597" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">providedDropEditKinds</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a>[]</span>
<div class="details collapse" id="details-1597">
<div class="comment"><p>List of <a href="#DocumentDropOrPasteEditKind">kinds</a> that the provider may return in <a href="#DocumentDropEditProvider.provideDocumentDropEdits">provideDocumentDropEdits</a>.</p>
<p>This is used to filter out providers when a specific <a href="#DocumentDropOrPasteEditKind">kind</a> of edit is requested.</p>
</div>
</div>

### <a name="DocumentDropOrPasteEditKind"></a><span class="code-item" id=1556>DocumentDropOrPasteEditKind</span>



<div class="comment"><p>Identifies a <a href="#DocumentDropEdit">DocumentDropEdit</a> or <a href="#DocumentPasteEdit">DocumentPasteEdit</a></p>
</div>

#### Static



<a name="DocumentDropOrPasteEditKind.Empty"></a><span class="ts" id=1557 data-target="#details-1557" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Empty</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a></span>
<div class="details collapse" id="details-1557">
</div>



<a name="DocumentDropOrPasteEditKind.Text"></a><span class="ts" id=1558 data-target="#details-1558" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Text</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a></span>
<div class="details collapse" id="details-1558">
<div class="comment"><p>The root kind for basic text edits.</p>
<p>This kind should be used for edits that insert basic text into the document. A good example of this is
an edit that pastes the clipboard text while also updating imports in the file based on the pasted text.
For this we could use a kind such as <code>text.updateImports.someLanguageId</code>.</p>
<p>Even though most drop/paste edits ultimately insert text, you should not use <a href="#DocumentDropOrPasteEditKind.Text">Text</a> as the base kind
for every edit as this is redundant. Instead a more specific kind that describes the type of content being
inserted should be used instead. For example, if the edit adds a Markdown link, use <code>markdown.link</code> since even
though the content being inserted is text, it&#39;s more important to know that the edit inserts Markdown syntax.</p>
</div>
</div>



<a name="DocumentDropOrPasteEditKind.TextUpdateImports"></a><span class="ts" id=1559 data-target="#details-1559" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TextUpdateImports</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a></span>
<div class="details collapse" id="details-1559">
<div class="comment"><p>Root kind for edits that update imports in a document in addition to inserting text.</p>
</div>
</div>

#### Properties



<a name="DocumentDropOrPasteEditKind.value"></a><span class="ts" id=1563 data-target="#details-1563" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1563">
<div class="comment"><p>The raw string value of the kind.</p>
</div>
</div>

#### Methods



<a name="DocumentDropOrPasteEditKind.append"></a><span class="ts" id=1565 data-target="#details-1565" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">append</span><span>(</span><span>...</span><span class="ident">parts</span><span>: </span><span class="type-intrinsic">string</span>[]<span>)</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a></span>
<div class="details collapse" id="details-1565">
<div class="comment"><p>Create a new kind by appending additional scopes to the current kind.</p>
<p>Does not modify the current kind.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span>...</span><span class="ident">parts</span><span>: </span><span class="type-intrinsic">string</span>[]</td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DocumentDropOrPasteEditKind.contains"></a><span class="ts" id=1571 data-target="#details-1571" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contains</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1571">
<div class="comment"><p>Checks if <code>other</code> is a sub-kind of this <code>DocumentDropOrPasteEditKind</code>.</p>
<p>The kind <code>&quot;text.plain&quot;</code> for example contains <code>&quot;text.plain&quot;</code> and <code>&quot;text.plain.list&quot;</code>,
but not <code>&quot;text&quot;</code> or <code>&quot;unicorn.text.plain&quot;</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a></td><td><div class="comment"><p>Kind to check.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DocumentDropOrPasteEditKind.intersects"></a><span class="ts" id=1568 data-target="#details-1568" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">intersects</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1568">
<div class="comment"><p>Checks if this kind intersects <code>other</code>.</p>
<p>The kind <code>&quot;text.plain&quot;</code> for example intersects <code>text</code>, <code>&quot;text.plain&quot;</code> and <code>&quot;text.plain.list&quot;</code>,
but not <code>&quot;unicorn&quot;</code>, or <code>&quot;textUnicorn.plain&quot;</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a></td><td><div class="comment"><p>Kind to check.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="DocumentFilter"></a><span class="code-item" id=582>DocumentFilter</span>



<div class="comment"><p>A document filter denotes a document by different properties like
the <a href="#TextDocument.languageId">language</a>, the <a href="#Uri.scheme">scheme</a> of
its resource, or a glob-pattern that is applied to the <a href="#TextDocument.fileName">path</a>.</p>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">{ </span><span style="--shiki-dark:#C8C8C8;--shiki-light:#000000">language</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'typescript'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#C8C8C8;--shiki-light:#000000">scheme</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'file'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> }</span></span></code></pre>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">{ </span><span style="--shiki-dark:#C8C8C8;--shiki-light:#000000">language</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'json'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#C8C8C8;--shiki-light:#000000">pattern</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'**/package.json'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> }</span></span></code></pre>
</div>

#### Properties



<a name="DocumentFilter.language"></a><span class="ts" id=583 data-target="#details-583" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">language</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-583">
<div class="comment"><p>A language id, like <code>typescript</code>.</p>
</div>
</div>



<a name="DocumentFilter.notebookType"></a><span class="ts" id=584 data-target="#details-584" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">notebookType</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-584">
<div class="comment"><p>The <a href="#NotebookDocument.notebookType">type</a> of a notebook, like <code>jupyter-notebook</code>. This allows
to narrow down on the type of a notebook that a <a href="#NotebookCell.document">cell document</a> belongs to.</p>
<p><em>Note</em> that setting the <code>notebookType</code>-property changes how <code>scheme</code> and <code>pattern</code> are interpreted. When set
they are evaluated against the <a href="#NotebookDocument.uri">notebook uri</a>, not the document uri.</p>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">{ </span><span style="--shiki-dark:#C8C8C8;--shiki-light:#000000">language</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'python'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#C8C8C8;--shiki-light:#000000">notebookType</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'jupyter-notebook'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#C8C8C8;--shiki-light:#000000">scheme</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'untitled'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> }</span></span></code></pre>
</div>
</div>



<a name="DocumentFilter.pattern"></a><span class="ts" id=586 data-target="#details-586" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">pattern</span><span>?</span><span>: </span><a class="type-ref" href="#GlobPattern">GlobPattern</a></span>
<div class="details collapse" id="details-586">
<div class="comment"><p>A <a href="#GlobPattern">glob pattern</a> that is matched on the absolute path of the document. Use a <a href="#RelativePattern">relative pattern</a>
to filter documents to a <a href="#WorkspaceFolder">workspace folder</a>.</p>
</div>
</div>



<a name="DocumentFilter.scheme"></a><span class="ts" id=585 data-target="#details-585" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">scheme</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-585">
<div class="comment"><p>A Uri <a href="#Uri.scheme">scheme</a>, like <code>file</code> or <code>untitled</code>.</p>
</div>
</div>

### <a name="DocumentFormattingEditProvider"></a><span class="code-item" id=1159>DocumentFormattingEditProvider</span>



<div class="comment"><p>The document formatting provider interface defines the contract between extensions and
the formatting-feature.</p>
</div>

#### Methods



<a name="DocumentFormattingEditProvider.provideDocumentFormattingEdits"></a><span class="ts" id=1161 data-target="#details-1161" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDocumentFormattingEdits</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">options</span><span>: </span><a class="type-ref" href="#FormattingOptions">FormattingOptions</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TextEdit">TextEdit</a>[]&gt;</span>
<div class="details collapse" id="details-1161">
<div class="comment"><p>Provide formatting edits for a whole document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#FormattingOptions">FormattingOptions</a></td><td><div class="comment"><p>Options controlling formatting.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TextEdit">TextEdit</a>[]&gt;</td><td><div class="comment"><p>A set of text edits or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="DocumentHighlight"></a><span class="code-item" id=791>DocumentHighlight</span>



<div class="comment"><p>A document highlight is a range inside a text document which deserves
special attention. Usually a document highlight is visualized by changing
the background color of its range.</p>
</div>

#### Constructors



<a name="DocumentHighlight.DocumentHighlight"></a><span class="ts" id=793 data-target="#details-793" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DocumentHighlight</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#DocumentHighlightKind">DocumentHighlightKind</a><span>)</span><span>: </span><a class="type-ref" href="#DocumentHighlight">DocumentHighlight</a></span>
<div class="details collapse" id="details-793">
<div class="comment"><p>Creates a new document highlight object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range the highlight applies to.</p>
</div></td></tr>
<tr><td><span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#DocumentHighlightKind">DocumentHighlightKind</a></td><td><div class="comment"><p>The highlight kind, default is <a href="#DocumentHighlightKind.Text">text</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DocumentHighlight">DocumentHighlight</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="DocumentHighlight.kind"></a><span class="ts" id=797 data-target="#details-797" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#DocumentHighlightKind">DocumentHighlightKind</a></span>
<div class="details collapse" id="details-797">
<div class="comment"><p>The highlight kind, default is <a href="#DocumentHighlightKind.Text">text</a>.</p>
</div>
</div>



<a name="DocumentHighlight.range"></a><span class="ts" id=796 data-target="#details-796" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-796">
<div class="comment"><p>The range this highlight applies to.</p>
</div>
</div>

### <a name="DocumentHighlightKind"></a><span class="code-item" id=787>DocumentHighlightKind</span>



<div class="comment"><p>A document highlight kind.</p>
</div>

#### Enumeration Members



<a name="DocumentHighlightKind.Text"></a><span class="ts" id=788 data-target="#details-788" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Text</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-788">
<div class="comment"><p>A textual occurrence.</p>
</div>
</div>



<a name="DocumentHighlightKind.Read"></a><span class="ts" id=789 data-target="#details-789" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Read</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-789">
<div class="comment"><p>Read-access of a symbol, like reading a variable.</p>
</div>
</div>



<a name="DocumentHighlightKind.Write"></a><span class="ts" id=790 data-target="#details-790" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Write</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-790">
<div class="comment"><p>Write-access of a symbol, like writing to a variable.</p>
</div>
</div>

### <a name="DocumentHighlightProvider"></a><span class="code-item" id=798>DocumentHighlightProvider</span>



<div class="comment"><p>The document highlight provider interface defines the contract between extensions and
the word-highlight-feature.</p>
</div>

#### Methods



<a name="DocumentHighlightProvider.provideDocumentHighlights"></a><span class="ts" id=800 data-target="#details-800" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDocumentHighlights</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DocumentHighlight">DocumentHighlight</a>[]&gt;</span>
<div class="details collapse" id="details-800">
<div class="comment"><p>Provide a set of document highlights, like all occurrences of a variable or
all exit-points of a function.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DocumentHighlight">DocumentHighlight</a>[]&gt;</td><td><div class="comment"><p>An array of document highlights or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="DocumentLink"></a><span class="code-item" id=1343>DocumentLink</span>



<div class="comment"><p>A document link is a range in a text document that links to an internal or external resource, like another
text document or a web site.</p>
</div>

#### Constructors



<a name="DocumentLink.DocumentLink"></a><span class="ts" id=1345 data-target="#details-1345" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DocumentLink</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">target</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#DocumentLink">DocumentLink</a></span>
<div class="details collapse" id="details-1345">
<div class="comment"><p>Creates a new document link.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range the document link applies to. Must not be empty.</p>
</div></td></tr>
<tr><td><span class="ident">target</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri the document link points to.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DocumentLink">DocumentLink</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="DocumentLink.range"></a><span class="ts" id=1348 data-target="#details-1348" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1348">
<div class="comment"><p>The range this link applies to.</p>
</div>
</div>



<a name="DocumentLink.target"></a><span class="ts" id=1349 data-target="#details-1349" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">target</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-1349">
<div class="comment"><p>The uri this link points to.</p>
</div>
</div>



<a name="DocumentLink.tooltip"></a><span class="ts" id=1350 data-target="#details-1350" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1350">
<div class="comment"><p>The tooltip text when you hover over this link.</p>
<p>If a tooltip is provided, is will be displayed in a string that includes instructions on how to
trigger the link, such as <code>{0} (ctrl + click)</code>. The specific instructions vary depending on OS,
user settings, and localization.</p>
</div>
</div>

### <a name="DocumentLinkProvider"></a><span class="code-item" id=1351>DocumentLinkProvider&lt;T&gt;</span>



<div class="comment"><p>The document link provider defines the contract between extensions and feature of showing
links in the editor.</p>
</div>

#### Methods



<a name="DocumentLinkProvider.provideDocumentLinks"></a><span class="ts" id=1354 data-target="#details-1354" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDocumentLinks</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-1354">
<div class="comment"><p>Provide links for the given document. Note that the editor ships with a default provider that detects
<code>http(s)</code> and <code>file</code> links.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>An array of <a href="#DocumentLink">document links</a> or a thenable that resolves to such. The lack of a result
can be signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="DocumentLinkProvider.resolveDocumentLink"></a><span class="ts" id=1358 data-target="#details-1358" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveDocumentLink</span><span>(</span><span class="ident">link</span><span>: </span><span class="type-ref">T</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-1358">
<div class="comment"><p>Given a link fill in its <a href="#DocumentLink.target">target</a>. This method is called when an incomplete
link is selected in the UI. Providers can implement this method and return incomplete links
(without target) from the <a href="#DocumentLinkProvider.provideDocumentLinks">provideDocumentLinks</a> method which
often helps to improve performance.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">link</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The link that is to be resolved.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="DocumentPasteEdit"></a><span class="code-item" id=1624>DocumentPasteEdit</span>



<div class="comment"><p>An edit the applies a paste operation.</p>
</div>

#### Constructors



<a name="DocumentPasteEdit.DocumentPasteEdit"></a><span class="ts" id=1626 data-target="#details-1626" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DocumentPasteEdit</span><span>(</span><span class="ident">insertText</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#SnippetString">SnippetString</a>, <span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">kind</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a><span>)</span><span>: </span><a class="type-ref" href="#DocumentPasteEdit">DocumentPasteEdit</a></span>
<div class="details collapse" id="details-1626">
<div class="comment"><p>Create a new paste edit.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">insertText</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#SnippetString">SnippetString</a></td><td><div class="comment"><p>The text or snippet to insert at the pasted locations.</p>
</div></td></tr>
<tr><td><span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Human readable label that describes the edit.</p>
</div></td></tr>
<tr><td><span class="ident">kind</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a></td><td><div class="comment"><p><a href="#DocumentDropOrPasteEditKind">Kind</a> of the edit.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DocumentPasteEdit">DocumentPasteEdit</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="DocumentPasteEdit.additionalEdit"></a><span class="ts" id=1633 data-target="#details-1633" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">additionalEdit</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a></span>
<div class="details collapse" id="details-1633">
<div class="comment"><p>An optional additional edit to apply on paste.</p>
</div>
</div>



<a name="DocumentPasteEdit.insertText"></a><span class="ts" id=1632 data-target="#details-1632" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">insertText</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#SnippetString">SnippetString</a></span>
<div class="details collapse" id="details-1632">
<div class="comment"><p>The text or snippet to insert at the pasted locations.</p>
<p>If your edit requires more advanced insertion logic, set this to an empty string and provide an <a href="#DocumentPasteEdit.additionalEdit">additional edit</a> instead.</p>
</div>
</div>



<a name="DocumentPasteEdit.kind"></a><span class="ts" id=1631 data-target="#details-1631" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a></span>
<div class="details collapse" id="details-1631">
<div class="comment"><p><a href="#DocumentDropOrPasteEditKind">Kind</a> of the edit.</p>
</div>
</div>



<a name="DocumentPasteEdit.title"></a><span class="ts" id=1630 data-target="#details-1630" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1630">
<div class="comment"><p>Human readable label that describes the edit.</p>
</div>
</div>



<a name="DocumentPasteEdit.yieldTo"></a><span class="ts" id=1634 data-target="#details-1634" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">yieldTo</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a>[]</span>
<div class="details collapse" id="details-1634">
<div class="comment"><p>Controls ordering when multiple paste edits can potentially be applied.</p>
<p>If this edit yields to another, it will be shown lower in the list of possible paste edits shown to the user.</p>
</div>
</div>

### <a name="DocumentPasteEditContext"></a><span class="code-item" id=1602>DocumentPasteEditContext</span>



<div class="comment"><p>Additional information about the paste operation.</p>
</div>

#### Properties



<a name="DocumentPasteEditContext.only"></a><span class="ts" id=1603 data-target="#details-1603" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">only</span><span>: </span><a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a></span>
<div class="details collapse" id="details-1603">
<div class="comment"><p>Requested kind of paste edits to return.</p>
<p>When a explicit kind if requested by <a href="#DocumentPasteTriggerKind.PasteAs">PasteAs</a>, providers are
encourage to be more flexible when generating an edit of the requested kind.</p>
</div>
</div>



<a name="DocumentPasteEditContext.triggerKind"></a><span class="ts" id=1604 data-target="#details-1604" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">triggerKind</span><span>: </span><a class="type-ref" href="#DocumentPasteTriggerKind">DocumentPasteTriggerKind</a></span>
<div class="details collapse" id="details-1604">
<div class="comment"><p>The reason why paste edits were requested.</p>
</div>
</div>

### <a name="DocumentPasteEditProvider"></a><span class="code-item" id=1605>DocumentPasteEditProvider&lt;T&gt;</span>



<div class="comment"><p>Provider invoked when the user copies or pastes in a <a href="#TextDocument">TextDocument</a>.</p>
</div>

#### Methods



<a name="DocumentPasteEditProvider.prepareDocumentPaste"></a><span class="ts" id=1608 data-target="#details-1608" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prepareDocumentPaste</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">ranges</span><span>: </span>readonly <a class="type-ref" href="#Range">Range</a>[], <span class="ident">dataTransfer</span><span>: </span><a class="type-ref" href="#DataTransfer">DataTransfer</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-1608">
<div class="comment"><p>Optional method invoked after the user copies from a <a href="#TextEditor">text editor</a>.</p>
<p>This allows the provider to attach metadata about the copied text to the <a href="#DataTransfer">DataTransfer</a>. This data
transfer is then passed back to providers in <a href="#DocumentPasteEditProvider.provideDocumentPasteEdits">provideDocumentPasteEdits</a>.</p>
<p>Note that currently any changes to the <a href="#DataTransfer">DataTransfer</a> are isolated to the current editor window.
This means that any added metadata cannot be seen by other editor windows or by other applications.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>Text document where the copy took place.</p>
</div></td></tr>
<tr><td><span class="ident">ranges</span><span>: </span>readonly <a class="type-ref" href="#Range">Range</a>[]</td><td><div class="comment"><p>Ranges being copied in <a href="#DocumentPasteEditProvider.prepareDocumentPaste.document">document</a>.</p>
</div></td></tr>
<tr><td><span class="ident">dataTransfer</span><span>: </span><a class="type-ref" href="#DataTransfer">DataTransfer</a></td><td><div class="comment"><p>The data transfer associated with the copy. You can store additional values on this for
later use in <a href="#DocumentPasteEditProvider.provideDocumentPasteEdits">provideDocumentPasteEdits</a>. This object is only valid for the duration of this method.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>Optional thenable that resolves when all changes to the <code>dataTransfer</code> are complete.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="DocumentPasteEditProvider.provideDocumentPasteEdits"></a><span class="ts" id=1614 data-target="#details-1614" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDocumentPasteEdits</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">ranges</span><span>: </span>readonly <a class="type-ref" href="#Range">Range</a>[], <span class="ident">dataTransfer</span><span>: </span><a class="type-ref" href="#DataTransfer">DataTransfer</a>, <span class="ident">context</span><span>: </span><a class="type-ref" href="#DocumentPasteEditContext">DocumentPasteEditContext</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-1614">
<div class="comment"><p>Invoked before the user pastes into a <a href="#TextEditor">text editor</a>.</p>
<p>Returned edits can replace the standard pasting behavior.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>Document being pasted into</p>
</div></td></tr>
<tr><td><span class="ident">ranges</span><span>: </span>readonly <a class="type-ref" href="#Range">Range</a>[]</td><td><div class="comment"><p>Range in the <a href="#DocumentPasteEditProvider.provideDocumentPasteEdits.document">document</a> to paste into.</p>
</div></td></tr>
<tr><td><span class="ident">dataTransfer</span><span>: </span><a class="type-ref" href="#DataTransfer">DataTransfer</a></td><td><div class="comment"><p>The <a href="#DataTransfer">data transfer</a> associated with the paste. This object is only
valid for the duration of the paste operation.</p>
</div></td></tr>
<tr><td><span class="ident">context</span><span>: </span><a class="type-ref" href="#DocumentPasteEditContext">DocumentPasteEditContext</a></td><td><div class="comment"><p>Additional context for the paste.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>Set of potential <a href="#DocumentPasteEdit">edits</a> that can apply the paste. Only a single returned
<a href="#DocumentPasteEdit">DocumentPasteEdit</a> is applied at a time. If multiple edits are returned from all providers, then
the first is automatically applied and a widget is shown that lets the user switch to the other edits.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="DocumentPasteEditProvider.resolveDocumentPasteEdit"></a><span class="ts" id=1621 data-target="#details-1621" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveDocumentPasteEdit</span><span>(</span><span class="ident">pasteEdit</span><span>: </span><span class="type-ref">T</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-1621">
<div class="comment"><p>Optional method which fills in the <a href="#DocumentPasteEdit.additionalEdit">DocumentPasteEdit.additionalEdit</a> before the edit is applied.</p>
<p>This is called once per edit and should be used if generating the complete edit may take a long time.
Resolve can only be used to change <a href="#DocumentPasteEdit.insertText">DocumentPasteEdit.insertText</a> or <a href="#DocumentPasteEdit.additionalEdit">DocumentPasteEdit.additionalEdit</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">pasteEdit</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The <a href="#DocumentPasteEdit">DocumentPasteEdit</a> to resolve.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>The resolved paste edit or a thenable that resolves to such. It is OK to return the given
<code>pasteEdit</code>. If no result is returned, the given <code>pasteEdit</code> is used.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="DocumentPasteProviderMetadata"></a><span class="code-item" id=1635>DocumentPasteProviderMetadata</span>



<div class="comment"><p>Provides additional metadata about how a <a href="#DocumentPasteEditProvider">DocumentPasteEditProvider</a> works.</p>
</div>

#### Properties



<a name="DocumentPasteProviderMetadata.copyMimeTypes"></a><span class="ts" id=1637 data-target="#details-1637" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">copyMimeTypes</span><span>?</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-1637">
<div class="comment"><p>Mime types that <a href="#DocumentPasteEditProvider.prepareDocumentPaste">prepareDocumentPaste</a> may add on copy.</p>
</div>
</div>



<a name="DocumentPasteProviderMetadata.pasteMimeTypes"></a><span class="ts" id=1638 data-target="#details-1638" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">pasteMimeTypes</span><span>?</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-1638">
<div class="comment"><p>Mime types that <a href="#DocumentPasteEditProvider.provideDocumentPasteEdits">provideDocumentPasteEdits</a> should be invoked for.</p>
<p>This can either be an exact mime type such as <code>image/png</code>, or a wildcard pattern such as <code>image/*</code>.</p>
<p>Use <code>text/uri-list</code> for resources dropped from the explorer or other tree views in the workbench.</p>
<p>Use <code>files</code> to indicate that the provider should be invoked if any <a href="#DataTransferFile">files</a> are present in the <a href="#DataTransfer">DataTransfer</a>.
Note that <a href="#DataTransferFile">DataTransferFile</a> entries are only created when pasting content from outside the editor, such as
from the operating system.</p>
</div>
</div>



<a name="DocumentPasteProviderMetadata.providedPasteEditKinds"></a><span class="ts" id=1636 data-target="#details-1636" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">providedPasteEditKinds</span><span>: </span>readonly <a class="type-ref" href="#DocumentDropOrPasteEditKind">DocumentDropOrPasteEditKind</a>[]</span>
<div class="details collapse" id="details-1636">
<div class="comment"><p>List of <a href="#DocumentDropOrPasteEditKind">kinds</a> that the provider may return in <a href="#DocumentPasteEditProvider.provideDocumentPasteEdits">provideDocumentPasteEdits</a>.</p>
<p>This is used to filter out providers when a specific <a href="#DocumentDropOrPasteEditKind">kind</a> of edit is requested.</p>
</div>
</div>

### <a name="DocumentPasteTriggerKind"></a><span class="code-item" id=1599>DocumentPasteTriggerKind</span>



<div class="comment"><p>The reason why paste edits were requested.</p>
</div>

#### Enumeration Members



<a name="DocumentPasteTriggerKind.Automatic"></a><span class="ts" id=1600 data-target="#details-1600" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Automatic</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-1600">
<div class="comment"><p>Pasting was requested as part of a normal paste operation.</p>
</div>
</div>



<a name="DocumentPasteTriggerKind.PasteAs"></a><span class="ts" id=1601 data-target="#details-1601" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">PasteAs</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1601">
<div class="comment"><p>Pasting was requested by the user with the <code>paste as</code> command.</p>
</div>
</div>

### <a name="DocumentRangeFormattingEditProvider"></a><span class="code-item" id=1165>DocumentRangeFormattingEditProvider</span>



<div class="comment"><p>The document formatting provider interface defines the contract between extensions and
the formatting-feature.</p>
</div>

#### Methods



<a name="DocumentRangeFormattingEditProvider.provideDocumentRangeFormattingEdits"></a><span class="ts" id=1167 data-target="#details-1167" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDocumentRangeFormattingEdits</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">options</span><span>: </span><a class="type-ref" href="#FormattingOptions">FormattingOptions</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TextEdit">TextEdit</a>[]&gt;</span>
<div class="details collapse" id="details-1167">
<div class="comment"><p>Provide formatting edits for a range in a document.</p>
<p>The given range is a hint and providers can decide to format a smaller
or larger range. Often this is done by adjusting the start and end
of the range to full syntax nodes.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range which should be formatted.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#FormattingOptions">FormattingOptions</a></td><td><div class="comment"><p>Options controlling formatting.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TextEdit">TextEdit</a>[]&gt;</td><td><div class="comment"><p>A set of text edits or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="DocumentRangeFormattingEditProvider.provideDocumentRangesFormattingEdits"></a><span class="ts" id=1173 data-target="#details-1173" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDocumentRangesFormattingEdits</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">ranges</span><span>: </span><a class="type-ref" href="#Range">Range</a>[], <span class="ident">options</span><span>: </span><a class="type-ref" href="#FormattingOptions">FormattingOptions</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TextEdit">TextEdit</a>[]&gt;</span>
<div class="details collapse" id="details-1173">
<div class="comment"><p>Provide formatting edits for multiple ranges in a document.</p>
<p>This function is optional but allows a formatter to perform faster when formatting only modified ranges or when
formatting a large number of selections.</p>
<p>The given ranges are hints and providers can decide to format a smaller
or larger range. Often this is done by adjusting the start and end
of the range to full syntax nodes.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">ranges</span><span>: </span><a class="type-ref" href="#Range">Range</a>[]</td><td><div class="comment"><p>The ranges which should be formatted.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#FormattingOptions">FormattingOptions</a></td><td><div class="comment"><p>Options controlling formatting.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TextEdit">TextEdit</a>[]&gt;</td><td><div class="comment"><p>A set of text edits or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="DocumentRangeSemanticTokensProvider"></a><span class="code-item" id=1147>DocumentRangeSemanticTokensProvider</span>



<div class="comment"><p>The document range semantic tokens provider interface defines the contract between extensions and
semantic tokens.</p>
</div>

#### Events



<a name="DocumentRangeSemanticTokensProvider.onDidChangeSemanticTokens"></a><span class="ts" id=1148 data-target="#details-1148" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeSemanticTokens</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-1148">
<div class="comment"><p>An optional event to signal that the semantic tokens from this provider have changed.</p>
</div>
</div>

#### Methods



<a name="DocumentRangeSemanticTokensProvider.provideDocumentRangeSemanticTokens"></a><span class="ts" id=1150 data-target="#details-1150" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDocumentRangeSemanticTokens</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#SemanticTokens">SemanticTokens</a>&gt;</span>
<div class="details collapse" id="details-1150">
<div class="comment"><p><em>See also</em>
<a href="#DocumentSemanticTokensProvider.provideDocumentSemanticTokens">provideDocumentSemanticTokens</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#SemanticTokens">SemanticTokens</a>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="DocumentSelector"></a><span class="code-item" id=587>DocumentSelector</span>



<div class="comment"><p>A language selector is the combination of one or many language identifiers
and <a href="#DocumentFilter">language filters</a>.</p>
<p><em>Note</em> that a document selector that is just a language identifier selects <em>all</em>
documents, even those that are not saved on disk. Only use such selectors when
a feature works without further context, e.g. without the need to resolve related
&#39;files&#39;.</p>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">let</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> sel</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">DocumentSelector</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = { </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">scheme:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'file'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">language:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'typescript'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> };</span></span>
<span class="line"></span></code></pre>
</div>



<a name="DocumentSelector"></a><span class="ts" id=587 data-target="#details-587" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DocumentSelector</span><span>: </span><a class="type-ref" href="#DocumentFilter">DocumentFilter</a> &#124; <span class="type-intrinsic">string</span> &#124; <span class="type-ref-ts">ReadonlyArray</span>&lt;<a class="type-ref" href="#DocumentFilter">DocumentFilter</a> &#124; <span class="type-intrinsic">string</span>&gt;</span>

### <a name="DocumentSemanticTokensProvider"></a><span class="code-item" id=1136>DocumentSemanticTokensProvider</span>



<div class="comment"><p>The document semantic tokens provider interface defines the contract between extensions and
semantic tokens.</p>
</div>

#### Events



<a name="DocumentSemanticTokensProvider.onDidChangeSemanticTokens"></a><span class="ts" id=1137 data-target="#details-1137" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeSemanticTokens</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-1137">
<div class="comment"><p>An optional event to signal that the semantic tokens from this provider have changed.</p>
</div>
</div>

#### Methods



<a name="DocumentSemanticTokensProvider.provideDocumentSemanticTokens"></a><span class="ts" id=1139 data-target="#details-1139" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDocumentSemanticTokens</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#SemanticTokens">SemanticTokens</a>&gt;</span>
<div class="details collapse" id="details-1139">
<div class="comment"><p>Tokens in a file are represented as an array of integers. The position of each token is expressed relative to
the token before it, because most tokens remain stable relative to each other when edits are made in a file.</p>
<hr>
<p>In short, each token takes 5 integers to represent, so a specific token <code>i</code> in the file consists of the following array indices:</p>
<ul>
<li>at index <code>5*i</code>   - <code>deltaLine</code>: token line number, relative to the previous token</li>
<li>at index <code>5*i+1</code> - <code>deltaStart</code>: token start character, relative to the previous token (relative to 0 or the previous token&#39;s start if they are on the same line)</li>
<li>at index <code>5*i+2</code> - <code>length</code>: the length of the token. A token cannot be multiline.</li>
<li>at index <code>5*i+3</code> - <code>tokenType</code>: will be looked up in <code>SemanticTokensLegend.tokenTypes</code>. We currently ask that <code>tokenType</code> &lt; 65536.</li>
<li>at index <code>5*i+4</code> - <code>tokenModifiers</code>: each set bit will be looked up in <code>SemanticTokensLegend.tokenModifiers</code></li>
</ul>
<hr>
<h3 id="how-to-encode-tokens">How to encode tokens</h3>
<p>Here is an example for encoding a file with 3 tokens in a uint32 array:</p>
<pre class="shiki" data-lang="text" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span>   { line: 2, startChar:  5, length: 3, tokenType: "property",  tokenModifiers: ["private", "static"] },</span></span>
<span class="line"><span>   { line: 2, startChar: 10, length: 4, tokenType: "type",      tokenModifiers: [] },</span></span>
<span class="line"><span>   { line: 5, startChar:  2, length: 7, tokenType: "class",     tokenModifiers: [] }</span></span></code></pre>
<ol>
<li>First of all, a legend must be devised. This legend must be provided up-front and capture all possible token types.
For this example, we will choose the following legend which must be passed in when registering the provider:</li>
</ol>
<pre class="shiki" data-lang="text" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span>   tokenTypes: ['property', 'type', 'class'],</span></span>
<span class="line"><span>   tokenModifiers: ['private', 'static']</span></span></code></pre>
<ol start="2">
<li>The first transformation step is to encode <code>tokenType</code> and <code>tokenModifiers</code> as integers using the legend. Token types are looked
up by index, so a <code>tokenType</code> value of <code>1</code> means <code>tokenTypes[1]</code>. Multiple token modifiers can be set by using bit flags,
so a <code>tokenModifier</code> value of <code>3</code> is first viewed as binary <code>0b00000011</code>, which means <code>[tokenModifiers[0], tokenModifiers[1]]</code> because
bits 0 and 1 are set. Using this legend, the tokens now are:</li>
</ol>
<pre class="shiki" data-lang="text" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span>   { line: 2, startChar:  5, length: 3, tokenType: 0, tokenModifiers: 3 },</span></span>
<span class="line"><span>   { line: 2, startChar: 10, length: 4, tokenType: 1, tokenModifiers: 0 },</span></span>
<span class="line"><span>   { line: 5, startChar:  2, length: 7, tokenType: 2, tokenModifiers: 0 }</span></span></code></pre>
<ol start="3">
<li>The next step is to represent each token relative to the previous token in the file. In this case, the second token
is on the same line as the first token, so the <code>startChar</code> of the second token is made relative to the <code>startChar</code>
of the first token, so it will be <code>10 - 5</code>. The third token is on a different line than the second token, so the
<code>startChar</code> of the third token will not be altered:</li>
</ol>
<pre class="shiki" data-lang="text" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span>   { deltaLine: 2, deltaStartChar: 5, length: 3, tokenType: 0, tokenModifiers: 3 },</span></span>
<span class="line"><span>   { deltaLine: 0, deltaStartChar: 5, length: 4, tokenType: 1, tokenModifiers: 0 },</span></span>
<span class="line"><span>   { deltaLine: 3, deltaStartChar: 2, length: 7, tokenType: 2, tokenModifiers: 0 }</span></span></code></pre>
<ol start="4">
<li>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:</li>
</ol>
<pre class="shiki" data-lang="text" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span>   // 1st token,  2nd token,  3rd token</span></span>
<span class="line"><span>   [  2,5,3,0,3,  0,5,4,1,0,  3,2,7,2,0 ]</span></span></code></pre>
<p><em>See also</em>
<a href="#SemanticTokensBuilder">SemanticTokensBuilder</a> for a helper to encode tokens as integers.
<em>NOTE</em>: When doing edits, it is possible that multiple edits occur until the editor decides to invoke the semantic tokens provider.
<em>NOTE</em>: If the provider cannot temporarily compute semantic tokens, it can indicate this by throwing an error with the message &#39;Busy&#39;.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#SemanticTokens">SemanticTokens</a>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="DocumentSemanticTokensProvider.provideDocumentSemanticTokensEdits"></a><span class="ts" id=1143 data-target="#details-1143" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDocumentSemanticTokensEdits</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">previousResultId</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#SemanticTokens">SemanticTokens</a> &#124; <a class="type-ref" href="#SemanticTokensEdits">SemanticTokensEdits</a>&gt;</span>
<div class="details collapse" id="details-1143">
<div class="comment"><p>Instead of always returning all the tokens in a file, it is possible for a <code>DocumentSemanticTokensProvider</code> to implement
this method (<code>provideDocumentSemanticTokensEdits</code>) and then return incremental updates to the previously provided semantic tokens.</p>
<hr>
<h3 id="how-tokens-change-when-the-document-changes">How tokens change when the document changes</h3>
<p>Suppose that <code>provideDocumentSemanticTokens</code> has previously returned the following semantic tokens:</p>
<pre class="shiki" data-lang="text" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span>   // 1st token,  2nd token,  3rd token</span></span>
<span class="line"><span>   [  2,5,3,0,3,  0,5,4,1,0,  3,2,7,2,0 ]</span></span></code></pre>
<p>Also suppose that after some edits, the new semantic tokens in a file are:</p>
<pre class="shiki" data-lang="text" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span>   // 1st token,  2nd token,  3rd token</span></span>
<span class="line"><span>   [  3,5,3,0,3,  0,5,4,1,0,  3,2,7,2,0 ]</span></span></code></pre>
<p>It is possible to express these new tokens in terms of an edit applied to the previous tokens:</p>
<pre class="shiki" data-lang="text" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span>   [  2,5,3,0,3,  0,5,4,1,0,  3,2,7,2,0 ] // old tokens</span></span>
<span class="line"><span>   [  3,5,3,0,3,  0,5,4,1,0,  3,2,7,2,0 ] // new tokens</span></span>
<span class="line"><span></span></span>
<span class="line"><span>   edit: { start:  0, deleteCount: 1, data: [3] } // replace integer at offset 0 with 3</span></span></code></pre>
<p><em>NOTE</em>: If the provider cannot compute <code>SemanticTokensEdits</code>, it can &quot;give up&quot; and return all the tokens in the document again.
<em>NOTE</em>: All edits in <code>SemanticTokensEdits</code> contain indices in the old integers array, so they all refer to the previous result state.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">previousResultId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#SemanticTokens">SemanticTokens</a> &#124; <a class="type-ref" href="#SemanticTokensEdits">SemanticTokensEdits</a>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="DocumentSymbol"></a><span class="code-item" id=851>DocumentSymbol</span>



<div class="comment"><p>Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document
symbols can be hierarchical and they have two ranges: one that encloses its definition and one that points to
its most interesting range, e.g. the range of an identifier.</p>
</div>

#### Constructors



<a name="DocumentSymbol.DocumentSymbol"></a><span class="ts" id=853 data-target="#details-853" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">DocumentSymbol</span><span>(</span><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">detail</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a>, <span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">selectionRange</span><span>: </span><a class="type-ref" href="#Range">Range</a><span>)</span><span>: </span><a class="type-ref" href="#DocumentSymbol">DocumentSymbol</a></span>
<div class="details collapse" id="details-853">
<div class="comment"><p>Creates a new document symbol.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The name of the symbol.</p>
</div></td></tr>
<tr><td><span class="ident">detail</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Details for the symbol.</p>
</div></td></tr>
<tr><td><span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a></td><td><div class="comment"><p>The kind of the symbol.</p>
</div></td></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The full range of the symbol.</p>
</div></td></tr>
<tr><td><span class="ident">selectionRange</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range that should be reveal.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#DocumentSymbol">DocumentSymbol</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="DocumentSymbol.children"></a><span class="ts" id=865 data-target="#details-865" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">children</span><span>: </span><a class="type-ref" href="#DocumentSymbol">DocumentSymbol</a>[]</span>
<div class="details collapse" id="details-865">
<div class="comment"><p>Children of this symbol, e.g. properties of a class.</p>
</div>
</div>



<a name="DocumentSymbol.detail"></a><span class="ts" id=860 data-target="#details-860" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">detail</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-860">
<div class="comment"><p>More detail for this symbol, e.g. the signature of a function.</p>
</div>
</div>



<a name="DocumentSymbol.kind"></a><span class="ts" id=861 data-target="#details-861" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a></span>
<div class="details collapse" id="details-861">
<div class="comment"><p>The kind of this symbol.</p>
</div>
</div>



<a name="DocumentSymbol.name"></a><span class="ts" id=859 data-target="#details-859" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-859">
<div class="comment"><p>The name of this symbol.</p>
</div>
</div>



<a name="DocumentSymbol.range"></a><span class="ts" id=863 data-target="#details-863" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-863">
<div class="comment"><p>The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.</p>
</div>
</div>



<a name="DocumentSymbol.selectionRange"></a><span class="ts" id=864 data-target="#details-864" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selectionRange</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-864">
<div class="comment"><p>The range that should be selected and reveal when this symbol is being picked, e.g. the name of a function.
Must be contained by the <a href="#DocumentSymbol.range">range</a>.</p>
</div>
</div>



<a name="DocumentSymbol.tags"></a><span class="ts" id=862 data-target="#details-862" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tags</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#SymbolTag">SymbolTag</a>[]</span>
<div class="details collapse" id="details-862">
<div class="comment"><p>Tags for this symbol.</p>
</div>
</div>

### <a name="DocumentSymbolProvider"></a><span class="code-item" id=866>DocumentSymbolProvider</span>



<div class="comment"><p>The document symbol provider interface defines the contract between extensions and
the <a href="https://code.visualstudio.com/docs/editor/editingevolved#_go-to-symbol">go to symbol</a>-feature.</p>
</div>

#### Methods



<a name="DocumentSymbolProvider.provideDocumentSymbols"></a><span class="ts" id=868 data-target="#details-868" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideDocumentSymbols</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DocumentSymbol">DocumentSymbol</a>[] &#124; <a class="type-ref" href="#SymbolInformation">SymbolInformation</a>[]&gt;</span>
<div class="details collapse" id="details-868">
<div class="comment"><p>Provide symbol information for the given document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#DocumentSymbol">DocumentSymbol</a>[] &#124; <a class="type-ref" href="#SymbolInformation">SymbolInformation</a>[]&gt;</td><td><div class="comment"><p>An array of document highlights or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="DocumentSymbolProviderMetadata"></a><span class="code-item" id=871>DocumentSymbolProviderMetadata</span>



<div class="comment"><p>Metadata about a document symbol provider.</p>
</div>

#### Properties



<a name="DocumentSymbolProviderMetadata.label"></a><span class="ts" id=872 data-target="#details-872" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-872">
<div class="comment"><p>A human-readable string that is shown when multiple outlines trees show for one document.</p>
</div>
</div>

### <a name="EndOfLine"></a><span class="code-item" id=373>EndOfLine</span>



<div class="comment"><p>Represents an end of line character sequence in a <a href="#TextDocument">document</a>.</p>
</div>

#### Enumeration Members



<a name="EndOfLine.LF"></a><span class="ts" id=374 data-target="#details-374" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">LF</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-374">
<div class="comment"><p>The line feed <code>\n</code> character.</p>
</div>
</div>



<a name="EndOfLine.CRLF"></a><span class="ts" id=375 data-target="#details-375" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">CRLF</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-375">
<div class="comment"><p>The carriage return line feed <code>\r\n</code> sequence.</p>
</div>
</div>

### <a name="EnterAction"></a><span class="code-item" id=1656>EnterAction</span>



<div class="comment"><p>Describes what to do when pressing Enter.</p>
</div>

#### Properties



<a name="EnterAction.appendText"></a><span class="ts" id=1658 data-target="#details-1658" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendText</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1658">
<div class="comment"><p>Describes text to be appended after the new line and after the indentation.</p>
</div>
</div>



<a name="EnterAction.indentAction"></a><span class="ts" id=1657 data-target="#details-1657" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">indentAction</span><span>: </span><a class="type-ref" href="#IndentAction">IndentAction</a></span>
<div class="details collapse" id="details-1657">
<div class="comment"><p>Describe what to do with the indentation.</p>
</div>
</div>



<a name="EnterAction.removeText"></a><span class="ts" id=1659 data-target="#details-1659" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">removeText</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1659">
<div class="comment"><p>Describes the number of characters to remove from the new line&#39;s indentation.</p>
</div>
</div>

### <a name="EnvironmentVariableCollection"></a><span class="code-item" id=3104>EnvironmentVariableCollection</span>



<div class="comment"><p>A collection of mutations that an extension can apply to a process environment.</p>
</div>

#### Properties



<a name="EnvironmentVariableCollection.description"></a><span class="ts" id=3106 data-target="#details-3106" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">description</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-3106">
<div class="comment"><p>A description for the environment variable collection, this will be used to describe the
changes in the UI.</p>
</div>
</div>



<a name="EnvironmentVariableCollection.persistent"></a><span class="ts" id=3105 data-target="#details-3105" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">persistent</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3105">
<div class="comment"><p>Whether the collection should be cached for the workspace and applied to the terminal
across window reloads. When true the collection will be active immediately such when the
window reloads. Additionally, this API will return the cached version if it exists. The
collection will be invalidated when the extension is uninstalled or when the collection
is cleared. Defaults to true.</p>
</div>
</div>

#### Methods



<a name="EnvironmentVariableCollection.append"></a><span class="ts" id=3113 data-target="#details-3113" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">append</span><span>(</span><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorOptions">EnvironmentVariableMutatorOptions</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3113">
<div class="comment"><p>Append a value to an environment variable.</p>
<p>Note that an extension can only make a single change to any one variable, so this will
overwrite any previous calls to replace, append or prepend.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The variable to append to.</p>
</div></td></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The value to append to the variable.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorOptions">EnvironmentVariableMutatorOptions</a></td><td><div class="comment"><p>Options applied to the mutator, when no options are provided this will
default to <code>{ applyAtProcessCreation: true }</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="EnvironmentVariableCollection.clear"></a><span class="ts" id=3138 data-target="#details-3138" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">clear</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3138">
<div class="comment"><p>Clears all mutators from this collection.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="EnvironmentVariableCollection.delete"></a><span class="ts" id=3135 data-target="#details-3135" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">delete</span><span>(</span><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3135">
<div class="comment"><p>Deletes this collection&#39;s mutator for a variable.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The variable to delete the mutator for.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="EnvironmentVariableCollection.forEach"></a><span class="ts" id=3126 data-target="#details-3126" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">forEach</span><span>(</span><span class="ident">callback</span><span>: </span>(variable: <span class="type-intrinsic">string</span>, mutator: <a class="type-ref" href="#EnvironmentVariableMutator">EnvironmentVariableMutator</a>, collection: <a class="type-ref" href="#EnvironmentVariableCollection">EnvironmentVariableCollection</a>) =&gt; <span class="type-intrinsic">any</span>, <span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3126">
<div class="comment"><p>Iterate over each mutator in this collection.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">callback</span><span>: </span>(variable: <span class="type-intrinsic">string</span>, mutator: <a class="type-ref" href="#EnvironmentVariableMutator">EnvironmentVariableMutator</a>, collection: <a class="type-ref" href="#EnvironmentVariableCollection">EnvironmentVariableCollection</a>) =&gt; <span class="type-intrinsic">any</span></td><td><div class="comment"><p>Function to execute for each entry.</p>
</div></td></tr>
<tr><td><span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>The <code>this</code> context used when invoking the handler function.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="EnvironmentVariableCollection.get"></a><span class="ts" id=3123 data-target="#details-3123" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">get</span><span>(</span><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutator">EnvironmentVariableMutator</a></span>
<div class="details collapse" id="details-3123">
<div class="comment"><p>Gets the mutator that this collection applies to a variable, if any.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The variable to get the mutator for.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#EnvironmentVariableMutator">EnvironmentVariableMutator</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="EnvironmentVariableCollection.prepend"></a><span class="ts" id=3118 data-target="#details-3118" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prepend</span><span>(</span><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorOptions">EnvironmentVariableMutatorOptions</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3118">
<div class="comment"><p>Prepend a value to an environment variable.</p>
<p>Note that an extension can only make a single change to any one variable, so this will
overwrite any previous calls to replace, append or prepend.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The variable to prepend.</p>
</div></td></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The value to prepend to the variable.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorOptions">EnvironmentVariableMutatorOptions</a></td><td><div class="comment"><p>Options applied to the mutator, when no options are provided this will
default to <code>{ applyAtProcessCreation: true }</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="EnvironmentVariableCollection.replace"></a><span class="ts" id=3108 data-target="#details-3108" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">replace</span><span>(</span><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorOptions">EnvironmentVariableMutatorOptions</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3108">
<div class="comment"><p>Replace an environment variable with a value.</p>
<p>Note that an extension can only make a single change to any one variable, so this will
overwrite any previous calls to replace, append or prepend.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The variable to replace.</p>
</div></td></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The value to replace the variable with.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorOptions">EnvironmentVariableMutatorOptions</a></td><td><div class="comment"><p>Options applied to the mutator, when no options are provided this will
default to <code>{ applyAtProcessCreation: true }</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="EnvironmentVariableMutator"></a><span class="code-item" id=3100>EnvironmentVariableMutator</span>



<div class="comment"><p>A type of mutation and its value to be applied to an environment variable.</p>
</div>

#### Properties



<a name="EnvironmentVariableMutator.options"></a><span class="ts" id=3103 data-target="#details-3103" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">options</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorOptions">EnvironmentVariableMutatorOptions</a></span>
<div class="details collapse" id="details-3103">
<div class="comment"><p>Options applied to the mutator.</p>
</div>
</div>



<a name="EnvironmentVariableMutator.type"></a><span class="ts" id=3101 data-target="#details-3101" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">type</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorType">EnvironmentVariableMutatorType</a></span>
<div class="details collapse" id="details-3101">
<div class="comment"><p>The type of mutation that will occur to the variable.</p>
</div>
</div>



<a name="EnvironmentVariableMutator.value"></a><span class="ts" id=3102 data-target="#details-3102" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3102">
<div class="comment"><p>The value to use for the variable.</p>
</div>
</div>

### <a name="EnvironmentVariableMutatorOptions"></a><span class="code-item" id=3097>EnvironmentVariableMutatorOptions</span>



<div class="comment"><p>Options applied to the mutator.</p>
</div>

#### Properties



<a name="EnvironmentVariableMutatorOptions.applyAtProcessCreation"></a><span class="ts" id=3098 data-target="#details-3098" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">applyAtProcessCreation</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3098">
<div class="comment"><p>Apply to the environment just before the process is created. Defaults to false.</p>
</div>
</div>



<a name="EnvironmentVariableMutatorOptions.applyAtShellIntegration"></a><span class="ts" id=3099 data-target="#details-3099" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">applyAtShellIntegration</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3099">
<div class="comment"><p>Apply to the environment in the shell integration script. Note that this <em>will not</em> apply
the mutator if shell integration is disabled or not working for some reason. Defaults to
false.</p>
</div>
</div>

### <a name="EnvironmentVariableMutatorType"></a><span class="code-item" id=3093>EnvironmentVariableMutatorType</span>



<div class="comment"><p>A type of mutation that can be applied to an environment variable.</p>
</div>

#### Enumeration Members



<a name="EnvironmentVariableMutatorType.Replace"></a><span class="ts" id=3094 data-target="#details-3094" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Replace</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-3094">
<div class="comment"><p>Replace the variable&#39;s existing value.</p>
</div>
</div>



<a name="EnvironmentVariableMutatorType.Append"></a><span class="ts" id=3095 data-target="#details-3095" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Append</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-3095">
<div class="comment"><p>Append to the end of the variable&#39;s existing value.</p>
</div>
</div>



<a name="EnvironmentVariableMutatorType.Prepend"></a><span class="ts" id=3096 data-target="#details-3096" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Prepend</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-3096">
<div class="comment"><p>Prepend to the start of the variable&#39;s existing value.</p>
</div>
</div>

### <a name="EnvironmentVariableScope"></a><span class="code-item" id=3177>EnvironmentVariableScope</span>



<div class="comment"><p>The scope object to which the environment variable collection applies.</p>
</div>

#### Properties



<a name="EnvironmentVariableScope.workspaceFolder"></a><span class="ts" id=3178 data-target="#details-3178" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">workspaceFolder</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a></span>
<div class="details collapse" id="details-3178">
<div class="comment"><p>Any specific workspace folder to get collection for.</p>
</div>
</div>

### <a name="EvaluatableExpression"></a><span class="code-item" id=739>EvaluatableExpression</span>



<div class="comment"><p>An EvaluatableExpression represents an expression in a document that can be evaluated by an active debugger or runtime.
The result of this evaluation is shown in a tooltip-like widget.
If only a range is specified, the expression will be extracted from the underlying document.
An optional expression can be used to override the extracted expression.
In this case the range is still used to highlight the range in the document.</p>
</div>

#### Constructors



<a name="EvaluatableExpression.EvaluatableExpression"></a><span class="ts" id=741 data-target="#details-741" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">EvaluatableExpression</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">expression</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#EvaluatableExpression">EvaluatableExpression</a></span>
<div class="details collapse" id="details-741">
<div class="comment"><p>Creates a new evaluatable expression object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range in the underlying document from which the evaluatable expression is extracted.</p>
</div></td></tr>
<tr><td><span class="ident">expression</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>If specified overrides the extracted expression.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#EvaluatableExpression">EvaluatableExpression</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="EvaluatableExpression.expression"></a><span class="ts" id=745 data-target="#details-745" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">expression</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-745">
<div class="comment"><p>If specified the expression overrides the extracted expression.</p>
</div>
</div>



<a name="EvaluatableExpression.range"></a><span class="ts" id=744 data-target="#details-744" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-744">
<div class="comment"><p>The range is used to extract the evaluatable expression from the underlying document and to highlight it.</p>
</div>
</div>

### <a name="EvaluatableExpressionProvider"></a><span class="code-item" id=746>EvaluatableExpressionProvider</span>



<div class="comment"><p>The evaluatable expression provider interface defines the contract between extensions and
the debug hover. In this contract the provider returns an evaluatable expression for a given position
in a document and the editor evaluates this expression in the active debug session and shows the result in a debug hover.</p>
</div>

#### Methods



<a name="EvaluatableExpressionProvider.provideEvaluatableExpression"></a><span class="ts" id=748 data-target="#details-748" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideEvaluatableExpression</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#EvaluatableExpression">EvaluatableExpression</a>&gt;</span>
<div class="details collapse" id="details-748">
<div class="comment"><p>Provide an evaluatable expression for the given document and position.
The editor will evaluate this expression in the active debug session and will show the result in the debug hover.
The expression can be implicitly specified by the range in the underlying document or by explicitly returning an expression.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document for which the debug hover is about to appear.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The line and character position in the document where the debug hover is about to appear.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#EvaluatableExpression">EvaluatableExpression</a>&gt;</td><td><div class="comment"><p>An EvaluatableExpression or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="Event"></a><span class="code-item" id=468>Event&lt;T&gt;</span>



<div class="comment"><p>Represents a typed event.</p>
<p>A function that represents an event to which you subscribe by calling it with
a listener function as argument.</p>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">item</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onDidChange</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">function</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Event happened: '</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> + </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"></span></code></pre>
</div>



<a name="Event"></a><span class="ts" id=470 data-target="#details-470" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span>(</span><span class="ident">listener</span><span>: </span>(e: <span class="type-ref">T</span>) =&gt; <span class="type-intrinsic">any</span>, <span class="ident">thisArgs</span><span>?</span><span>: </span><span class="type-intrinsic">any</span>, <span class="ident">disposables</span><span>?</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a>[]<span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-470">
<div class="comment"><p>A function that represents an event to which you subscribe by calling it with
a listener function as argument.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">listener</span><span>: </span>(e: <span class="type-ref">T</span>) =&gt; <span class="type-intrinsic">any</span></td><td><div class="comment"><p>The listener function will be called when the event happens.</p>
</div></td></tr>
<tr><td><span class="ident">thisArgs</span><span>?</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>The <code>this</code>-argument which will be used when calling the event listener.</p>
</div></td></tr>
<tr><td><span class="ident">disposables</span><span>?</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a>[]</td><td><div class="comment"><p>An array to which a <a href="#Disposable">Disposable</a> will be added.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A disposable which unsubscribes the event listener.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="EventEmitter"></a><span class="code-item" id=477>EventEmitter&lt;T&gt;</span>



<div class="comment"><p>An event emitter can be used to create and manage an <a href="#Event">Event</a> for others
to subscribe to. One emitter always owns one event.</p>
<p>Use this class if you want to provide event from within your extension, for instance
inside a <a href="#TextDocumentContentProvider">TextDocumentContentProvider</a> or when providing
API to other extensions.</p>
</div>

#### Constructors



<a name="EventEmitter.EventEmitter"></a><span class="ts" id=480 data-target="#details-480" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">EventEmitter</span><span>&lt;</span>T<span>&gt;</span><span>(</span><span>)</span><span>: </span><a class="type-ref" href="#EventEmitter&amp;lt;T&amp;gt;">EventEmitter</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-480">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#EventEmitter&amp;lt;T&amp;gt;">EventEmitter</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="EventEmitter.event"></a><span class="ts" id=482 data-target="#details-482" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">event</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-482">
<div class="comment"><p>The event listeners can subscribe to.</p>
</div>
</div>

#### Methods



<a name="EventEmitter.dispose"></a><span class="ts" id=487 data-target="#details-487" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-487">
<div class="comment"><p>Dispose this object and free resources.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="EventEmitter.fire"></a><span class="ts" id=484 data-target="#details-484" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fire</span><span>(</span><span class="ident">data</span><span>: </span><span class="type-ref">T</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-484">
<div class="comment"><p>Notify all subscribers of the <a href="#EventEmitter.event">event</a>. Failure
of one or more listener will not fail this function call.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">data</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The event object.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="Extension"></a><span class="code-item" id=2046>Extension&lt;T&gt;</span>



<div class="comment"><p>Represents an extension.</p>
<p>To get an instance of an <code>Extension</code> use <a href="#extensions.getExtension">getExtension</a>.</p>
</div>

#### Properties



<a name="Extension.exports"></a><span class="ts" id=2054 data-target="#details-2054" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">exports</span><span>: </span><span class="type-ref">T</span></span>
<div class="details collapse" id="details-2054">
<div class="comment"><p>The public API exported by this extension (return value of <code>activate</code>).
It is an invalid action to access this field before this extension has been activated.</p>
</div>
</div>



<a name="Extension.extensionKind"></a><span class="ts" id=2053 data-target="#details-2053" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">extensionKind</span><span>: </span><a class="type-ref" href="#ExtensionKind">ExtensionKind</a></span>
<div class="details collapse" id="details-2053">
<div class="comment"><p>The extension kind describes if an extension runs where the UI runs
or if an extension runs where the remote extension host runs. The extension kind
is defined in the <code>package.json</code>-file of extensions but can also be refined
via the <code>remote.extensionKind</code>-setting. When no remote extension host exists,
the value is <a href="#ExtensionKind.UI">ExtensionKind.UI</a>.</p>
</div>
</div>



<a name="Extension.extensionPath"></a><span class="ts" id=2050 data-target="#details-2050" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">extensionPath</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2050">
<div class="comment"><p>The absolute file path of the directory containing this extension. Shorthand
notation for <a href="#Extension.extensionUri">Extension.extensionUri.fsPath</a> (independent of the uri scheme).</p>
</div>
</div>



<a name="Extension.extensionUri"></a><span class="ts" id=2049 data-target="#details-2049" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">extensionUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-2049">
<div class="comment"><p>The uri of the directory containing the extension.</p>
</div>
</div>



<a name="Extension.id"></a><span class="ts" id=2048 data-target="#details-2048" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2048">
<div class="comment"><p>The canonical extension identifier in the form of: <code>publisher.name</code>.</p>
</div>
</div>



<a name="Extension.isActive"></a><span class="ts" id=2051 data-target="#details-2051" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isActive</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2051">
<div class="comment"><p><code>true</code> if the extension has been activated.</p>
</div>
</div>



<a name="Extension.packageJSON"></a><span class="ts" id=2052 data-target="#details-2052" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">packageJSON</span><span>: </span><span class="type-intrinsic">any</span></span>
<div class="details collapse" id="details-2052">
<div class="comment"><p>The parsed contents of the extension&#39;s package.json.</p>
</div>
</div>

#### Methods



<a name="Extension.activate"></a><span class="ts" id=2056 data-target="#details-2056" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activate</span><span>(</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2056">
<div class="comment"><p>Activates this extension and returns its public API.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>A promise that will resolve when this extension has been activated.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="ExtensionContext"></a><span class="code-item" id=2061>ExtensionContext</span>



<div class="comment"><p>An extension context is a collection of utilities private to an
extension.</p>
<p>An instance of an <code>ExtensionContext</code> is provided as the first
parameter to the <code>activate</code>-call of an extension.</p>
</div>

#### Properties



<a name="ExtensionContext.environmentVariableCollection"></a><span class="ts" id=2075 data-target="#details-2075" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">environmentVariableCollection</span><span>: </span><a class="type-ref" href="#GlobalEnvironmentVariableCollection">GlobalEnvironmentVariableCollection</a></span>
<div class="details collapse" id="details-2075">
<div class="comment"><p>Gets the extension&#39;s global environment variable collection for this workspace, enabling changes to be
applied to terminal environment variables.</p>
</div>
</div>



<a name="ExtensionContext.extension"></a><span class="ts" id=2086 data-target="#details-2086" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">extension</span><span>: </span><a class="type-ref" href="#Extension&amp;lt;T&amp;gt;">Extension</a>&lt;<span class="type-intrinsic">any</span>&gt;</span>
<div class="details collapse" id="details-2086">
<div class="comment"><p>The current <code>Extension</code> instance.</p>
</div>
</div>



<a name="ExtensionContext.extensionMode"></a><span class="ts" id=2085 data-target="#details-2085" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">extensionMode</span><span>: </span><a class="type-ref" href="#ExtensionMode">ExtensionMode</a></span>
<div class="details collapse" id="details-2085">
<div class="comment"><p>The mode the extension is running in. See <a href="#ExtensionMode">ExtensionMode</a>
for possible values and scenarios.</p>
</div>
</div>



<a name="ExtensionContext.extensionPath"></a><span class="ts" id=2074 data-target="#details-2074" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">extensionPath</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2074">
<div class="comment"><p>The absolute file path of the directory containing the extension. Shorthand
notation for <a href="#TextDocument.uri">ExtensionContext.extensionUri.fsPath</a> (independent of the uri scheme).</p>
</div>
</div>



<a name="ExtensionContext.extensionUri"></a><span class="ts" id=2073 data-target="#details-2073" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">extensionUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-2073">
<div class="comment"><p>The uri of the directory containing the extension.</p>
</div>
</div>



<a name="ExtensionContext.globalState"></a><span class="ts" id=2067 data-target="#details-2067" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">globalState</span><span>: </span><a class="type-ref" href="#Memento">Memento</a> &#38; {setKeysForSync}</span>
<div class="details collapse" id="details-2067">
<div class="comment"><p>A memento object that stores state independent
of the current opened <a href="#workspace.workspaceFolders">workspace</a>.</p>
</div>
</div>



<a name="ExtensionContext.globalStoragePath"></a><span class="ts" id=2082 data-target="#details-2082" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">globalStoragePath</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2082">
<div class="comment"><p>An absolute file path in which the extension can store global state.
The directory might not exist on disk and creation is
up to the extension. However, the parent directory is guaranteed to be existent.</p>
<p>Use <a href="#ExtensionContext.globalState">globalState</a> to store key value data.</p>
<ul>
<li><em>deprecated</em> - Use <a href="#ExtensionContext.globalStorageUri">globalStorageUri</a> instead.</li>
</ul>
</div>
</div>



<a name="ExtensionContext.globalStorageUri"></a><span class="ts" id=2081 data-target="#details-2081" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">globalStorageUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-2081">
<div class="comment"><p>The uri of a directory in which the extension can store global state.
The directory might not exist on disk and creation is
up to the extension. However, the parent directory is guaranteed to be existent.</p>
<p>Use <a href="#ExtensionContext.globalState">globalState</a> to store key value data.</p>
<p><em>See also</em>
<a href="#FileSystem">workspace.fs</a> for how to read and write files and folders from
 an uri.</p>
</div>
</div>



<a name="ExtensionContext.languageModelAccessInformation"></a><span class="ts" id=2087 data-target="#details-2087" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">languageModelAccessInformation</span><span>: </span><a class="type-ref" href="#LanguageModelAccessInformation">LanguageModelAccessInformation</a></span>
<div class="details collapse" id="details-2087">
<div class="comment"><p>An object that keeps information about how this extension can use language models.</p>
<p><em>See also</em>
<a href="#LanguageModelChat.sendRequest">LanguageModelChat.sendRequest</a></p>
</div>
</div>



<a name="ExtensionContext.logPath"></a><span class="ts" id=2084 data-target="#details-2084" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">logPath</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2084">
<div class="comment"><p>An absolute file path of a directory in which the extension can create log files.
The directory might not exist on disk and creation is up to the extension. However,
the parent directory is guaranteed to be existent.</p>
<ul>
<li><em>deprecated</em> - Use <a href="#ExtensionContext.logUri">logUri</a> instead.</li>
</ul>
</div>
</div>



<a name="ExtensionContext.logUri"></a><span class="ts" id=2083 data-target="#details-2083" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">logUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-2083">
<div class="comment"><p>The uri of a directory in which the extension can create log files.
The directory might not exist on disk and creation is up to the extension. However,
the parent directory is guaranteed to be existent.</p>
<p><em>See also</em>
<a href="#FileSystem">workspace.fs</a> for how to read and write files and folders from
 an uri.</p>
</div>
</div>



<a name="ExtensionContext.secrets"></a><span class="ts" id=2072 data-target="#details-2072" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">secrets</span><span>: </span><a class="type-ref" href="#SecretStorage">SecretStorage</a></span>
<div class="details collapse" id="details-2072">
<div class="comment"><p>A secret storage object that stores state independent
of the current opened <a href="#workspace.workspaceFolders">workspace</a>.</p>
</div>
</div>



<a name="ExtensionContext.storagePath"></a><span class="ts" id=2080 data-target="#details-2080" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">storagePath</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2080">
<div class="comment"><p>An absolute file path of a workspace specific directory in which the extension
can store private state. The directory might not exist on disk and creation is
up to the extension. However, the parent directory is guaranteed to be existent.</p>
<p>Use <a href="#ExtensionContext.workspaceState">workspaceState</a> or
<a href="#ExtensionContext.globalState">globalState</a> to store key value data.</p>
<ul>
<li><em>deprecated</em> - Use <a href="#ExtensionContext.storageUri">storageUri</a> instead.</li>
</ul>
</div>
</div>



<a name="ExtensionContext.storageUri"></a><span class="ts" id=2079 data-target="#details-2079" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">storageUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-2079">
<div class="comment"><p>The uri of a workspace specific directory in which the extension
can store private state. The directory might not exist and creation is
up to the extension. However, the parent directory is guaranteed to be existent.
The value is <code>undefined</code> when no workspace nor folder has been opened.</p>
<p>Use <a href="#ExtensionContext.workspaceState">workspaceState</a> or
<a href="#ExtensionContext.globalState">globalState</a> to store key value data.</p>
<p><em>See also</em>
<a href="#FileSystem">workspace.fs</a> for how to read and write files and folders from
 a uri.</p>
</div>
</div>



<a name="ExtensionContext.subscriptions"></a><span class="ts" id=2062 data-target="#details-2062" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">subscriptions</span><span>: </span>Array&lt;{dispose}&gt;</span>
<div class="details collapse" id="details-2062">
<div class="comment"><p>An array to which disposables can be added. When this
extension is deactivated the disposables will be disposed.</p>
<p><em>Note</em> that asynchronous dispose-functions aren&#39;t awaited.</p>
</div>
</div>



<a name="ExtensionContext.workspaceState"></a><span class="ts" id=2066 data-target="#details-2066" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">workspaceState</span><span>: </span><a class="type-ref" href="#Memento">Memento</a></span>
<div class="details collapse" id="details-2066">
<div class="comment"><p>A memento object that stores state in the context
of the currently opened <a href="#workspace.workspaceFolders">workspace</a>.</p>
</div>
</div>

#### Methods



<a name="ExtensionContext.asAbsolutePath"></a><span class="ts" id=2077 data-target="#details-2077" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">asAbsolutePath</span><span>(</span><span class="ident">relativePath</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2077">
<div class="comment"><p>Get the absolute path of a resource contained in the extension.</p>
<p><em>Note</em> that an absolute uri can be constructed via <a href="#Uri.joinPath">Uri.joinPath</a> and
<a href="#ExtensionContext.extensionUri">extensionUri</a>, e.g. <code>vscode.Uri.joinPath(context.extensionUri, relativePath);</code></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">relativePath</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A relative path to a resource contained in the extension.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The absolute path of the resource.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="ExtensionKind"></a><span class="code-item" id=2043>ExtensionKind</span>



<div class="comment"><p>In a remote window the extension kind describes if an extension
runs where the UI (window) runs or if an extension runs remotely.</p>
</div>

#### Enumeration Members



<a name="ExtensionKind.UI"></a><span class="ts" id=2044 data-target="#details-2044" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">UI</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-2044">
<div class="comment"><p>Extension runs where the UI runs.</p>
</div>
</div>



<a name="ExtensionKind.Workspace"></a><span class="ts" id=2045 data-target="#details-2045" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Workspace</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-2045">
<div class="comment"><p>Extension runs where the remote extension host runs.</p>
</div>
</div>

### <a name="ExtensionMode"></a><span class="code-item" id=2057>ExtensionMode</span>



<div class="comment"><p>The ExtensionMode is provided on the <code>ExtensionContext</code> and indicates the
mode the specific extension is running in.</p>
</div>

#### Enumeration Members



<a name="ExtensionMode.Production"></a><span class="ts" id=2058 data-target="#details-2058" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Production</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-2058">
<div class="comment"><p>The extension is installed normally (for example, from the marketplace
or VSIX) in the editor.</p>
</div>
</div>



<a name="ExtensionMode.Development"></a><span class="ts" id=2059 data-target="#details-2059" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Development</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-2059">
<div class="comment"><p>The extension is running from an <code>--extensionDevelopmentPath</code> provided
when launching the editor.</p>
</div>
</div>



<a name="ExtensionMode.Test"></a><span class="ts" id=2060 data-target="#details-2060" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Test</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-2060">
<div class="comment"><p>The extension is running from an <code>--extensionTestsPath</code> and
the extension host is running unit tests.</p>
</div>
</div>

### <a name="ExtensionTerminalOptions"></a><span class="code-item" id=3057>ExtensionTerminalOptions</span>



<div class="comment"><p>Value-object describing what options a virtual process terminal should use.</p>
</div>

#### Properties



<a name="ExtensionTerminalOptions.color"></a><span class="ts" id=3061 data-target="#details-3061" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">color</span><span>?</span><span>: </span><a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-3061">
<div class="comment"><p>The icon <a href="#ThemeColor">ThemeColor</a> for the terminal.
The standard <code>terminal.ansi*</code> theme keys are
recommended for the best contrast and consistency across themes.</p>
</div>
</div>



<a name="ExtensionTerminalOptions.iconPath"></a><span class="ts" id=3060 data-target="#details-3060" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">iconPath</span><span>?</span><span>: </span><a class="type-ref" href="#IconPath">IconPath</a></span>
<div class="details collapse" id="details-3060">
<div class="comment"><p>The icon path or <a href="#ThemeIcon">ThemeIcon</a> for the terminal.</p>
</div>
</div>



<a name="ExtensionTerminalOptions.isTransient"></a><span class="ts" id=3063 data-target="#details-3063" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isTransient</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3063">
<div class="comment"><p>Opt-out of the default terminal persistence on restart and reload.
This will only take effect when <code>terminal.integrated.enablePersistentSessions</code> is enabled.</p>
</div>
</div>



<a name="ExtensionTerminalOptions.location"></a><span class="ts" id=3062 data-target="#details-3062" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">location</span><span>?</span><span>: </span><a class="type-ref" href="#TerminalEditorLocationOptions">TerminalEditorLocationOptions</a> &#124; <a class="type-ref" href="#TerminalSplitLocationOptions">TerminalSplitLocationOptions</a> &#124; <a class="type-ref" href="#TerminalLocation">TerminalLocation</a></span>
<div class="details collapse" id="details-3062">
<div class="comment"><p>The <a href="#TerminalLocation">TerminalLocation</a> or <a href="#TerminalEditorLocationOptions">TerminalEditorLocationOptions</a> or <a href="#TerminalSplitLocationOptions">TerminalSplitLocationOptions</a> for the terminal.</p>
</div>
</div>



<a name="ExtensionTerminalOptions.name"></a><span class="ts" id=3058 data-target="#details-3058" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3058">
<div class="comment"><p>A human-readable string which will be used to represent the terminal in the UI.</p>
</div>
</div>



<a name="ExtensionTerminalOptions.pty"></a><span class="ts" id=3059 data-target="#details-3059" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">pty</span><span>: </span><a class="type-ref" href="#Pseudoterminal">Pseudoterminal</a></span>
<div class="details collapse" id="details-3059">
<div class="comment"><p>An implementation of <a href="#Pseudoterminal">Pseudoterminal</a> that allows an extension to
control a terminal.</p>
</div>
</div>



<a name="ExtensionTerminalOptions.shellIntegrationNonce"></a><span class="ts" id=3064 data-target="#details-3064" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">shellIntegrationNonce</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3064">
<div class="comment"><p>The nonce to use to verify shell integration sequences are coming from a trusted source.
An example impact of UX of this is if the command line is reported with a nonce, it will
not need to verify with the user that the command line is correct before rerunning it
via the <a href="https://code.visualstudio.com/docs/terminal/shell-integration#_command-decorations-and-the-overview-ruler">shell integration command decoration</a>.</p>
<p>This should be used if the terminal includes <a href="https://code.visualstudio.com/docs/terminal/shell-integration#_supported-escape-sequences">custom shell integration support</a>.
It should be set to a random GUID. Inside the <a href="#Pseudoterminal">Pseudoterminal</a> implementation, this value
can be passed through in the relevant sequences to make them trusted.</p>
</div>
</div>

### <a name="FileChangeEvent"></a><span class="code-item" id=2331>FileChangeEvent</span>



<div class="comment"><p>The event filesystem providers must use to signal a file change.</p>
</div>

#### Properties



<a name="FileChangeEvent.type"></a><span class="ts" id=2332 data-target="#details-2332" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">type</span><span>: </span><a class="type-ref" href="#FileChangeType">FileChangeType</a></span>
<div class="details collapse" id="details-2332">
<div class="comment"><p>The type of change.</p>
</div>
</div>



<a name="FileChangeEvent.uri"></a><span class="ts" id=2333 data-target="#details-2333" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-2333">
<div class="comment"><p>The uri of the file that has changed.</p>
</div>
</div>

### <a name="FileChangeType"></a><span class="code-item" id=2327>FileChangeType</span>



<div class="comment"><p>Enumeration of file change types.</p>
</div>

#### Enumeration Members



<a name="FileChangeType.Changed"></a><span class="ts" id=2328 data-target="#details-2328" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Changed</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-2328">
<div class="comment"><p>The contents or metadata of a file have changed.</p>
</div>
</div>



<a name="FileChangeType.Created"></a><span class="ts" id=2329 data-target="#details-2329" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Created</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-2329">
<div class="comment"><p>A file has been created.</p>
</div>
</div>



<a name="FileChangeType.Deleted"></a><span class="ts" id=2330 data-target="#details-2330" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Deleted</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-2330">
<div class="comment"><p>A file has been deleted.</p>
</div>
</div>

### <a name="FileCoverage"></a><span class="code-item" id=4618>FileCoverage</span>



<div class="comment"><p>Contains coverage metadata for a file.</p>
</div>

#### Static



<a name="FileCoverage.fromDetails"></a><span class="ts" id=4620 data-target="#details-4620" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fromDetails</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">details</span><span>: </span>readonly <a class="type-ref" href="#FileCoverageDetail">FileCoverageDetail</a>[]<span>)</span><span>: </span><a class="type-ref" href="#FileCoverage">FileCoverage</a></span>
<div class="details collapse" id="details-4620">
<div class="comment"><p>Creates a <a href="#FileCoverage">FileCoverage</a> instance with counts filled in from
the coverage details.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Covered file URI</p>
</div></td></tr>
<tr><td><span class="ident">details</span><span>: </span>readonly <a class="type-ref" href="#FileCoverageDetail">FileCoverageDetail</a>[]</td><td><div class="comment"><p>Detailed coverage information</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FileCoverage">FileCoverage</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Constructors



<a name="FileCoverage.FileCoverage"></a><span class="ts" id=4624 data-target="#details-4624" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">FileCoverage</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">statementCoverage</span><span>: </span><a class="type-ref" href="#TestCoverageCount">TestCoverageCount</a>, <span class="ident">branchCoverage</span><span>?</span><span>: </span><a class="type-ref" href="#TestCoverageCount">TestCoverageCount</a>, <span class="ident">declarationCoverage</span><span>?</span><span>: </span><a class="type-ref" href="#TestCoverageCount">TestCoverageCount</a>, <span class="ident">includesTests</span><span>?</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a>[]<span>)</span><span>: </span><a class="type-ref" href="#FileCoverage">FileCoverage</a></span>
<div class="details collapse" id="details-4624">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Covered file URI</p>
</div></td></tr>
<tr><td><span class="ident">statementCoverage</span><span>: </span><a class="type-ref" href="#TestCoverageCount">TestCoverageCount</a></td><td><div class="comment"><p>Statement coverage information. If the reporter
does not provide statement coverage information, this can instead be
used to represent line coverage.</p>
</div></td></tr>
<tr><td><span class="ident">branchCoverage</span><span>?</span><span>: </span><a class="type-ref" href="#TestCoverageCount">TestCoverageCount</a></td><td><div class="comment"><p>Branch coverage information</p>
</div></td></tr>
<tr><td><span class="ident">declarationCoverage</span><span>?</span><span>: </span><a class="type-ref" href="#TestCoverageCount">TestCoverageCount</a></td><td><div class="comment"><p>Declaration coverage information</p>
</div></td></tr>
<tr><td><span class="ident">includesTests</span><span>?</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a>[]</td><td><div class="comment"><p>Test cases included in this coverage report, see <a href="#FileCoverage.includesTests">FileCoverage.includesTests</a></p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FileCoverage">FileCoverage</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="FileCoverage.branchCoverage"></a><span class="ts" id=4632 data-target="#details-4632" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">branchCoverage</span><span>?</span><span>: </span><a class="type-ref" href="#TestCoverageCount">TestCoverageCount</a></span>
<div class="details collapse" id="details-4632">
<div class="comment"><p>Branch coverage information.</p>
</div>
</div>



<a name="FileCoverage.declarationCoverage"></a><span class="ts" id=4633 data-target="#details-4633" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">declarationCoverage</span><span>?</span><span>: </span><a class="type-ref" href="#TestCoverageCount">TestCoverageCount</a></span>
<div class="details collapse" id="details-4633">
<div class="comment"><p>Declaration coverage information. Depending on the reporter and
language, this may be types such as functions, methods, or namespaces.</p>
</div>
</div>



<a name="FileCoverage.includesTests"></a><span class="ts" id=4634 data-target="#details-4634" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">includesTests</span><span>?</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a>[]</span>
<div class="details collapse" id="details-4634">
<div class="comment"><p>A list of <a href="#TestItem">test cases</a> that generated coverage in this
file. If set, then <a href="#TestRunProfile.loadDetailedCoverageForTest">TestRunProfile.loadDetailedCoverageForTest</a>
should also be defined in order to retrieve detailed coverage information.</p>
</div>
</div>



<a name="FileCoverage.statementCoverage"></a><span class="ts" id=4631 data-target="#details-4631" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">statementCoverage</span><span>: </span><a class="type-ref" href="#TestCoverageCount">TestCoverageCount</a></span>
<div class="details collapse" id="details-4631">
<div class="comment"><p>Statement coverage information. If the reporter does not provide statement
coverage information, this can instead be used to represent line coverage.</p>
</div>
</div>



<a name="FileCoverage.uri"></a><span class="ts" id=4630 data-target="#details-4630" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4630">
<div class="comment"><p>File URI.</p>
</div>
</div>

### <a name="FileCoverageDetail"></a><span class="code-item" id=4662>FileCoverageDetail</span>



<div class="comment"><p>Coverage details returned from <a href="#TestRunProfile.loadDetailedCoverage">TestRunProfile.loadDetailedCoverage</a>.</p>
</div>



<a name="FileCoverageDetail"></a><span class="ts" id=4662 data-target="#details-4662" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">FileCoverageDetail</span><span>: </span><a class="type-ref" href="#StatementCoverage">StatementCoverage</a> &#124; <a class="type-ref" href="#DeclarationCoverage">DeclarationCoverage</a></span>

### <a name="FileCreateEvent"></a><span class="code-item" id=3310>FileCreateEvent</span>



<div class="comment"><p>An event that is fired after files are created.</p>
</div>

#### Properties



<a name="FileCreateEvent.files"></a><span class="ts" id=3311 data-target="#details-3311" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">files</span><span>: </span>readonly <a class="type-ref" href="#Uri">Uri</a>[]</span>
<div class="details collapse" id="details-3311">
<div class="comment"><p>The files that got created.</p>
</div>
</div>

### <a name="FileDecoration"></a><span class="code-item" id=2027>FileDecoration</span>



<div class="comment"><p>A file decoration represents metadata that can be rendered with a file.</p>
</div>

#### Constructors



<a name="FileDecoration.FileDecoration"></a><span class="ts" id=2029 data-target="#details-2029" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">FileDecoration</span><span>(</span><span class="ident">badge</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">color</span><span>?</span><span>: </span><a class="type-ref" href="#ThemeColor">ThemeColor</a><span>)</span><span>: </span><a class="type-ref" href="#FileDecoration">FileDecoration</a></span>
<div class="details collapse" id="details-2029">
<div class="comment"><p>Creates a new decoration.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">badge</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A letter that represents the decoration.</p>
</div></td></tr>
<tr><td><span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The tooltip of the decoration.</p>
</div></td></tr>
<tr><td><span class="ident">color</span><span>?</span><span>: </span><a class="type-ref" href="#ThemeColor">ThemeColor</a></td><td><div class="comment"><p>The color of the decoration.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FileDecoration">FileDecoration</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="FileDecoration.badge"></a><span class="ts" id=2033 data-target="#details-2033" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">badge</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2033">
<div class="comment"><p>A very short string that represents this decoration.</p>
</div>
</div>



<a name="FileDecoration.color"></a><span class="ts" id=2035 data-target="#details-2035" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">color</span><span>?</span><span>: </span><a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-2035">
<div class="comment"><p>The color of this decoration.</p>
</div>
</div>



<a name="FileDecoration.propagate"></a><span class="ts" id=2036 data-target="#details-2036" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">propagate</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2036">
<div class="comment"><p>A flag expressing that this decoration should be
propagated to its parents.</p>
</div>
</div>



<a name="FileDecoration.tooltip"></a><span class="ts" id=2034 data-target="#details-2034" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2034">
<div class="comment"><p>A human-readable tooltip for this decoration.</p>
</div>
</div>

### <a name="FileDecorationProvider"></a><span class="code-item" id=2037>FileDecorationProvider</span>



<div class="comment"><p>The decoration provider interfaces defines the contract between extensions and
file decorations.</p>
</div>

#### Events



<a name="FileDecorationProvider.onDidChangeFileDecorations"></a><span class="ts" id=2038 data-target="#details-2038" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeFileDecorations</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#Uri">Uri</a>[]&gt;</span>
<div class="details collapse" id="details-2038">
<div class="comment"><p>An optional event to signal that decorations for one or many files have changed.</p>
<p><em>Note</em> that this event should be used to propagate information about children.</p>
<p><em>See also</em>
<a href="#EventEmitter">EventEmitter</a></p>
</div>
</div>

#### Methods



<a name="FileDecorationProvider.provideFileDecoration"></a><span class="ts" id=2040 data-target="#details-2040" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideFileDecoration</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#FileDecoration">FileDecoration</a>&gt;</span>
<div class="details collapse" id="details-2040">
<div class="comment"><p>Provide decorations for a given uri.</p>
<p><em>Note</em> that this function is only called when a file gets rendered in the UI.
This means a decoration from a descendent that propagates upwards must be signaled
to the editor via the <a href="#FileDecorationProvider.onDidChangeFileDecorations">onDidChangeFileDecorations</a>-event.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the file to provide a decoration for.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#FileDecoration">FileDecoration</a>&gt;</td><td><div class="comment"><p>A decoration or a thenable that resolves to such.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="FileDeleteEvent"></a><span class="code-item" id=3320>FileDeleteEvent</span>



<div class="comment"><p>An event that is fired after files are deleted.</p>
</div>

#### Properties



<a name="FileDeleteEvent.files"></a><span class="ts" id=3321 data-target="#details-3321" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">files</span><span>: </span>readonly <a class="type-ref" href="#Uri">Uri</a>[]</span>
<div class="details collapse" id="details-3321">
<div class="comment"><p>The files that got deleted.</p>
</div>
</div>

### <a name="FilePermission"></a><span class="code-item" id=2296>FilePermission</span>



<div class="comment"><p>Permissions of a file.</p>
</div>

#### Enumeration Members



<a name="FilePermission.Readonly"></a><span class="ts" id=2297 data-target="#details-2297" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Readonly</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-2297">
<div class="comment"><p>The file is readonly.</p>
<p><em>Note:</em> All <code>FileStat</code> from a <code>FileSystemProvider</code> that is registered with
the option <code>isReadonly: true</code> will be implicitly handled as if <code>FilePermission.Readonly</code>
is set. As a consequence, it is not possible to have a readonly file system provider
registered where some <code>FileStat</code> are not readonly.</p>
</div>
</div>

### <a name="FileRenameEvent"></a><span class="code-item" id=3333>FileRenameEvent</span>



<div class="comment"><p>An event that is fired after files are renamed.</p>
</div>

#### Properties



<a name="FileRenameEvent.files"></a><span class="ts" id=3334 data-target="#details-3334" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">files</span><span>: </span>ReadonlyArray&lt;{newUri: <a class="type-ref" href="#Uri">Uri</a>, oldUri: <a class="type-ref" href="#Uri">Uri</a>}&gt;</span>
<div class="details collapse" id="details-3334">
<div class="comment"><p>The files that got renamed.</p>
</div>
</div>

### <a name="FileStat"></a><span class="code-item" id=2298>FileStat</span>



<div class="comment"><p>The <code>FileStat</code>-type represents metadata about a file</p>
</div>

#### Properties



<a name="FileStat.ctime"></a><span class="ts" id=2300 data-target="#details-2300" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ctime</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-2300">
<div class="comment"><p>The creation timestamp in milliseconds elapsed since January 1, 1970 00:00:00 UTC.</p>
</div>
</div>



<a name="FileStat.mtime"></a><span class="ts" id=2301 data-target="#details-2301" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">mtime</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-2301">
<div class="comment"><p>The modification timestamp in milliseconds elapsed since January 1, 1970 00:00:00 UTC.</p>
<p><em>Note:</em> If the file changed, it is important to provide an updated <code>mtime</code> that advanced
from the previous value. Otherwise there may be optimizations in place that will not show
the updated file contents in an editor for example.</p>
</div>
</div>



<a name="FileStat.permissions"></a><span class="ts" id=2303 data-target="#details-2303" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">permissions</span><span>?</span><span>: </span><a class="type-ref" href="#FilePermission">FilePermission</a></span>
<div class="details collapse" id="details-2303">
<div class="comment"><p>The permissions of the file, e.g. whether the file is readonly.</p>
<p><em>Note:</em> This value might be a bitmask, e.g. <code>FilePermission.Readonly | FilePermission.Other</code>.</p>
</div>
</div>



<a name="FileStat.size"></a><span class="ts" id=2302 data-target="#details-2302" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">size</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-2302">
<div class="comment"><p>The size in bytes.</p>
<p><em>Note:</em> If the file changed, it is important to provide an updated <code>size</code>. Otherwise there
may be optimizations in place that will not show the updated file contents in an editor for
example.</p>
</div>
</div>



<a name="FileStat.type"></a><span class="ts" id=2299 data-target="#details-2299" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">type</span><span>: </span><a class="type-ref" href="#FileType">FileType</a></span>
<div class="details collapse" id="details-2299">
<div class="comment"><p>The type of the file, e.g. is a regular file, a directory, or symbolic link
to a file.</p>
<p><em>Note:</em> This value might be a bitmask, e.g. <code>FileType.File | FileType.SymbolicLink</code>.</p>
</div>
</div>

### <a name="FileSystem"></a><span class="code-item" id=2383>FileSystem</span>



<div class="comment"><p>The file system interface exposes the editor&#39;s built-in and contributed
<a href="#FileSystemProvider">file system providers</a>. It allows extensions to work
with files from the local disk as well as files from remote places, like the
remote extension host or ftp-servers.</p>
<p><em>Note</em> that an instance of this interface is available as <a href="#workspace.fs">workspace.fs</a>.</p>
</div>

#### Methods



<a name="FileSystem.copy"></a><span class="ts" id=2415 data-target="#details-2415" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">copy</span><span>(</span><span class="ident">source</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">target</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">options</span><span>?</span><span>: </span>{overwrite: <span class="type-intrinsic">boolean</span>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2415">
<div class="comment"><p>Copy files or folders.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">source</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The existing file.</p>
</div></td></tr>
<tr><td><span class="ident">target</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The destination location.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{overwrite: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"><p>Defines if existing files should be overwritten.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileSystem.createDirectory"></a><span class="ts" id=2391 data-target="#details-2391" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createDirectory</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2391">
<div class="comment"><p>Create a new directory (Note, that new files are created via <code>write</code>-calls).</p>
<p><em>Note</em> that missing directories are created automatically, e.g this call has
<code>mkdirp</code> semantics.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the new folder.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileSystem.delete"></a><span class="ts" id=2401 data-target="#details-2401" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">delete</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">options</span><span>?</span><span>: </span>{recursive: <span class="type-intrinsic">boolean</span>, useTrash: <span class="type-intrinsic">boolean</span>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2401">
<div class="comment"><p>Delete a file.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The resource that is to be deleted.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{recursive: <span class="type-intrinsic">boolean</span>, useTrash: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"><p>Defines if trash can should be used and if deletion of folders is recursive</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileSystem.isWritableFileSystem"></a><span class="ts" id=2422 data-target="#details-2422" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isWritableFileSystem</span><span>(</span><span class="ident">scheme</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2422">
<div class="comment"><p>Check if a given file system supports writing files.</p>
<p>Keep in mind that just because a file system supports writing, that does
not mean that writes will always succeed. There may be permissions issues
or other errors that prevent writing a file.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">scheme</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The scheme of the filesystem, for example <code>file</code> or <code>git</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> if the file system supports writing, <code>false</code> if it does not
support writing (i.e. it is readonly), and <code>undefined</code> if the editor does not
know about the filesystem.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="FileSystem.readDirectory"></a><span class="ts" id=2388 data-target="#details-2388" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">readDirectory</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;Array&lt;[<span class="type-intrinsic">string</span>, <a class="type-ref" href="#FileType">FileType</a>]&gt;&gt;</span>
<div class="details collapse" id="details-2388">
<div class="comment"><p>Retrieve all entries of a <a href="#FileType.Directory">directory</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the folder.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;Array&lt;[<span class="type-intrinsic">string</span>, <a class="type-ref" href="#FileType">FileType</a>]&gt;&gt;</td><td><div class="comment"><p>An array of name/type-tuples or a thenable that resolves to such.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="FileSystem.readFile"></a><span class="ts" id=2394 data-target="#details-2394" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">readFile</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</span>
<div class="details collapse" id="details-2394">
<div class="comment"><p>Read the entire contents of a file.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the file.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</td><td><div class="comment"><p>An array of bytes or a thenable that resolves to such.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="FileSystem.rename"></a><span class="ts" id=2408 data-target="#details-2408" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">rename</span><span>(</span><span class="ident">source</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">target</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">options</span><span>?</span><span>: </span>{overwrite: <span class="type-intrinsic">boolean</span>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2408">
<div class="comment"><p>Rename a file or folder.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">source</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The existing file.</p>
</div></td></tr>
<tr><td><span class="ident">target</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The new location.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{overwrite: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"><p>Defines if existing files should be overwritten.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileSystem.stat"></a><span class="ts" id=2385 data-target="#details-2385" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">stat</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#FileStat">FileStat</a>&gt;</span>
<div class="details collapse" id="details-2385">
<div class="comment"><p>Retrieve metadata about a file.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the file to retrieve metadata about.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#FileStat">FileStat</a>&gt;</td><td><div class="comment"><p>The file metadata about the file.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="FileSystem.writeFile"></a><span class="ts" id=2397 data-target="#details-2397" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">writeFile</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">content</span><span>: </span><span class="type-ref-ts">Uint8Array</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2397">
<div class="comment"><p>Write data to a file, replacing its entire contents.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the file.</p>
</div></td></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-ref-ts">Uint8Array</span></td><td><div class="comment"><p>The new content of the file.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="FileSystemError"></a><span class="code-item" id=2304>FileSystemError</span>



<div class="comment"><p>A type that filesystem providers should use to signal errors.</p>
<p>This class has factory methods for common error-cases, like <code>FileNotFound</code> when
a file or folder doesn&#39;t exist, use them like so: <code>throw vscode.FileSystemError.FileNotFound(someUri);</code></p>
</div>

#### Static



<a name="FileSystemError.FileExists"></a><span class="ts" id=2309 data-target="#details-2309" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">FileExists</span><span>(</span><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#FileSystemError">FileSystemError</a></span>
<div class="details collapse" id="details-2309">
<div class="comment"><p>Create an error to signal that a file or folder already exists, e.g. when
creating but not overwriting a file.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Message or uri.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FileSystemError">FileSystemError</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileSystemError.FileIsADirectory"></a><span class="ts" id=2315 data-target="#details-2315" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">FileIsADirectory</span><span>(</span><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#FileSystemError">FileSystemError</a></span>
<div class="details collapse" id="details-2315">
<div class="comment"><p>Create an error to signal that a file is a folder.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Message or uri.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FileSystemError">FileSystemError</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileSystemError.FileNotADirectory"></a><span class="ts" id=2312 data-target="#details-2312" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">FileNotADirectory</span><span>(</span><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#FileSystemError">FileSystemError</a></span>
<div class="details collapse" id="details-2312">
<div class="comment"><p>Create an error to signal that a file is not a folder.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Message or uri.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FileSystemError">FileSystemError</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileSystemError.FileNotFound"></a><span class="ts" id=2306 data-target="#details-2306" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">FileNotFound</span><span>(</span><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#FileSystemError">FileSystemError</a></span>
<div class="details collapse" id="details-2306">
<div class="comment"><p>Create an error to signal that a file or folder wasn&#39;t found.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Message or uri.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FileSystemError">FileSystemError</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileSystemError.NoPermissions"></a><span class="ts" id=2318 data-target="#details-2318" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">NoPermissions</span><span>(</span><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#FileSystemError">FileSystemError</a></span>
<div class="details collapse" id="details-2318">
<div class="comment"><p>Create an error to signal that an operation lacks required permissions.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Message or uri.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FileSystemError">FileSystemError</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileSystemError.Unavailable"></a><span class="ts" id=2321 data-target="#details-2321" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Unavailable</span><span>(</span><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#FileSystemError">FileSystemError</a></span>
<div class="details collapse" id="details-2321">
<div class="comment"><p>Create an error to signal that the file system is unavailable or too busy to
complete a request.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Message or uri.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FileSystemError">FileSystemError</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Constructors



<a name="FileSystemError.FileSystemError"></a><span class="ts" id=2324 data-target="#details-2324" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">FileSystemError</span><span>(</span><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#FileSystemError">FileSystemError</a></span>
<div class="details collapse" id="details-2324">
<div class="comment"><p>Creates a new filesystem error.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">messageOrUri</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Message or uri.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FileSystemError">FileSystemError</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="FileSystemError.code"></a><span class="ts" id=2326 data-target="#details-2326" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">code</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2326">
<div class="comment"><p>A code that identifies this error.</p>
<p>Possible values are names of errors, like <a href="#FileSystemError.FileNotFound">FileNotFound</a>,
or <code>Unknown</code> for unspecified errors.</p>
</div>
</div>

### <a name="FileSystemProvider"></a><span class="code-item" id=2334>FileSystemProvider</span>



<div class="comment"><p>The filesystem provider defines what the editor needs to read, write, discover,
and to manage files and folders. It allows extensions to serve files from remote places,
like ftp-servers, and to seamlessly integrate those into the editor.</p>
<ul>
<li><em>Note 1:</em> The filesystem provider API works with <a href="#Uri">uris</a> and assumes hierarchical
paths, e.g. <code>foo:/my/path</code> is a child of <code>foo:/my/</code> and a parent of <code>foo:/my/path/deeper</code>.</li>
<li><em>Note 2:</em> There is an activation event <code>onFileSystem:&lt;scheme&gt;</code> that fires when a file
or folder is being accessed.</li>
<li><em>Note 3:</em> The word &#39;file&#39; is often used to denote all <a href="#FileType">kinds</a> of files, e.g.
folders, symbolic links, and regular files.</li>
</ul>
</div>

#### Events



<a name="FileSystemProvider.onDidChangeFile"></a><span class="ts" id=2335 data-target="#details-2335" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeFile</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#FileChangeEvent">FileChangeEvent</a>[]&gt;</span>
<div class="details collapse" id="details-2335">
<div class="comment"><p>An event to signal that a resource has been created, changed, or deleted. This
event should fire for resources that are being <a href="#FileSystemProvider.watch">watched</a>
by clients of this provider.</p>
<p><em>Note:</em> It is important that the metadata of the file that changed provides an
updated <code>mtime</code> that advanced from the previous value in the <a href="#FileStat">stat</a> and a
correct <code>size</code> value. Otherwise there may be optimizations in place that will not show
the change in an editor for example.</p>
</div>
</div>

#### Methods



<a name="FileSystemProvider.copy"></a><span class="ts" id=2377 data-target="#details-2377" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">copy</span><span>(</span><span class="ident">source</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">destination</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">options</span><span>: </span>{overwrite: <span class="type-intrinsic">boolean</span>}<span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2377">
<div class="comment"><p>Copy files or folders. Implementing this function is optional but it will speedup
the copy operation.</p>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileNotFound">FileNotFound</a> when <code>source</code> doesn&#39;t exist.</li>
</ul>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileNotFound">FileNotFound</a> when parent of <code>destination</code> doesn&#39;t exist, e.g. no mkdirp-logic required.</li>
</ul>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileExists">FileExists</a> when <code>destination</code> exists and when the <code>overwrite</code> option is not <code>true</code>.</li>
</ul>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.NoPermissions">NoPermissions</a> when permissions aren&#39;t sufficient.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">source</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The existing file.</p>
</div></td></tr>
<tr><td><span class="ident">destination</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The destination location.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span>{overwrite: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"><p>Defines if existing files should be overwritten.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileSystemProvider.createDirectory"></a><span class="ts" id=2350 data-target="#details-2350" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createDirectory</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2350">
<div class="comment"><p>Create a new directory (Note, that new files are created via <code>write</code>-calls).</p>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileNotFound">FileNotFound</a> when the parent of <code>uri</code> doesn&#39;t exist, e.g. no mkdirp-logic required.</li>
</ul>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileExists">FileExists</a> when <code>uri</code> already exists.</li>
</ul>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.NoPermissions">NoPermissions</a> when permissions aren&#39;t sufficient.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the new folder.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileSystemProvider.delete"></a><span class="ts" id=2364 data-target="#details-2364" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">delete</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">options</span><span>: </span>{recursive: <span class="type-intrinsic">boolean</span>}<span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2364">
<div class="comment"><p>Delete a file.</p>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileNotFound">FileNotFound</a> when <code>uri</code> doesn&#39;t exist.</li>
</ul>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.NoPermissions">NoPermissions</a> when permissions aren&#39;t sufficient.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The resource that is to be deleted.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span>{recursive: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"><p>Defines if deletion of folders is recursive.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileSystemProvider.readDirectory"></a><span class="ts" id=2347 data-target="#details-2347" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">readDirectory</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span>Array&lt;[<span class="type-intrinsic">string</span>, <a class="type-ref" href="#FileType">FileType</a>]&gt; &#124; <span class="type-ref">Thenable</span>&lt;Array&lt;[<span class="type-intrinsic">string</span>, <a class="type-ref" href="#FileType">FileType</a>]&gt;&gt;</span>
<div class="details collapse" id="details-2347">
<div class="comment"><p>Retrieve all entries of a <a href="#FileType.Directory">directory</a>.</p>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileNotFound">FileNotFound</a> when <code>uri</code> doesn&#39;t exist.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the folder.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td>Array&lt;[<span class="type-intrinsic">string</span>, <a class="type-ref" href="#FileType">FileType</a>]&gt; &#124; <span class="type-ref">Thenable</span>&lt;Array&lt;[<span class="type-intrinsic">string</span>, <a class="type-ref" href="#FileType">FileType</a>]&gt;&gt;</td><td><div class="comment"><p>An array of name/type-tuples or a thenable that resolves to such.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="FileSystemProvider.readFile"></a><span class="ts" id=2353 data-target="#details-2353" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">readFile</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt; &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</span>
<div class="details collapse" id="details-2353">
<div class="comment"><p>Read the entire contents of a file.</p>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileNotFound">FileNotFound</a> when <code>uri</code> doesn&#39;t exist.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the file.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt; &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</td><td><div class="comment"><p>An array of bytes or a thenable that resolves to such.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="FileSystemProvider.rename"></a><span class="ts" id=2370 data-target="#details-2370" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">rename</span><span>(</span><span class="ident">oldUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">newUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">options</span><span>: </span>{overwrite: <span class="type-intrinsic">boolean</span>}<span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2370">
<div class="comment"><p>Rename a file or folder.</p>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileNotFound">FileNotFound</a> when <code>oldUri</code> doesn&#39;t exist.</li>
</ul>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileNotFound">FileNotFound</a> when parent of <code>newUri</code> doesn&#39;t exist, e.g. no mkdirp-logic required.</li>
</ul>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileExists">FileExists</a> when <code>newUri</code> exists and when the <code>overwrite</code> option is not <code>true</code>.</li>
</ul>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.NoPermissions">NoPermissions</a> when permissions aren&#39;t sufficient.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">oldUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The existing file.</p>
</div></td></tr>
<tr><td><span class="ident">newUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The new location.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span>{overwrite: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"><p>Defines if existing files should be overwritten.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileSystemProvider.stat"></a><span class="ts" id=2344 data-target="#details-2344" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">stat</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#FileStat">FileStat</a> &#124; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#FileStat">FileStat</a>&gt;</span>
<div class="details collapse" id="details-2344">
<div class="comment"><p>Retrieve metadata about a file.</p>
<p>Note that the metadata for symbolic links should be the metadata of the file they refer to.
Still, the <a href="#FileType.SymbolicLink">SymbolicLink</a>-type must be used in addition to the actual type, e.g.
<code>FileType.SymbolicLink | FileType.Directory</code>.</p>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileNotFound">FileNotFound</a> when <code>uri</code> doesn&#39;t exist.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the file to retrieve metadata about.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FileStat">FileStat</a> &#124; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#FileStat">FileStat</a>&gt;</td><td><div class="comment"><p>The file metadata about the file.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="FileSystemProvider.watch"></a><span class="ts" id=2337 data-target="#details-2337" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">watch</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">options</span><span>: </span>{excludes: readonly <span class="type-intrinsic">string</span>[], recursive: <span class="type-intrinsic">boolean</span>}<span>)</span><span>: </span><a class="type-ref" href="#Disposable">Disposable</a></span>
<div class="details collapse" id="details-2337">
<div class="comment"><p>Subscribes to file change events in the file or folder denoted by <code>uri</code>. For folders,
the option <code>recursive</code> indicates whether subfolders, sub-subfolders, etc. should
be watched for file changes as well. With <code>recursive: false</code>, only changes to the
files that are direct children of the folder should trigger an event.</p>
<p>The <code>excludes</code> array is used to indicate paths that should be excluded from file
watching. It is typically derived from the <code>files.watcherExclude</code> setting that
is configurable by the user. Each entry can be be:</p>
<ul>
<li>the absolute path to exclude</li>
<li>a relative path to exclude (for example <code>build/output</code>)</li>
<li>a simple glob pattern (for example <code>**/build</code>, <code>output/**</code>)</li>
</ul>
<p><em>Note</em> that case-sensitivity of the <a href="#excludes">excludes</a> patterns for built-in file system providers
will depend on the underlying file system: on Windows and macOS the matching will be case-insensitive and
on Linux it will be case-sensitive.</p>
<p>It is the file system provider&#39;s job to call <a href="#FileSystemProvider.onDidChangeFile">onDidChangeFile</a>
for every change given these rules. No event should be emitted for files that match any of the provided
excludes.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the file or folder to be watched.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span>{excludes: readonly <span class="type-intrinsic">string</span>[], recursive: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"><p>Configures the watch.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Disposable">Disposable</a></td><td><div class="comment"><p>A disposable that tells the provider to stop watching the <code>uri</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="FileSystemProvider.writeFile"></a><span class="ts" id=2356 data-target="#details-2356" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">writeFile</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">content</span><span>: </span><span class="type-ref-ts">Uint8Array</span>, <span class="ident">options</span><span>: </span>{create: <span class="type-intrinsic">boolean</span>, overwrite: <span class="type-intrinsic">boolean</span>}<span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2356">
<div class="comment"><p>Write data to a file, replacing its entire contents.</p>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileNotFound">FileNotFound</a> when <code>uri</code> doesn&#39;t exist and <code>create</code> is not set.</li>
</ul>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileNotFound">FileNotFound</a> when the parent of <code>uri</code> doesn&#39;t exist and <code>create</code> is set, e.g. no mkdirp-logic required.</li>
</ul>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.FileExists">FileExists</a> when <code>uri</code> already exists, <code>create</code> is set but <code>overwrite</code> is not set.</li>
</ul>
<ul>
<li><em>throws</em> - <a href="#FileSystemError.NoPermissions">NoPermissions</a> when permissions aren&#39;t sufficient.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the file.</p>
</div></td></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-ref-ts">Uint8Array</span></td><td><div class="comment"><p>The new content of the file.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span>{create: <span class="type-intrinsic">boolean</span>, overwrite: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"><p>Defines if missing files should or must be created.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="FileSystemWatcher"></a><span class="code-item" id=488>FileSystemWatcher</span>



<div class="comment"><p>A file system watcher notifies about changes to files and folders
on disk or from other <a href="#FileSystemProvider">FileSystemProviders</a>.</p>
<p>To get an instance of a <code>FileSystemWatcher</code> use
<a href="#workspace.createFileSystemWatcher">createFileSystemWatcher</a>.</p>
</div>

#### Events



<a name="FileSystemWatcher.onDidChange"></a><span class="ts" id=493 data-target="#details-493" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChange</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</span>
<div class="details collapse" id="details-493">
<div class="comment"><p>An event which fires on file/folder change.</p>
</div>
</div>



<a name="FileSystemWatcher.onDidCreate"></a><span class="ts" id=492 data-target="#details-492" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidCreate</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</span>
<div class="details collapse" id="details-492">
<div class="comment"><p>An event which fires on file/folder creation.</p>
</div>
</div>



<a name="FileSystemWatcher.onDidDelete"></a><span class="ts" id=494 data-target="#details-494" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidDelete</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</span>
<div class="details collapse" id="details-494">
<div class="comment"><p>An event which fires on file/folder deletion.</p>
</div>
</div>

#### Properties



<a name="FileSystemWatcher.ignoreChangeEvents"></a><span class="ts" id=490 data-target="#details-490" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ignoreChangeEvents</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-490">
<div class="comment"><p>true if this file system watcher has been created such that
it ignores change file system events.</p>
</div>
</div>



<a name="FileSystemWatcher.ignoreCreateEvents"></a><span class="ts" id=489 data-target="#details-489" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ignoreCreateEvents</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-489">
<div class="comment"><p>true if this file system watcher has been created such that
it ignores creation file system events.</p>
</div>
</div>



<a name="FileSystemWatcher.ignoreDeleteEvents"></a><span class="ts" id=491 data-target="#details-491" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ignoreDeleteEvents</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-491">
<div class="comment"><p>true if this file system watcher has been created such that
it ignores delete file system events.</p>
</div>
</div>

#### Methods



<a name="FileSystemWatcher.dispose"></a><span class="ts" id=496 data-target="#details-496" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">any</span></span>
<div class="details collapse" id="details-496">
<div class="comment"><p>Dispose this object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">any</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="FileType"></a><span class="code-item" id=2291>FileType</span>



<div class="comment"><p>Enumeration of file types. The types <code>File</code> and <code>Directory</code> can also be
a symbolic links, in that case use <code>FileType.File | FileType.SymbolicLink</code> and
<code>FileType.Directory | FileType.SymbolicLink</code>.</p>
</div>

#### Enumeration Members



<a name="FileType.Unknown"></a><span class="ts" id=2292 data-target="#details-2292" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Unknown</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-2292">
<div class="comment"><p>The file type is unknown.</p>
</div>
</div>



<a name="FileType.File"></a><span class="ts" id=2293 data-target="#details-2293" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">File</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-2293">
<div class="comment"><p>A regular file.</p>
</div>
</div>



<a name="FileType.Directory"></a><span class="ts" id=2294 data-target="#details-2294" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Directory</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-2294">
<div class="comment"><p>A directory.</p>
</div>
</div>



<a name="FileType.SymbolicLink"></a><span class="ts" id=2295 data-target="#details-2295" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SymbolicLink</span><span>: </span><span class="type-literal">64</span></span>
<div class="details collapse" id="details-2295">
<div class="comment"><p>A symbolic link to a file.</p>
</div>
</div>

### <a name="FileWillCreateEvent"></a><span class="code-item" id=3302>FileWillCreateEvent</span>



<div class="comment"><p>An event that is fired when files are going to be created.</p>
<p>To make modifications to the workspace before the files are created,
call the <a href="#FileWillCreateEvent.waitUntil">waitUntil</a>-function with a
thenable that resolves to a <a href="#WorkspaceEdit">workspace edit</a>.</p>
</div>

#### Properties



<a name="FileWillCreateEvent.files"></a><span class="ts" id=3304 data-target="#details-3304" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">files</span><span>: </span>readonly <a class="type-ref" href="#Uri">Uri</a>[]</span>
<div class="details collapse" id="details-3304">
<div class="comment"><p>The files that are going to be created.</p>
</div>
</div>



<a name="FileWillCreateEvent.token"></a><span class="ts" id=3303 data-target="#details-3303" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></span>
<div class="details collapse" id="details-3303">
<div class="comment"><p>A cancellation token.</p>
</div>
</div>

#### Methods



<a name="FileWillCreateEvent.waitUntil"></a><span class="ts" id=3306 data-target="#details-3306" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">waitUntil</span><span>(</span><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3306">
<div class="comment"><p>Allows to pause the event and to apply a <a href="#WorkspaceEdit">workspace edit</a>.</p>
<p><em>Note:</em> This function can only be called during event dispatch and not
in an asynchronous manner:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onWillCreateFiles</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // async, will *throw* an error</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  setTimeout</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(() </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">waitUntil</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">promise</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">));</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // sync, OK</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">waitUntil</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">promise</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a>&gt;</td><td><div class="comment"><p>A thenable that delays saving.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileWillCreateEvent.waitUntil"></a><span class="ts" id=3308 data-target="#details-3308" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">waitUntil</span><span>(</span><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3308">
<div class="comment"><p>Allows to pause the event until the provided thenable resolves.</p>
<p><em>Note:</em> This function can only be called during event dispatch.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;</td><td><div class="comment"><p>A thenable that delays saving.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="FileWillDeleteEvent"></a><span class="code-item" id=3312>FileWillDeleteEvent</span>



<div class="comment"><p>An event that is fired when files are going to be deleted.</p>
<p>To make modifications to the workspace before the files are deleted,
call the <a href="#FileWillCreateEvent.waitUntil"><code>waitUntil</code></a>-function with a
thenable that resolves to a <a href="#WorkspaceEdit">workspace edit</a>.</p>
</div>

#### Properties



<a name="FileWillDeleteEvent.files"></a><span class="ts" id=3314 data-target="#details-3314" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">files</span><span>: </span>readonly <a class="type-ref" href="#Uri">Uri</a>[]</span>
<div class="details collapse" id="details-3314">
<div class="comment"><p>The files that are going to be deleted.</p>
</div>
</div>



<a name="FileWillDeleteEvent.token"></a><span class="ts" id=3313 data-target="#details-3313" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></span>
<div class="details collapse" id="details-3313">
<div class="comment"><p>A cancellation token.</p>
</div>
</div>

#### Methods



<a name="FileWillDeleteEvent.waitUntil"></a><span class="ts" id=3316 data-target="#details-3316" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">waitUntil</span><span>(</span><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3316">
<div class="comment"><p>Allows to pause the event and to apply a <a href="#WorkspaceEdit">workspace edit</a>.</p>
<p><em>Note:</em> This function can only be called during event dispatch and not
in an asynchronous manner:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onWillCreateFiles</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // async, will *throw* an error</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  setTimeout</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(() </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">waitUntil</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">promise</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">));</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // sync, OK</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">waitUntil</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">promise</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a>&gt;</td><td><div class="comment"><p>A thenable that delays saving.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileWillDeleteEvent.waitUntil"></a><span class="ts" id=3318 data-target="#details-3318" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">waitUntil</span><span>(</span><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3318">
<div class="comment"><p>Allows to pause the event until the provided thenable resolves.</p>
<p><em>Note:</em> This function can only be called during event dispatch.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;</td><td><div class="comment"><p>A thenable that delays saving.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="FileWillRenameEvent"></a><span class="code-item" id=3322>FileWillRenameEvent</span>



<div class="comment"><p>An event that is fired when files are going to be renamed.</p>
<p>To make modifications to the workspace before the files are renamed,
call the <a href="#FileWillCreateEvent.waitUntil"><code>waitUntil</code></a>-function with a
thenable that resolves to a <a href="#WorkspaceEdit">workspace edit</a>.</p>
</div>

#### Properties



<a name="FileWillRenameEvent.files"></a><span class="ts" id=3324 data-target="#details-3324" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">files</span><span>: </span>ReadonlyArray&lt;{newUri: <a class="type-ref" href="#Uri">Uri</a>, oldUri: <a class="type-ref" href="#Uri">Uri</a>}&gt;</span>
<div class="details collapse" id="details-3324">
<div class="comment"><p>The files that are going to be renamed.</p>
</div>
</div>



<a name="FileWillRenameEvent.token"></a><span class="ts" id=3323 data-target="#details-3323" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></span>
<div class="details collapse" id="details-3323">
<div class="comment"><p>A cancellation token.</p>
</div>
</div>

#### Methods



<a name="FileWillRenameEvent.waitUntil"></a><span class="ts" id=3329 data-target="#details-3329" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">waitUntil</span><span>(</span><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3329">
<div class="comment"><p>Allows to pause the event and to apply a <a href="#WorkspaceEdit">workspace edit</a>.</p>
<p><em>Note:</em> This function can only be called during event dispatch and not
in an asynchronous manner:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onWillCreateFiles</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // async, will *throw* an error</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  setTimeout</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(() </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">waitUntil</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">promise</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">));</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // sync, OK</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">waitUntil</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">promise</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a>&gt;</td><td><div class="comment"><p>A thenable that delays saving.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="FileWillRenameEvent.waitUntil"></a><span class="ts" id=3331 data-target="#details-3331" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">waitUntil</span><span>(</span><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3331">
<div class="comment"><p>Allows to pause the event until the provided thenable resolves.</p>
<p><em>Note:</em> This function can only be called during event dispatch.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;</td><td><div class="comment"><p>A thenable that delays saving.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="FoldingContext"></a><span class="code-item" id=1448>FoldingContext</span>



<div class="comment"><p>Folding context (for future use)</p>
</div>

### <a name="FoldingRange"></a><span class="code-item" id=1435>FoldingRange</span>



<div class="comment"><p>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.
Invalid ranges will be ignored.</p>
</div>

#### Constructors



<a name="FoldingRange.FoldingRange"></a><span class="ts" id=1437 data-target="#details-1437" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">FoldingRange</span><span>(</span><span class="ident">start</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">end</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#FoldingRangeKind">FoldingRangeKind</a><span>)</span><span>: </span><a class="type-ref" href="#FoldingRange">FoldingRange</a></span>
<div class="details collapse" id="details-1437">
<div class="comment"><p>Creates a new folding range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">start</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The start line of the folded range.</p>
</div></td></tr>
<tr><td><span class="ident">end</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The end line of the folded range.</p>
</div></td></tr>
<tr><td><span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#FoldingRangeKind">FoldingRangeKind</a></td><td><div class="comment"><p>The kind of the folding range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FoldingRange">FoldingRange</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="FoldingRange.end"></a><span class="ts" id=1442 data-target="#details-1442" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">end</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1442">
<div class="comment"><p>The zero-based end line of the range to fold. The folded area ends with the line&#39;s last character.
To be valid, the end must be zero or larger and smaller than the number of lines in the document.</p>
</div>
</div>



<a name="FoldingRange.kind"></a><span class="ts" id=1443 data-target="#details-1443" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#FoldingRangeKind">FoldingRangeKind</a></span>
<div class="details collapse" id="details-1443">
<div class="comment"><p>Describes the <a href="#FoldingRangeKind">Kind</a> of the folding range such as <a href="#FoldingRangeKind.Comment">Comment</a> or
<a href="#FoldingRangeKind.Region">Region</a>. The kind is used to categorize folding ranges and used by commands
like &#39;Fold all comments&#39;. See
<a href="#FoldingRangeKind">FoldingRangeKind</a> for an enumeration of all kinds.
If not set, the range is originated from a syntax element.</p>
</div>
</div>



<a name="FoldingRange.start"></a><span class="ts" id=1441 data-target="#details-1441" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">start</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1441">
<div class="comment"><p>The zero-based start line of the range to fold. The folded area starts after the line&#39;s last character.
To be valid, the end must be zero or larger and smaller than the number of lines in the document.</p>
</div>
</div>

### <a name="FoldingRangeKind"></a><span class="code-item" id=1444>FoldingRangeKind</span>



<div class="comment"><p>An enumeration of specific folding range kinds. The kind is an optional field of a <a href="#FoldingRange">FoldingRange</a>
and is used to distinguish specific folding ranges such as ranges originated from comments. The kind is used by commands like
<code>Fold all comments</code> or <code>Fold all regions</code>.
If the kind is not set on the range, the range originated from a syntax element other than comments, imports or region markers.</p>
</div>

#### Enumeration Members



<a name="FoldingRangeKind.Comment"></a><span class="ts" id=1445 data-target="#details-1445" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Comment</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1445">
<div class="comment"><p>Kind for folding range representing a comment.</p>
</div>
</div>



<a name="FoldingRangeKind.Imports"></a><span class="ts" id=1446 data-target="#details-1446" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Imports</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1446">
<div class="comment"><p>Kind for folding range representing a import.</p>
</div>
</div>



<a name="FoldingRangeKind.Region"></a><span class="ts" id=1447 data-target="#details-1447" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Region</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-1447">
<div class="comment"><p>Kind for folding range representing regions originating from folding markers like <code>#region</code> and <code>#endregion</code>.</p>
</div>
</div>

### <a name="FoldingRangeProvider"></a><span class="code-item" id=1449>FoldingRangeProvider</span>



<div class="comment"><p>The folding range provider interface defines the contract between extensions and
<a href="https://code.visualstudio.com/docs/editor/codebasics#_folding">Folding</a> in the editor.</p>
</div>

#### Events



<a name="FoldingRangeProvider.onDidChangeFoldingRanges"></a><span class="ts" id=1450 data-target="#details-1450" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeFoldingRanges</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-1450">
<div class="comment"><p>An optional event to signal that the folding ranges from this provider have changed.</p>
</div>
</div>

#### Methods



<a name="FoldingRangeProvider.provideFoldingRanges"></a><span class="ts" id=1452 data-target="#details-1452" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideFoldingRanges</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">context</span><span>: </span><a class="type-ref" href="#FoldingContext">FoldingContext</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#FoldingRange">FoldingRange</a>[]&gt;</span>
<div class="details collapse" id="details-1452">
<div class="comment"><p>Returns a list of folding ranges or null and undefined if the provider
does not want to participate or was cancelled.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">context</span><span>: </span><a class="type-ref" href="#FoldingContext">FoldingContext</a></td><td><div class="comment"><p>Additional context information (for future use)</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#FoldingRange">FoldingRange</a>[]&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="FormattingOptions"></a><span class="code-item" id=1154>FormattingOptions</span>



<div class="comment"><p>Value-object describing what options formatting should use.</p>
</div>

#### Properties



<a name="FormattingOptions.insertSpaces"></a><span class="ts" id=1156 data-target="#details-1156" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">insertSpaces</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1156">
<div class="comment"><p>Prefer spaces over tabs.</p>
</div>
</div>



<a name="FormattingOptions.tabSize"></a><span class="ts" id=1155 data-target="#details-1155" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tabSize</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1155">
<div class="comment"><p>Size of a tab in spaces.</p>
</div>
</div>

### <a name="FunctionBreakpoint"></a><span class="code-item" id=4156>FunctionBreakpoint</span>



<div class="comment"><p>A breakpoint specified by a function name.</p>
</div>

#### Constructors



<a name="FunctionBreakpoint.FunctionBreakpoint"></a><span class="ts" id=4158 data-target="#details-4158" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">FunctionBreakpoint</span><span>(</span><span class="ident">functionName</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">enabled</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span>, <span class="ident">condition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">hitCondition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">logMessage</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#FunctionBreakpoint">FunctionBreakpoint</a></span>
<div class="details collapse" id="details-4158">
<div class="comment"><p>Create a new function breakpoint.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">functionName</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">enabled</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">condition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">hitCondition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">logMessage</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#FunctionBreakpoint">FunctionBreakpoint</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="FunctionBreakpoint.condition"></a><span class="ts" id=4167 data-target="#details-4167" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">condition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4167">
<div class="comment"><p>An optional expression for conditional breakpoints.</p>
</div>
</div>



<a name="FunctionBreakpoint.enabled"></a><span class="ts" id=4166 data-target="#details-4166" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">enabled</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4166">
<div class="comment"><p>Is breakpoint enabled.</p>
</div>
</div>



<a name="FunctionBreakpoint.functionName"></a><span class="ts" id=4164 data-target="#details-4164" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">functionName</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4164">
<div class="comment"><p>The name of the function to which this breakpoint is attached.</p>
</div>
</div>



<a name="FunctionBreakpoint.hitCondition"></a><span class="ts" id=4168 data-target="#details-4168" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hitCondition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4168">
<div class="comment"><p>An optional expression that controls how many hits of the breakpoint are ignored.</p>
</div>
</div>



<a name="FunctionBreakpoint.id"></a><span class="ts" id=4165 data-target="#details-4165" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4165">
<div class="comment"><p>The unique ID of the breakpoint.</p>
</div>
</div>



<a name="FunctionBreakpoint.logMessage"></a><span class="ts" id=4169 data-target="#details-4169" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">logMessage</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4169">
<div class="comment"><p>An optional message that gets logged when this breakpoint is hit. Embedded expressions within {} are interpolated by the debug adapter.</p>
</div>
</div>

### <a name="GlobalEnvironmentVariableCollection"></a><span class="code-item" id=3139>GlobalEnvironmentVariableCollection</span>



<div class="comment"><p>A collection of mutations that an extension can apply to a process environment. Applies to all scopes.</p>
</div>

#### Properties



<a name="GlobalEnvironmentVariableCollection.description"></a><span class="ts" id=3144 data-target="#details-3144" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">description</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-3144">
<div class="comment"><p>A description for the environment variable collection, this will be used to describe the
changes in the UI.</p>
</div>
</div>



<a name="GlobalEnvironmentVariableCollection.persistent"></a><span class="ts" id=3143 data-target="#details-3143" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">persistent</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3143">
<div class="comment"><p>Whether the collection should be cached for the workspace and applied to the terminal
across window reloads. When true the collection will be active immediately such when the
window reloads. Additionally, this API will return the cached version if it exists. The
collection will be invalidated when the extension is uninstalled or when the collection
is cleared. Defaults to true.</p>
</div>
</div>

#### Methods



<a name="GlobalEnvironmentVariableCollection.append"></a><span class="ts" id=3151 data-target="#details-3151" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">append</span><span>(</span><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorOptions">EnvironmentVariableMutatorOptions</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3151">
<div class="comment"><p>Append a value to an environment variable.</p>
<p>Note that an extension can only make a single change to any one variable, so this will
overwrite any previous calls to replace, append or prepend.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The variable to append to.</p>
</div></td></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The value to append to the variable.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorOptions">EnvironmentVariableMutatorOptions</a></td><td><div class="comment"><p>Options applied to the mutator, when no options are provided this will
default to <code>{ applyAtProcessCreation: true }</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="GlobalEnvironmentVariableCollection.clear"></a><span class="ts" id=3176 data-target="#details-3176" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">clear</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3176">
<div class="comment"><p>Clears all mutators from this collection.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="GlobalEnvironmentVariableCollection.delete"></a><span class="ts" id=3173 data-target="#details-3173" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">delete</span><span>(</span><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3173">
<div class="comment"><p>Deletes this collection&#39;s mutator for a variable.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The variable to delete the mutator for.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="GlobalEnvironmentVariableCollection.forEach"></a><span class="ts" id=3164 data-target="#details-3164" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">forEach</span><span>(</span><span class="ident">callback</span><span>: </span>(variable: <span class="type-intrinsic">string</span>, mutator: <a class="type-ref" href="#EnvironmentVariableMutator">EnvironmentVariableMutator</a>, collection: <a class="type-ref" href="#EnvironmentVariableCollection">EnvironmentVariableCollection</a>) =&gt; <span class="type-intrinsic">any</span>, <span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3164">
<div class="comment"><p>Iterate over each mutator in this collection.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">callback</span><span>: </span>(variable: <span class="type-intrinsic">string</span>, mutator: <a class="type-ref" href="#EnvironmentVariableMutator">EnvironmentVariableMutator</a>, collection: <a class="type-ref" href="#EnvironmentVariableCollection">EnvironmentVariableCollection</a>) =&gt; <span class="type-intrinsic">any</span></td><td><div class="comment"><p>Function to execute for each entry.</p>
</div></td></tr>
<tr><td><span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>The <code>this</code> context used when invoking the handler function.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="GlobalEnvironmentVariableCollection.get"></a><span class="ts" id=3161 data-target="#details-3161" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">get</span><span>(</span><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutator">EnvironmentVariableMutator</a></span>
<div class="details collapse" id="details-3161">
<div class="comment"><p>Gets the mutator that this collection applies to a variable, if any.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The variable to get the mutator for.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#EnvironmentVariableMutator">EnvironmentVariableMutator</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="GlobalEnvironmentVariableCollection.getScoped"></a><span class="ts" id=3141 data-target="#details-3141" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getScoped</span><span>(</span><span class="ident">scope</span><span>: </span><a class="type-ref" href="#EnvironmentVariableScope">EnvironmentVariableScope</a><span>)</span><span>: </span><a class="type-ref" href="#EnvironmentVariableCollection">EnvironmentVariableCollection</a></span>
<div class="details collapse" id="details-3141">
<div class="comment"><p>Gets scope-specific environment variable collection for the extension. This enables alterations to
terminal environment variables solely within the designated scope, and is applied in addition to (and
after) the global collection.</p>
<p>Each object obtained through this method is isolated and does not impact objects for other scopes,
including the global collection.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">scope</span><span>: </span><a class="type-ref" href="#EnvironmentVariableScope">EnvironmentVariableScope</a></td><td><div class="comment"><p>The scope to which the environment variable collection applies to.</p>
<p>If a scope parameter is omitted, collection applicable to all relevant scopes for that parameter is
returned. For instance, if the &#39;workspaceFolder&#39; parameter is not specified, the collection that applies
across all workspace folders will be returned.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#EnvironmentVariableCollection">EnvironmentVariableCollection</a></td><td><div class="comment"><p>Environment variable collection for the passed in scope.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="GlobalEnvironmentVariableCollection.prepend"></a><span class="ts" id=3156 data-target="#details-3156" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prepend</span><span>(</span><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorOptions">EnvironmentVariableMutatorOptions</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3156">
<div class="comment"><p>Prepend a value to an environment variable.</p>
<p>Note that an extension can only make a single change to any one variable, so this will
overwrite any previous calls to replace, append or prepend.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The variable to prepend.</p>
</div></td></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The value to prepend to the variable.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorOptions">EnvironmentVariableMutatorOptions</a></td><td><div class="comment"><p>Options applied to the mutator, when no options are provided this will
default to <code>{ applyAtProcessCreation: true }</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="GlobalEnvironmentVariableCollection.replace"></a><span class="ts" id=3146 data-target="#details-3146" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">replace</span><span>(</span><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorOptions">EnvironmentVariableMutatorOptions</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3146">
<div class="comment"><p>Replace an environment variable with a value.</p>
<p>Note that an extension can only make a single change to any one variable, so this will
overwrite any previous calls to replace, append or prepend.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">variable</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The variable to replace.</p>
</div></td></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The value to replace the variable with.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#EnvironmentVariableMutatorOptions">EnvironmentVariableMutatorOptions</a></td><td><div class="comment"><p>Options applied to the mutator, when no options are provided this will
default to <code>{ applyAtProcessCreation: true }</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="GlobPattern"></a><span class="code-item" id=581>GlobPattern</span>



<div class="comment"><p>A file glob pattern to match file paths against. This can either be a glob pattern string
(like <code>**/*.{ts,js}</code> or <code>*.{ts,js}</code>) or a <a href="#RelativePattern">relative pattern</a>.</p>
<p>Glob patterns can have the following syntax:</p>
<ul>
<li><code>*</code> to match zero or more characters in a path segment</li>
<li><code>?</code> to match on one character in a path segment</li>
<li><code>**</code> to match any number of path segments, including none</li>
<li><code>{}</code> to group conditions (e.g. <code>**/*.{ts,js}</code> matches all TypeScript and JavaScript files)</li>
<li><code>[]</code> to declare a range of characters to match in a path segment (e.g., <code>example.[0-9]</code> to match on <code>example.0</code>, <code>example.1</code>, …)</li>
<li><code>[!...]</code> to negate a range of characters to match in a path segment (e.g., <code>example.[!0-9]</code> to match on <code>example.a</code>, <code>example.b</code>, but not <code>example.0</code>)</li>
</ul>
<p>Note: a backslash (``) is not valid within a glob pattern. If you have an existing file
path to match against, consider to use the <a href="#RelativePattern">relative pattern</a> support
that takes care of converting any backslash into slash. Otherwise, make sure to convert
any backslash to slash when creating the glob pattern.</p>
</div>



<a name="GlobPattern"></a><span class="ts" id=581 data-target="#details-581" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">GlobPattern</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#RelativePattern">RelativePattern</a></span>

### <a name="Hover"></a><span class="code-item" id=726>Hover</span>



<div class="comment"><p>A hover represents additional information for a symbol or word. Hovers are
rendered in a tooltip-like widget.</p>
</div>

#### Constructors



<a name="Hover.Hover"></a><span class="ts" id=728 data-target="#details-728" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Hover</span><span>(</span><span class="ident">contents</span><span>: </span><a class="type-ref" href="#MarkdownString">MarkdownString</a> &#124; <a class="type-ref" href="#MarkedString">MarkedString</a> &#124; Array&lt;<span class="type-unknown">MarkdownString | MarkedString</span>&gt;, <span class="ident">range</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a><span>)</span><span>: </span><a class="type-ref" href="#Hover">Hover</a></span>
<div class="details collapse" id="details-728">
<div class="comment"><p>Creates a new hover object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">contents</span><span>: </span><a class="type-ref" href="#MarkdownString">MarkdownString</a> &#124; <a class="type-ref" href="#MarkedString">MarkedString</a> &#124; Array&lt;<span class="type-unknown">MarkdownString | MarkedString</span>&gt;</td><td><div class="comment"><p>The contents of the hover.</p>
</div></td></tr>
<tr><td><span class="ident">range</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range to which the hover applies.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Hover">Hover</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="Hover.contents"></a><span class="ts" id=731 data-target="#details-731" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contents</span><span>: </span>Array&lt;<a class="type-ref" href="#MarkdownString">MarkdownString</a> &#124; <a class="type-ref" href="#MarkedString">MarkedString</a>&gt;</span>
<div class="details collapse" id="details-731">
<div class="comment"><p>The contents of this hover.</p>
</div>
</div>



<a name="Hover.range"></a><span class="ts" id=732 data-target="#details-732" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-732">
<div class="comment"><p>The range to which this hover applies. When missing, the
editor will use the range at the current position or the
current position itself.</p>
</div>
</div>

### <a name="HoverProvider"></a><span class="code-item" id=733>HoverProvider</span>



<div class="comment"><p>The hover provider interface defines the contract between extensions and
the <a href="https://code.visualstudio.com/docs/editor/intellisense">hover</a>-feature.</p>
</div>

#### Methods



<a name="HoverProvider.provideHover"></a><span class="ts" id=735 data-target="#details-735" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideHover</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Hover">Hover</a>&gt;</span>
<div class="details collapse" id="details-735">
<div class="comment"><p>Provide a hover for the given position and document. Multiple hovers at the same
position will be merged by the editor. A hover can have a range which defaults
to the word range at the position when omitted.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Hover">Hover</a>&gt;</td><td><div class="comment"><p>A hover or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="IconPath"></a><span class="code-item" id=252>IconPath</span>



<div class="comment"><p>Represents an icon in the UI. This is either an uri, separate uris for the light- and dark-themes,
or a <a href="#ThemeIcon">theme icon</a>.</p>
</div>



<a name="IconPath"></a><span class="ts" id=252 data-target="#details-252" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">IconPath</span><span>: </span><a class="type-ref" href="#Uri">Uri</a> &#124; {dark: <a class="type-ref" href="#Uri">Uri</a>, light: <a class="type-ref" href="#Uri">Uri</a>} &#124; <a class="type-ref" href="#ThemeIcon">ThemeIcon</a></span>

### <a name="ImplementationProvider"></a><span class="code-item" id=681>ImplementationProvider</span>



<div class="comment"><p>The implementation provider interface defines the contract between extensions and
the go to implementation feature.</p>
</div>

#### Methods



<a name="ImplementationProvider.provideImplementation"></a><span class="ts" id=683 data-target="#details-683" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideImplementation</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Definition">Definition</a> &#124; <a class="type-ref" href="#LocationLink">LocationLink</a>[]&gt;</span>
<div class="details collapse" id="details-683">
<div class="comment"><p>Provide the implementations of the symbol at the given position and document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Definition">Definition</a> &#124; <a class="type-ref" href="#LocationLink">LocationLink</a>[]&gt;</td><td><div class="comment"><p>A definition or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="IndentAction"></a><span class="code-item" id=1651>IndentAction</span>



<div class="comment"><p>Describes what to do with the indentation when pressing Enter.</p>
</div>

#### Enumeration Members



<a name="IndentAction.None"></a><span class="ts" id=1652 data-target="#details-1652" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">None</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-1652">
<div class="comment"><p>Insert new line and copy the previous line&#39;s indentation.</p>
</div>
</div>



<a name="IndentAction.Indent"></a><span class="ts" id=1653 data-target="#details-1653" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Indent</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1653">
<div class="comment"><p>Insert new line and indent once (relative to the previous line&#39;s indentation).</p>
</div>
</div>



<a name="IndentAction.IndentOutdent"></a><span class="ts" id=1654 data-target="#details-1654" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">IndentOutdent</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1654">
<div class="comment"><p>Insert two new lines:</p>
<ul>
<li>the first one indented which will hold the cursor</li>
<li>the second one at the same indentation level</li>
</ul>
</div>
</div>



<a name="IndentAction.Outdent"></a><span class="ts" id=1655 data-target="#details-1655" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Outdent</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-1655">
<div class="comment"><p>Insert new line and outdent once (relative to the previous line&#39;s indentation).</p>
</div>
</div>

### <a name="IndentationRule"></a><span class="code-item" id=1646>IndentationRule</span>



<div class="comment"><p>Describes indentation rules for a language.</p>
</div>

#### Properties



<a name="IndentationRule.decreaseIndentPattern"></a><span class="ts" id=1647 data-target="#details-1647" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">decreaseIndentPattern</span><span>: </span><span class="type-ref-ts">RegExp</span></span>
<div class="details collapse" id="details-1647">
<div class="comment"><p>If a line matches this pattern, then all the lines after it should be unindented once (until another rule matches).</p>
</div>
</div>



<a name="IndentationRule.increaseIndentPattern"></a><span class="ts" id=1648 data-target="#details-1648" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">increaseIndentPattern</span><span>: </span><span class="type-ref-ts">RegExp</span></span>
<div class="details collapse" id="details-1648">
<div class="comment"><p>If a line matches this pattern, then all the lines after it should be indented once (until another rule matches).</p>
</div>
</div>



<a name="IndentationRule.indentNextLinePattern"></a><span class="ts" id=1649 data-target="#details-1649" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">indentNextLinePattern</span><span>?</span><span>: </span><span class="type-ref-ts">RegExp</span></span>
<div class="details collapse" id="details-1649">
<div class="comment"><p>If a line matches this pattern, then <strong>only the next line</strong> after it should be indented once.</p>
</div>
</div>



<a name="IndentationRule.unIndentedLinePattern"></a><span class="ts" id=1650 data-target="#details-1650" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">unIndentedLinePattern</span><span>?</span><span>: </span><span class="type-ref-ts">RegExp</span></span>
<div class="details collapse" id="details-1650">
<div class="comment"><p>If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules.</p>
</div>
</div>

### <a name="InlayHint"></a><span class="code-item" id=1410>InlayHint</span>



<div class="comment"><p>Inlay hint information.</p>
</div>

#### Constructors



<a name="InlayHint.InlayHint"></a><span class="ts" id=1412 data-target="#details-1412" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">InlayHint</span><span>(</span><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#InlayHintLabelPart">InlayHintLabelPart</a>[], <span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#InlayHintKind">InlayHintKind</a><span>)</span><span>: </span><a class="type-ref" href="#InlayHint">InlayHint</a></span>
<div class="details collapse" id="details-1412">
<div class="comment"><p>Creates a new inlay hint.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position of the hint.</p>
</div></td></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#InlayHintLabelPart">InlayHintLabelPart</a>[]</td><td><div class="comment"><p>The label of the hint.</p>
</div></td></tr>
<tr><td><span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#InlayHintKind">InlayHintKind</a></td><td><div class="comment"><p>The <a href="#InlayHintKind">kind</a> of the hint.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#InlayHint">InlayHint</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="InlayHint.kind"></a><span class="ts" id=1419 data-target="#details-1419" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#InlayHintKind">InlayHintKind</a></span>
<div class="details collapse" id="details-1419">
<div class="comment"><p>The kind of this hint. The inlay hint kind defines the appearance of this inlay hint.</p>
</div>
</div>



<a name="InlayHint.label"></a><span class="ts" id=1417 data-target="#details-1417" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#InlayHintLabelPart">InlayHintLabelPart</a>[]</span>
<div class="details collapse" id="details-1417">
<div class="comment"><p>The label of this hint. A human readable string or an array of <a href="#InlayHintLabelPart">label parts</a>.</p>
<p><em>Note</em> that neither the string nor the label part can be empty.</p>
</div>
</div>



<a name="InlayHint.paddingLeft"></a><span class="ts" id=1421 data-target="#details-1421" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">paddingLeft</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1421">
<div class="comment"><p>Render padding before the hint. Padding will use the editor&#39;s background color,
not the background color of the hint itself. That means padding can be used to visually
align/separate an inlay hint.</p>
</div>
</div>



<a name="InlayHint.paddingRight"></a><span class="ts" id=1422 data-target="#details-1422" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">paddingRight</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1422">
<div class="comment"><p>Render padding after the hint. Padding will use the editor&#39;s background color,
not the background color of the hint itself. That means padding can be used to visually
align/separate an inlay hint.</p>
</div>
</div>



<a name="InlayHint.position"></a><span class="ts" id=1416 data-target="#details-1416" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-1416">
<div class="comment"><p>The position of this hint.</p>
<p>If multiple hints have the same position, they will be shown in the order
they appear in the results.</p>
</div>
</div>



<a name="InlayHint.textEdits"></a><span class="ts" id=1420 data-target="#details-1420" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">textEdits</span><span>?</span><span>: </span><a class="type-ref" href="#TextEdit">TextEdit</a>[]</span>
<div class="details collapse" id="details-1420">
<div class="comment"><p>Optional <a href="#TextEdit">text edits</a> that are performed when accepting this inlay hint. The default
gesture for accepting an inlay hint is the double click.</p>
<p><em>Note</em> that edits are expected to change the document so that the inlay hint (or its nearest variant) is
now part of the document and the inlay hint itself is now obsolete.</p>
<p><em>Note</em> that this property can be set late during
<a href="#InlayHintsProvider.resolveInlayHint">resolving</a> of inlay hints.</p>
</div>
</div>



<a name="InlayHint.tooltip"></a><span class="ts" id=1418 data-target="#details-1418" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-1418">
<div class="comment"><p>The tooltip text when you hover over this item.</p>
<p><em>Note</em> that this property can be set late during
<a href="#InlayHintsProvider.resolveInlayHint">resolving</a> of inlay hints.</p>
</div>
</div>

### <a name="InlayHintKind"></a><span class="code-item" id=1399>InlayHintKind</span>



<div class="comment"><p>Inlay hint kinds.</p>
<p>The kind of an inline hint defines its appearance, e.g the corresponding foreground and background colors are being
used.</p>
</div>

#### Enumeration Members



<a name="InlayHintKind.Type"></a><span class="ts" id=1400 data-target="#details-1400" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Type</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1400">
<div class="comment"><p>An inlay hint that is for a type annotation.</p>
</div>
</div>



<a name="InlayHintKind.Parameter"></a><span class="ts" id=1401 data-target="#details-1401" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Parameter</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1401">
<div class="comment"><p>An inlay hint that is for a parameter.</p>
</div>
</div>

### <a name="InlayHintLabelPart"></a><span class="code-item" id=1402>InlayHintLabelPart</span>



<div class="comment"><p>An inlay hint label part allows for interactive and composite labels of inlay hints.</p>
</div>

#### Constructors



<a name="InlayHintLabelPart.InlayHintLabelPart"></a><span class="ts" id=1404 data-target="#details-1404" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">InlayHintLabelPart</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#InlayHintLabelPart">InlayHintLabelPart</a></span>
<div class="details collapse" id="details-1404">
<div class="comment"><p>Creates a new inlay hint label part.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The value of the part.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#InlayHintLabelPart">InlayHintLabelPart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="InlayHintLabelPart.command"></a><span class="ts" id=1409 data-target="#details-1409" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>?</span><span>: </span><a class="type-ref" href="#Command">Command</a></span>
<div class="details collapse" id="details-1409">
<div class="comment"><p>An optional command for this label part.</p>
<p>The editor renders parts with commands as clickable links. The command is added to the context menu
when a label part defines <a href="#InlayHintLabelPart.location">location</a> and <a href="#InlayHintLabelPart.command">command</a> .</p>
<p><em>Note</em> that this property can be set late during
<a href="#InlayHintsProvider.resolveInlayHint">resolving</a> of inlay hints.</p>
</div>
</div>



<a name="InlayHintLabelPart.location"></a><span class="ts" id=1408 data-target="#details-1408" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">location</span><span>?</span><span>: </span><a class="type-ref" href="#Location">Location</a></span>
<div class="details collapse" id="details-1408">
<div class="comment"><p>An optional <a href="#Location">source code location</a> that represents this label
part.</p>
<p>The editor will use this location for the hover and for code navigation features: This
part will become a clickable link that resolves to the definition of the symbol at the
given location (not necessarily the location itself), it shows the hover that shows at
the given location, and it shows a context menu with further code navigation commands.</p>
<p><em>Note</em> that this property can be set late during
<a href="#InlayHintsProvider.resolveInlayHint">resolving</a> of inlay hints.</p>
</div>
</div>



<a name="InlayHintLabelPart.tooltip"></a><span class="ts" id=1407 data-target="#details-1407" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-1407">
<div class="comment"><p>The tooltip text when you hover over this label part.</p>
<p><em>Note</em> that this property can be set late during
<a href="#InlayHintsProvider.resolveInlayHint">resolving</a> of inlay hints.</p>
</div>
</div>



<a name="InlayHintLabelPart.value"></a><span class="ts" id=1406 data-target="#details-1406" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1406">
<div class="comment"><p>The value of this label part.</p>
</div>
</div>

### <a name="InlayHintsProvider"></a><span class="code-item" id=1423>InlayHintsProvider&lt;T&gt;</span>



<div class="comment"><p>The inlay hints provider interface defines the contract between extensions and
the inlay hints feature.</p>
</div>

#### Events



<a name="InlayHintsProvider.onDidChangeInlayHints"></a><span class="ts" id=1425 data-target="#details-1425" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeInlayHints</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-1425">
<div class="comment"><p>An optional event to signal that inlay hints from this provider have changed.</p>
</div>
</div>

#### Methods



<a name="InlayHintsProvider.provideInlayHints"></a><span class="ts" id=1427 data-target="#details-1427" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideInlayHints</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-1427">
<div class="comment"><p>Provide inlay hints for the given range and document.</p>
<p><em>Note</em> that inlay hints that are not <a href="#Range.contains">contained</a> by the given range are ignored.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range for which inlay hints should be computed.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>An array of inlay hints or a thenable that resolves to such.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="InlayHintsProvider.resolveInlayHint"></a><span class="ts" id=1432 data-target="#details-1432" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveInlayHint</span><span>(</span><span class="ident">hint</span><span>: </span><span class="type-ref">T</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-1432">
<div class="comment"><p>Given an inlay hint fill in <a href="#InlayHint.tooltip">tooltip</a>, <a href="#InlayHint.textEdits">text edits</a>,
or complete label <a href="#InlayHintLabelPart">parts</a>.</p>
<p><em>Note</em> that the editor will resolve an inlay hint at most once.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">hint</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>An inlay hint.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>The resolved inlay hint or a thenable that resolves to such. It is OK to return the given <code>item</code>. When no result is returned, the given <code>item</code> will be used.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="InlineCompletionContext"></a><span class="code-item" id=1324>InlineCompletionContext</span>



<div class="comment"><p>Provides information about the context in which an inline completion was requested.</p>
</div>

#### Properties



<a name="InlineCompletionContext.selectedCompletionInfo"></a><span class="ts" id=1326 data-target="#details-1326" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selectedCompletionInfo</span><span>: </span><a class="type-ref" href="#SelectedCompletionInfo">SelectedCompletionInfo</a></span>
<div class="details collapse" id="details-1326">
<div class="comment"><p>Provides information about the currently selected item in the autocomplete widget if it is visible.</p>
<p>If set, provided inline completions must extend the text of the selected item
and use the same range, otherwise they are not shown as preview.
As an example, if the document text is <code>console.</code> and the selected item is <code>.log</code> replacing the <code>.</code> in the document,
the inline completion must also replace <code>.</code> and start with <code>.log</code>, for example <code>.log()</code>.</p>
<p>Inline completion providers are requested again whenever the selected item changes.</p>
</div>
</div>



<a name="InlineCompletionContext.triggerKind"></a><span class="ts" id=1325 data-target="#details-1325" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">triggerKind</span><span>: </span><a class="type-ref" href="#InlineCompletionTriggerKind">InlineCompletionTriggerKind</a></span>
<div class="details collapse" id="details-1325">
<div class="comment"><p>Describes how the inline completion was triggered.</p>
</div>
</div>

### <a name="InlineCompletionItem"></a><span class="code-item" id=1333>InlineCompletionItem</span>



<div class="comment"><p>An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.</p>
<p><em>See also</em>
<a href="#InlineCompletionItemProvider.provideInlineCompletionItems">InlineCompletionItemProvider.provideInlineCompletionItems</a></p>
</div>

#### Constructors



<a name="InlineCompletionItem.InlineCompletionItem"></a><span class="ts" id=1335 data-target="#details-1335" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">InlineCompletionItem</span><span>(</span><span class="ident">insertText</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#SnippetString">SnippetString</a>, <span class="ident">range</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">command</span><span>?</span><span>: </span><a class="type-ref" href="#Command">Command</a><span>)</span><span>: </span><a class="type-ref" href="#InlineCompletionItem">InlineCompletionItem</a></span>
<div class="details collapse" id="details-1335">
<div class="comment"><p>Creates a new inline completion item.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">insertText</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#SnippetString">SnippetString</a></td><td><div class="comment"><p>The text to replace the range with.</p>
</div></td></tr>
<tr><td><span class="ident">range</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range to replace. If not set, the word at the requested position will be used.</p>
</div></td></tr>
<tr><td><span class="ident">command</span><span>?</span><span>: </span><a class="type-ref" href="#Command">Command</a></td><td><div class="comment"><p>An optional <a href="#Command">Command</a> that is executed <em>after</em> inserting this completion.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#InlineCompletionItem">InlineCompletionItem</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="InlineCompletionItem.command"></a><span class="ts" id=1342 data-target="#details-1342" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>?</span><span>: </span><a class="type-ref" href="#Command">Command</a></span>
<div class="details collapse" id="details-1342">
<div class="comment"><p>An optional <a href="#Command">Command</a> that is executed <em>after</em> inserting this completion.</p>
</div>
</div>



<a name="InlineCompletionItem.filterText"></a><span class="ts" id=1340 data-target="#details-1340" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">filterText</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1340">
<div class="comment"><p>A text that is used to decide if this inline completion should be shown. When <code>falsy</code>
the <a href="#InlineCompletionItem.insertText">InlineCompletionItem.insertText</a> is used.</p>
<p>An inline completion is shown if the text to replace is a prefix of the filter text.</p>
</div>
</div>



<a name="InlineCompletionItem.insertText"></a><span class="ts" id=1339 data-target="#details-1339" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">insertText</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#SnippetString">SnippetString</a></span>
<div class="details collapse" id="details-1339">
<div class="comment"><p>The text to replace the range with. Must be set.
Is used both for the preview and the accept operation.</p>
</div>
</div>



<a name="InlineCompletionItem.range"></a><span class="ts" id=1341 data-target="#details-1341" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1341">
<div class="comment"><p>The range to replace.
Must begin and end on the same line.</p>
<p>Prefer replacements over insertions to provide a better experience when the user deletes typed text.</p>
</div>
</div>

### <a name="InlineCompletionItemProvider"></a><span class="code-item" id=1312>InlineCompletionItemProvider</span>



<div class="comment"><p>The inline completion item provider interface defines the contract between extensions and
the inline completion feature.</p>
<p>Providers are asked for completions either explicitly by a user gesture or implicitly when typing.</p>
</div>

#### Methods



<a name="InlineCompletionItemProvider.provideInlineCompletionItems"></a><span class="ts" id=1314 data-target="#details-1314" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideInlineCompletionItems</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">context</span><span>: </span><a class="type-ref" href="#InlineCompletionContext">InlineCompletionContext</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#InlineCompletionList">InlineCompletionList</a> &#124; <a class="type-ref" href="#InlineCompletionItem">InlineCompletionItem</a>[]&gt;</span>
<div class="details collapse" id="details-1314">
<div class="comment"><p>Provides inline completion items for the given position and document.
If inline completions are enabled, this method will be called whenever the user stopped typing.
It will also be called when the user explicitly triggers inline completions or explicitly asks for the next or previous inline completion.
In that case, all available inline completions should be returned.
<code>context.triggerKind</code> can be used to distinguish between these scenarios.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document inline completions are requested for.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position inline completions are requested for.</p>
</div></td></tr>
<tr><td><span class="ident">context</span><span>: </span><a class="type-ref" href="#InlineCompletionContext">InlineCompletionContext</a></td><td><div class="comment"><p>A context object with additional information.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#InlineCompletionList">InlineCompletionList</a> &#124; <a class="type-ref" href="#InlineCompletionItem">InlineCompletionItem</a>[]&gt;</td><td><div class="comment"><p>An array of completion items or a thenable that resolves to an array of completion items.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="InlineCompletionList"></a><span class="code-item" id=1319>InlineCompletionList</span>



<div class="comment"><p>Represents a collection of <a href="#InlineCompletionItem">inline completion items</a> to be presented
in the editor.</p>
</div>

#### Constructors



<a name="InlineCompletionList.InlineCompletionList"></a><span class="ts" id=1321 data-target="#details-1321" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">InlineCompletionList</span><span>(</span><span class="ident">items</span><span>: </span><a class="type-ref" href="#InlineCompletionItem">InlineCompletionItem</a>[]<span>)</span><span>: </span><a class="type-ref" href="#InlineCompletionList">InlineCompletionList</a></span>
<div class="details collapse" id="details-1321">
<div class="comment"><p>Creates a new list of inline completion items.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">items</span><span>: </span><a class="type-ref" href="#InlineCompletionItem">InlineCompletionItem</a>[]</td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#InlineCompletionList">InlineCompletionList</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="InlineCompletionList.items"></a><span class="ts" id=1323 data-target="#details-1323" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">items</span><span>: </span><a class="type-ref" href="#InlineCompletionItem">InlineCompletionItem</a>[]</span>
<div class="details collapse" id="details-1323">
<div class="comment"><p>The inline completion items.</p>
</div>
</div>

### <a name="InlineCompletionTriggerKind"></a><span class="code-item" id=1330>InlineCompletionTriggerKind</span>



<div class="comment"><p>Describes how an <a href="#InlineCompletionItemProvider">inline completion provider</a> was triggered.</p>
</div>

#### Enumeration Members



<a name="InlineCompletionTriggerKind.Invoke"></a><span class="ts" id=1331 data-target="#details-1331" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Invoke</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-1331">
<div class="comment"><p>Completion was triggered explicitly by a user gesture.
Return multiple completion items to enable cycling through them.</p>
</div>
</div>



<a name="InlineCompletionTriggerKind.Automatic"></a><span class="ts" id=1332 data-target="#details-1332" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Automatic</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1332">
<div class="comment"><p>Completion was triggered automatically while editing.
It is sufficient to return a single completion item in this case.</p>
</div>
</div>

### <a name="InlineValue"></a><span class="code-item" id=775>InlineValue</span>



<div class="comment"><p>Inline value information can be provided by different means:</p>
<ul>
<li>directly as a text value (class InlineValueText).</li>
<li>as a name to use for a variable lookup (class InlineValueVariableLookup)</li>
<li>as an evaluatable expression (class InlineValueEvaluatableExpression)
The InlineValue types combines all inline value types into one type.</li>
</ul>
</div>



<a name="InlineValue"></a><span class="ts" id=775 data-target="#details-775" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">InlineValue</span><span>: </span><a class="type-ref" href="#InlineValueText">InlineValueText</a> &#124; <a class="type-ref" href="#InlineValueVariableLookup">InlineValueVariableLookup</a> &#124; <a class="type-ref" href="#InlineValueEvaluatableExpression">InlineValueEvaluatableExpression</a></span>

### <a name="InlineValueContext"></a><span class="code-item" id=776>InlineValueContext</span>



<div class="comment"><p>A value-object that contains contextual information when requesting inline values from a InlineValuesProvider.</p>
</div>

#### Properties



<a name="InlineValueContext.frameId"></a><span class="ts" id=777 data-target="#details-777" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">frameId</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-777">
<div class="comment"><p>The stack frame (as a DAP Id) where the execution has stopped.</p>
</div>
</div>



<a name="InlineValueContext.stoppedLocation"></a><span class="ts" id=778 data-target="#details-778" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">stoppedLocation</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-778">
<div class="comment"><p>The document range where execution has stopped.
Typically the end position of the range denotes the line where the inline values are shown.</p>
</div>
</div>

### <a name="InlineValueEvaluatableExpression"></a><span class="code-item" id=768>InlineValueEvaluatableExpression</span>



<div class="comment"><p>Provide an inline value through an expression evaluation.
If only a range is specified, the expression will be extracted from the underlying document.
An optional expression can be used to override the extracted expression.</p>
</div>

#### Constructors



<a name="InlineValueEvaluatableExpression.InlineValueEvaluatableExpression"></a><span class="ts" id=770 data-target="#details-770" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">InlineValueEvaluatableExpression</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">expression</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#InlineValueEvaluatableExpression">InlineValueEvaluatableExpression</a></span>
<div class="details collapse" id="details-770">
<div class="comment"><p>Creates a new InlineValueEvaluatableExpression object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range in the underlying document from which the evaluatable expression is extracted.</p>
</div></td></tr>
<tr><td><span class="ident">expression</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>If specified overrides the extracted expression.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#InlineValueEvaluatableExpression">InlineValueEvaluatableExpression</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="InlineValueEvaluatableExpression.expression"></a><span class="ts" id=774 data-target="#details-774" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">expression</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-774">
<div class="comment"><p>If specified the expression overrides the extracted expression.</p>
</div>
</div>



<a name="InlineValueEvaluatableExpression.range"></a><span class="ts" id=773 data-target="#details-773" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-773">
<div class="comment"><p>The document range for which the inline value applies.
The range is used to extract the evaluatable expression from the underlying document.</p>
</div>
</div>

### <a name="InlineValuesProvider"></a><span class="code-item" id=779>InlineValuesProvider</span>



<div class="comment"><p>The inline values provider interface defines the contract between extensions and the editor&#39;s debugger inline values feature.
In this contract the provider returns inline value information for a given document range
and the editor shows this information in the editor at the end of lines.</p>
</div>

#### Events



<a name="InlineValuesProvider.onDidChangeInlineValues"></a><span class="ts" id=780 data-target="#details-780" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeInlineValues</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-780">
<div class="comment"><p>An optional event to signal that inline values have changed.</p>
<p><em>See also</em>
<a href="#EventEmitter">EventEmitter</a></p>
</div>
</div>

#### Methods



<a name="InlineValuesProvider.provideInlineValues"></a><span class="ts" id=782 data-target="#details-782" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideInlineValues</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">viewPort</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">context</span><span>: </span><a class="type-ref" href="#InlineValueContext">InlineValueContext</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#InlineValue">InlineValue</a>[]&gt;</span>
<div class="details collapse" id="details-782">
<div class="comment"><p>Provide &quot;inline value&quot; information for a given document and range.
The editor calls this method whenever debugging stops in the given document.
The returned inline values information is rendered in the editor at the end of lines.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document for which the inline values information is needed.</p>
</div></td></tr>
<tr><td><span class="ident">viewPort</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The visible document range for which inline values should be computed.</p>
</div></td></tr>
<tr><td><span class="ident">context</span><span>: </span><a class="type-ref" href="#InlineValueContext">InlineValueContext</a></td><td><div class="comment"><p>A bag containing contextual information like the current location.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#InlineValue">InlineValue</a>[]&gt;</td><td><div class="comment"><p>An array of InlineValueDescriptors or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="InlineValueText"></a><span class="code-item" id=752>InlineValueText</span>



<div class="comment"><p>Provide inline value as text.</p>
</div>

#### Constructors



<a name="InlineValueText.InlineValueText"></a><span class="ts" id=754 data-target="#details-754" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">InlineValueText</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#InlineValueText">InlineValueText</a></span>
<div class="details collapse" id="details-754">
<div class="comment"><p>Creates a new InlineValueText object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The document line where to show the inline value.</p>
</div></td></tr>
<tr><td><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The value to be shown for the line.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#InlineValueText">InlineValueText</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="InlineValueText.range"></a><span class="ts" id=757 data-target="#details-757" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-757">
<div class="comment"><p>The document range for which the inline value applies.</p>
</div>
</div>



<a name="InlineValueText.text"></a><span class="ts" id=758 data-target="#details-758" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-758">
<div class="comment"><p>The text of the inline value.</p>
</div>
</div>

### <a name="InlineValueVariableLookup"></a><span class="code-item" id=759>InlineValueVariableLookup</span>



<div class="comment"><p>Provide inline value through a variable lookup.
If only a range is specified, the variable name will be extracted from the underlying document.
An optional variable name can be used to override the extracted name.</p>
</div>

#### Constructors



<a name="InlineValueVariableLookup.InlineValueVariableLookup"></a><span class="ts" id=761 data-target="#details-761" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">InlineValueVariableLookup</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">variableName</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">caseSensitiveLookup</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><a class="type-ref" href="#InlineValueVariableLookup">InlineValueVariableLookup</a></span>
<div class="details collapse" id="details-761">
<div class="comment"><p>Creates a new InlineValueVariableLookup object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The document line where to show the inline value.</p>
</div></td></tr>
<tr><td><span class="ident">variableName</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The name of the variable to look up.</p>
</div></td></tr>
<tr><td><span class="ident">caseSensitiveLookup</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>How to perform the lookup. If missing lookup is case sensitive.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#InlineValueVariableLookup">InlineValueVariableLookup</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="InlineValueVariableLookup.caseSensitiveLookup"></a><span class="ts" id=767 data-target="#details-767" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">caseSensitiveLookup</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-767">
<div class="comment"><p>How to perform the lookup.</p>
</div>
</div>



<a name="InlineValueVariableLookup.range"></a><span class="ts" id=765 data-target="#details-765" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-765">
<div class="comment"><p>The document range for which the inline value applies.
The range is used to extract the variable name from the underlying document.</p>
</div>
</div>



<a name="InlineValueVariableLookup.variableName"></a><span class="ts" id=766 data-target="#details-766" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">variableName</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-766">
<div class="comment"><p>If specified the name of the variable to look up.</p>
</div>
</div>

### <a name="InputBox"></a><span class="code-item" id=3235>InputBox</span>



<div class="comment"><p>A concrete <a href="#QuickInput">QuickInput</a> to let the user input a text value.</p>
<p>Note that in many cases the more convenient <a href="#window.showInputBox">window.showInputBox</a> is easier to use.
<a href="#window.createInputBox">window.createInputBox</a> should be used when <a href="#window.showInputBox">window.showInputBox</a> does not offer
the required flexibility.</p>
</div>

#### Events



<a name="InputBox.onDidAccept"></a><span class="ts" id=3241 data-target="#details-3241" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidAccept</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3241">
<div class="comment"><p>An event signaling when the user indicated acceptance of the input value.</p>
</div>
</div>



<a name="InputBox.onDidChangeValue"></a><span class="ts" id=3240 data-target="#details-3240" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeValue</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-3240">
<div class="comment"><p>An event signaling when the value has changed.</p>
</div>
</div>



<a name="InputBox.onDidHide"></a><span class="ts" id=3256 data-target="#details-3256" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidHide</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3256">
<div class="comment"><p>An event signaling when this input UI is hidden.</p>
<p>There are several reasons why this UI might have to be hidden and the extension will be notified
through <a href="#QuickInput.onDidHide">onDidHide</a>. Examples include: an explicit call to
<a href="#QuickInput.hide">hide</a>, the user pressing Esc, some other input UI opening, etc.</p>
</div>
</div>



<a name="InputBox.onDidTriggerButton"></a><span class="ts" id=3243 data-target="#details-3243" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidTriggerButton</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#QuickInputButton">QuickInputButton</a>&gt;</span>
<div class="details collapse" id="details-3243">
<div class="comment"><p>An event signaling when a button was triggered.</p>
</div>
</div>

#### Properties



<a name="InputBox.busy"></a><span class="ts" id=3250 data-target="#details-3250" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">busy</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3250">
<div class="comment"><p>Determines if the UI should show a progress indicator. Defaults to <code>false</code>.</p>
<p>Change this to <code>true</code>, for example, while loading more data or validating user input.</p>
</div>
</div>



<a name="InputBox.buttons"></a><span class="ts" id=3242 data-target="#details-3242" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">buttons</span><span>: </span>readonly <a class="type-ref" href="#QuickInputButton">QuickInputButton</a>[]</span>
<div class="details collapse" id="details-3242">
<div class="comment"><p>Buttons for actions in the UI.</p>
</div>
</div>



<a name="InputBox.enabled"></a><span class="ts" id=3249 data-target="#details-3249" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">enabled</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3249">
<div class="comment"><p>Determines if the UI should allow for user input. Defaults to <code>true</code>.</p>
<p>Change this to <code>false</code>, for example, while validating user input or loading data for the next
step in user input.</p>
</div>
</div>



<a name="InputBox.ignoreFocusOut"></a><span class="ts" id=3251 data-target="#details-3251" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ignoreFocusOut</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3251">
<div class="comment"><p>Determines if the UI should stay open even when losing UI focus. Defaults to <code>false</code>.
This setting is ignored on iPad and is always <code>false</code>.</p>
</div>
</div>



<a name="InputBox.password"></a><span class="ts" id=3239 data-target="#details-3239" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">password</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3239">
<div class="comment"><p>Determines if the input value should be hidden. Defaults to <code>false</code>.</p>
</div>
</div>



<a name="InputBox.placeholder"></a><span class="ts" id=3238 data-target="#details-3238" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">placeholder</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3238">
<div class="comment"><p>Optional placeholder text shown when no value has been input.</p>
</div>
</div>



<a name="InputBox.prompt"></a><span class="ts" id=3244 data-target="#details-3244" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prompt</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3244">
<div class="comment"><p>An optional prompt text providing some ask or explanation to the user.</p>
</div>
</div>



<a name="InputBox.step"></a><span class="ts" id=3247 data-target="#details-3247" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">step</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3247">
<div class="comment"><p>An optional current step count for multi-step input flows.</p>
</div>
</div>



<a name="InputBox.title"></a><span class="ts" id=3246 data-target="#details-3246" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3246">
<div class="comment"><p>An optional title for the input UI.</p>
</div>
</div>



<a name="InputBox.totalSteps"></a><span class="ts" id=3248 data-target="#details-3248" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">totalSteps</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3248">
<div class="comment"><p>An optional total step count for multi-step input flows.</p>
</div>
</div>



<a name="InputBox.validationMessage"></a><span class="ts" id=3245 data-target="#details-3245" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">validationMessage</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#InputBoxValidationMessage">InputBoxValidationMessage</a></span>
<div class="details collapse" id="details-3245">
<div class="comment"><p>An optional validation message indicating a problem with the current input value.</p>
<p>By setting a string, the InputBox will use a default <a href="#InputBoxValidationSeverity">InputBoxValidationSeverity</a> of Error.
Returning <code>undefined</code> clears the validation message.</p>
</div>
</div>



<a name="InputBox.value"></a><span class="ts" id=3236 data-target="#details-3236" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3236">
<div class="comment"><p>The current input value.</p>
</div>
</div>



<a name="InputBox.valueSelection"></a><span class="ts" id=3237 data-target="#details-3237" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">valueSelection</span><span>: </span>readonly [<span class="type-intrinsic">number</span>, <span class="type-intrinsic">number</span>]</span>
<div class="details collapse" id="details-3237">
<div class="comment"><p>Selection range in the input value.</p>
<p>Defined as tuple of two numbers where the first is the inclusive start index and the second the
exclusive end index. When <code>undefined</code> the whole pre-filled value will be selected, when empty
(start equals end) only the cursor will be set, otherwise the defined range will be selected.</p>
<p>This property does not get updated when the user types or makes a selection, but it can be updated
by the extension.</p>
</div>
</div>

#### Methods



<a name="InputBox.dispose"></a><span class="ts" id=3258 data-target="#details-3258" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3258">
<div class="comment"><p>Dispose of this input UI and any associated resources.</p>
<p>If it is still visible, it is first hidden. After this call the input UI is no longer functional
and no additional methods or properties on it should be accessed. Instead a new input UI should
be created.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="InputBox.hide"></a><span class="ts" id=3255 data-target="#details-3255" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hide</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3255">
<div class="comment"><p>Hides this input UI.</p>
<p>This will also fire an <a href="#QuickInput.onDidHide">onDidHide</a> event.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="InputBox.show"></a><span class="ts" id=3253 data-target="#details-3253" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">show</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3253">
<div class="comment"><p>Makes the input UI visible in its current configuration.</p>
<p>Any other input UI will first fire an <a href="#QuickInput.onDidHide">onDidHide</a> event.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="InputBoxOptions"></a><span class="code-item" id=562>InputBoxOptions</span>



<div class="comment"><p>Options to configure the behavior of the input box UI.</p>
</div>

#### Properties



<a name="InputBoxOptions.ignoreFocusOut"></a><span class="ts" id=569 data-target="#details-569" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ignoreFocusOut</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-569">
<div class="comment"><p>Set to <code>true</code> to keep the input box open when focus moves to another part of the editor or to another window.
This setting is ignored on iPad and is always false.</p>
</div>
</div>



<a name="InputBoxOptions.password"></a><span class="ts" id=568 data-target="#details-568" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">password</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-568">
<div class="comment"><p>Controls if a password input is shown. Password input hides the typed text.</p>
</div>
</div>



<a name="InputBoxOptions.placeHolder"></a><span class="ts" id=567 data-target="#details-567" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">placeHolder</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-567">
<div class="comment"><p>An optional string to show as placeholder in the input box to guide the user what to type.</p>
</div>
</div>



<a name="InputBoxOptions.prompt"></a><span class="ts" id=566 data-target="#details-566" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prompt</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-566">
<div class="comment"><p>The text to display underneath the input box.</p>
</div>
</div>



<a name="InputBoxOptions.title"></a><span class="ts" id=563 data-target="#details-563" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-563">
<div class="comment"><p>An optional string that represents the title of the input box.</p>
</div>
</div>



<a name="InputBoxOptions.value"></a><span class="ts" id=564 data-target="#details-564" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-564">
<div class="comment"><p>The value to pre-fill in the input box.</p>
</div>
</div>



<a name="InputBoxOptions.valueSelection"></a><span class="ts" id=565 data-target="#details-565" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">valueSelection</span><span>?</span><span>: </span>[<span class="type-intrinsic">number</span>, <span class="type-intrinsic">number</span>]</span>
<div class="details collapse" id="details-565">
<div class="comment"><p>Selection of the pre-filled <a href="#InputBoxOptions.value">value</a>. Defined as tuple of two number where the
first is the inclusive start index and the second the exclusive end index. When <code>undefined</code> the whole
pre-filled value will be selected, when empty (start equals end) only the cursor will be set,
otherwise the defined range will be selected.</p>
</div>
</div>

#### Methods



<a name="InputBoxOptions.validateInput"></a><span class="ts" id=571 data-target="#details-571" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">validateInput</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#InputBoxValidationMessage">InputBoxValidationMessage</a> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#InputBoxValidationMessage">InputBoxValidationMessage</a>&gt;</span>
<div class="details collapse" id="details-571">
<div class="comment"><p>An optional function that will be called to validate input and to give a hint
to the user.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The current value of the input box.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#InputBoxValidationMessage">InputBoxValidationMessage</a> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#InputBoxValidationMessage">InputBoxValidationMessage</a>&gt;</td><td><div class="comment"><p>Either a human-readable string which is presented as an error message or an <a href="#InputBoxValidationMessage">InputBoxValidationMessage</a>
 which can provide a specific message severity. Return <code>undefined</code>, <code>null</code>, or the empty string when &#39;value&#39; is valid.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="InputBoxValidationMessage"></a><span class="code-item" id=559>InputBoxValidationMessage</span>



<div class="comment"><p>Represents a validation message for an <a href="#InputBox">InputBox</a>.</p>
</div>

#### Properties



<a name="InputBoxValidationMessage.message"></a><span class="ts" id=560 data-target="#details-560" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-560">
<div class="comment"><p>The validation message to display to the user.</p>
</div>
</div>



<a name="InputBoxValidationMessage.severity"></a><span class="ts" id=561 data-target="#details-561" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">severity</span><span>: </span><a class="type-ref" href="#InputBoxValidationSeverity">InputBoxValidationSeverity</a></span>
<div class="details collapse" id="details-561">
<div class="comment"><p>The severity level of the validation message.</p>
<p><strong>Note:</strong> When using <a href="#InputBoxValidationSeverity.Error">InputBoxValidationSeverity.Error</a>, the user will not be able to accept
the input (e.g., by pressing Enter). <a href="#InputBoxValidationSeverity.Info">Info</a> and
<a href="#InputBoxValidationSeverity.Warning">Warning</a> severities will still allow the input to be accepted.</p>
</div>
</div>

### <a name="InputBoxValidationSeverity"></a><span class="code-item" id=555>InputBoxValidationSeverity</span>



<div class="comment"><p>Severity levels for input box validation messages.</p>
</div>

#### Enumeration Members



<a name="InputBoxValidationSeverity.Info"></a><span class="ts" id=556 data-target="#details-556" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Info</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-556">
<div class="comment"><p>Indicates an informational message that does not prevent input acceptance.</p>
</div>
</div>



<a name="InputBoxValidationSeverity.Warning"></a><span class="ts" id=557 data-target="#details-557" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Warning</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-557">
<div class="comment"><p>Indicates a warning message that does not prevent input acceptance.</p>
</div>
</div>



<a name="InputBoxValidationSeverity.Error"></a><span class="ts" id=558 data-target="#details-558" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Error</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-558">
<div class="comment"><p>Indicates an error message that prevents the user from accepting the input.</p>
</div>
</div>

### <a name="LanguageConfiguration"></a><span class="code-item" id=1674>LanguageConfiguration</span>



<div class="comment"><p>The language configuration interfaces defines the contract between extensions
and various editor features, like automatic bracket insertion, automatic indentation etc.</p>
</div>

#### Properties



<a name="LanguageConfiguration.__characterPairSupport"></a><span class="ts" id=1690 data-target="#details-1690" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">__characterPairSupport</span><span>?</span><span>: </span>{autoClosingPairs: Array&lt;{close: <span class="type-intrinsic">string</span>, notIn: <span class="type-intrinsic">string</span>[], open: <span class="type-intrinsic">string</span>}&gt;}</span>
<div class="details collapse" id="details-1690">
<div class="comment"><p><strong>Deprecated</strong> Do not use.</p>
<ul>
<li><em>deprecated</em> - * Use the autoClosingPairs property in the language configuration file instead.</li>
</ul>
</div>
<div class="signature variable-declaration-child">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td>autoClosingPairs: Array&lt;{close: <span class="type-intrinsic">string</span>, notIn: <span class="type-intrinsic">string</span>[], open: <span class="type-intrinsic">string</span>}&gt;</td><td><div class="comment"><ul>
<li><em>deprecated</em></li>
</ul>
</div></td></tr>
</table>
</div>
</div>



<a name="LanguageConfiguration.__electricCharacterSupport"></a><span class="ts" id=1681 data-target="#details-1681" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">__electricCharacterSupport</span><span>?</span><span>: </span>{brackets: <span class="type-intrinsic">any</span>, docComment: {close: <span class="type-intrinsic">string</span>, lineStart: <span class="type-intrinsic">string</span>, open: <span class="type-intrinsic">string</span>, scope: <span class="type-intrinsic">string</span>}}</span>
<div class="details collapse" id="details-1681">
<div class="comment"><p><strong>Deprecated</strong> Do not use.</p>
<ul>
<li><em>deprecated</em> - Will be replaced by a better API soon.</li>
</ul>
</div>
<div class="signature variable-declaration-child">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td>brackets: <span class="type-intrinsic">any</span></td><td><div class="comment"><p>This property is deprecated and will be <strong>ignored</strong> from
the editor.</p>
<ul>
<li><em>deprecated</em></li>
</ul>
</div></td></tr>
<tr><td>docComment: {close: <span class="type-intrinsic">string</span>, lineStart: <span class="type-intrinsic">string</span>, open: <span class="type-intrinsic">string</span>, scope: <span class="type-intrinsic">string</span>}</td><td><div class="comment"><p>This property is deprecated and not fully supported anymore by
the editor (scope and lineStart are ignored).
Use the autoClosingPairs property in the language configuration file instead.</p>
<ul>
<li><em>deprecated</em></li>
</ul>
</div></td></tr>
</table>
</div>
</div>



<a name="LanguageConfiguration.autoClosingPairs"></a><span class="ts" id=1680 data-target="#details-1680" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">autoClosingPairs</span><span>?</span><span>: </span><a class="type-ref" href="#AutoClosingPair">AutoClosingPair</a>[]</span>
<div class="details collapse" id="details-1680">
<div class="comment"><p>The language&#39;s auto closing pairs.</p>
</div>
</div>



<a name="LanguageConfiguration.brackets"></a><span class="ts" id=1676 data-target="#details-1676" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">brackets</span><span>?</span><span>: </span><a class="type-ref" href="#CharacterPair">CharacterPair</a>[]</span>
<div class="details collapse" id="details-1676">
<div class="comment"><p>The language&#39;s brackets.
This configuration implicitly affects pressing Enter around these brackets.</p>
</div>
</div>



<a name="LanguageConfiguration.comments"></a><span class="ts" id=1675 data-target="#details-1675" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">comments</span><span>?</span><span>: </span><a class="type-ref" href="#CommentRule">CommentRule</a></span>
<div class="details collapse" id="details-1675">
<div class="comment"><p>The language&#39;s comment settings.</p>
</div>
</div>



<a name="LanguageConfiguration.indentationRules"></a><span class="ts" id=1678 data-target="#details-1678" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">indentationRules</span><span>?</span><span>: </span><a class="type-ref" href="#IndentationRule">IndentationRule</a></span>
<div class="details collapse" id="details-1678">
<div class="comment"><p>The language&#39;s indentation settings.</p>
</div>
</div>



<a name="LanguageConfiguration.onEnterRules"></a><span class="ts" id=1679 data-target="#details-1679" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onEnterRules</span><span>?</span><span>: </span><a class="type-ref" href="#OnEnterRule">OnEnterRule</a>[]</span>
<div class="details collapse" id="details-1679">
<div class="comment"><p>The language&#39;s rules to be evaluated when pressing Enter.</p>
</div>
</div>



<a name="LanguageConfiguration.wordPattern"></a><span class="ts" id=1677 data-target="#details-1677" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">wordPattern</span><span>?</span><span>: </span><span class="type-ref-ts">RegExp</span></span>
<div class="details collapse" id="details-1677">
<div class="comment"><p>The language&#39;s word definition.
If the language supports Unicode identifiers (e.g. JavaScript), it is preferable
to provide a word definition that uses exclusion of known separators.
e.g.: A regex that matches anything except known separators (and dot is allowed to occur in a floating point number):</p>
<pre class="shiki" data-lang="text" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span>/(-?\d*\.\d\w*)|([^\`\~\!\\#\%\^\&#x26;\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\&#x3C;\>/\?\s]+)/g</span></span></code></pre>
</div>
</div>

### <a name="LanguageModelAccessInformation"></a><span class="code-item" id=5099>LanguageModelAccessInformation</span>



<div class="comment"><p>Represents extension specific information about the access to language models.</p>
</div>

#### Events



<a name="LanguageModelAccessInformation.onDidChange"></a><span class="ts" id=5100 data-target="#details-5100" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChange</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-5100">
<div class="comment"><p>An event that fires when access information changes.</p>
</div>
</div>

#### Methods



<a name="LanguageModelAccessInformation.canSendRequest"></a><span class="ts" id=5102 data-target="#details-5102" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">canSendRequest</span><span>(</span><span class="ident">chat</span><span>: </span><a class="type-ref" href="#LanguageModelChat">LanguageModelChat</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-5102">
<div class="comment"><p>Checks if a request can be made to a language model.</p>
<p><em>Note</em> that calling this function will not trigger a consent UI but just checks for a persisted state.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">chat</span><span>: </span><a class="type-ref" href="#LanguageModelChat">LanguageModelChat</a></td><td><div class="comment"><p>A language model chat object.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> if a request can be made, <code>false</code> if not, <code>undefined</code> if the language
model does not exist or consent hasn&#39;t been asked for.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="LanguageModelChat"></a><span class="code-item" id=4949>LanguageModelChat</span>



<div class="comment"><p>Represents a language model for making chat requests.</p>
<p><em>See also</em>
<a href="#lm.selectChatModels">lm.selectChatModels</a></p>
</div>

#### Properties



<a name="LanguageModelChat.family"></a><span class="ts" id=4953 data-target="#details-4953" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">family</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4953">
<div class="comment"><p>Opaque family-name of the language model. Values might be <code>gpt-3.5-turbo</code>, <code>gpt4</code>, <code>phi2</code>, or <code>llama</code>
but they are defined by extensions contributing languages and subject to change.</p>
</div>
</div>



<a name="LanguageModelChat.id"></a><span class="ts" id=4951 data-target="#details-4951" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4951">
<div class="comment"><p>Opaque identifier of the language model.</p>
</div>
</div>



<a name="LanguageModelChat.maxInputTokens"></a><span class="ts" id=4955 data-target="#details-4955" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">maxInputTokens</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-4955">
<div class="comment"><p>The maximum number of tokens that can be sent to the model in a single request.</p>
</div>
</div>



<a name="LanguageModelChat.name"></a><span class="ts" id=4950 data-target="#details-4950" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4950">
<div class="comment"><p>Human-readable name of the language model.</p>
</div>
</div>



<a name="LanguageModelChat.vendor"></a><span class="ts" id=4952 data-target="#details-4952" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">vendor</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4952">
<div class="comment"><p>A well-known identifier of the vendor of the language model. An example is <code>copilot</code>, but
values are defined by extensions contributing chat models and need to be looked up with them.</p>
</div>
</div>



<a name="LanguageModelChat.version"></a><span class="ts" id=4954 data-target="#details-4954" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">version</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4954">
<div class="comment"><p>Opaque version string of the model. This is defined by the extension contributing the language model
and subject to change.</p>
</div>
</div>

#### Methods



<a name="LanguageModelChat.countTokens"></a><span class="ts" id=4962 data-target="#details-4962" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">countTokens</span><span>(</span><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#LanguageModelChatMessage">LanguageModelChatMessage</a>, <span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">number</span>&gt;</span>
<div class="details collapse" id="details-4962">
<div class="comment"><p>Count the number of tokens in a message using the model specific tokenizer-logic.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#LanguageModelChatMessage">LanguageModelChatMessage</a></td><td><div class="comment"><p>A string or a message instance.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>Optional cancellation token.  See <a href="#CancellationTokenSource">CancellationTokenSource</a> for how to create one.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">number</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the number of tokens.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="LanguageModelChat.sendRequest"></a><span class="ts" id=4957 data-target="#details-4957" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">sendRequest</span><span>(</span><span class="ident">messages</span><span>: </span><a class="type-ref" href="#LanguageModelChatMessage">LanguageModelChatMessage</a>[], <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#LanguageModelChatRequestOptions">LanguageModelChatRequestOptions</a>, <span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#LanguageModelChatResponse">LanguageModelChatResponse</a>&gt;</span>
<div class="details collapse" id="details-4957">
<div class="comment"><p>Make a chat request using a language model.</p>
<p><em>Note</em> that language model use may be subject to access restrictions and user consent. Calling this function
for the first time (for an extension) will show a consent dialog to the user and because of that this function
must <em>only be called in response to a user action!</em> Extensions can use <a href="#LanguageModelAccessInformation.canSendRequest">LanguageModelAccessInformation.canSendRequest</a>
to check if they have the necessary permissions to make a request.</p>
<p>This function will return a rejected promise if making a request to the language model is not
possible. Reasons for this can be:</p>
<ul>
<li>user consent not given, see <a href="#LanguageModelError.NoPermissions"><code>NoPermissions</code></a></li>
<li>model does not exist anymore, see <a href="#LanguageModelError.NotFound"><code>NotFound</code></a></li>
<li>quota limits exceeded, see <a href="#LanguageModelError.Blocked"><code>Blocked</code></a></li>
<li>other issues in which case extension must check [LanguageModelError.cause <code>LanguageModelError.cause</code>](#LanguageModelError.cause <code>LanguageModelError.cause</code>)</li>
</ul>
<p>An extension can make use of language model tool calling by passing a set of tools to
<a href="#LanguageModelChatRequestOptions.tools">LanguageModelChatRequestOptions.tools</a>. The language model will return a <a href="#LanguageModelToolCallPart">LanguageModelToolCallPart</a> and
the extension can invoke the tool and make another request with the result.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">messages</span><span>: </span><a class="type-ref" href="#LanguageModelChatMessage">LanguageModelChatMessage</a>[]</td><td><div class="comment"><p>An array of message instances.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#LanguageModelChatRequestOptions">LanguageModelChatRequestOptions</a></td><td><div class="comment"><p>Options that control the request.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token which controls the request. See <a href="#CancellationTokenSource">CancellationTokenSource</a> for how to create one.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#LanguageModelChatResponse">LanguageModelChatResponse</a>&gt;</td><td><div class="comment"><p>A thenable that resolves to a <a href="#LanguageModelChatResponse">LanguageModelChatResponse</a>. The promise will reject when the request couldn&#39;t be made.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="LanguageModelChatCapabilities"></a><span class="code-item" id=5045>LanguageModelChatCapabilities</span>



<div class="comment"><p>Various features that the <a href="#LanguageModelChatInformation">LanguageModelChatInformation</a> supports such as tool calling or image input.</p>
</div>

#### Properties



<a name="LanguageModelChatCapabilities.imageInput"></a><span class="ts" id=5046 data-target="#details-5046" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">imageInput</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-5046">
<div class="comment"><p>Whether image input is supported by the model.
Common supported images are jpg and png, but each model will vary in supported mimetypes.</p>
</div>
</div>



<a name="LanguageModelChatCapabilities.toolCalling"></a><span class="ts" id=5047 data-target="#details-5047" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">toolCalling</span><span>?</span><span>: </span><span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-5047">
<div class="comment"><p>Whether tool calling is supported by the model.
If a number is provided, that is the maximum number of tools that can be provided in a request to the model.</p>
</div>
</div>

### <a name="LanguageModelChatInformation"></a><span class="code-item" id=5035>LanguageModelChatInformation</span>



<div class="comment"><p>Represents a language model provided by a <a href="#LanguageModelChatProvider">LanguageModelChatProvider</a>.</p>
</div>

#### Properties



<a name="LanguageModelChatInformation.capabilities"></a><span class="ts" id=5044 data-target="#details-5044" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">capabilities</span><span>: </span><a class="type-ref" href="#LanguageModelChatCapabilities">LanguageModelChatCapabilities</a></span>
<div class="details collapse" id="details-5044">
<div class="comment"><p>Various features that the model supports such as tool calling or image input.</p>
</div>
</div>



<a name="LanguageModelChatInformation.detail"></a><span class="ts" id=5040 data-target="#details-5040" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">detail</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5040">
<div class="comment"><p>An optional, human-readable string which will be rendered alongside the model.
Useful for distinguishing models of the same name in the UI.</p>
</div>
</div>



<a name="LanguageModelChatInformation.family"></a><span class="ts" id=5038 data-target="#details-5038" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">family</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5038">
<div class="comment"><p>Opaque family-name of the language model. Values might be <code>gpt-3.5-turbo</code>, <code>gpt4</code>, <code>phi2</code>, or <code>llama</code></p>
</div>
</div>



<a name="LanguageModelChatInformation.id"></a><span class="ts" id=5036 data-target="#details-5036" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5036">
<div class="comment"><p>Unique identifier for the language model. Must be unique per provider, but not required to be globally unique.</p>
</div>
</div>



<a name="LanguageModelChatInformation.maxInputTokens"></a><span class="ts" id=5042 data-target="#details-5042" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">maxInputTokens</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-5042">
<div class="comment"><p>The maximum number of tokens the model can accept as input.</p>
</div>
</div>



<a name="LanguageModelChatInformation.maxOutputTokens"></a><span class="ts" id=5043 data-target="#details-5043" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">maxOutputTokens</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-5043">
<div class="comment"><p>The maximum number of tokens the model is capable of producing.</p>
</div>
</div>



<a name="LanguageModelChatInformation.name"></a><span class="ts" id=5037 data-target="#details-5037" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5037">
<div class="comment"><p>Human-readable name of the language model.</p>
</div>
</div>



<a name="LanguageModelChatInformation.tooltip"></a><span class="ts" id=5039 data-target="#details-5039" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5039">
<div class="comment"><p>The tooltip to render when hovering the model. Used to provide more information about the model.</p>
</div>
</div>



<a name="LanguageModelChatInformation.version"></a><span class="ts" id=5041 data-target="#details-5041" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">version</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5041">
<div class="comment"><p>Opaque version string of the model.
This is used as a lookup value in <a href="#LanguageModelChatSelector.version">LanguageModelChatSelector.version</a>
An example is how GPT 4o has multiple versions like 2024-11-20 and 2024-08-06</p>
</div>
</div>

### <a name="LanguageModelChatMessage"></a><span class="code-item" id=4929>LanguageModelChatMessage</span>



<div class="comment"><p>Represents a message in a chat. Can assume different roles, like user or assistant.</p>
</div>

#### Static



<a name="LanguageModelChatMessage.Assistant"></a><span class="ts" id=4935 data-target="#details-4935" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Assistant</span><span>(</span><span class="ident">content</span><span>: </span><span class="type-intrinsic">string</span> &#124; Array&lt;<a class="type-ref" href="#LanguageModelTextPart">LanguageModelTextPart</a> &#124; <a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a> &#124; <a class="type-ref" href="#LanguageModelToolCallPart">LanguageModelToolCallPart</a>&gt;, <span class="ident">name</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelChatMessage">LanguageModelChatMessage</a></span>
<div class="details collapse" id="details-4935">
<div class="comment"><p>Utility to create a new assistant message.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-intrinsic">string</span> &#124; Array&lt;<a class="type-ref" href="#LanguageModelTextPart">LanguageModelTextPart</a> &#124; <a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a> &#124; <a class="type-ref" href="#LanguageModelToolCallPart">LanguageModelToolCallPart</a>&gt;</td><td><div class="comment"><p>The content of the message.</p>
</div></td></tr>
<tr><td><span class="ident">name</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The optional name of a user for the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelChatMessage">LanguageModelChatMessage</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LanguageModelChatMessage.User"></a><span class="ts" id=4931 data-target="#details-4931" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">User</span><span>(</span><span class="ident">content</span><span>: </span><span class="type-intrinsic">string</span> &#124; Array&lt;<a class="type-ref" href="#LanguageModelTextPart">LanguageModelTextPart</a> &#124; <a class="type-ref" href="#LanguageModelToolResultPart">LanguageModelToolResultPart</a> &#124; <a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a>&gt;, <span class="ident">name</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelChatMessage">LanguageModelChatMessage</a></span>
<div class="details collapse" id="details-4931">
<div class="comment"><p>Utility to create a new user message.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-intrinsic">string</span> &#124; Array&lt;<a class="type-ref" href="#LanguageModelTextPart">LanguageModelTextPart</a> &#124; <a class="type-ref" href="#LanguageModelToolResultPart">LanguageModelToolResultPart</a> &#124; <a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a>&gt;</td><td><div class="comment"><p>The content of the message.</p>
</div></td></tr>
<tr><td><span class="ident">name</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The optional name of a user for the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelChatMessage">LanguageModelChatMessage</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Constructors



<a name="LanguageModelChatMessage.LanguageModelChatMessage"></a><span class="ts" id=4939 data-target="#details-4939" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">LanguageModelChatMessage</span><span>(</span><span class="ident">role</span><span>: </span><a class="type-ref" href="#LanguageModelChatMessageRole">LanguageModelChatMessageRole</a>, <span class="ident">content</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#LanguageModelInputPart">LanguageModelInputPart</a>[], <span class="ident">name</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelChatMessage">LanguageModelChatMessage</a></span>
<div class="details collapse" id="details-4939">
<div class="comment"><p>Create a new user message.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">role</span><span>: </span><a class="type-ref" href="#LanguageModelChatMessageRole">LanguageModelChatMessageRole</a></td><td><div class="comment"><p>The role of the message.</p>
</div></td></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#LanguageModelInputPart">LanguageModelInputPart</a>[]</td><td><div class="comment"><p>The content of the message.</p>
</div></td></tr>
<tr><td><span class="ident">name</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The optional name of a user for the message.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelChatMessage">LanguageModelChatMessage</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="LanguageModelChatMessage.content"></a><span class="ts" id=4944 data-target="#details-4944" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">content</span><span>: </span><a class="type-ref" href="#LanguageModelInputPart">LanguageModelInputPart</a>[]</span>
<div class="details collapse" id="details-4944">
<div class="comment"><p>A string or heterogeneous array of things that a message can contain as content. Some parts may be message-type
specific for some models.</p>
</div>
</div>



<a name="LanguageModelChatMessage.name"></a><span class="ts" id=4945 data-target="#details-4945" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4945">
<div class="comment"><p>The optional name of a user for this message.</p>
</div>
</div>



<a name="LanguageModelChatMessage.role"></a><span class="ts" id=4943 data-target="#details-4943" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">role</span><span>: </span><a class="type-ref" href="#LanguageModelChatMessageRole">LanguageModelChatMessageRole</a></span>
<div class="details collapse" id="details-4943">
<div class="comment"><p>The role of this message.</p>
</div>
</div>

### <a name="LanguageModelChatMessageRole"></a><span class="code-item" id=4926>LanguageModelChatMessageRole</span>



<div class="comment"><p>Represents the role of a chat message. This is either the user or the assistant.</p>
</div>

#### Enumeration Members



<a name="LanguageModelChatMessageRole.User"></a><span class="ts" id=4927 data-target="#details-4927" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">User</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-4927">
<div class="comment"><p>The user role, e.g the human interacting with a language model.</p>
</div>
</div>



<a name="LanguageModelChatMessageRole.Assistant"></a><span class="ts" id=4928 data-target="#details-4928" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Assistant</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-4928">
<div class="comment"><p>The assistant role, e.g. the language model generating responses.</p>
</div>
</div>

### <a name="LanguageModelChatProvider"></a><span class="code-item" id=5054>LanguageModelChatProvider&lt;T&gt;</span>



<div class="comment"><p>A LanguageModelChatProvider implements access to language models, which users can then use through the chat view, or through extension API by acquiring a LanguageModelChat.
An example of this would be an OpenAI provider that provides models like gpt-5, o3, etc.</p>
</div>

#### Events



<a name="LanguageModelChatProvider.onDidChangeLanguageModelChatInformation"></a><span class="ts" id=5056 data-target="#details-5056" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeLanguageModelChatInformation</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-5056">
<div class="comment"><p>An optional event fired when the available set of language models changes.</p>
</div>
</div>

#### Methods



<a name="LanguageModelChatProvider.provideLanguageModelChatInformation"></a><span class="ts" id=5058 data-target="#details-5058" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideLanguageModelChatInformation</span><span>(</span><span class="ident">options</span><span>: </span><a class="type-ref" href="#PrepareLanguageModelChatModelOptions">PrepareLanguageModelChatModelOptions</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-5058">
<div class="comment"><p>Get the list of available language models provided by this provider</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#PrepareLanguageModelChatModelOptions">PrepareLanguageModelChatModelOptions</a></td><td><div class="comment"><p>Options which specify the calling context of this function</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>The list of available language models</p>
</div></td></tr>
</table>
</div>
</div>



<a name="LanguageModelChatProvider.provideLanguageModelChatResponse"></a><span class="ts" id=5062 data-target="#details-5062" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideLanguageModelChatResponse</span><span>(</span><span class="ident">model</span><span>: </span><span class="type-ref">T</span>, <span class="ident">messages</span><span>: </span>readonly <a class="type-ref" href="#LanguageModelChatRequestMessage">LanguageModelChatRequestMessage</a>[], <span class="ident">options</span><span>: </span><a class="type-ref" href="#ProvideLanguageModelChatResponseOptions">ProvideLanguageModelChatResponseOptions</a>, <span class="ident">progress</span><span>: </span><a class="type-ref" href="#Progress&amp;lt;T&amp;gt;">Progress</a>&lt;<a class="type-ref" href="#LanguageModelResponsePart">LanguageModelResponsePart</a>&gt;, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-5062">
<div class="comment"><p>Returns the response for a chat request, passing the results to the progress callback.
The <a href="#LanguageModelChatProvider">LanguageModelChatProvider</a> must emit the response parts to the progress callback as they are received from the language model.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">model</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The language model to use</p>
</div></td></tr>
<tr><td><span class="ident">messages</span><span>: </span>readonly <a class="type-ref" href="#LanguageModelChatRequestMessage">LanguageModelChatRequestMessage</a>[]</td><td><div class="comment"><p>The messages to include in the request</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#ProvideLanguageModelChatResponseOptions">ProvideLanguageModelChatResponseOptions</a></td><td><div class="comment"><p>Options for the request</p>
</div></td></tr>
<tr><td><span class="ident">progress</span><span>: </span><a class="type-ref" href="#Progress&amp;lt;T&amp;gt;">Progress</a>&lt;<a class="type-ref" href="#LanguageModelResponsePart">LanguageModelResponsePart</a>&gt;</td><td><div class="comment"><p>The progress to emit the streamed response chunks to</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>A promise that resolves when the response is complete. Results are actually passed to the progress callback.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="LanguageModelChatProvider.provideTokenCount"></a><span class="ts" id=5069 data-target="#details-5069" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideTokenCount</span><span>(</span><span class="ident">model</span><span>: </span><span class="type-ref">T</span>, <span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#LanguageModelChatRequestMessage">LanguageModelChatRequestMessage</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">number</span>&gt;</span>
<div class="details collapse" id="details-5069">
<div class="comment"><p>Returns the number of tokens for a given text using the model-specific tokenizer logic</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">model</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The language model to use</p>
</div></td></tr>
<tr><td><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#LanguageModelChatRequestMessage">LanguageModelChatRequestMessage</a></td><td><div class="comment"><p>The text to count tokens for</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">number</span>&gt;</td><td><div class="comment"><p>The number of tokens</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="LanguageModelChatRequestMessage"></a><span class="code-item" id=5048>LanguageModelChatRequestMessage</span>



<div class="comment"><p>The provider version of <a href="#LanguageModelChatMessage">LanguageModelChatMessage</a>.</p>
</div>

#### Properties



<a name="LanguageModelChatRequestMessage.content"></a><span class="ts" id=5050 data-target="#details-5050" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">content</span><span>: </span>readonly <span class="type-intrinsic">unknown</span>[]</span>
<div class="details collapse" id="details-5050">
<div class="comment"><p>A heterogeneous array of things that a message can contain as content. Some parts may be message-type
specific for some models.</p>
</div>
</div>



<a name="LanguageModelChatRequestMessage.name"></a><span class="ts" id=5051 data-target="#details-5051" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5051">
<div class="comment"><p>The optional name of a user for this message.</p>
</div>
</div>



<a name="LanguageModelChatRequestMessage.role"></a><span class="ts" id=5049 data-target="#details-5049" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">role</span><span>: </span><a class="type-ref" href="#LanguageModelChatMessageRole">LanguageModelChatMessageRole</a></span>
<div class="details collapse" id="details-5049">
<div class="comment"><p>The role of this message.</p>
</div>
</div>

### <a name="LanguageModelChatRequestOptions"></a><span class="code-item" id=4984>LanguageModelChatRequestOptions</span>



<div class="comment"><p>Options for making a chat request using a language model.</p>
<p><em>See also</em>
<a href="#LanguageModelChat.sendRequest">LanguageModelChat.sendRequest</a></p>
</div>

#### Properties



<a name="LanguageModelChatRequestOptions.justification"></a><span class="ts" id=4985 data-target="#details-4985" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">justification</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4985">
<div class="comment"><p>A human-readable message that explains why access to a language model is needed and what feature is enabled by it.</p>
</div>
</div>



<a name="LanguageModelChatRequestOptions.modelOptions"></a><span class="ts" id=4986 data-target="#details-4986" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">modelOptions</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-4986">
<div class="comment"><p>A set of options that control the behavior of the language model. These options are specific to the language model
and need to be looked up in the respective documentation.</p>
</div>
</div>



<a name="LanguageModelChatRequestOptions.toolMode"></a><span class="ts" id=4991 data-target="#details-4991" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">toolMode</span><span>?</span><span>: </span><a class="type-ref" href="#LanguageModelChatToolMode">LanguageModelChatToolMode</a></span>
<div class="details collapse" id="details-4991">
<div class="comment"><p>The tool-selecting mode to use. <a href="#LanguageModelChatToolMode.Auto">LanguageModelChatToolMode.Auto</a> by default.</p>
</div>
</div>



<a name="LanguageModelChatRequestOptions.tools"></a><span class="ts" id=4990 data-target="#details-4990" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tools</span><span>?</span><span>: </span><a class="type-ref" href="#LanguageModelChatTool">LanguageModelChatTool</a>[]</span>
<div class="details collapse" id="details-4990">
<div class="comment"><p>An optional list of tools that are available to the language model. These could be registered tools available via
<a href="#lm.tools">lm.tools</a>, or private tools that are just implemented within the calling extension.</p>
<p>If the LLM requests to call one of these tools, it will return a <a href="#LanguageModelToolCallPart">LanguageModelToolCallPart</a> in
<a href="#LanguageModelChatResponse.stream">LanguageModelChatResponse.stream</a>. It&#39;s the caller&#39;s responsibility to invoke the tool. If it&#39;s a tool
registered in <a href="#lm.tools">lm.tools</a>, that means calling <a href="#lm.invokeTool">lm.invokeTool</a>.</p>
<p>Then, the tool result can be provided to the LLM by creating an Assistant-type <a href="#LanguageModelChatMessage">LanguageModelChatMessage</a> with a
<a href="#LanguageModelToolCallPart">LanguageModelToolCallPart</a>, followed by a User-type message with a <a href="#LanguageModelToolResultPart">LanguageModelToolResultPart</a>.</p>
</div>
</div>

### <a name="LanguageModelChatResponse"></a><span class="code-item" id=4946>LanguageModelChatResponse</span>



<div class="comment"><p>Represents a language model response.</p>
<p><em>See also</em>
<a href="#ChatRequest">ChatRequest</a></p>
</div>

#### Properties



<a name="LanguageModelChatResponse.stream"></a><span class="ts" id=4947 data-target="#details-4947" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">stream</span><span>: </span><span class="type-ref-ts">AsyncIterable</span>&lt;<span class="type-intrinsic">unknown</span>&gt;</span>
<div class="details collapse" id="details-4947">
<div class="comment"><p>An async iterable that is a stream of text and tool-call parts forming the overall response. A
<a href="#LanguageModelTextPart">LanguageModelTextPart</a> is part of the assistant&#39;s response to be shown to the user. A
<a href="#LanguageModelToolCallPart">LanguageModelToolCallPart</a> is a request from the language model to call a tool. The latter will
only be returned if tools were passed in the request via <a href="#LanguageModelChatRequestOptions.tools">LanguageModelChatRequestOptions.tools</a>. The
<code>unknown</code>-type is used as a placeholder for future parts, like image data parts.</p>
<p><em>Note</em> that this stream will error when during data receiving an error occurs. Consumers of the stream should handle
the errors accordingly.</p>
<p>To cancel the stream, the consumer can <a href="#CancellationTokenSource.cancel">cancel</a> the token that was used to make
the request or break from the for-loop.</p>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">try</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // consume stream</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">  for</span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB"> await</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> chunk</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> of</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> response</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">stream</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">    if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">chunk</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> instanceof</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99"> LanguageModelTextPart</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">      console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'TEXT'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">chunk</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    } </span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">else</span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB"> if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">chunk</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> instanceof</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99"> LanguageModelToolCallPart</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">      console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'TOOL CALL'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">chunk</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">} </span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">catch</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">e</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // stream ended with an error</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">error</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">e</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span>
<span class="line"></span></code></pre>
</div>
</div>



<a name="LanguageModelChatResponse.text"></a><span class="ts" id=4948 data-target="#details-4948" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">text</span><span>: </span><span class="type-ref-ts">AsyncIterable</span>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-4948">
<div class="comment"><p>This is equivalent to filtering everything except for text parts from a <a href="#LanguageModelChatResponse.stream">LanguageModelChatResponse.stream</a>.</p>
<p><em>See also</em>
<a href="#LanguageModelChatResponse.stream">LanguageModelChatResponse.stream</a></p>
</div>
</div>

### <a name="LanguageModelChatSelector"></a><span class="code-item" id=4965>LanguageModelChatSelector</span>



<div class="comment"><p>Describes how to select language models for chat requests.</p>
<p><em>See also</em>
<a href="#lm.selectChatModels">lm.selectChatModels</a></p>
</div>

#### Properties



<a name="LanguageModelChatSelector.family"></a><span class="ts" id=4967 data-target="#details-4967" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">family</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4967">
<div class="comment"><p>A family of language models.</p>
<p><em>See also</em>
<a href="#LanguageModelChat.family">LanguageModelChat.family</a></p>
</div>
</div>



<a name="LanguageModelChatSelector.id"></a><span class="ts" id=4969 data-target="#details-4969" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4969">
<div class="comment"><p>The identifier of a language model.</p>
<p><em>See also</em>
<a href="#LanguageModelChat.id">LanguageModelChat.id</a></p>
</div>
</div>



<a name="LanguageModelChatSelector.vendor"></a><span class="ts" id=4966 data-target="#details-4966" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">vendor</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4966">
<div class="comment"><p>A vendor of language models.</p>
<p><em>See also</em>
<a href="#LanguageModelChat.vendor">LanguageModelChat.vendor</a></p>
</div>
</div>



<a name="LanguageModelChatSelector.version"></a><span class="ts" id=4968 data-target="#details-4968" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">version</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4968">
<div class="comment"><p>The version of a language model.</p>
<p><em>See also</em>
<a href="#LanguageModelChat.version">LanguageModelChat.version</a></p>
</div>
</div>

### <a name="LanguageModelChatTool"></a><span class="code-item" id=5104>LanguageModelChatTool</span>



<div class="comment"><p>A tool that is available to the language model via <a href="#LanguageModelChatRequestOptions">LanguageModelChatRequestOptions</a>. A language model uses all the
properties of this interface to decide which tool to call, and how to call it.</p>
</div>

#### Properties



<a name="LanguageModelChatTool.description"></a><span class="ts" id=5106 data-target="#details-5106" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">description</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5106">
<div class="comment"><p>The description of the tool.</p>
</div>
</div>



<a name="LanguageModelChatTool.inputSchema"></a><span class="ts" id=5107 data-target="#details-5107" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">inputSchema</span><span>?</span><span>: </span><span class="type-intrinsic">object</span></span>
<div class="details collapse" id="details-5107">
<div class="comment"><p>A JSON schema for the input this tool accepts.</p>
</div>
</div>



<a name="LanguageModelChatTool.name"></a><span class="ts" id=5105 data-target="#details-5105" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5105">
<div class="comment"><p>The name of the tool.</p>
</div>
</div>

### <a name="LanguageModelChatToolMode"></a><span class="code-item" id=5108>LanguageModelChatToolMode</span>



<div class="comment"><p>A tool-calling mode for the language model to use.</p>
</div>

#### Enumeration Members



<a name="LanguageModelChatToolMode.Auto"></a><span class="ts" id=5109 data-target="#details-5109" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Auto</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-5109">
<div class="comment"><p>The language model can choose to call a tool or generate a message. Is the default.</p>
</div>
</div>



<a name="LanguageModelChatToolMode.Required"></a><span class="ts" id=5110 data-target="#details-5110" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Required</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-5110">
<div class="comment"><p>The language model must call one of the provided tools. Note- some models only support a single tool when using this
mode.</p>
</div>
</div>

### <a name="LanguageModelDataPart"></a><span class="code-item" id=5142>LanguageModelDataPart</span>



<div class="comment"><p>A language model response part containing arbitrary data. Can be used in <a href="#LanguageModelChatResponse">responses</a>,
<a href="#LanguageModelChatMessage">chat messages</a>, <a href="#LanguageModelToolResult">tool results</a>, and other language model interactions.</p>
</div>

#### Static



<a name="LanguageModelDataPart.image"></a><span class="ts" id=5144 data-target="#details-5144" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">image</span><span>(</span><span class="ident">data</span><span>: </span><span class="type-ref-ts">Uint8Array</span>, <span class="ident">mime</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a></span>
<div class="details collapse" id="details-5144">
<div class="comment"><p>Create a new <a href="#LanguageModelDataPart">LanguageModelDataPart</a> for an image.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">data</span><span>: </span><span class="type-ref-ts">Uint8Array</span></td><td><div class="comment"><p>Binary image data</p>
</div></td></tr>
<tr><td><span class="ident">mime</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The MIME type of the image. Common values are <code>image/png</code> and <code>image/jpeg</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LanguageModelDataPart.json"></a><span class="ts" id=5148 data-target="#details-5148" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">json</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">any</span>, <span class="ident">mime</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a></span>
<div class="details collapse" id="details-5148">
<div class="comment"><p>Create a new <a href="#LanguageModelDataPart">LanguageModelDataPart</a> for a json.</p>
<p><em>Note</em> that this function is not expecting &quot;stringified JSON&quot; but
an object that can be stringified. This function will throw an error
when the passed value cannot be JSON-stringified.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>A JSON-stringifyable value.</p>
</div></td></tr>
<tr><td><span class="ident">mime</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Optional MIME type, defaults to <code>application/json</code></p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LanguageModelDataPart.text"></a><span class="ts" id=5152 data-target="#details-5152" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">text</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">mime</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a></span>
<div class="details collapse" id="details-5152">
<div class="comment"><p>Create a new <a href="#LanguageModelDataPart">LanguageModelDataPart</a> for text.</p>
<p><em>Note</em> that an UTF-8 encoder is used to create bytes for the string.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Text data</p>
</div></td></tr>
<tr><td><span class="ident">mime</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The MIME type if any. Common values are <code>text/plain</code> and <code>text/markdown</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Constructors



<a name="LanguageModelDataPart.LanguageModelDataPart"></a><span class="ts" id=5156 data-target="#details-5156" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">LanguageModelDataPart</span><span>(</span><span class="ident">data</span><span>: </span><span class="type-ref-ts">Uint8Array</span>, <span class="ident">mimeType</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a></span>
<div class="details collapse" id="details-5156">
<div class="comment"><p>Construct a generic data part with the given content.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">data</span><span>: </span><span class="type-ref-ts">Uint8Array</span></td><td><div class="comment"><p>The byte data for this part.</p>
</div></td></tr>
<tr><td><span class="ident">mimeType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The mime type of the data.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="LanguageModelDataPart.data"></a><span class="ts" id=5160 data-target="#details-5160" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">data</span><span>: </span><span class="type-ref-ts">Uint8Array</span></span>
<div class="details collapse" id="details-5160">
<div class="comment"><p>The byte data for this part.</p>
</div>
</div>



<a name="LanguageModelDataPart.mimeType"></a><span class="ts" id=5159 data-target="#details-5159" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">mimeType</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5159">
<div class="comment"><p>The mime type which determines how the data property is interpreted.</p>
</div>
</div>

### <a name="LanguageModelError"></a><span class="code-item" id=4970>LanguageModelError</span>



<div class="comment"><p>An error type for language model specific errors.</p>
<p>Consumers of language models should check the code property to determine specific
failure causes, like <code>if(someError.code === vscode.LanguageModelError.NotFound.name) {...}</code>
for the case of referring to an unknown language model. For unspecified errors the <code>cause</code>-property
will contain the actual error.</p>
</div>

#### Static



<a name="LanguageModelError.Blocked"></a><span class="ts" id=4975 data-target="#details-4975" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Blocked</span><span>(</span><span class="ident">message</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelError">LanguageModelError</a></span>
<div class="details collapse" id="details-4975">
<div class="comment"><p>The requestor is blocked from using this language model.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelError">LanguageModelError</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LanguageModelError.NoPermissions"></a><span class="ts" id=4972 data-target="#details-4972" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">NoPermissions</span><span>(</span><span class="ident">message</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelError">LanguageModelError</a></span>
<div class="details collapse" id="details-4972">
<div class="comment"><p>The requestor does not have permissions to use this
language model</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelError">LanguageModelError</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LanguageModelError.NotFound"></a><span class="ts" id=4978 data-target="#details-4978" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">NotFound</span><span>(</span><span class="ident">message</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelError">LanguageModelError</a></span>
<div class="details collapse" id="details-4978">
<div class="comment"><p>The language model does not exist.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelError">LanguageModelError</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Constructors



<a name="LanguageModelError.LanguageModelError"></a><span class="ts" id=4981 data-target="#details-4981" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">LanguageModelError</span><span>(</span><span class="ident">message</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelError">LanguageModelError</a></span>
<div class="details collapse" id="details-4981">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelError">LanguageModelError</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="LanguageModelError.code"></a><span class="ts" id=4983 data-target="#details-4983" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">code</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4983">
<div class="comment"><p>A code that identifies this error.</p>
<p>Possible values are names of errors, like <a href="#LanguageModelError.NotFound">NotFound</a>,
or <code>Unknown</code> for unspecified errors from the language model itself. In the latter case the
<code>cause</code>-property will contain the actual error.</p>
</div>
</div>

### <a name="LanguageModelInputPart"></a><span class="code-item" id=5053>LanguageModelInputPart</span>



<div class="comment"><p>The various message types which can be sent via <a href="#LanguageModelChat.sendRequest">LanguageModelChat.sendRequest</a> and processed by a <a href="#LanguageModelChatProvider">LanguageModelChatProvider</a></p>
</div>



<a name="LanguageModelInputPart"></a><span class="ts" id=5053 data-target="#details-5053" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">LanguageModelInputPart</span><span>: </span><a class="type-ref" href="#LanguageModelTextPart">LanguageModelTextPart</a> &#124; <a class="type-ref" href="#LanguageModelToolResultPart">LanguageModelToolResultPart</a> &#124; <a class="type-ref" href="#LanguageModelToolCallPart">LanguageModelToolCallPart</a> &#124; <a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a></span>

### <a name="LanguageModelPromptTsxPart"></a><span class="code-item" id=5132>LanguageModelPromptTsxPart</span>



<div class="comment"><p>A language model response part containing a PromptElementJSON from <code>vscode/prompt-tsx</code>.</p>
<p><em>See also</em>
<a href="#LanguageModelToolResult">LanguageModelToolResult</a></p>
</div>

#### Constructors



<a name="LanguageModelPromptTsxPart.LanguageModelPromptTsxPart"></a><span class="ts" id=5134 data-target="#details-5134" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">LanguageModelPromptTsxPart</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">unknown</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelPromptTsxPart">LanguageModelPromptTsxPart</a></span>
<div class="details collapse" id="details-5134">
<div class="comment"><p>Construct a prompt-tsx part with the given content.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">unknown</span></td><td><div class="comment"><p>The value of the part, the result of <code>renderElementJSON</code> from <code>vscode/prompt-tsx</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelPromptTsxPart">LanguageModelPromptTsxPart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="LanguageModelPromptTsxPart.value"></a><span class="ts" id=5136 data-target="#details-5136" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">unknown</span></span>
<div class="details collapse" id="details-5136">
<div class="comment"><p>The value of the part.</p>
</div>
</div>

### <a name="LanguageModelResponsePart"></a><span class="code-item" id=5052>LanguageModelResponsePart</span>



<div class="comment"><p>The various message types which a <a href="#LanguageModelChatProvider">LanguageModelChatProvider</a> can emit in the chat response stream</p>
</div>



<a name="LanguageModelResponsePart"></a><span class="ts" id=5052 data-target="#details-5052" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">LanguageModelResponsePart</span><span>: </span><a class="type-ref" href="#LanguageModelTextPart">LanguageModelTextPart</a> &#124; <a class="type-ref" href="#LanguageModelToolResultPart">LanguageModelToolResultPart</a> &#124; <a class="type-ref" href="#LanguageModelToolCallPart">LanguageModelToolCallPart</a> &#124; <a class="type-ref" href="#LanguageModelDataPart">LanguageModelDataPart</a></span>

### <a name="LanguageModelTextPart"></a><span class="code-item" id=5127>LanguageModelTextPart</span>



<div class="comment"><p>A language model response part containing a piece of text, returned from a <a href="#LanguageModelChatResponse">LanguageModelChatResponse</a>.</p>
</div>

#### Constructors



<a name="LanguageModelTextPart.LanguageModelTextPart"></a><span class="ts" id=5129 data-target="#details-5129" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">LanguageModelTextPart</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelTextPart">LanguageModelTextPart</a></span>
<div class="details collapse" id="details-5129">
<div class="comment"><p>Construct a text part with the given content.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The text content of the part.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelTextPart">LanguageModelTextPart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="LanguageModelTextPart.value"></a><span class="ts" id=5131 data-target="#details-5131" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5131">
<div class="comment"><p>The text content of the part.</p>
</div>
</div>

### <a name="LanguageModelTool"></a><span class="code-item" id=5181>LanguageModelTool&lt;T&gt;</span>



<div class="comment"><p>A tool that can be invoked by a call to a <a href="#LanguageModelChat">LanguageModelChat</a>.</p>
</div>

#### Methods



<a name="LanguageModelTool.invoke"></a><span class="ts" id=5184 data-target="#details-5184" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">invoke</span><span>(</span><span class="ident">options</span><span>: </span><a class="type-ref" href="#LanguageModelToolInvocationOptions&amp;lt;T&amp;gt;">LanguageModelToolInvocationOptions</a>&lt;<span class="type-ref">T</span>&gt;, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#LanguageModelToolResult">LanguageModelToolResult</a>&gt;</span>
<div class="details collapse" id="details-5184">
<div class="comment"><p>Invoke the tool with the given input and return a result.</p>
<p>The provided <a href="#LanguageModelToolInvocationOptions.input">LanguageModelToolInvocationOptions.input</a> has been validated against the declared schema.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#LanguageModelToolInvocationOptions&amp;lt;T&amp;gt;">LanguageModelToolInvocationOptions</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#LanguageModelToolResult">LanguageModelToolResult</a>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LanguageModelTool.prepareInvocation"></a><span class="ts" id=5188 data-target="#details-5188" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prepareInvocation</span><span>(</span><span class="ident">options</span><span>: </span><a class="type-ref" href="#LanguageModelToolInvocationPrepareOptions&amp;lt;T&amp;gt;">LanguageModelToolInvocationPrepareOptions</a>&lt;<span class="type-ref">T</span>&gt;, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#PreparedToolInvocation">PreparedToolInvocation</a>&gt;</span>
<div class="details collapse" id="details-5188">
<div class="comment"><p>Called once before a tool is invoked. It&#39;s recommended to implement this to customize the progress message that appears
while the tool is running, and to provide a more useful message with context from the invocation input. Can also
signal that a tool needs user confirmation before running, if appropriate.</p>
<ul>
<li><em>Note 1:</em> Must be free of side-effects.</li>
<li><em>Note 2:</em> A call to <code>prepareInvocation</code> is not necessarily followed by a call to <code>invoke</code>.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#LanguageModelToolInvocationPrepareOptions&amp;lt;T&amp;gt;">LanguageModelToolInvocationPrepareOptions</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#PreparedToolInvocation">PreparedToolInvocation</a>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="LanguageModelToolCallPart"></a><span class="code-item" id=5111>LanguageModelToolCallPart</span>



<div class="comment"><p>A language model response part indicating a tool call, returned from a <a href="#LanguageModelChatResponse">LanguageModelChatResponse</a>, and also can be
included as a content part on a <a href="#LanguageModelChatMessage">LanguageModelChatMessage</a>, to represent a previous tool call in a chat request.</p>
</div>

#### Constructors



<a name="LanguageModelToolCallPart.LanguageModelToolCallPart"></a><span class="ts" id=5113 data-target="#details-5113" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">LanguageModelToolCallPart</span><span>(</span><span class="ident">callId</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">input</span><span>: </span><span class="type-intrinsic">object</span><span>)</span><span>: </span><a class="type-ref" href="#LanguageModelToolCallPart">LanguageModelToolCallPart</a></span>
<div class="details collapse" id="details-5113">
<div class="comment"><p>Create a new LanguageModelToolCallPart.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">callId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The ID of the tool call.</p>
</div></td></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The name of the tool to call.</p>
</div></td></tr>
<tr><td><span class="ident">input</span><span>: </span><span class="type-intrinsic">object</span></td><td><div class="comment"><p>The input with which to call the tool.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelToolCallPart">LanguageModelToolCallPart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="LanguageModelToolCallPart.callId"></a><span class="ts" id=5117 data-target="#details-5117" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">callId</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5117">
<div class="comment"><p>The ID of the tool call. This is a unique identifier for the tool call within the chat request.</p>
</div>
</div>



<a name="LanguageModelToolCallPart.input"></a><span class="ts" id=5119 data-target="#details-5119" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">input</span><span>: </span><span class="type-intrinsic">object</span></span>
<div class="details collapse" id="details-5119">
<div class="comment"><p>The input with which to call the tool.</p>
</div>
</div>



<a name="LanguageModelToolCallPart.name"></a><span class="ts" id=5118 data-target="#details-5118" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5118">
<div class="comment"><p>The name of the tool to call.</p>
</div>
</div>

### <a name="LanguageModelToolConfirmationMessages"></a><span class="code-item" id=5191>LanguageModelToolConfirmationMessages</span>



<div class="comment"><p>When this is returned in <a href="#PreparedToolInvocation">PreparedToolInvocation</a>, the user will be asked to confirm before running the tool. These
messages will be shown with buttons that say &quot;Continue&quot; and &quot;Cancel&quot;.</p>
</div>

#### Properties



<a name="LanguageModelToolConfirmationMessages.message"></a><span class="ts" id=5193 data-target="#details-5193" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-5193">
<div class="comment"><p>The body of the confirmation message.</p>
</div>
</div>



<a name="LanguageModelToolConfirmationMessages.title"></a><span class="ts" id=5192 data-target="#details-5192" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5192">
<div class="comment"><p>The title of the confirmation message.</p>
</div>
</div>

### <a name="LanguageModelToolInformation"></a><span class="code-item" id=5173>LanguageModelToolInformation</span>



<div class="comment"><p>Information about a registered tool available in <a href="#lm.tools">lm.tools</a>.</p>
</div>

#### Properties



<a name="LanguageModelToolInformation.description"></a><span class="ts" id=5175 data-target="#details-5175" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">description</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5175">
<div class="comment"><p>A description of this tool that may be passed to a language model.</p>
</div>
</div>



<a name="LanguageModelToolInformation.inputSchema"></a><span class="ts" id=5176 data-target="#details-5176" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">inputSchema</span><span>: </span><span class="type-intrinsic">object</span></span>
<div class="details collapse" id="details-5176">
<div class="comment"><p>A JSON schema for the input this tool accepts.</p>
</div>
</div>



<a name="LanguageModelToolInformation.name"></a><span class="ts" id=5174 data-target="#details-5174" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5174">
<div class="comment"><p>A unique name for the tool.</p>
</div>
</div>



<a name="LanguageModelToolInformation.tags"></a><span class="ts" id=5177 data-target="#details-5177" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tags</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-5177">
<div class="comment"><p>A set of tags, declared by the tool, that roughly describe the tool&#39;s capabilities. A tool user may use these to filter
the set of tools to just ones that are relevant for the task at hand.</p>
</div>
</div>

### <a name="LanguageModelToolInvocationOptions"></a><span class="code-item" id=5162>LanguageModelToolInvocationOptions&lt;T&gt;</span>



<div class="comment"><p>Options provided for tool invocation.</p>
</div>

#### Properties



<a name="LanguageModelToolInvocationOptions.input"></a><span class="ts" id=5165 data-target="#details-5165" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">input</span><span>: </span><span class="type-ref">T</span></span>
<div class="details collapse" id="details-5165">
<div class="comment"><p>The input with which to invoke the tool. The input must match the schema defined in
<a href="#LanguageModelToolInformation.inputSchema">LanguageModelToolInformation.inputSchema</a></p>
</div>
</div>



<a name="LanguageModelToolInvocationOptions.tokenizationOptions"></a><span class="ts" id=5166 data-target="#details-5166" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tokenizationOptions</span><span>?</span><span>: </span><a class="type-ref" href="#LanguageModelToolTokenizationOptions">LanguageModelToolTokenizationOptions</a></span>
<div class="details collapse" id="details-5166">
<div class="comment"><p>Options to hint at how many tokens the tool should return in its response, and enable the tool to count tokens
accurately.</p>
</div>
</div>



<a name="LanguageModelToolInvocationOptions.toolInvocationToken"></a><span class="ts" id=5164 data-target="#details-5164" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">toolInvocationToken</span><span>: </span><span class="type-intrinsic">undefined</span></span>
<div class="details collapse" id="details-5164">
<div class="comment"><p>An opaque object that ties a tool invocation to a chat request from a <a href="#ChatParticipant">chat participant</a>.</p>
<p>The <em>only</em> way to get a valid tool invocation token is using the provided <a href="#ChatRequest.toolInvocationToken">toolInvocationToken</a>
from a chat request. In that case, a progress bar will be automatically shown for the tool invocation in the chat response view, and if
the tool requires user confirmation, it will show up inline in the chat view.</p>
<p>If the tool is being invoked outside of a chat request, <code>undefined</code> should be passed instead, and no special UI except for
confirmations will be shown.</p>
<p><em>Note</em> that a tool that invokes another tool during its invocation, can pass along the <code>toolInvocationToken</code> that it received.</p>
</div>
</div>

### <a name="LanguageModelToolInvocationPrepareOptions"></a><span class="code-item" id=5178>LanguageModelToolInvocationPrepareOptions&lt;T&gt;</span>



<div class="comment"><p>Options for <a href="#LanguageModelTool.prepareInvocation">LanguageModelTool.prepareInvocation</a>.</p>
</div>

#### Properties



<a name="LanguageModelToolInvocationPrepareOptions.input"></a><span class="ts" id=5180 data-target="#details-5180" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">input</span><span>: </span><span class="type-ref">T</span></span>
<div class="details collapse" id="details-5180">
<div class="comment"><p>The input that the tool is being invoked with.</p>
</div>
</div>

### <a name="LanguageModelToolResult"></a><span class="code-item" id=5137>LanguageModelToolResult</span>



<div class="comment"><p>A result returned from a tool invocation. If using <code>vscode/prompt-tsx</code>, this result may be rendered using a <code>ToolResult</code>.</p>
</div>

#### Constructors



<a name="LanguageModelToolResult.LanguageModelToolResult"></a><span class="ts" id=5139 data-target="#details-5139" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">LanguageModelToolResult</span><span>(</span><span class="ident">content</span><span>: </span><span class="type-intrinsic">unknown</span>[]<span>)</span><span>: </span><a class="type-ref" href="#LanguageModelToolResult">LanguageModelToolResult</a></span>
<div class="details collapse" id="details-5139">
<div class="comment"><p>Create a LanguageModelToolResult</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-intrinsic">unknown</span>[]</td><td><div class="comment"><p>A list of tool result content parts</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelToolResult">LanguageModelToolResult</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="LanguageModelToolResult.content"></a><span class="ts" id=5141 data-target="#details-5141" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">content</span><span>: </span><span class="type-intrinsic">unknown</span>[]</span>
<div class="details collapse" id="details-5141">
<div class="comment"><p>A list of tool result content parts. Includes <code>unknown</code> because this list may be extended with new content types in
the future.</p>
<p><em>See also</em>
<a href="#lm.invokeTool">lm.invokeTool</a>.</p>
</div>
</div>

### <a name="LanguageModelToolResultPart"></a><span class="code-item" id=5120>LanguageModelToolResultPart</span>



<div class="comment"><p>The result of a tool call. This is the counterpart of a <a href="#LanguageModelToolCallPart">tool call</a> and
it can only be included in the content of a User message</p>
</div>

#### Constructors



<a name="LanguageModelToolResultPart.LanguageModelToolResultPart"></a><span class="ts" id=5122 data-target="#details-5122" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">LanguageModelToolResultPart</span><span>(</span><span class="ident">callId</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">content</span><span>: </span><span class="type-intrinsic">unknown</span>[]<span>)</span><span>: </span><a class="type-ref" href="#LanguageModelToolResultPart">LanguageModelToolResultPart</a></span>
<div class="details collapse" id="details-5122">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">callId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The ID of the tool call.</p>
</div></td></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-intrinsic">unknown</span>[]</td><td><div class="comment"><p>The content of the tool result.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LanguageModelToolResultPart">LanguageModelToolResultPart</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="LanguageModelToolResultPart.callId"></a><span class="ts" id=5125 data-target="#details-5125" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">callId</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5125">
<div class="comment"><p>The ID of the tool call.</p>
<p><em>Note</em> that this should match the <a href="#LanguageModelToolCallPart.callId">callId</a> of a tool call part.</p>
</div>
</div>



<a name="LanguageModelToolResultPart.content"></a><span class="ts" id=5126 data-target="#details-5126" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">content</span><span>: </span><span class="type-intrinsic">unknown</span>[]</span>
<div class="details collapse" id="details-5126">
<div class="comment"><p>The value of the tool result.</p>
</div>
</div>

### <a name="LanguageModelToolTokenizationOptions"></a><span class="code-item" id=5167>LanguageModelToolTokenizationOptions</span>



<div class="comment"><p>Options related to tokenization for a tool invocation.</p>
</div>

#### Properties



<a name="LanguageModelToolTokenizationOptions.tokenBudget"></a><span class="ts" id=5168 data-target="#details-5168" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tokenBudget</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-5168">
<div class="comment"><p>If known, the maximum number of tokens the tool should emit in its result.</p>
</div>
</div>

#### Methods



<a name="LanguageModelToolTokenizationOptions.countTokens"></a><span class="ts" id=5170 data-target="#details-5170" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">countTokens</span><span>(</span><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">number</span>&gt;</span>
<div class="details collapse" id="details-5170">
<div class="comment"><p>Count the number of tokens in a message using the model specific tokenizer-logic.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>?</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>Optional cancellation token.  See <a href="#CancellationTokenSource">CancellationTokenSource</a> for how to create one.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">number</span>&gt;</td><td><div class="comment"><p>A thenable that resolves to the number of tokens.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="LanguageStatusItem"></a><span class="code-item" id=1815>LanguageStatusItem</span>



<div class="comment"><p>A language status item is the preferred way to present language status reports for the active text editors,
such as selected linter or notifying about a configuration problem.</p>
</div>

#### Properties



<a name="LanguageStatusItem.accessibilityInformation"></a><span class="ts" id=1824 data-target="#details-1824" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">accessibilityInformation</span><span>?</span><span>: </span><a class="type-ref" href="#AccessibilityInformation">AccessibilityInformation</a></span>
<div class="details collapse" id="details-1824">
<div class="comment"><p>Accessibility information used when a screen reader interacts with this item</p>
</div>
</div>



<a name="LanguageStatusItem.busy"></a><span class="ts" id=1822 data-target="#details-1822" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">busy</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1822">
<div class="comment"><p>Controls whether the item is shown as &quot;busy&quot;. Defaults to <code>false</code>.</p>
</div>
</div>



<a name="LanguageStatusItem.command"></a><span class="ts" id=1823 data-target="#details-1823" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>: </span><a class="type-ref" href="#Command">Command</a></span>
<div class="details collapse" id="details-1823">
<div class="comment"><p>A <a href="#Command">command</a> for this item.</p>
</div>
</div>



<a name="LanguageStatusItem.detail"></a><span class="ts" id=1821 data-target="#details-1821" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">detail</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1821">
<div class="comment"><p>Optional, human-readable details for this item.</p>
</div>
</div>



<a name="LanguageStatusItem.id"></a><span class="ts" id=1816 data-target="#details-1816" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1816">
<div class="comment"><p>The identifier of this item.</p>
</div>
</div>



<a name="LanguageStatusItem.name"></a><span class="ts" id=1817 data-target="#details-1817" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1817">
<div class="comment"><p>The short name of this item, like &#39;Java Language Status&#39;, etc.</p>
</div>
</div>



<a name="LanguageStatusItem.selector"></a><span class="ts" id=1818 data-target="#details-1818" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selector</span><span>: </span><a class="type-ref" href="#DocumentSelector">DocumentSelector</a></span>
<div class="details collapse" id="details-1818">
<div class="comment"><p>A <a href="#DocumentSelector">selector</a> that defines for what editors
this item shows.</p>
</div>
</div>



<a name="LanguageStatusItem.severity"></a><span class="ts" id=1819 data-target="#details-1819" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">severity</span><span>: </span><a class="type-ref" href="#LanguageStatusSeverity">LanguageStatusSeverity</a></span>
<div class="details collapse" id="details-1819">
<div class="comment"><p>The severity of this item.</p>
<p>Defaults to <a href="#LanguageStatusSeverity.Information">information</a>. You can use this property to
signal to users that there is a problem that needs attention, like a missing executable or an
invalid configuration.</p>
</div>
</div>



<a name="LanguageStatusItem.text"></a><span class="ts" id=1820 data-target="#details-1820" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1820">
<div class="comment"><p>The text to show for the entry. You can embed icons in the text by leveraging the syntax:</p>
<p><code>My text $(icon-name) contains icons like $(icon-name) this one.</code></p>
<p>Where the icon-name is taken from the ThemeIcon <a href="https://code.visualstudio.com/api/references/icons-in-labels#icon-listing">icon set</a>, e.g.
<code>light-bulb</code>, <code>thumbsup</code>, <code>zap</code> etc.</p>
</div>
</div>

#### Methods



<a name="LanguageStatusItem.dispose"></a><span class="ts" id=1826 data-target="#details-1826" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1826">
<div class="comment"><p>Dispose and free associated resources.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="LanguageStatusSeverity"></a><span class="code-item" id=1811>LanguageStatusSeverity</span>



<div class="comment"><p>Represents the severity level of a language status.</p>
</div>

#### Enumeration Members



<a name="LanguageStatusSeverity.Information"></a><span class="ts" id=1812 data-target="#details-1812" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Information</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-1812">
<div class="comment"><p>Informational severity level.</p>
</div>
</div>



<a name="LanguageStatusSeverity.Warning"></a><span class="ts" id=1813 data-target="#details-1813" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Warning</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1813">
<div class="comment"><p>Warning severity level.</p>
</div>
</div>



<a name="LanguageStatusSeverity.Error"></a><span class="ts" id=1814 data-target="#details-1814" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Error</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1814">
<div class="comment"><p>Error severity level.</p>
</div>
</div>

### <a name="LineCommentRule"></a><span class="code-item" id=1640>LineCommentRule</span>



<div class="comment"><p>Configuration for line comments.</p>
</div>

#### Properties



<a name="LineCommentRule.comment"></a><span class="ts" id=1641 data-target="#details-1641" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">comment</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1641">
<div class="comment"><p>The line comment token, like <code>//</code></p>
</div>
</div>



<a name="LineCommentRule.noIndent"></a><span class="ts" id=1642 data-target="#details-1642" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">noIndent</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1642">
<div class="comment"><p>Whether the comment token should not be indented and placed at the first column.
Defaults to false.</p>
</div>
</div>

### <a name="LinkedEditingRangeProvider"></a><span class="code-item" id=1550>LinkedEditingRangeProvider</span>



<div class="comment"><p>The linked editing range provider interface defines the contract between extensions and
the linked editing feature.</p>
</div>

#### Methods



<a name="LinkedEditingRangeProvider.provideLinkedEditingRanges"></a><span class="ts" id=1552 data-target="#details-1552" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideLinkedEditingRanges</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#LinkedEditingRanges">LinkedEditingRanges</a>&gt;</span>
<div class="details collapse" id="details-1552">
<div class="comment"><p>For a given position in a document, returns the range of the symbol at the position and all ranges
that have the same content. A change to one of the ranges can be applied to all other ranges if the new content
is valid. An optional word pattern can be returned with the result to describe valid contents.
If no result-specific word pattern is provided, the word pattern from the language configuration is used.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the provider was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the provider was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#LinkedEditingRanges">LinkedEditingRanges</a>&gt;</td><td><div class="comment"><p>A list of ranges that can be edited together</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="LinkedEditingRanges"></a><span class="code-item" id=1543>LinkedEditingRanges</span>



<div class="comment"><p>Represents a list of ranges that can be edited together along with a word pattern to describe valid range contents.</p>
</div>

#### Constructors



<a name="LinkedEditingRanges.LinkedEditingRanges"></a><span class="ts" id=1545 data-target="#details-1545" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">LinkedEditingRanges</span><span>(</span><span class="ident">ranges</span><span>: </span><a class="type-ref" href="#Range">Range</a>[], <span class="ident">wordPattern</span><span>?</span><span>: </span><span class="type-ref-ts">RegExp</span><span>)</span><span>: </span><a class="type-ref" href="#LinkedEditingRanges">LinkedEditingRanges</a></span>
<div class="details collapse" id="details-1545">
<div class="comment"><p>Create a new linked editing ranges object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">ranges</span><span>: </span><a class="type-ref" href="#Range">Range</a>[]</td><td><div class="comment"><p>A list of ranges that can be edited together</p>
</div></td></tr>
<tr><td><span class="ident">wordPattern</span><span>?</span><span>: </span><span class="type-ref-ts">RegExp</span></td><td><div class="comment"><p>An optional word pattern that describes valid contents for the given ranges</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#LinkedEditingRanges">LinkedEditingRanges</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="LinkedEditingRanges.ranges"></a><span class="ts" id=1548 data-target="#details-1548" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ranges</span><span>: </span><a class="type-ref" href="#Range">Range</a>[]</span>
<div class="details collapse" id="details-1548">
<div class="comment"><p>A list of ranges that can be edited together. The ranges must have
identical length and text content. The ranges cannot overlap.</p>
</div>
</div>



<a name="LinkedEditingRanges.wordPattern"></a><span class="ts" id=1549 data-target="#details-1549" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">wordPattern</span><span>: </span><span class="type-ref-ts">RegExp</span></span>
<div class="details collapse" id="details-1549">
<div class="comment"><p>An optional word pattern that describes valid contents for the given ranges.
If no pattern is provided, the language configuration&#39;s word pattern will be used.</p>
</div>
</div>

### <a name="Location"></a><span class="code-item" id=1736>Location</span>



<div class="comment"><p>Represents a location inside a resource, such as a line
inside a text file.</p>
</div>

#### Constructors



<a name="Location.Location"></a><span class="ts" id=1738 data-target="#details-1738" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Location</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">rangeOrPosition</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><a class="type-ref" href="#Location">Location</a></span>
<div class="details collapse" id="details-1738">
<div class="comment"><p>Creates a new location object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The resource identifier.</p>
</div></td></tr>
<tr><td><span class="ident">rangeOrPosition</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The range or position. Positions will be converted to an empty range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Location">Location</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="Location.range"></a><span class="ts" id=1742 data-target="#details-1742" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1742">
<div class="comment"><p>The document range of this location.</p>
</div>
</div>



<a name="Location.uri"></a><span class="ts" id=1741 data-target="#details-1741" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-1741">
<div class="comment"><p>The resource identifier of this location.</p>
</div>
</div>

### <a name="LocationLink"></a><span class="code-item" id=1743>LocationLink</span>



<div class="comment"><p>Represents the connection of two locations. Provides additional metadata over normal <a href="#Location">locations</a>,
including an origin range.</p>
</div>

#### Properties



<a name="LocationLink.originSelectionRange"></a><span class="ts" id=1744 data-target="#details-1744" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">originSelectionRange</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1744">
<div class="comment"><p>Span of the origin of this link.</p>
<p>Used as the underlined span for mouse definition hover. Defaults to the word range at
the definition position.</p>
</div>
</div>



<a name="LocationLink.targetRange"></a><span class="ts" id=1746 data-target="#details-1746" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">targetRange</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1746">
<div class="comment"><p>The full target range of this link.</p>
</div>
</div>



<a name="LocationLink.targetSelectionRange"></a><span class="ts" id=1747 data-target="#details-1747" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">targetSelectionRange</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1747">
<div class="comment"><p>The span of this link.</p>
</div>
</div>



<a name="LocationLink.targetUri"></a><span class="ts" id=1745 data-target="#details-1745" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">targetUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-1745">
<div class="comment"><p>The target resource identifier of this link.</p>
</div>
</div>

### <a name="LogLevel"></a><span class="code-item" id=2575>LogLevel</span>



<div class="comment"><p>Log levels</p>
</div>

#### Enumeration Members



<a name="LogLevel.Off"></a><span class="ts" id=2576 data-target="#details-2576" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Off</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-2576">
<div class="comment"><p>No messages are logged with this level.</p>
</div>
</div>



<a name="LogLevel.Trace"></a><span class="ts" id=2577 data-target="#details-2577" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Trace</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-2577">
<div class="comment"><p>All messages are logged with this level.</p>
</div>
</div>



<a name="LogLevel.Debug"></a><span class="ts" id=2578 data-target="#details-2578" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Debug</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-2578">
<div class="comment"><p>Messages with debug and higher log level are logged with this level.</p>
</div>
</div>



<a name="LogLevel.Info"></a><span class="ts" id=2579 data-target="#details-2579" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Info</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-2579">
<div class="comment"><p>Messages with info and higher log level are logged with this level.</p>
</div>
</div>



<a name="LogLevel.Warning"></a><span class="ts" id=2580 data-target="#details-2580" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Warning</span><span>: </span><span class="type-literal">4</span></span>
<div class="details collapse" id="details-2580">
<div class="comment"><p>Messages with warning and higher log level are logged with this level.</p>
</div>
</div>



<a name="LogLevel.Error"></a><span class="ts" id=2581 data-target="#details-2581" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Error</span><span>: </span><span class="type-literal">5</span></span>
<div class="details collapse" id="details-2581">
<div class="comment"><p>Only error messages are logged with this level.</p>
</div>
</div>

### <a name="LogOutputChannel"></a><span class="code-item" id=1862>LogOutputChannel</span>



<div class="comment"><p>A channel for containing log output.</p>
<p>To get an instance of a <code>LogOutputChannel</code> use
<a href="#window.createOutputChannel">createOutputChannel</a>.</p>
</div>

#### Events



<a name="LogOutputChannel.onDidChangeLogLevel"></a><span class="ts" id=1864 data-target="#details-1864" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeLogLevel</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#LogLevel">LogLevel</a>&gt;</span>
<div class="details collapse" id="details-1864">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the log level of the channel changes.</p>
</div>
</div>

#### Properties



<a name="LogOutputChannel.logLevel"></a><span class="ts" id=1863 data-target="#details-1863" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">logLevel</span><span>: </span><a class="type-ref" href="#LogLevel">LogLevel</a></span>
<div class="details collapse" id="details-1863">
<div class="comment"><p>The current log level of the channel. Defaults to <a href="#env.logLevel">editor log level</a>.</p>
</div>
</div>



<a name="LogOutputChannel.name"></a><span class="ts" id=1885 data-target="#details-1885" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1885">
<div class="comment"><p>The human-readable name of this output channel.</p>
</div>
</div>

#### Methods



<a name="LogOutputChannel.append"></a><span class="ts" id=1887 data-target="#details-1887" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">append</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1887">
<div class="comment"><p>Append the given value to the channel.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string, falsy values will not be printed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LogOutputChannel.appendLine"></a><span class="ts" id=1890 data-target="#details-1890" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendLine</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1890">
<div class="comment"><p>Append the given value and a line feed character
to the channel.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string, falsy values will be printed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LogOutputChannel.clear"></a><span class="ts" id=1896 data-target="#details-1896" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">clear</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1896">
<div class="comment"><p>Removes all output from the channel.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LogOutputChannel.debug"></a><span class="ts" id=1870 data-target="#details-1870" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">debug</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span>...</span><span class="ident">args</span><span>: </span><span class="type-intrinsic">any</span>[]<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1870">
<div class="comment"><p>Outputs the given debug message to the channel.</p>
<p>The message is only logged if the channel is configured to display <a href="#LogLevel.Debug">debug</a> log level or lower.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>debug message to log</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">args</span><span>: </span><span class="type-intrinsic">any</span>[]</td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LogOutputChannel.dispose"></a><span class="ts" id=1906 data-target="#details-1906" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1906">
<div class="comment"><p>Dispose and free associated resources.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LogOutputChannel.error"></a><span class="ts" id=1882 data-target="#details-1882" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">error</span><span>(</span><span class="ident">error</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-ref-ts">Error</span>, <span>...</span><span class="ident">args</span><span>: </span><span class="type-intrinsic">any</span>[]<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1882">
<div class="comment"><p>Outputs the given error or error message to the channel.</p>
<p>The message is only logged if the channel is configured to display <a href="#LogLevel.Error">error</a> log level or lower.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">error</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-ref-ts">Error</span></td><td><div class="comment"><p>Error or error message to log</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">args</span><span>: </span><span class="type-intrinsic">any</span>[]</td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LogOutputChannel.hide"></a><span class="ts" id=1904 data-target="#details-1904" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hide</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1904">
<div class="comment"><p>Hide this channel from the UI.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LogOutputChannel.info"></a><span class="ts" id=1874 data-target="#details-1874" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">info</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span>...</span><span class="ident">args</span><span>: </span><span class="type-intrinsic">any</span>[]<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1874">
<div class="comment"><p>Outputs the given information message to the channel.</p>
<p>The message is only logged if the channel is configured to display <a href="#LogLevel.Info">info</a> log level or lower.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>info message to log</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">args</span><span>: </span><span class="type-intrinsic">any</span>[]</td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LogOutputChannel.replace"></a><span class="ts" id=1893 data-target="#details-1893" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">replace</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1893">
<div class="comment"><p>Replaces all output from the channel with the given value.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string, falsy values will not be printed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LogOutputChannel.show"></a><span class="ts" id=1898 data-target="#details-1898" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">show</span><span>(</span><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1898">
<div class="comment"><p>Reveal this channel in the UI.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>When <code>true</code> the channel will not take focus.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LogOutputChannel.show"></a><span class="ts" id=1900 data-target="#details-1900" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">show</span><span>(</span><span class="ident">column</span><span>?</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a>, <span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1900">
<div class="comment"><p>Reveal this channel in the UI.</p>
<ul>
<li><em>deprecated</em> - Use the overload with just one parameter (<code>show(preserveFocus?: boolean): void</code>).</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">column</span><span>?</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a></td><td><div class="comment"><p>This argument is <strong>deprecated</strong> and will be ignored.</p>
</div></td></tr>
<tr><td><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>When <code>true</code> the channel will not take focus.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LogOutputChannel.trace"></a><span class="ts" id=1866 data-target="#details-1866" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">trace</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span>...</span><span class="ident">args</span><span>: </span><span class="type-intrinsic">any</span>[]<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1866">
<div class="comment"><p>Outputs the given trace message to the channel. Use this method to log verbose information.</p>
<p>The message is only logged if the channel is configured to display <a href="#LogLevel.Trace">trace</a> log level.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>trace message to log</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">args</span><span>: </span><span class="type-intrinsic">any</span>[]</td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="LogOutputChannel.warn"></a><span class="ts" id=1878 data-target="#details-1878" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">warn</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span>, <span>...</span><span class="ident">args</span><span>: </span><span class="type-intrinsic">any</span>[]<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1878">
<div class="comment"><p>Outputs the given warning message to the channel.</p>
<p>The message is only logged if the channel is configured to display <a href="#LogLevel.Warning">warning</a> log level or lower.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>warning message to log</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">args</span><span>: </span><span class="type-intrinsic">any</span>[]</td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="MarkdownString"></a><span class="code-item" id=700>MarkdownString</span>



<div class="comment"><p>Human-readable text that supports formatting via the <a href="https://commonmark.org">markdown syntax</a>.</p>
<p>Rendering of <a href="#ThemeIcon">theme icons</a> via the <code>$(&lt;name&gt;)</code>-syntax is supported
when the <a href="#MarkdownString.supportThemeIcons">supportThemeIcons</a> is set to <code>true</code>.</p>
<p>Rendering of embedded html is supported when <a href="#MarkdownString.supportHtml">supportHtml</a> is set to <code>true</code>.</p>
</div>

#### Constructors



<a name="MarkdownString.MarkdownString"></a><span class="ts" id=702 data-target="#details-702" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">MarkdownString</span><span>(</span><span class="ident">value</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">supportThemeIcons</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-702">
<div class="comment"><p>Creates a new markdown string with the given value.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Optional, initial value.</p>
</div></td></tr>
<tr><td><span class="ident">supportThemeIcons</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Optional, Specifies whether <a href="#ThemeIcon">ThemeIcons</a> are supported within the <a href="#MarkdownString">MarkdownString</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#MarkdownString">MarkdownString</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="MarkdownString.baseUri"></a><span class="ts" id=711 data-target="#details-711" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">baseUri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-711">
<div class="comment"><p>Uri that relative paths are resolved relative to.</p>
<p>If the <code>baseUri</code> ends with <code>/</code>, it is considered a directory and relative paths in the markdown are resolved relative to that directory:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> md</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">MarkdownString</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`[link](./file.js)`</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">md</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">baseUri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">Uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">file</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'/path/to/dir/'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Here 'link' in the rendered markdown resolves to '/path/to/dir/file.js'</span></span>
<span class="line"></span></code></pre>
<p>If the <code>baseUri</code> is a file, relative paths in the markdown are resolved relative to the parent dir of that file:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> md</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">MarkdownString</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`[link](./file.js)`</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">md</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">baseUri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">Uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">file</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'/path/to/otherFile.js'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Here 'link' in the rendered markdown resolves to '/path/to/file.js'</span></span>
<span class="line"></span></code></pre>
</div>
</div>



<a name="MarkdownString.isTrusted"></a><span class="ts" id=706 data-target="#details-706" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isTrusted</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span> &#124; {enabledCommands: readonly <span class="type-intrinsic">string</span>[]}</span>
<div class="details collapse" id="details-706">
<div class="comment"><p>Indicates that this markdown string is from a trusted source. Only <em>trusted</em>
markdown supports links that execute commands, e.g. <code>[Run it](command:myCommandId)</code>.</p>
<p>Defaults to <code>false</code> (commands are disabled).</p>
</div>
</div>



<a name="MarkdownString.supportHtml"></a><span class="ts" id=710 data-target="#details-710" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">supportHtml</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-710">
<div class="comment"><p>Indicates that this markdown string can contain raw html tags. Defaults to <code>false</code>.</p>
<p>When <code>supportHtml</code> is false, the markdown renderer will strip out any raw html tags
that appear in the markdown text. This means you can only use markdown syntax for rendering.</p>
<p>When <code>supportHtml</code> is true, the markdown render will also allow a safe subset of html tags
and attributes to be rendered. See <a href="https://github.com/microsoft/vscode/blob/6d2920473c6f13759c978dd89104c4270a83422d/src/vs/base/browser/markdownRenderer.ts#L296">https://github.com/microsoft/vscode/blob/6d2920473c6f13759c978dd89104c4270a83422d/src/vs/base/browser/markdownRenderer.ts#L296</a>
for a list of all supported tags and attributes.</p>
</div>
</div>



<a name="MarkdownString.supportThemeIcons"></a><span class="ts" id=709 data-target="#details-709" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">supportThemeIcons</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-709">
<div class="comment"><p>Indicates that this markdown string can contain <a href="#ThemeIcon">ThemeIcons</a>, e.g. <code>$(zap)</code>.</p>
</div>
</div>



<a name="MarkdownString.value"></a><span class="ts" id=705 data-target="#details-705" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-705">
<div class="comment"><p>The markdown string.</p>
</div>
</div>

#### Methods



<a name="MarkdownString.appendCodeblock"></a><span class="ts" id=719 data-target="#details-719" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendCodeblock</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">language</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-719">
<div class="comment"><p>Appends the given string as codeblock using the provided language.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A code snippet.</p>
</div></td></tr>
<tr><td><span class="ident">language</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>An optional <a href="#languages.getLanguages">language identifier</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#MarkdownString">MarkdownString</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="MarkdownString.appendMarkdown"></a><span class="ts" id=716 data-target="#details-716" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendMarkdown</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-716">
<div class="comment"><p>Appends the given string &#39;as is&#39; to this markdown string. When <a href="#MarkdownString.supportThemeIcons">supportThemeIcons</a> is <code>true</code>, <a href="#ThemeIcon">ThemeIcons</a> in the <code>value</code> will be iconified.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Markdown string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#MarkdownString">MarkdownString</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="MarkdownString.appendText"></a><span class="ts" id=713 data-target="#details-713" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendText</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-713">
<div class="comment"><p>Appends and escapes the given string to this markdown string.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Plain text.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#MarkdownString">MarkdownString</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="MarkedString"></a><span class="code-item" id=722>MarkedString</span>



<div class="comment"><p>MarkedString can be used to render human-readable text. It is either a markdown string
or a code-block that provides a language and a code snippet. Note that
markdown strings will be sanitized - that means html will be escaped.</p>
<ul>
<li><em>deprecated</em> - This type is deprecated, please use <a href="#MarkdownString">MarkdownString</a> instead.</li>
</ul>
</div>



<a name="MarkedString"></a><span class="ts" id=722 data-target="#details-722" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">MarkedString</span><span>: </span><span class="type-intrinsic">string</span> &#124; {language: <span class="type-intrinsic">string</span>, value: <span class="type-intrinsic">string</span>}</span>

### <a name="McpHttpServerDefinition"></a><span class="code-item" id=5006>McpHttpServerDefinition</span>



<div class="comment"><p>McpHttpServerDefinition represents an MCP server available using the
Streamable HTTP transport.</p>
</div>

#### Constructors



<a name="McpHttpServerDefinition.McpHttpServerDefinition"></a><span class="ts" id=5008 data-target="#details-5008" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">McpHttpServerDefinition</span><span>(</span><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">headers</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">string</span>&gt;, <span class="ident">version</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#McpHttpServerDefinition">McpHttpServerDefinition</a></span>
<div class="details collapse" id="details-5008">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The human-readable name of the server.</p>
</div></td></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The URI of the server.</p>
</div></td></tr>
<tr><td><span class="ident">headers</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">string</span>&gt;</td><td><div class="comment"><p>Optional additional headers included with requests to the server&#39;s origin.</p>
</div></td></tr>
<tr><td><span class="ident">version</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#McpHttpServerDefinition">McpHttpServerDefinition</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="McpHttpServerDefinition.headers"></a><span class="ts" id=5015 data-target="#details-5015" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">headers</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-5015">
<div class="comment"><p>Optional additional headers included with requests to the server&#39;s origin.
These headers are not sent to a different origin, including across redirects.</p>
</div>
</div>



<a name="McpHttpServerDefinition.label"></a><span class="ts" id=5013 data-target="#details-5013" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5013">
<div class="comment"><p>The human-readable name of the server.</p>
</div>
</div>



<a name="McpHttpServerDefinition.uri"></a><span class="ts" id=5014 data-target="#details-5014" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-5014">
<div class="comment"><p>The URI of the server. The editor will make a POST request to this URI
to begin each session.</p>
</div>
</div>



<a name="McpHttpServerDefinition.version"></a><span class="ts" id=5016 data-target="#details-5016" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">version</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5016">
<div class="comment"><p>Optional version identification for the server. If this changes, the
editor will indicate that tools have changed and prompt to refresh them.</p>
</div>
</div>

### <a name="McpServerDefinition"></a><span class="code-item" id=5017>McpServerDefinition</span>



<div class="comment"><p>Definitions that describe different types of Model Context Protocol servers,
which can be returned from the <a href="#McpServerDefinitionProvider">McpServerDefinitionProvider</a>.</p>
</div>



<a name="McpServerDefinition"></a><span class="ts" id=5017 data-target="#details-5017" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">McpServerDefinition</span><span>: </span><a class="type-ref" href="#McpStdioServerDefinition">McpStdioServerDefinition</a> &#124; <a class="type-ref" href="#McpHttpServerDefinition">McpHttpServerDefinition</a></span>

### <a name="McpServerDefinitionProvider"></a><span class="code-item" id=5018>McpServerDefinitionProvider&lt;T&gt;</span>



<div class="comment"><p>A type that can provide Model Context Protocol server definitions. This
should be registered using <a href="#lm.registerMcpServerDefinitionProvider">lm.registerMcpServerDefinitionProvider</a>
during extension activation.</p>
</div>

#### Events



<a name="McpServerDefinitionProvider.onDidChangeMcpServerDefinitions"></a><span class="ts" id=5020 data-target="#details-5020" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeMcpServerDefinitions</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-5020">
<div class="comment"><p>Optional event fired to signal that the set of available servers has changed.</p>
</div>
</div>

#### Methods



<a name="McpServerDefinitionProvider.provideMcpServerDefinitions"></a><span class="ts" id=5022 data-target="#details-5022" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideMcpServerDefinitions</span><span>(</span><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-5022">
<div class="comment"><p>Provides available MCP servers. The editor will call this method eagerly
to ensure the availability of servers for the language model, and so
extensions should not take actions which would require user
interaction, such as authentication.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>An array of MCP available MCP servers</p>
</div></td></tr>
</table>
</div>
</div>



<a name="McpServerDefinitionProvider.resolveMcpServerDefinition"></a><span class="ts" id=5025 data-target="#details-5025" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveMcpServerDefinition</span><span>(</span><span class="ident">server</span><span>: </span><span class="type-ref">T</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-5025">
<div class="comment"><p>This function will be called when the editor needs to start a MCP server.
At this point, the extension may take any actions which may require user
interaction, such as authentication. Any non-<code>readonly</code> property of the
server may be modified, and the extension should return the resolved server.</p>
<p>The extension may return undefined to indicate that the server
should not be started, or throw an error. If there is a pending tool
call, the editor will cancel it and return an error message to the
language model.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">server</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The MCP server to resolve</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>The resolved server or thenable that resolves to such. This may
be the given <code>server</code> definition with non-readonly properties filled in.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="McpStdioServerDefinition"></a><span class="code-item" id=4992>McpStdioServerDefinition</span>



<div class="comment"><p>McpStdioServerDefinition represents an MCP server available by running
a local process and operating on its stdin and stdout streams. The process
will be spawned as a child process of the extension host and by default
will not run in a shell environment.</p>
</div>

#### Constructors



<a name="McpStdioServerDefinition.McpStdioServerDefinition"></a><span class="ts" id=4994 data-target="#details-4994" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">McpStdioServerDefinition</span><span>(</span><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">args</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>[], <span class="ident">env</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span> &#124; <span class="type-literal">null</span>&gt;, <span class="ident">version</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#McpStdioServerDefinition">McpStdioServerDefinition</a></span>
<div class="details collapse" id="details-4994">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The human-readable name of the server.</p>
</div></td></tr>
<tr><td><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The command used to start the server.</p>
</div></td></tr>
<tr><td><span class="ident">args</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>Additional command-line arguments passed to the server.</p>
</div></td></tr>
<tr><td><span class="ident">env</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span> &#124; <span class="type-literal">null</span>&gt;</td><td><div class="comment"><p>Optional additional environment information for the server.</p>
</div></td></tr>
<tr><td><span class="ident">version</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Optional version identification for the server.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#McpStdioServerDefinition">McpStdioServerDefinition</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="McpStdioServerDefinition.args"></a><span class="ts" id=5003 data-target="#details-5003" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">args</span><span>: </span><span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-5003">
<div class="comment"><p>Additional command-line arguments passed to the server.</p>
</div>
</div>



<a name="McpStdioServerDefinition.command"></a><span class="ts" id=5002 data-target="#details-5002" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5002">
<div class="comment"><p>The command used to start the server. Node.js-based servers may use
<code>process.execPath</code> to use the editor&#39;s version of Node.js to run the script.</p>
</div>
</div>



<a name="McpStdioServerDefinition.cwd"></a><span class="ts" id=5001 data-target="#details-5001" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cwd</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-5001">
<div class="comment"><p>The working directory used to start the server.</p>
</div>
</div>



<a name="McpStdioServerDefinition.env"></a><span class="ts" id=5004 data-target="#details-5004" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">env</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span> &#124; <span class="type-literal">null</span>&gt;</span>
<div class="details collapse" id="details-5004">
<div class="comment"><p>Optional additional environment information for the server. Variables
in this environment will overwrite or remove (if null) the default
environment variables of the editor&#39;s extension host.</p>
</div>
</div>



<a name="McpStdioServerDefinition.label"></a><span class="ts" id=5000 data-target="#details-5000" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5000">
<div class="comment"><p>The human-readable name of the server.</p>
</div>
</div>



<a name="McpStdioServerDefinition.version"></a><span class="ts" id=5005 data-target="#details-5005" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">version</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-5005">
<div class="comment"><p>Optional version identification for the server. If this changes, the
editor will indicate that tools have changed and prompt to refresh them.</p>
</div>
</div>

### <a name="Memento"></a><span class="code-item" id=2088>Memento</span>



<div class="comment"><p>A memento represents a storage utility. It can store and retrieve
values.</p>
</div>

#### Methods



<a name="Memento.get"></a><span class="ts" id=2092 data-target="#details-2092" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">get</span><span>&lt;</span>T<span>&gt;</span><span>(</span><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-ref">T</span></span>
<div class="details collapse" id="details-2092">
<div class="comment"><p>Return a value.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">T</span></td><td><div class="comment"><p>The stored value or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Memento.get"></a><span class="ts" id=2095 data-target="#details-2095" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">get</span><span>&lt;</span>T<span>&gt;</span><span>(</span><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">defaultValue</span><span>: </span><span class="type-ref">T</span><span>)</span><span>: </span><span class="type-ref">T</span></span>
<div class="details collapse" id="details-2095">
<div class="comment"><p>Return a value.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string.</p>
</div></td></tr>
<tr><td><span class="ident">defaultValue</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>A value that should be returned when there is no
value (<code>undefined</code>) with the given key.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">T</span></td><td><div class="comment"><p>The stored value or the defaultValue.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Memento.keys"></a><span class="ts" id=2090 data-target="#details-2090" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">keys</span><span>(</span><span>)</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-2090">
<div class="comment"><p>Returns the stored keys.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td>readonly <span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>The stored keys.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Memento.update"></a><span class="ts" id=2100 data-target="#details-2100" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">update</span><span>(</span><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">value</span><span>: </span><span class="type-intrinsic">any</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2100">
<div class="comment"><p>Store a value. The value must be JSON-stringifyable.</p>
<p><em>Note</em> that using <code>undefined</code> as value removes the key from the underlying
storage.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string.</p>
</div></td></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>A value. MUST not contain cyclic references.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="MessageItem"></a><span class="code-item" id=549>MessageItem</span>



<div class="comment"><p>Represents an action that is shown with an information, warning, or
error message.</p>
<p><em>See also</em></p>
<ul>
<li><a href="#window.showInformationMessage">showInformationMessage</a></li>
<li><a href="#window.showWarningMessage">showWarningMessage</a></li>
<li><a href="#window.showErrorMessage">showErrorMessage</a></li>
</ul>
</div>

#### Properties



<a name="MessageItem.isCloseAffordance"></a><span class="ts" id=551 data-target="#details-551" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isCloseAffordance</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-551">
<div class="comment"><p>A hint for modal dialogs that the item should be triggered
when the user cancels the dialog (e.g. by pressing the ESC
key).</p>
<p>Note: this option is ignored for non-modal messages.</p>
</div>
</div>



<a name="MessageItem.title"></a><span class="ts" id=550 data-target="#details-550" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-550">
<div class="comment"><p>A short title like &#39;Retry&#39;, &#39;Open Log&#39; etc.</p>
</div>
</div>

### <a name="MessageOptions"></a><span class="code-item" id=552>MessageOptions</span>



<div class="comment"><p>Options to configure the behavior of the message.</p>
<p><em>See also</em></p>
<ul>
<li><a href="#window.showInformationMessage">showInformationMessage</a></li>
<li><a href="#window.showWarningMessage">showWarningMessage</a></li>
<li><a href="#window.showErrorMessage">showErrorMessage</a></li>
</ul>
</div>

#### Properties



<a name="MessageOptions.detail"></a><span class="ts" id=554 data-target="#details-554" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">detail</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-554">
<div class="comment"><p>Human-readable detail message that is rendered less prominent. <em>Note</em> that detail
is only shown for <a href="#MessageOptions.modal">modal</a> messages.</p>
</div>
</div>



<a name="MessageOptions.modal"></a><span class="ts" id=553 data-target="#details-553" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">modal</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-553">
<div class="comment"><p>Indicates that this message should be modal.</p>
</div>
</div>

### <a name="NotebookCell"></a><span class="code-item" id=3691>NotebookCell</span>



<div class="comment"><p>Represents a cell of a <a href="#NotebookDocument">notebook</a>, either a <a href="#NotebookCellKind.Code">code</a>-cell
or <a href="#NotebookCellKind.Markup">markup</a>-cell.</p>
<p>NotebookCell instances are immutable and are kept in sync for as long as they are part of their notebook.</p>
</div>

#### Properties



<a name="NotebookCell.document"></a><span class="ts" id=3695 data-target="#details-3695" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></span>
<div class="details collapse" id="details-3695">
<div class="comment"><p>The <a href="#TextDocument">text</a> of this cell, represented as text document.</p>
</div>
</div>



<a name="NotebookCell.executionSummary"></a><span class="ts" id=3701 data-target="#details-3701" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executionSummary</span><span>: </span><a class="type-ref" href="#NotebookCellExecutionSummary">NotebookCellExecutionSummary</a></span>
<div class="details collapse" id="details-3701">
<div class="comment"><p>The most recent <a href="#NotebookCellExecutionSummary">execution summary</a> for this cell.</p>
</div>
</div>



<a name="NotebookCell.index"></a><span class="ts" id=3692 data-target="#details-3692" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">index</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3692">
<div class="comment"><p>The index of this cell in its <a href="#NotebookDocument.cellAt">containing notebook</a>. The
index is updated when a cell is moved within its notebook. The index is <code>-1</code>
when the cell has been removed from its notebook.</p>
</div>
</div>



<a name="NotebookCell.kind"></a><span class="ts" id=3694 data-target="#details-3694" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>: </span><a class="type-ref" href="#NotebookCellKind">NotebookCellKind</a></span>
<div class="details collapse" id="details-3694">
<div class="comment"><p>The kind of this cell.</p>
</div>
</div>



<a name="NotebookCell.metadata"></a><span class="ts" id=3696 data-target="#details-3696" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">metadata</span><span>: </span></span>
<div class="details collapse" id="details-3696">
<div class="comment"><p>The metadata of this cell. Can be anything but must be JSON-stringifyable.</p>
</div>
</div>



<a name="NotebookCell.notebook"></a><span class="ts" id=3693 data-target="#details-3693" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">notebook</span><span>: </span><a class="type-ref" href="#NotebookDocument">NotebookDocument</a></span>
<div class="details collapse" id="details-3693">
<div class="comment"><p>The <a href="#NotebookDocument">notebook</a> that contains this cell.</p>
</div>
</div>



<a name="NotebookCell.outputs"></a><span class="ts" id=3700 data-target="#details-3700" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">outputs</span><span>: </span>readonly <a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a>[]</span>
<div class="details collapse" id="details-3700">
<div class="comment"><p>The outputs of this cell.</p>
</div>
</div>

### <a name="NotebookCellData"></a><span class="code-item" id=3810>NotebookCellData</span>



<div class="comment"><p>NotebookCellData is the raw representation of notebook cells. Its is part of <a href="#NotebookData">NotebookData</a>.</p>
</div>

#### Constructors



<a name="NotebookCellData.NotebookCellData"></a><span class="ts" id=3812 data-target="#details-3812" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">NotebookCellData</span><span>(</span><span class="ident">kind</span><span>: </span><a class="type-ref" href="#NotebookCellKind">NotebookCellKind</a>, <span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">languageId</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#NotebookCellData">NotebookCellData</a></span>
<div class="details collapse" id="details-3812">
<div class="comment"><p>Create new cell data. Minimal cell data specifies its kind, its source value, and the
language identifier of its source.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">kind</span><span>: </span><a class="type-ref" href="#NotebookCellKind">NotebookCellKind</a></td><td><div class="comment"><p>The kind.</p>
</div></td></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The source value.</p>
</div></td></tr>
<tr><td><span class="ident">languageId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The language identifier of the source value.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookCellData">NotebookCellData</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="NotebookCellData.executionSummary"></a><span class="ts" id=3824 data-target="#details-3824" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executionSummary</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookCellExecutionSummary">NotebookCellExecutionSummary</a></span>
<div class="details collapse" id="details-3824">
<div class="comment"><p>The execution summary of this cell data.</p>
</div>
</div>



<a name="NotebookCellData.kind"></a><span class="ts" id=3816 data-target="#details-3816" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>: </span><a class="type-ref" href="#NotebookCellKind">NotebookCellKind</a></span>
<div class="details collapse" id="details-3816">
<div class="comment"><p>The <a href="#NotebookCellKind">kind</a> of this cell data.</p>
</div>
</div>



<a name="NotebookCellData.languageId"></a><span class="ts" id=3818 data-target="#details-3818" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">languageId</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3818">
<div class="comment"><p>The language identifier of the source value of this cell data. Any value from
<a href="#languages.getLanguages">getLanguages</a> is possible.</p>
</div>
</div>



<a name="NotebookCellData.metadata"></a><span class="ts" id=3820 data-target="#details-3820" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">metadata</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-3820">
<div class="comment"><p>Arbitrary metadata of this cell data. Can be anything but must be JSON-stringifyable.</p>
</div>
</div>



<a name="NotebookCellData.outputs"></a><span class="ts" id=3819 data-target="#details-3819" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">outputs</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a>[]</span>
<div class="details collapse" id="details-3819">
<div class="comment"><p>The outputs of this cell data.</p>
</div>
</div>



<a name="NotebookCellData.value"></a><span class="ts" id=3817 data-target="#details-3817" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3817">
<div class="comment"><p>The source value of this cell data - either source code or formatted text.</p>
</div>
</div>

### <a name="NotebookCellExecution"></a><span class="code-item" id=3887>NotebookCellExecution</span>



<div class="comment"><p>A NotebookCellExecution is how <a href="#NotebookController">notebook controller</a> modify a notebook cell as
it is executing.</p>
<p>When a cell execution object is created, the cell enters the [NotebookCellExecutionState.Pending Pending](#NotebookCellExecutionState.Pending Pending) state.
When <a href="#NotebookCellExecution.start">start(...)</a> is called on the execution task, it enters the [NotebookCellExecutionState.Executing Executing](#NotebookCellExecutionState.Executing Executing) state. When
<a href="#NotebookCellExecution.end">end(...)</a> is called, it enters the [NotebookCellExecutionState.Idle Idle](#NotebookCellExecutionState.Idle Idle) state.</p>
</div>

#### Properties



<a name="NotebookCellExecution.cell"></a><span class="ts" id=3888 data-target="#details-3888" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cell</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a></span>
<div class="details collapse" id="details-3888">
<div class="comment"><p>The <a href="#NotebookCell">cell</a> for which this execution has been created.</p>
</div>
</div>



<a name="NotebookCellExecution.executionOrder"></a><span class="ts" id=3890 data-target="#details-3890" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executionOrder</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3890">
<div class="comment"><p>Set and unset the order of this cell execution.</p>
</div>
</div>



<a name="NotebookCellExecution.token"></a><span class="ts" id=3889 data-target="#details-3889" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></span>
<div class="details collapse" id="details-3889">
<div class="comment"><p>A cancellation token which will be triggered when the cell execution is canceled
from the UI.</p>
<p><em>Note</em> that the cancellation token will not be triggered when the <a href="#NotebookController">controller</a>
that created this execution uses an <a href="#NotebookController.interruptHandler">interrupt-handler</a>.</p>
</div>
</div>

#### Methods



<a name="NotebookCellExecution.appendOutput"></a><span class="ts" id=3906 data-target="#details-3906" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendOutput</span><span>(</span><span class="ident">out</span><span>: </span><a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a> &#124; readonly <a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a>[], <span class="ident">cell</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3906">
<div class="comment"><p>Append to the output of the cell that is executing or to another cell that is affected by this execution.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">out</span><span>: </span><a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a> &#124; readonly <a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a>[]</td><td><div class="comment"><p>Output that is appended to the current output.</p>
</div></td></tr>
<tr><td><span class="ident">cell</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a></td><td><div class="comment"><p>Cell for which output is cleared. Defaults to the <a href="#NotebookCellExecution.cell">cell</a> of
this execution.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>A thenable that resolves when the operation finished.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="NotebookCellExecution.appendOutputItems"></a><span class="ts" id=3914 data-target="#details-3914" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendOutputItems</span><span>(</span><span class="ident">items</span><span>: </span><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a> &#124; readonly <a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a>[], <span class="ident">output</span><span>: </span><a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3914">
<div class="comment"><p>Append output items to existing cell output.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">items</span><span>: </span><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a> &#124; readonly <a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a>[]</td><td><div class="comment"><p>Output items that are append to existing output.</p>
</div></td></tr>
<tr><td><span class="ident">output</span><span>: </span><a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a></td><td><div class="comment"><p>Output object that already exists.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>A thenable that resolves when the operation finished.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="NotebookCellExecution.clearOutput"></a><span class="ts" id=3899 data-target="#details-3899" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">clearOutput</span><span>(</span><span class="ident">cell</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3899">
<div class="comment"><p>Clears the output of the cell that is executing or of another cell that is affected by this execution.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">cell</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a></td><td><div class="comment"><p>Cell for which output is cleared. Defaults to the <a href="#NotebookCellExecution.cell">cell</a> of
this execution.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>A thenable that resolves when the operation finished.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="NotebookCellExecution.end"></a><span class="ts" id=3895 data-target="#details-3895" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">end</span><span>(</span><span class="ident">success</span><span>: </span><span class="type-intrinsic">boolean</span>, <span class="ident">endTime</span><span>?</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3895">
<div class="comment"><p>Signal that execution has ended.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">success</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>If true, a green check is shown on the cell status bar.
If false, a red X is shown.
If undefined, no check or X icon is shown.</p>
</div></td></tr>
<tr><td><span class="ident">endTime</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The time that execution finished, in milliseconds in the Unix epoch.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="NotebookCellExecution.replaceOutput"></a><span class="ts" id=3902 data-target="#details-3902" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">replaceOutput</span><span>(</span><span class="ident">out</span><span>: </span><a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a> &#124; readonly <a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a>[], <span class="ident">cell</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3902">
<div class="comment"><p>Replace the output of the cell that is executing or of another cell that is affected by this execution.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">out</span><span>: </span><a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a> &#124; readonly <a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a>[]</td><td><div class="comment"><p>Output that replaces the current output.</p>
</div></td></tr>
<tr><td><span class="ident">cell</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a></td><td><div class="comment"><p>Cell for which output is cleared. Defaults to the <a href="#NotebookCellExecution.cell">cell</a> of
this execution.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>A thenable that resolves when the operation finished.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="NotebookCellExecution.replaceOutputItems"></a><span class="ts" id=3910 data-target="#details-3910" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">replaceOutputItems</span><span>(</span><span class="ident">items</span><span>: </span><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a> &#124; readonly <a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a>[], <span class="ident">output</span><span>: </span><a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3910">
<div class="comment"><p>Replace all output items of existing cell output.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">items</span><span>: </span><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a> &#124; readonly <a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a>[]</td><td><div class="comment"><p>Output items that replace the items of existing output.</p>
</div></td></tr>
<tr><td><span class="ident">output</span><span>: </span><a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a></td><td><div class="comment"><p>Output object that already exists.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>A thenable that resolves when the operation finished.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="NotebookCellExecution.start"></a><span class="ts" id=3892 data-target="#details-3892" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">start</span><span>(</span><span class="ident">startTime</span><span>?</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3892">
<div class="comment"><p>Signal that the execution has begun.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">startTime</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The time that execution began, in milliseconds in the Unix epoch. Used to drive the clock
that shows for how long a cell has been running. If not given, the clock won&#39;t be shown.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="NotebookCellExecutionSummary"></a><span class="code-item" id=3752>NotebookCellExecutionSummary</span>



<div class="comment"><p>The summary of a notebook cell execution.</p>
</div>

#### Properties



<a name="NotebookCellExecutionSummary.executionOrder"></a><span class="ts" id=3753 data-target="#details-3753" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executionOrder</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3753">
<div class="comment"><p>The order in which the execution happened.</p>
</div>
</div>



<a name="NotebookCellExecutionSummary.success"></a><span class="ts" id=3754 data-target="#details-3754" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">success</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3754">
<div class="comment"><p>If the execution finished successfully.</p>
</div>
</div>



<a name="NotebookCellExecutionSummary.timing"></a><span class="ts" id=3755 data-target="#details-3755" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">timing</span><span>?</span><span>: </span>{endTime: <span class="type-intrinsic">number</span>, startTime: <span class="type-intrinsic">number</span>}</span>
<div class="details collapse" id="details-3755">
<div class="comment"><p>The times at which execution started and ended, as unix timestamps</p>
</div>
<div class="signature variable-declaration-child">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td>endTime: <span class="type-intrinsic">number</span></td><td><div class="comment"><p>Execution end time.</p>
</div></td></tr>
<tr><td>startTime: <span class="type-intrinsic">number</span></td><td><div class="comment"><p>Execution start time.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="NotebookCellKind"></a><span class="code-item" id=3688>NotebookCellKind</span>



<div class="comment"><p>A notebook cell kind.</p>
</div>

#### Enumeration Members



<a name="NotebookCellKind.Markup"></a><span class="ts" id=3689 data-target="#details-3689" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Markup</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-3689">
<div class="comment"><p>A markup-cell is formatted source that is used for display.</p>
</div>
</div>



<a name="NotebookCellKind.Code"></a><span class="ts" id=3690 data-target="#details-3690" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Code</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-3690">
<div class="comment"><p>A code-cell is source that can be <a href="#NotebookController">executed</a> and that
produces <a href="#NotebookCellOutput">output</a>.</p>
</div>
</div>

### <a name="NotebookCellOutput"></a><span class="code-item" id=3797>NotebookCellOutput</span>



<div class="comment"><p>Notebook cell output represents a result of executing a cell. It is a container type for multiple
<a href="#NotebookCellOutputItem">output items</a> where contained items represent the same result but
use different MIME types.</p>
</div>

#### Constructors



<a name="NotebookCellOutput.NotebookCellOutput"></a><span class="ts" id=3799 data-target="#details-3799" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">NotebookCellOutput</span><span>(</span><span class="ident">items</span><span>: </span><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a>[], <span class="ident">metadata</span><span>?</span><span>: </span><span>)</span><span>: </span><a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a></span>
<div class="details collapse" id="details-3799">
<div class="comment"><p>Create new notebook output.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">items</span><span>: </span><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a>[]</td><td><div class="comment"><p>Notebook output items.</p>
</div></td></tr>
<tr><td><span class="ident">metadata</span><span>?</span><span>: </span></td><td><div class="comment"><p>Optional metadata.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="NotebookCellOutput.items"></a><span class="ts" id=3805 data-target="#details-3805" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">items</span><span>: </span><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a>[]</span>
<div class="details collapse" id="details-3805">
<div class="comment"><p>The output items of this output. Each item must represent the same result. <em>Note</em> that repeated
MIME types per output is invalid and that the editor will just pick one of them.</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">NotebookCellOutput</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">([</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">NotebookCellOutputItem</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">text</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Hello'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'text/plain'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">),</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">NotebookCellOutputItem</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">text</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'&#x3C;i>Hello&#x3C;/i>'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'text/html'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">),</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">NotebookCellOutputItem</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">text</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'_Hello_'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'text/markdown'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">),</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">NotebookCellOutputItem</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">text</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Hey'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'text/plain'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// INVALID: repeated type, editor will pick just one</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">]);</span></span>
<span class="line"></span></code></pre>
</div>
</div>



<a name="NotebookCellOutput.metadata"></a><span class="ts" id=3806 data-target="#details-3806" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">metadata</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-3806">
<div class="comment"><p>Arbitrary metadata for this cell output. Can be anything but must be JSON-stringifyable.</p>
</div>
</div>

### <a name="NotebookCellOutputItem"></a><span class="code-item" id=3773>NotebookCellOutputItem</span>



<div class="comment"><p>One representation of a <a href="#NotebookCellOutput">notebook output</a>, defined by MIME type and data.</p>
</div>

#### Static



<a name="NotebookCellOutputItem.error"></a><span class="ts" id=3789 data-target="#details-3789" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">error</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-ref-ts">Error</span><span>)</span><span>: </span><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a></span>
<div class="details collapse" id="details-3789">
<div class="comment"><p>Factory function to create a <code>NotebookCellOutputItem</code> that uses
uses the <code>application/vnd.code.notebook.error</code> mime type.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-ref-ts">Error</span></td><td><div class="comment"><p>An error object.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a></td><td><div class="comment"><p>A new output item object.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="NotebookCellOutputItem.json"></a><span class="ts" id=3779 data-target="#details-3779" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">json</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">any</span>, <span class="ident">mime</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a></span>
<div class="details collapse" id="details-3779">
<div class="comment"><p>Factory function to create a <code>NotebookCellOutputItem</code> from
a JSON object.</p>
<p><em>Note</em> that this function is not expecting &quot;stringified JSON&quot; but
an object that can be stringified. This function will throw an error
when the passed value cannot be JSON-stringified.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>A JSON-stringifyable value.</p>
</div></td></tr>
<tr><td><span class="ident">mime</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Optional MIME type, defaults to <code>application/json</code></p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a></td><td><div class="comment"><p>A new output item object.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="NotebookCellOutputItem.stderr"></a><span class="ts" id=3786 data-target="#details-3786" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">stderr</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a></span>
<div class="details collapse" id="details-3786">
<div class="comment"><p>Factory function to create a <code>NotebookCellOutputItem</code> that uses
uses the <code>application/vnd.code.notebook.stderr</code> mime type.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a></td><td><div class="comment"><p>A new output item object.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="NotebookCellOutputItem.stdout"></a><span class="ts" id=3783 data-target="#details-3783" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">stdout</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a></span>
<div class="details collapse" id="details-3783">
<div class="comment"><p>Factory function to create a <code>NotebookCellOutputItem</code> that uses
uses the <code>application/vnd.code.notebook.stdout</code> mime type.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a></td><td><div class="comment"><p>A new output item object.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="NotebookCellOutputItem.text"></a><span class="ts" id=3775 data-target="#details-3775" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">text</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">mime</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a></span>
<div class="details collapse" id="details-3775">
<div class="comment"><p>Factory function to create a <code>NotebookCellOutputItem</code> from a string.</p>
<p><em>Note</em> that an UTF-8 encoder is used to create bytes for the string.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string.</p>
</div></td></tr>
<tr><td><span class="ident">mime</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Optional MIME type, defaults to <code>text/plain</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a></td><td><div class="comment"><p>A new output item object.</p>
</div></td></tr>
</table>
</div>
</div>

#### Constructors



<a name="NotebookCellOutputItem.NotebookCellOutputItem"></a><span class="ts" id=3792 data-target="#details-3792" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">NotebookCellOutputItem</span><span>(</span><span class="ident">data</span><span>: </span><span class="type-ref-ts">Uint8Array</span>, <span class="ident">mime</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a></span>
<div class="details collapse" id="details-3792">
<div class="comment"><p>Create a new notebook cell output item.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">data</span><span>: </span><span class="type-ref-ts">Uint8Array</span></td><td><div class="comment"><p>The value of the output item.</p>
</div></td></tr>
<tr><td><span class="ident">mime</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The mime type of the output item.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookCellOutputItem">NotebookCellOutputItem</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="NotebookCellOutputItem.data"></a><span class="ts" id=3796 data-target="#details-3796" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">data</span><span>: </span><span class="type-ref-ts">Uint8Array</span></span>
<div class="details collapse" id="details-3796">
<div class="comment"><p>The data of this output item. Must always be an array of unsigned 8-bit integers.</p>
</div>
</div>



<a name="NotebookCellOutputItem.mime"></a><span class="ts" id=3795 data-target="#details-3795" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">mime</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3795">
<div class="comment"><p>The mime type which determines how the <a href="#NotebookCellOutputItem.data">data</a>-property
is interpreted.</p>
<p>Notebooks have built-in support for certain mime-types, extensions can add support for new
types and override existing types.</p>
</div>
</div>

### <a name="NotebookCellStatusBarAlignment"></a><span class="code-item" id=3917>NotebookCellStatusBarAlignment</span>



<div class="comment"><p>Represents the alignment of status bar items.</p>
</div>

#### Enumeration Members



<a name="NotebookCellStatusBarAlignment.Left"></a><span class="ts" id=3918 data-target="#details-3918" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Left</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-3918">
<div class="comment"><p>Aligned to the left side.</p>
</div>
</div>



<a name="NotebookCellStatusBarAlignment.Right"></a><span class="ts" id=3919 data-target="#details-3919" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Right</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-3919">
<div class="comment"><p>Aligned to the right side.</p>
</div>
</div>

### <a name="NotebookCellStatusBarItem"></a><span class="code-item" id=3920>NotebookCellStatusBarItem</span>



<div class="comment"><p>A contribution to a cell&#39;s status bar</p>
</div>

#### Constructors



<a name="NotebookCellStatusBarItem.NotebookCellStatusBarItem"></a><span class="ts" id=3922 data-target="#details-3922" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">NotebookCellStatusBarItem</span><span>(</span><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">alignment</span><span>: </span><a class="type-ref" href="#NotebookCellStatusBarAlignment">NotebookCellStatusBarAlignment</a><span>)</span><span>: </span><a class="type-ref" href="#NotebookCellStatusBarItem">NotebookCellStatusBarItem</a></span>
<div class="details collapse" id="details-3922">
<div class="comment"><p>Creates a new NotebookCellStatusBarItem.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The text to show for the item.</p>
</div></td></tr>
<tr><td><span class="ident">alignment</span><span>: </span><a class="type-ref" href="#NotebookCellStatusBarAlignment">NotebookCellStatusBarAlignment</a></td><td><div class="comment"><p>Whether the item is aligned to the left or right.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookCellStatusBarItem">NotebookCellStatusBarItem</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="NotebookCellStatusBarItem.accessibilityInformation"></a><span class="ts" id=3930 data-target="#details-3930" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">accessibilityInformation</span><span>?</span><span>: </span><a class="type-ref" href="#AccessibilityInformation">AccessibilityInformation</a></span>
<div class="details collapse" id="details-3930">
<div class="comment"><p>Accessibility information used when a screen reader interacts with this item.</p>
</div>
</div>



<a name="NotebookCellStatusBarItem.alignment"></a><span class="ts" id=3926 data-target="#details-3926" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">alignment</span><span>: </span><a class="type-ref" href="#NotebookCellStatusBarAlignment">NotebookCellStatusBarAlignment</a></span>
<div class="details collapse" id="details-3926">
<div class="comment"><p>Whether the item is aligned to the left or right.</p>
</div>
</div>



<a name="NotebookCellStatusBarItem.command"></a><span class="ts" id=3927 data-target="#details-3927" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Command">Command</a></span>
<div class="details collapse" id="details-3927">
<div class="comment"><p>An optional <a href="#Command">Command</a> or identifier of a command to run on click.</p>
<p>The command must be <a href="#commands.getCommands">known</a>.</p>
<p>Note that if this is a <a href="#Command">Command</a> object, only the <a href="#Command.command">command</a> and <a href="#Command.arguments">arguments</a>
are used by the editor.</p>
</div>
</div>



<a name="NotebookCellStatusBarItem.priority"></a><span class="ts" id=3929 data-target="#details-3929" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">priority</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3929">
<div class="comment"><p>The priority of the item. A higher value item will be shown more to the left.</p>
</div>
</div>



<a name="NotebookCellStatusBarItem.text"></a><span class="ts" id=3925 data-target="#details-3925" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3925">
<div class="comment"><p>The text to show for the item.</p>
</div>
</div>



<a name="NotebookCellStatusBarItem.tooltip"></a><span class="ts" id=3928 data-target="#details-3928" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3928">
<div class="comment"><p>A tooltip to show when the item is hovered.</p>
</div>
</div>

### <a name="NotebookCellStatusBarItemProvider"></a><span class="code-item" id=3931>NotebookCellStatusBarItemProvider</span>



<div class="comment"><p>A provider that can contribute items to the status bar that appears below a cell&#39;s editor.</p>
</div>

#### Events



<a name="NotebookCellStatusBarItemProvider.onDidChangeCellStatusBarItems"></a><span class="ts" id=3932 data-target="#details-3932" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeCellStatusBarItems</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3932">
<div class="comment"><p>An optional event to signal that statusbar items have changed. The provide method will be called again.</p>
</div>
</div>

#### Methods



<a name="NotebookCellStatusBarItemProvider.provideCellStatusBarItems"></a><span class="ts" id=3934 data-target="#details-3934" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideCellStatusBarItems</span><span>(</span><span class="ident">cell</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#NotebookCellStatusBarItem">NotebookCellStatusBarItem</a> &#124; <a class="type-ref" href="#NotebookCellStatusBarItem">NotebookCellStatusBarItem</a>[]&gt;</span>
<div class="details collapse" id="details-3934">
<div class="comment"><p>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.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">cell</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a></td><td><div class="comment"><p>The cell for which to return items.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A token triggered if this request should be cancelled.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#NotebookCellStatusBarItem">NotebookCellStatusBarItem</a> &#124; <a class="type-ref" href="#NotebookCellStatusBarItem">NotebookCellStatusBarItem</a>[]&gt;</td><td><div class="comment"><p>One or more <a href="#NotebookCellStatusBarItem">cell statusbar items</a></p>
</div></td></tr>
</table>
</div>
</div>

### <a name="NotebookController"></a><span class="code-item" id=3856>NotebookController</span>



<div class="comment"><p>A notebook controller represents an entity that can execute notebook cells. This is often referred to as a kernel.</p>
<p>There can be multiple controllers and the editor will let users choose which controller to use for a certain notebook. The
<a href="#NotebookController.notebookType">notebookType</a>-property defines for what kind of notebooks a controller is for and
the <a href="#NotebookController.updateNotebookAffinity">updateNotebookAffinity</a>-function allows controllers to set a preference
for specific notebook documents. When a controller has been selected its
<a href="#NotebookController.onDidChangeSelectedNotebooks">onDidChangeSelectedNotebooks</a>-event fires.</p>
<p>When a cell is being run the editor will invoke the <a href="#NotebookController.executeHandler">executeHandler</a> and a controller
is expected to create and finalize a <a href="#NotebookCellExecution">notebook cell execution</a>. However, controllers are also free
to create executions by themselves.</p>
</div>

#### Events



<a name="NotebookController.onDidChangeSelectedNotebooks"></a><span class="ts" id=3877 data-target="#details-3877" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeSelectedNotebooks</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;{notebook: <a class="type-ref" href="#NotebookDocument">NotebookDocument</a>, selected: <span class="type-intrinsic">boolean</span>}&gt;</span>
<div class="details collapse" id="details-3877">
<div class="comment"><p>An event that fires whenever a controller has been selected or un-selected for a notebook document.</p>
<p>There can be multiple controllers for a notebook and in that case a controllers needs to be <em>selected</em>. This is a user gesture
and happens either explicitly or implicitly when interacting with a notebook for which a controller was <em>suggested</em>. When possible,
the editor <em>suggests</em> a controller that is most likely to be <em>selected</em>.</p>
<p><em>Note</em> that controller selection is persisted (by the controllers <a href="#NotebookController.id">id</a>) and restored as soon as a
controller is re-created or as a notebook is <a href="#workspace.onDidOpenNotebookDocument">opened</a>.</p>
</div>
</div>

#### Properties



<a name="NotebookController.description"></a><span class="ts" id=3861 data-target="#details-3861" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">description</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3861">
<div class="comment"><p>The human-readable description which is rendered less prominent.</p>
</div>
</div>



<a name="NotebookController.detail"></a><span class="ts" id=3862 data-target="#details-3862" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">detail</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3862">
<div class="comment"><p>The human-readable detail which is rendered less prominent.</p>
</div>
</div>



<a name="NotebookController.executeHandler"></a><span class="ts" id=3867 data-target="#details-3867" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executeHandler</span><span>: </span>(cells: <a class="type-ref" href="#NotebookCell">NotebookCell</a>[], notebook: <a class="type-ref" href="#NotebookDocument">NotebookDocument</a>, controller: <a class="type-ref" href="#NotebookController">NotebookController</a>) =&gt; <span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3867">
<div class="comment"><p>The execute handler is invoked when the run gestures in the UI are selected, e.g Run Cell, Run All,
Run Selection etc. The execute handler is responsible for creating and managing <a href="#NotebookCellExecution">execution</a>-objects.</p>
</div>
<div class="comment"></div>
<div class="signature variable-declaration-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">cells</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a>[]</td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">notebook</span><span>: </span><a class="type-ref" href="#NotebookDocument">NotebookDocument</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">controller</span><span>: </span><a class="type-ref" href="#NotebookController">NotebookController</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="NotebookController.id"></a><span class="ts" id=3857 data-target="#details-3857" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3857">
<div class="comment"><p>The identifier of this notebook controller.</p>
<p><em>Note</em> that controllers are remembered by their identifier and that extensions should use
stable identifiers across sessions.</p>
</div>
</div>



<a name="NotebookController.interruptHandler"></a><span class="ts" id=3873 data-target="#details-3873" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">interruptHandler</span><span>?</span><span>: </span>(notebook: <a class="type-ref" href="#NotebookDocument">NotebookDocument</a>) =&gt; <span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3873">
<div class="comment"><p>Optional interrupt handler.</p>
<p>By default cell execution is canceled via <a href="#NotebookCellExecution.token">tokens</a>. Cancellation
tokens require that a controller can keep track of its execution so that it can cancel a specific execution at a later
point. Not all scenarios allow for that, eg. REPL-style controllers often work by interrupting whatever is currently
running. For those cases the interrupt handler exists - it can be thought of as the equivalent of <code>SIGINT</code>
or <code>Control+C</code> in terminals.</p>
<p><em>Note</em> that supporting <a href="#NotebookCellExecution.token">cancellation tokens</a> is preferred and that interrupt handlers should
only be used when tokens cannot be supported.</p>
</div>
<div class="comment"></div>
<div class="signature variable-declaration-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">notebook</span><span>: </span><a class="type-ref" href="#NotebookDocument">NotebookDocument</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="NotebookController.label"></a><span class="ts" id=3860 data-target="#details-3860" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3860">
<div class="comment"><p>The human-readable label of this notebook controller.</p>
</div>
</div>



<a name="NotebookController.notebookType"></a><span class="ts" id=3858 data-target="#details-3858" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3858">
<div class="comment"><p>The notebook type this controller is for.</p>
</div>
</div>



<a name="NotebookController.supportedLanguages"></a><span class="ts" id=3859 data-target="#details-3859" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">supportedLanguages</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-3859">
<div class="comment"><p>An array of language identifiers that are supported by this
controller. Any language identifier from <a href="#languages.getLanguages">getLanguages</a>
is possible. When falsy all languages are supported.</p>
<p>Samples:</p>
<pre class="shiki" data-lang="js" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// support JavaScript and TypeScript</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">myController</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">supportedLanguages</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = [</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'javascript'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'typescript'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">];</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// support all languages</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">myController</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">supportedLanguages</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">undefined</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">; </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// falsy</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">myController</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">supportedLanguages</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = []; </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// falsy</span></span>
<span class="line"></span></code></pre>
</div>
</div>



<a name="NotebookController.supportsExecutionOrder"></a><span class="ts" id=3863 data-target="#details-3863" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">supportsExecutionOrder</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3863">
<div class="comment"><p>Whether this controller supports execution order so that the
editor can render placeholders for them.</p>
</div>
</div>

#### Methods



<a name="NotebookController.createNotebookCellExecution"></a><span class="ts" id=3865 data-target="#details-3865" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createNotebookCellExecution</span><span>(</span><span class="ident">cell</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a><span>)</span><span>: </span><a class="type-ref" href="#NotebookCellExecution">NotebookCellExecution</a></span>
<div class="details collapse" id="details-3865">
<div class="comment"><p>Create a cell execution task.</p>
<p><em>Note</em> that there can only be one execution per cell at a time and that an error is thrown if
a cell execution is created while another is still active.</p>
<p>This should be used in response to the <a href="#NotebookController.executeHandler">execution handler</a>
being called or when cell execution has been started else, e.g when a cell was already
executing or when cell execution was triggered from another source.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">cell</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a></td><td><div class="comment"><p>The notebook cell for which to create the execution.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookCellExecution">NotebookCellExecution</a></td><td><div class="comment"><p>A notebook cell execution.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="NotebookController.dispose"></a><span class="ts" id=3886 data-target="#details-3886" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3886">
<div class="comment"><p>Dispose and free associated resources.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="NotebookController.updateNotebookAffinity"></a><span class="ts" id=3882 data-target="#details-3882" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">updateNotebookAffinity</span><span>(</span><span class="ident">notebook</span><span>: </span><a class="type-ref" href="#NotebookDocument">NotebookDocument</a>, <span class="ident">affinity</span><span>: </span><a class="type-ref" href="#NotebookControllerAffinity">NotebookControllerAffinity</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3882">
<div class="comment"><p>A controller can set affinities for specific notebook documents. This allows a controller
to be presented more prominent for some notebooks.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">notebook</span><span>: </span><a class="type-ref" href="#NotebookDocument">NotebookDocument</a></td><td><div class="comment"><p>The notebook for which a priority is set.</p>
</div></td></tr>
<tr><td><span class="ident">affinity</span><span>: </span><a class="type-ref" href="#NotebookControllerAffinity">NotebookControllerAffinity</a></td><td><div class="comment"><p>A controller affinity</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="NotebookControllerAffinity"></a><span class="code-item" id=3853>NotebookControllerAffinity</span>



<div class="comment"><p>Notebook controller affinity for notebook documents.</p>
<p><em>See also</em>
<a href="#NotebookController.updateNotebookAffinity">NotebookController.updateNotebookAffinity</a></p>
</div>

#### Enumeration Members



<a name="NotebookControllerAffinity.Default"></a><span class="ts" id=3854 data-target="#details-3854" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Default</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-3854">
<div class="comment"><p>Default affinity.</p>
</div>
</div>



<a name="NotebookControllerAffinity.Preferred"></a><span class="ts" id=3855 data-target="#details-3855" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Preferred</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-3855">
<div class="comment"><p>A controller is preferred for a notebook.</p>
</div>
</div>

### <a name="NotebookData"></a><span class="code-item" id=3825>NotebookData</span>



<div class="comment"><p>Raw representation of a notebook.</p>
<p>Extensions are responsible for creating <a href="#NotebookData">NotebookData</a> so that the editor
can create a <a href="#NotebookDocument">NotebookDocument</a>.</p>
<p><em>See also</em>
<a href="#NotebookSerializer">NotebookSerializer</a></p>
</div>

#### Constructors



<a name="NotebookData.NotebookData"></a><span class="ts" id=3827 data-target="#details-3827" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">NotebookData</span><span>(</span><span class="ident">cells</span><span>: </span><a class="type-ref" href="#NotebookCellData">NotebookCellData</a>[]<span>)</span><span>: </span><a class="type-ref" href="#NotebookData">NotebookData</a></span>
<div class="details collapse" id="details-3827">
<div class="comment"><p>Create new notebook data.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">cells</span><span>: </span><a class="type-ref" href="#NotebookCellData">NotebookCellData</a>[]</td><td><div class="comment"><p>An array of cell data.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookData">NotebookData</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="NotebookData.cells"></a><span class="ts" id=3829 data-target="#details-3829" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cells</span><span>: </span><a class="type-ref" href="#NotebookCellData">NotebookCellData</a>[]</span>
<div class="details collapse" id="details-3829">
<div class="comment"><p>The cell data of this notebook data.</p>
</div>
</div>



<a name="NotebookData.metadata"></a><span class="ts" id=3830 data-target="#details-3830" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">metadata</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-3830">
<div class="comment"><p>Arbitrary metadata of notebook data.</p>
</div>
</div>

### <a name="NotebookDocument"></a><span class="code-item" id=3702>NotebookDocument</span>



<div class="comment"><p>Represents a notebook which itself is a sequence of <a href="#NotebookCell">code or markup cells</a>. Notebook documents are
created from <a href="#NotebookData">notebook data</a>.</p>
</div>

#### Properties



<a name="NotebookDocument.cellCount"></a><span class="ts" id=3713 data-target="#details-3713" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cellCount</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3713">
<div class="comment"><p>The number of cells in the notebook.</p>
</div>
</div>



<a name="NotebookDocument.isClosed"></a><span class="ts" id=3708 data-target="#details-3708" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isClosed</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3708">
<div class="comment"><p><code>true</code> if the notebook has been closed. A closed notebook isn&#39;t synchronized anymore
and won&#39;t be re-used when the same resource is opened again.</p>
</div>
</div>



<a name="NotebookDocument.isDirty"></a><span class="ts" id=3706 data-target="#details-3706" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isDirty</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3706">
<div class="comment"><p><code>true</code> if there are unpersisted changes.</p>
</div>
</div>



<a name="NotebookDocument.isUntitled"></a><span class="ts" id=3707 data-target="#details-3707" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isUntitled</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3707">
<div class="comment"><p>Is this notebook representing an untitled file which has not been saved yet.</p>
</div>
</div>



<a name="NotebookDocument.metadata"></a><span class="ts" id=3709 data-target="#details-3709" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">metadata</span><span>: </span></span>
<div class="details collapse" id="details-3709">
<div class="comment"><p>Arbitrary metadata for this notebook. Can be anything but must be JSON-stringifyable.</p>
</div>
</div>



<a name="NotebookDocument.notebookType"></a><span class="ts" id=3704 data-target="#details-3704" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3704">
<div class="comment"><p>The type of notebook.</p>
</div>
</div>



<a name="NotebookDocument.uri"></a><span class="ts" id=3703 data-target="#details-3703" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-3703">
<div class="comment"><p>The associated uri for this notebook.</p>
<p><em>Note</em> that most notebooks use the <code>file</code>-scheme, which means they are files on disk. However, <strong>not</strong> all notebooks are
saved on disk and therefore the <code>scheme</code> must be checked before trying to access the underlying file or siblings on disk.</p>
<p><em>See also</em>
<a href="#FileSystemProvider">FileSystemProvider</a></p>
</div>
</div>



<a name="NotebookDocument.version"></a><span class="ts" id=3705 data-target="#details-3705" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">version</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3705">
<div class="comment"><p>The version number of this notebook (it will strictly increase after each
change, including undo/redo).</p>
</div>
</div>

#### Methods



<a name="NotebookDocument.cellAt"></a><span class="ts" id=3715 data-target="#details-3715" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cellAt</span><span>(</span><span class="ident">index</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a></span>
<div class="details collapse" id="details-3715">
<div class="comment"><p>Return the cell at the specified index. The index will be adjusted to the notebook.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">index</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The index of the cell to retrieve.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookCell">NotebookCell</a></td><td><div class="comment"><p>A <a href="#NotebookCell">cell</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="NotebookDocument.getCells"></a><span class="ts" id=3718 data-target="#details-3718" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getCells</span><span>(</span><span class="ident">range</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a><span>)</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a>[]</span>
<div class="details collapse" id="details-3718">
<div class="comment"><p>Get the cells of this notebook. A subset can be retrieved by providing
a range. The range will be adjusted to the notebook.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a></td><td><div class="comment"><p>A notebook range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookCell">NotebookCell</a>[]</td><td><div class="comment"><p>The cells contained by the range or all cells.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="NotebookDocument.save"></a><span class="ts" id=3721 data-target="#details-3721" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">save</span><span>(</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-3721">
<div class="comment"><p>Save the document. The saving will be handled by the corresponding <a href="#NotebookSerializer">serializer</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>A promise that will resolve to true when the document
has been saved. Will return false if the file was not dirty or when save failed.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="NotebookDocumentCellChange"></a><span class="code-item" id=3722>NotebookDocumentCellChange</span>



<div class="comment"><p>Describes a change to a notebook cell.</p>
<p><em>See also</em>
<a href="#NotebookDocumentChangeEvent">NotebookDocumentChangeEvent</a></p>
</div>

#### Properties



<a name="NotebookDocumentCellChange.cell"></a><span class="ts" id=3723 data-target="#details-3723" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cell</span><span>: </span><a class="type-ref" href="#NotebookCell">NotebookCell</a></span>
<div class="details collapse" id="details-3723">
<div class="comment"><p>The affected cell.</p>
</div>
</div>



<a name="NotebookDocumentCellChange.document"></a><span class="ts" id=3724 data-target="#details-3724" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></span>
<div class="details collapse" id="details-3724">
<div class="comment"><p>The document of the cell or <code>undefined</code> when it did not change.</p>
<p><em>Note</em> that you should use the <a href="#workspace.onDidChangeTextDocument">onDidChangeTextDocument</a>-event
for detailed change information, like what edits have been performed.</p>
</div>
</div>



<a name="NotebookDocumentCellChange.executionSummary"></a><span class="ts" id=3730 data-target="#details-3730" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executionSummary</span><span>: </span><a class="type-ref" href="#NotebookCellExecutionSummary">NotebookCellExecutionSummary</a></span>
<div class="details collapse" id="details-3730">
<div class="comment"><p>The new execution summary of the cell or <code>undefined</code> when it did not change.</p>
</div>
</div>



<a name="NotebookDocumentCellChange.metadata"></a><span class="ts" id=3725 data-target="#details-3725" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">metadata</span><span>: </span></span>
<div class="details collapse" id="details-3725">
<div class="comment"><p>The new metadata of the cell or <code>undefined</code> when it did not change.</p>
</div>
</div>



<a name="NotebookDocumentCellChange.outputs"></a><span class="ts" id=3729 data-target="#details-3729" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">outputs</span><span>: </span>readonly <a class="type-ref" href="#NotebookCellOutput">NotebookCellOutput</a>[]</span>
<div class="details collapse" id="details-3729">
<div class="comment"><p>The new outputs of the cell or <code>undefined</code> when they did not change.</p>
</div>
</div>

### <a name="NotebookDocumentChangeEvent"></a><span class="code-item" id=3735>NotebookDocumentChangeEvent</span>



<div class="comment"><p>An event describing a transactional <a href="#NotebookDocument">notebook</a> change.</p>
</div>

#### Properties



<a name="NotebookDocumentChangeEvent.cellChanges"></a><span class="ts" id=3742 data-target="#details-3742" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cellChanges</span><span>: </span>readonly <a class="type-ref" href="#NotebookDocumentCellChange">NotebookDocumentCellChange</a>[]</span>
<div class="details collapse" id="details-3742">
<div class="comment"><p>An array of <a href="#NotebookDocumentCellChange">cell changes</a>.</p>
</div>
</div>



<a name="NotebookDocumentChangeEvent.contentChanges"></a><span class="ts" id=3741 data-target="#details-3741" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contentChanges</span><span>: </span>readonly <a class="type-ref" href="#NotebookDocumentContentChange">NotebookDocumentContentChange</a>[]</span>
<div class="details collapse" id="details-3741">
<div class="comment"><p>An array of content changes describing added or removed <a href="#NotebookCell">cells</a>.</p>
</div>
</div>



<a name="NotebookDocumentChangeEvent.metadata"></a><span class="ts" id=3737 data-target="#details-3737" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">metadata</span><span>: </span></span>
<div class="details collapse" id="details-3737">
<div class="comment"><p>The new metadata of the notebook or <code>undefined</code> when it did not change.</p>
</div>
</div>



<a name="NotebookDocumentChangeEvent.notebook"></a><span class="ts" id=3736 data-target="#details-3736" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">notebook</span><span>: </span><a class="type-ref" href="#NotebookDocument">NotebookDocument</a></span>
<div class="details collapse" id="details-3736">
<div class="comment"><p>The affected notebook.</p>
</div>
</div>

### <a name="NotebookDocumentContentChange"></a><span class="code-item" id=3731>NotebookDocumentContentChange</span>



<div class="comment"><p>Describes a structural change to a notebook document, e.g newly added and removed cells.</p>
<p><em>See also</em>
<a href="#NotebookDocumentChangeEvent">NotebookDocumentChangeEvent</a></p>
</div>

#### Properties



<a name="NotebookDocumentContentChange.addedCells"></a><span class="ts" id=3733 data-target="#details-3733" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">addedCells</span><span>: </span>readonly <a class="type-ref" href="#NotebookCell">NotebookCell</a>[]</span>
<div class="details collapse" id="details-3733">
<div class="comment"><p>Cells that have been added to the document.</p>
</div>
</div>



<a name="NotebookDocumentContentChange.range"></a><span class="ts" id=3732 data-target="#details-3732" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a></span>
<div class="details collapse" id="details-3732">
<div class="comment"><p>The range at which cells have been either added or removed.</p>
<p>Note that no cells have been <a href="#NotebookDocumentContentChange.removedCells">removed</a>
when this range is <a href="#NotebookRange.isEmpty">empty</a>.</p>
</div>
</div>



<a name="NotebookDocumentContentChange.removedCells"></a><span class="ts" id=3734 data-target="#details-3734" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">removedCells</span><span>: </span>readonly <a class="type-ref" href="#NotebookCell">NotebookCell</a>[]</span>
<div class="details collapse" id="details-3734">
<div class="comment"><p>Cells that have been removed from the document.</p>
</div>
</div>

### <a name="NotebookDocumentContentOptions"></a><span class="code-item" id=3843>NotebookDocumentContentOptions</span>



<div class="comment"><p>Notebook content options define what parts of a notebook are persisted. Note</p>
<p>For instance, a notebook serializer can opt-out of saving outputs and in that case the editor doesn&#39;t mark a
notebooks as <a href="#NotebookDocument.isDirty">dirty</a> when its output has changed.</p>
</div>

#### Properties



<a name="NotebookDocumentContentOptions.transientCellMetadata"></a><span class="ts" id=3845 data-target="#details-3845" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">transientCellMetadata</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-3845">
<div class="comment"><p>Controls if a cell metadata property change event will trigger notebook document content
change events and if it will be used in the diff editor, defaults to false. If the
content provider doesn&#39;t persist a metadata property in the file document, it should be
set to true.</p>
</div>
</div>



<a name="NotebookDocumentContentOptions.transientDocumentMetadata"></a><span class="ts" id=3849 data-target="#details-3849" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">transientDocumentMetadata</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-3849">
<div class="comment"><p>Controls if a document metadata property change event will trigger notebook document
content change event and if it will be used in the diff editor, defaults to false. If the
content provider doesn&#39;t persist a metadata property in the file document, it should be
set to true.</p>
</div>
</div>



<a name="NotebookDocumentContentOptions.transientOutputs"></a><span class="ts" id=3844 data-target="#details-3844" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">transientOutputs</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3844">
<div class="comment"><p>Controls if output change events will trigger notebook document content change events and
if it will be used in the diff editor, defaults to false. If the content provider doesn&#39;t
persist the outputs in the file document, this should be set to true.</p>
</div>
</div>

### <a name="NotebookDocumentShowOptions"></a><span class="code-item" id=233>NotebookDocumentShowOptions</span>



<div class="comment"><p>Represents options to configure the behavior of showing a <a href="#NotebookDocument">notebook document</a> in an <a href="#NotebookEditor">notebook editor</a>.</p>
</div>

#### Properties



<a name="NotebookDocumentShowOptions.preserveFocus"></a><span class="ts" id=235 data-target="#details-235" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-235">
<div class="comment"><p>An optional flag that when <code>true</code> will stop the <a href="#NotebookEditor">notebook editor</a> from taking focus.</p>
</div>
</div>



<a name="NotebookDocumentShowOptions.preview"></a><span class="ts" id=236 data-target="#details-236" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">preview</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-236">
<div class="comment"><p>An optional flag that controls if an <a href="#NotebookEditor">notebook editor</a>-tab shows as preview. Preview tabs will
be replaced and reused until set to stay - either explicitly or through editing. The default behaviour depends
on the <code>workbench.editor.enablePreview</code>-setting.</p>
</div>
</div>



<a name="NotebookDocumentShowOptions.selections"></a><span class="ts" id=237 data-target="#details-237" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selections</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#NotebookRange">NotebookRange</a>[]</span>
<div class="details collapse" id="details-237">
<div class="comment"><p>An optional selection to apply for the document in the <a href="#NotebookEditor">notebook editor</a>.</p>
</div>
</div>



<a name="NotebookDocumentShowOptions.viewColumn"></a><span class="ts" id=234 data-target="#details-234" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">viewColumn</span><span>?</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a></span>
<div class="details collapse" id="details-234">
<div class="comment"><p>An optional view column in which the <a href="#NotebookEditor">notebook editor</a> should be shown.
The default is the <a href="#ViewColumn.Active">active</a>. Columns that do not exist
will be created as needed up to the maximum of <a href="#ViewColumn.Nine">ViewColumn.Nine</a>.
Use <a href="#ViewColumn.Beside">ViewColumn.Beside</a> to open the editor to the side of the currently
active one.</p>
</div>
</div>

### <a name="NotebookDocumentWillSaveEvent"></a><span class="code-item" id=3743>NotebookDocumentWillSaveEvent</span>



<div class="comment"><p>An event that is fired when a <a href="#NotebookDocument">notebook document</a> will be saved.</p>
<p>To make modifications to the document before it is being saved, call the
<a href="#NotebookDocumentWillSaveEvent.waitUntil">waitUntil</a>-function with a thenable
that resolves to a <a href="#WorkspaceEdit">workspace edit</a>.</p>
</div>

#### Properties



<a name="NotebookDocumentWillSaveEvent.notebook"></a><span class="ts" id=3745 data-target="#details-3745" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">notebook</span><span>: </span><a class="type-ref" href="#NotebookDocument">NotebookDocument</a></span>
<div class="details collapse" id="details-3745">
<div class="comment"><p>The <a href="#NotebookDocument">notebook document</a> that will be saved.</p>
</div>
</div>



<a name="NotebookDocumentWillSaveEvent.reason"></a><span class="ts" id=3746 data-target="#details-3746" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">reason</span><span>: </span><a class="type-ref" href="#TextDocumentSaveReason">TextDocumentSaveReason</a></span>
<div class="details collapse" id="details-3746">
<div class="comment"><p>The reason why save was triggered.</p>
</div>
</div>



<a name="NotebookDocumentWillSaveEvent.token"></a><span class="ts" id=3744 data-target="#details-3744" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></span>
<div class="details collapse" id="details-3744">
<div class="comment"><p>A cancellation token.</p>
</div>
</div>

#### Methods



<a name="NotebookDocumentWillSaveEvent.waitUntil"></a><span class="ts" id=3748 data-target="#details-3748" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">waitUntil</span><span>(</span><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3748">
<div class="comment"><p>Allows to pause the event loop and to apply <a href="#WorkspaceEdit">workspace edit</a>.
Edits of subsequent calls to this function will be applied in order. The
edits will be <em>ignored</em> if concurrent modifications of the notebook document happened.</p>
<p><em>Note:</em> This function can only be called during event dispatch and not
in an asynchronous manner:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onWillSaveNotebookDocument</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // async, will *throw* an error</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  setTimeout</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(() </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">waitUntil</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">promise</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">));</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // sync, OK</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">waitUntil</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">promise</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a>&gt;</td><td><div class="comment"><p>A thenable that resolves to <a href="#WorkspaceEdit">workspace edit</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="NotebookDocumentWillSaveEvent.waitUntil"></a><span class="ts" id=3750 data-target="#details-3750" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">waitUntil</span><span>(</span><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3750">
<div class="comment"><p>Allows to pause the event loop until the provided thenable resolved.</p>
<p><em>Note:</em> This function can only be called during event dispatch.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;</td><td><div class="comment"><p>A thenable that delays saving.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="NotebookEdit"></a><span class="code-item" id=930>NotebookEdit</span>



<div class="comment"><p>A notebook edit represents edits that should be applied to the contents of a notebook.</p>
</div>

#### Static



<a name="NotebookEdit.deleteCells"></a><span class="ts" id=940 data-target="#details-940" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">deleteCells</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a><span>)</span><span>: </span><a class="type-ref" href="#NotebookEdit">NotebookEdit</a></span>
<div class="details collapse" id="details-940">
<div class="comment"><p>Utility to create an edit that deletes cells in a notebook.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a></td><td><div class="comment"><p>The range of cells to delete.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookEdit">NotebookEdit</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="NotebookEdit.insertCells"></a><span class="ts" id=936 data-target="#details-936" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">insertCells</span><span>(</span><span class="ident">index</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">newCells</span><span>: </span><a class="type-ref" href="#NotebookCellData">NotebookCellData</a>[]<span>)</span><span>: </span><a class="type-ref" href="#NotebookEdit">NotebookEdit</a></span>
<div class="details collapse" id="details-936">
<div class="comment"><p>Utility to create an edit that replaces cells in a notebook.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">index</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The index to insert cells at.</p>
</div></td></tr>
<tr><td><span class="ident">newCells</span><span>: </span><a class="type-ref" href="#NotebookCellData">NotebookCellData</a>[]</td><td><div class="comment"><p>The new notebook cells.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookEdit">NotebookEdit</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="NotebookEdit.replaceCells"></a><span class="ts" id=932 data-target="#details-932" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">replaceCells</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a>, <span class="ident">newCells</span><span>: </span><a class="type-ref" href="#NotebookCellData">NotebookCellData</a>[]<span>)</span><span>: </span><a class="type-ref" href="#NotebookEdit">NotebookEdit</a></span>
<div class="details collapse" id="details-932">
<div class="comment"><p>Utility to create a edit that replaces cells in a notebook.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a></td><td><div class="comment"><p>The range of cells to replace</p>
</div></td></tr>
<tr><td><span class="ident">newCells</span><span>: </span><a class="type-ref" href="#NotebookCellData">NotebookCellData</a>[]</td><td><div class="comment"><p>The new notebook cells.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookEdit">NotebookEdit</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="NotebookEdit.updateCellMetadata"></a><span class="ts" id=943 data-target="#details-943" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">updateCellMetadata</span><span>(</span><span class="ident">index</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">newCellMetadata</span><span>: </span><span>)</span><span>: </span><a class="type-ref" href="#NotebookEdit">NotebookEdit</a></span>
<div class="details collapse" id="details-943">
<div class="comment"><p>Utility to create an edit that update a cell&#39;s metadata.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">index</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The index of the cell to update.</p>
</div></td></tr>
<tr><td><span class="ident">newCellMetadata</span><span>: </span></td><td><div class="comment"><p>The new metadata for the cell.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookEdit">NotebookEdit</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="NotebookEdit.updateNotebookMetadata"></a><span class="ts" id=950 data-target="#details-950" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">updateNotebookMetadata</span><span>(</span><span class="ident">newNotebookMetadata</span><span>: </span><span>)</span><span>: </span><a class="type-ref" href="#NotebookEdit">NotebookEdit</a></span>
<div class="details collapse" id="details-950">
<div class="comment"><p>Utility to create an edit that updates the notebook&#39;s metadata.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">newNotebookMetadata</span><span>: </span></td><td><div class="comment"><p>The new metadata for the notebook.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookEdit">NotebookEdit</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Constructors



<a name="NotebookEdit.NotebookEdit"></a><span class="ts" id=956 data-target="#details-956" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">NotebookEdit</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a>, <span class="ident">newCells</span><span>: </span><a class="type-ref" href="#NotebookCellData">NotebookCellData</a>[]<span>)</span><span>: </span><a class="type-ref" href="#NotebookEdit">NotebookEdit</a></span>
<div class="details collapse" id="details-956">
<div class="comment"><p>Create a new notebook edit.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a></td><td><div class="comment"><p>A notebook range.</p>
</div></td></tr>
<tr><td><span class="ident">newCells</span><span>: </span><a class="type-ref" href="#NotebookCellData">NotebookCellData</a>[]</td><td><div class="comment"><p>An array of new cell data.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookEdit">NotebookEdit</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="NotebookEdit.newCellMetadata"></a><span class="ts" id=961 data-target="#details-961" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">newCellMetadata</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-961">
<div class="comment"><p>Optional new metadata for the cells.</p>
</div>
</div>



<a name="NotebookEdit.newCells"></a><span class="ts" id=960 data-target="#details-960" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">newCells</span><span>: </span><a class="type-ref" href="#NotebookCellData">NotebookCellData</a>[]</span>
<div class="details collapse" id="details-960">
<div class="comment"><p>New cells being inserted. May be empty.</p>
</div>
</div>



<a name="NotebookEdit.newNotebookMetadata"></a><span class="ts" id=965 data-target="#details-965" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">newNotebookMetadata</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-965">
<div class="comment"><p>Optional new metadata for the notebook.</p>
</div>
</div>



<a name="NotebookEdit.range"></a><span class="ts" id=959 data-target="#details-959" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a></span>
<div class="details collapse" id="details-959">
<div class="comment"><p>Range of the cells being edited. May be empty.</p>
</div>
</div>

### <a name="NotebookEditor"></a><span class="code-item" id=3669>NotebookEditor</span>



<div class="comment"><p>Represents a notebook editor that is attached to a <a href="#NotebookDocument">notebook</a>.
Additional properties of the NotebookEditor are available in the proposed
API, which will be finalized later.</p>
</div>

#### Properties



<a name="NotebookEditor.notebook"></a><span class="ts" id=3670 data-target="#details-3670" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">notebook</span><span>: </span><a class="type-ref" href="#NotebookDocument">NotebookDocument</a></span>
<div class="details collapse" id="details-3670">
<div class="comment"><p>The <a href="#NotebookDocument">notebook document</a> associated with this notebook editor.</p>
</div>
</div>



<a name="NotebookEditor.selection"></a><span class="ts" id=3671 data-target="#details-3671" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selection</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a></span>
<div class="details collapse" id="details-3671">
<div class="comment"><p>The primary selection in this notebook editor.</p>
</div>
</div>



<a name="NotebookEditor.selections"></a><span class="ts" id=3672 data-target="#details-3672" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selections</span><span>: </span>readonly <a class="type-ref" href="#NotebookRange">NotebookRange</a>[]</span>
<div class="details collapse" id="details-3672">
<div class="comment"><p>All selections in this notebook editor.</p>
<p>The primary selection (or focused range) is <code>selections[0]</code>. When the document has no cells, the primary selection is empty <code>{ start: 0, end: 0 }</code>;</p>
</div>
</div>



<a name="NotebookEditor.viewColumn"></a><span class="ts" id=3674 data-target="#details-3674" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">viewColumn</span><span>?</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a></span>
<div class="details collapse" id="details-3674">
<div class="comment"><p>The column in which this editor shows.</p>
</div>
</div>



<a name="NotebookEditor.visibleRanges"></a><span class="ts" id=3673 data-target="#details-3673" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">visibleRanges</span><span>: </span>readonly <a class="type-ref" href="#NotebookRange">NotebookRange</a>[]</span>
<div class="details collapse" id="details-3673">
<div class="comment"><p>The current visible ranges in the editor (vertically).</p>
</div>
</div>

#### Methods



<a name="NotebookEditor.revealRange"></a><span class="ts" id=3676 data-target="#details-3676" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">revealRange</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a>, <span class="ident">revealType</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookEditorRevealType">NotebookEditorRevealType</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3676">
<div class="comment"><p>Scroll as indicated by <code>revealType</code> in order to reveal the given range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><td><span class="ident">revealType</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookEditorRevealType">NotebookEditorRevealType</a></td><td><div class="comment"><p>The scrolling strategy for revealing <code>range</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="NotebookEditorRevealType"></a><span class="code-item" id=3664>NotebookEditorRevealType</span>



<div class="comment"><p>Represents a notebook editor that is attached to a <a href="#NotebookDocument">notebook</a>.</p>
</div>

#### Enumeration Members



<a name="NotebookEditorRevealType.Default"></a><span class="ts" id=3665 data-target="#details-3665" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Default</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-3665">
<div class="comment"><p>The range will be revealed with as little scrolling as possible.</p>
</div>
</div>



<a name="NotebookEditorRevealType.InCenter"></a><span class="ts" id=3666 data-target="#details-3666" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">InCenter</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-3666">
<div class="comment"><p>The range will always be revealed in the center of the viewport.</p>
</div>
</div>



<a name="NotebookEditorRevealType.InCenterIfOutsideViewport"></a><span class="ts" id=3667 data-target="#details-3667" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">InCenterIfOutsideViewport</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-3667">
<div class="comment"><p>If the range is outside the viewport, it will be revealed in the center of the viewport.
Otherwise, it will be revealed with as little scrolling as possible.</p>
</div>
</div>



<a name="NotebookEditorRevealType.AtTop"></a><span class="ts" id=3668 data-target="#details-3668" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">AtTop</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-3668">
<div class="comment"><p>The range will always be revealed at the top of the viewport.</p>
</div>
</div>

### <a name="NotebookEditorSelectionChangeEvent"></a><span class="code-item" id=227>NotebookEditorSelectionChangeEvent</span>



<div class="comment"><p>Represents an event describing the change in a <a href="#NotebookEditor.selections">notebook editor&#39;s selections</a>.</p>
</div>

#### Properties



<a name="NotebookEditorSelectionChangeEvent.notebookEditor"></a><span class="ts" id=228 data-target="#details-228" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">notebookEditor</span><span>: </span><a class="type-ref" href="#NotebookEditor">NotebookEditor</a></span>
<div class="details collapse" id="details-228">
<div class="comment"><p>The <a href="#NotebookEditor">notebook editor</a> for which the selections have changed.</p>
</div>
</div>



<a name="NotebookEditorSelectionChangeEvent.selections"></a><span class="ts" id=229 data-target="#details-229" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selections</span><span>: </span>readonly <a class="type-ref" href="#NotebookRange">NotebookRange</a>[]</span>
<div class="details collapse" id="details-229">
<div class="comment"><p>The new value for the <a href="#NotebookEditor.selections">notebook editor&#39;s selections</a>.</p>
</div>
</div>

### <a name="NotebookEditorVisibleRangesChangeEvent"></a><span class="code-item" id=230>NotebookEditorVisibleRangesChangeEvent</span>



<div class="comment"><p>Represents an event describing the change in a <a href="#NotebookEditor.visibleRanges">notebook editor&#39;s visibleRanges</a>.</p>
</div>

#### Properties



<a name="NotebookEditorVisibleRangesChangeEvent.notebookEditor"></a><span class="ts" id=231 data-target="#details-231" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">notebookEditor</span><span>: </span><a class="type-ref" href="#NotebookEditor">NotebookEditor</a></span>
<div class="details collapse" id="details-231">
<div class="comment"><p>The <a href="#NotebookEditor">notebook editor</a> for which the visible ranges have changed.</p>
</div>
</div>



<a name="NotebookEditorVisibleRangesChangeEvent.visibleRanges"></a><span class="ts" id=232 data-target="#details-232" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">visibleRanges</span><span>: </span>readonly <a class="type-ref" href="#NotebookRange">NotebookRange</a>[]</span>
<div class="details collapse" id="details-232">
<div class="comment"><p>The new value for the <a href="#NotebookEditor.visibleRanges">notebook editor&#39;s visibleRanges</a>.</p>
</div>
</div>

### <a name="NotebookRange"></a><span class="code-item" id=3759>NotebookRange</span>



<div class="comment"><p>A notebook range represents an ordered pair of two cell indices.
It is guaranteed that start is less than or equal to end.</p>
</div>

#### Constructors



<a name="NotebookRange.NotebookRange"></a><span class="ts" id=3761 data-target="#details-3761" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">NotebookRange</span><span>(</span><span class="ident">start</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">end</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a></span>
<div class="details collapse" id="details-3761">
<div class="comment"><p>Create a new notebook range. If <code>start</code> is not
before or equal to <code>end</code>, the values will be swapped.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">start</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>start index</p>
</div></td></tr>
<tr><td><span class="ident">end</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>end index.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookRange">NotebookRange</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="NotebookRange.end"></a><span class="ts" id=3765 data-target="#details-3765" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">end</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3765">
<div class="comment"><p>The exclusive end index of this range (zero-based).</p>
</div>
</div>



<a name="NotebookRange.isEmpty"></a><span class="ts" id=3766 data-target="#details-3766" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isEmpty</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3766">
<div class="comment"><p><code>true</code> if <code>start</code> and <code>end</code> are equal.</p>
</div>
</div>



<a name="NotebookRange.start"></a><span class="ts" id=3764 data-target="#details-3764" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">start</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3764">
<div class="comment"><p>The zero-based start index of this range.</p>
</div>
</div>

#### Methods



<a name="NotebookRange.with"></a><span class="ts" id=3768 data-target="#details-3768" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">with</span><span>(</span><span class="ident">change</span><span>: </span>{end: <span class="type-intrinsic">number</span>, start: <span class="type-intrinsic">number</span>}<span>)</span><span>: </span><a class="type-ref" href="#NotebookRange">NotebookRange</a></span>
<div class="details collapse" id="details-3768">
<div class="comment"><p>Derive a new range for this range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">change</span><span>: </span>{end: <span class="type-intrinsic">number</span>, start: <span class="type-intrinsic">number</span>}</td><td><div class="comment"><p>An object that describes a change to this range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookRange">NotebookRange</a></td><td><div class="comment"><p>A range that reflects the given change. Will return <code>this</code> range if the change
is not changing anything.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="NotebookRendererMessaging"></a><span class="code-item" id=3679>NotebookRendererMessaging</span>



<div class="comment"><p>Renderer messaging is used to communicate with a single renderer. It&#39;s returned from <a href="#notebooks.createRendererMessaging">notebooks.createRendererMessaging</a>.</p>
</div>

#### Events



<a name="NotebookRendererMessaging.onDidReceiveMessage"></a><span class="ts" id=3680 data-target="#details-3680" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidReceiveMessage</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;{editor: <a class="type-ref" href="#NotebookEditor">NotebookEditor</a>, message: <span class="type-intrinsic">any</span>}&gt;</span>
<div class="details collapse" id="details-3680">
<div class="comment"><p>An event that fires when a message is received from a renderer.</p>
</div>
</div>

#### Methods



<a name="NotebookRendererMessaging.postMessage"></a><span class="ts" id=3685 data-target="#details-3685" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">postMessage</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">any</span>, <span class="ident">editor</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookEditor">NotebookEditor</a><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-3685">
<div class="comment"><p>Send a message to one or all renderer.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>Message to send</p>
</div></td></tr>
<tr><td><span class="ident">editor</span><span>?</span><span>: </span><a class="type-ref" href="#NotebookEditor">NotebookEditor</a></td><td><div class="comment"><p>Editor to target with the message. If not provided, the
message is sent to all renderers.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>a boolean indicating whether the message was successfully
delivered to any renderer.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="NotebookSerializer"></a><span class="code-item" id=3834>NotebookSerializer</span>



<div class="comment"><p>The notebook serializer enables the editor to open notebook files.</p>
<p>At its core the editor only knows a <a href="#NotebookData">notebook data structure</a> but not
how that data structure is written to a file, nor how it is read from a file. The
notebook serializer bridges this gap by deserializing bytes into notebook data and
vice versa.</p>
</div>

#### Methods



<a name="NotebookSerializer.deserializeNotebook"></a><span class="ts" id=3836 data-target="#details-3836" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">deserializeNotebook</span><span>(</span><span class="ident">content</span><span>: </span><span class="type-ref-ts">Uint8Array</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#NotebookData">NotebookData</a> &#124; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#NotebookData">NotebookData</a>&gt;</span>
<div class="details collapse" id="details-3836">
<div class="comment"><p>Deserialize contents of a notebook file into the notebook data structure.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">content</span><span>: </span><span class="type-ref-ts">Uint8Array</span></td><td><div class="comment"><p>Contents of a notebook file.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#NotebookData">NotebookData</a> &#124; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#NotebookData">NotebookData</a>&gt;</td><td><div class="comment"><p>Notebook data or a thenable that resolves to such.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="NotebookSerializer.serializeNotebook"></a><span class="ts" id=3840 data-target="#details-3840" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">serializeNotebook</span><span>(</span><span class="ident">data</span><span>: </span><a class="type-ref" href="#NotebookData">NotebookData</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt; &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</span>
<div class="details collapse" id="details-3840">
<div class="comment"><p>Serialize notebook data into file contents.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">data</span><span>: </span><a class="type-ref" href="#NotebookData">NotebookData</a></td><td><div class="comment"><p>A notebook data structure.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt; &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;&gt;</td><td><div class="comment"><p>An array of bytes or a thenable that resolves to such.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="OnEnterRule"></a><span class="code-item" id=1660>OnEnterRule</span>



<div class="comment"><p>Describes a rule to be evaluated when pressing Enter.</p>
</div>

#### Properties



<a name="OnEnterRule.action"></a><span class="ts" id=1664 data-target="#details-1664" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">action</span><span>: </span><a class="type-ref" href="#EnterAction">EnterAction</a></span>
<div class="details collapse" id="details-1664">
<div class="comment"><p>The action to execute.</p>
</div>
</div>



<a name="OnEnterRule.afterText"></a><span class="ts" id=1662 data-target="#details-1662" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">afterText</span><span>?</span><span>: </span><span class="type-ref-ts">RegExp</span></span>
<div class="details collapse" id="details-1662">
<div class="comment"><p>This rule will only execute if the text after the cursor matches this regular expression.</p>
</div>
</div>



<a name="OnEnterRule.beforeText"></a><span class="ts" id=1661 data-target="#details-1661" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">beforeText</span><span>: </span><span class="type-ref-ts">RegExp</span></span>
<div class="details collapse" id="details-1661">
<div class="comment"><p>This rule will only execute if the text before the cursor matches this regular expression.</p>
</div>
</div>



<a name="OnEnterRule.previousLineText"></a><span class="ts" id=1663 data-target="#details-1663" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">previousLineText</span><span>?</span><span>: </span><span class="type-ref-ts">RegExp</span></span>
<div class="details collapse" id="details-1663">
<div class="comment"><p>This rule will only execute if the text above the current line matches this regular expression.</p>
</div>
</div>

### <a name="OnTypeFormattingEditProvider"></a><span class="code-item" id=1178>OnTypeFormattingEditProvider</span>



<div class="comment"><p>The document formatting provider interface defines the contract between extensions and
the formatting-feature.</p>
</div>

#### Methods



<a name="OnTypeFormattingEditProvider.provideOnTypeFormattingEdits"></a><span class="ts" id=1180 data-target="#details-1180" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideOnTypeFormattingEdits</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">ch</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>: </span><a class="type-ref" href="#FormattingOptions">FormattingOptions</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TextEdit">TextEdit</a>[]&gt;</span>
<div class="details collapse" id="details-1180">
<div class="comment"><p>Provide formatting edits after a character has been typed.</p>
<p>The given position and character should hint to the provider
what range the position to expand to, like find the matching <code>{</code>
when <code>}</code> has been entered.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">ch</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The character that has been typed.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#FormattingOptions">FormattingOptions</a></td><td><div class="comment"><p>Options controlling formatting.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TextEdit">TextEdit</a>[]&gt;</td><td><div class="comment"><p>A set of text edits or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="OpenDialogOptions"></a><span class="code-item" id=530>OpenDialogOptions</span>



<div class="comment"><p>Options to configure the behavior of a file open dialog.</p>
<ul>
<li>Note 1: On Windows and Linux, a file dialog cannot be both a file selector and a folder selector, so if you
set both <code>canSelectFiles</code> and <code>canSelectFolders</code> to <code>true</code> on these platforms, a folder selector will be shown.</li>
<li>Note 2: Explicitly setting <code>canSelectFiles</code> and <code>canSelectFolders</code> to <code>false</code> is futile
and the editor then silently adjusts the options to select files.</li>
</ul>
</div>

#### Properties



<a name="OpenDialogOptions.canSelectFiles"></a><span class="ts" id=533 data-target="#details-533" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">canSelectFiles</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-533">
<div class="comment"><p>Allow to select files, defaults to <code>true</code>.</p>
</div>
</div>



<a name="OpenDialogOptions.canSelectFolders"></a><span class="ts" id=534 data-target="#details-534" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">canSelectFolders</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-534">
<div class="comment"><p>Allow to select folders, defaults to <code>false</code>.</p>
</div>
</div>



<a name="OpenDialogOptions.canSelectMany"></a><span class="ts" id=535 data-target="#details-535" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">canSelectMany</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-535">
<div class="comment"><p>Allow to select many files or folders.</p>
</div>
</div>



<a name="OpenDialogOptions.defaultUri"></a><span class="ts" id=531 data-target="#details-531" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">defaultUri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-531">
<div class="comment"><p>The resource the dialog shows when opened.</p>
</div>
</div>



<a name="OpenDialogOptions.filters"></a><span class="ts" id=536 data-target="#details-536" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">filters</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-536">
<div class="comment"><p>A set of file filters that are used by the dialog. Each entry is a human-readable label,
like &quot;TypeScript&quot;, and an array of extensions, for example:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">{</span></span>
<span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">    'Images'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: [</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'png'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'jpg'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">],</span></span>
<span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">    'TypeScript'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: [</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'ts'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'tsx'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">]</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span></code></pre>
</div>
</div>



<a name="OpenDialogOptions.openLabel"></a><span class="ts" id=532 data-target="#details-532" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">openLabel</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-532">
<div class="comment"><p>A human-readable string for the open button.</p>
</div>
</div>



<a name="OpenDialogOptions.title"></a><span class="ts" id=540 data-target="#details-540" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-540">
<div class="comment"><p>Dialog title.</p>
<p>This parameter might be ignored, as not all operating systems display a title on open dialogs
(for example, macOS).</p>
</div>
</div>

### <a name="OutputChannel"></a><span class="code-item" id=1839>OutputChannel</span>



<div class="comment"><p>An output channel is a container for readonly textual information.</p>
<p>To get an instance of an <code>OutputChannel</code> use
<a href="#window.createOutputChannel">createOutputChannel</a>.</p>
</div>

#### Properties



<a name="OutputChannel.name"></a><span class="ts" id=1840 data-target="#details-1840" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1840">
<div class="comment"><p>The human-readable name of this output channel.</p>
</div>
</div>

#### Methods



<a name="OutputChannel.append"></a><span class="ts" id=1842 data-target="#details-1842" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">append</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1842">
<div class="comment"><p>Append the given value to the channel.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string, falsy values will not be printed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="OutputChannel.appendLine"></a><span class="ts" id=1845 data-target="#details-1845" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendLine</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1845">
<div class="comment"><p>Append the given value and a line feed character
to the channel.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string, falsy values will be printed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="OutputChannel.clear"></a><span class="ts" id=1851 data-target="#details-1851" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">clear</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1851">
<div class="comment"><p>Removes all output from the channel.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="OutputChannel.dispose"></a><span class="ts" id=1861 data-target="#details-1861" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1861">
<div class="comment"><p>Dispose and free associated resources.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="OutputChannel.hide"></a><span class="ts" id=1859 data-target="#details-1859" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hide</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1859">
<div class="comment"><p>Hide this channel from the UI.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="OutputChannel.replace"></a><span class="ts" id=1848 data-target="#details-1848" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">replace</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1848">
<div class="comment"><p>Replaces all output from the channel with the given value.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string, falsy values will not be printed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="OutputChannel.show"></a><span class="ts" id=1853 data-target="#details-1853" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">show</span><span>(</span><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1853">
<div class="comment"><p>Reveal this channel in the UI.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>When <code>true</code> the channel will not take focus.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="OutputChannel.show"></a><span class="ts" id=1855 data-target="#details-1855" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">show</span><span>(</span><span class="ident">column</span><span>?</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a>, <span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1855">
<div class="comment"><p>Reveal this channel in the UI.</p>
<ul>
<li><em>deprecated</em> - Use the overload with just one parameter (<code>show(preserveFocus?: boolean): void</code>).</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">column</span><span>?</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a></td><td><div class="comment"><p>This argument is <strong>deprecated</strong> and will be ignored.</p>
</div></td></tr>
<tr><td><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>When <code>true</code> the channel will not take focus.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="OverviewRulerLane"></a><span class="code-item" id=212>OverviewRulerLane</span>



<div class="comment"><p>Represents different positions for rendering a decoration in an <a href="#DecorationRenderOptions.overviewRulerLane">overview ruler</a>.
The overview ruler supports three lanes.</p>
</div>

#### Enumeration Members



<a name="OverviewRulerLane.Left"></a><span class="ts" id=213 data-target="#details-213" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Left</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-213">
<div class="comment"><p>The left lane of the overview ruler.</p>
</div>
</div>



<a name="OverviewRulerLane.Center"></a><span class="ts" id=214 data-target="#details-214" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Center</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-214">
<div class="comment"><p>The center lane of the overview ruler.</p>
</div>
</div>



<a name="OverviewRulerLane.Right"></a><span class="ts" id=215 data-target="#details-215" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Right</span><span>: </span><span class="type-literal">4</span></span>
<div class="details collapse" id="details-215">
<div class="comment"><p>The right lane of the overview ruler.</p>
</div>
</div>



<a name="OverviewRulerLane.Full"></a><span class="ts" id=216 data-target="#details-216" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Full</span><span>: </span><span class="type-literal">7</span></span>
<div class="details collapse" id="details-216">
<div class="comment"><p>All lanes of the overview ruler.</p>
</div>
</div>

### <a name="ParameterInformation"></a><span class="code-item" id=1186>ParameterInformation</span>



<div class="comment"><p>Represents a parameter of a callable-signature. A parameter can
have a label and a doc-comment.</p>
</div>

#### Constructors



<a name="ParameterInformation.ParameterInformation"></a><span class="ts" id=1188 data-target="#details-1188" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ParameterInformation</span><span>(</span><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span> &#124; [<span class="type-intrinsic">number</span>, <span class="type-intrinsic">number</span>], <span class="ident">documentation</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a><span>)</span><span>: </span><a class="type-ref" href="#ParameterInformation">ParameterInformation</a></span>
<div class="details collapse" id="details-1188">
<div class="comment"><p>Creates a new parameter information object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span> &#124; [<span class="type-intrinsic">number</span>, <span class="type-intrinsic">number</span>]</td><td><div class="comment"><p>A label string or inclusive start and exclusive end offsets within its containing signature label.</p>
</div></td></tr>
<tr><td><span class="ident">documentation</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></td><td><div class="comment"><p>A doc string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ParameterInformation">ParameterInformation</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="ParameterInformation.documentation"></a><span class="ts" id=1192 data-target="#details-1192" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">documentation</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-1192">
<div class="comment"><p>The human-readable doc-comment of this signature. Will be shown
in the UI but can be omitted.</p>
</div>
</div>



<a name="ParameterInformation.label"></a><span class="ts" id=1191 data-target="#details-1191" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span> &#124; [<span class="type-intrinsic">number</span>, <span class="type-intrinsic">number</span>]</span>
<div class="details collapse" id="details-1191">
<div class="comment"><p>The label of this signature.</p>
<p>Either a string or inclusive start and exclusive end offsets within its containing
<a href="#SignatureInformation.label">signature label</a>. <em>Note</em>: A label of type string must be
a substring of its containing signature information&#39;s <a href="#SignatureInformation.label">label</a>.</p>
</div>
</div>

### <a name="Position"></a><span class="code-item" id=52>Position</span>



<div class="comment"><p>Represents a line and character position, such as
the position of the cursor.</p>
<p>Position objects are <strong>immutable</strong>. Use the <a href="#Position.with">with</a> or
<a href="#Position.translate">translate</a> methods to derive new positions
from an existing position.</p>
</div>

#### Constructors



<a name="Position.Position"></a><span class="ts" id=54 data-target="#details-54" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Position</span><span>(</span><span class="ident">line</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">character</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-54">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">line</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A zero-based line value.</p>
</div></td></tr>
<tr><td><span class="ident">character</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A zero-based character value.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="Position.character"></a><span class="ts" id=58 data-target="#details-58" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">character</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-58">
<div class="comment"><p>The zero-based character value.</p>
<p>Character offsets are expressed using UTF-16 <a href="https://developer.mozilla.org/en-US/docs/Glossary/Code_unit">code units</a>.</p>
</div>
</div>



<a name="Position.line"></a><span class="ts" id=57 data-target="#details-57" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">line</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-57">
<div class="comment"><p>The zero-based line value.</p>
</div>
</div>

#### Methods



<a name="Position.compareTo"></a><span class="ts" id=75 data-target="#details-75" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">compareTo</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-75">
<div class="comment"><p>Compare this to <code>other</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A number smaller than zero if this position is before the given position,
a number greater than zero if this position is after the given position, or zero when
this and the given position are equal.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Position.isAfter"></a><span class="ts" id=66 data-target="#details-66" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isAfter</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-66">
<div class="comment"><p>Check if this position is after <code>other</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> if position is on a greater line
or on the same line on a greater character.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Position.isAfterOrEqual"></a><span class="ts" id=69 data-target="#details-69" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isAfterOrEqual</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-69">
<div class="comment"><p>Check if this position is after or equal to <code>other</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> if position is on a greater line
or on the same line on a greater or equal character.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Position.isBefore"></a><span class="ts" id=60 data-target="#details-60" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isBefore</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-60">
<div class="comment"><p>Check if this position is before <code>other</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> if position is on a smaller line
or on the same line on a smaller character.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Position.isBeforeOrEqual"></a><span class="ts" id=63 data-target="#details-63" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isBeforeOrEqual</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-63">
<div class="comment"><p>Check if this position is before or equal to <code>other</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> if position is on a smaller line
or on the same line on a smaller or equal character.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Position.isEqual"></a><span class="ts" id=72 data-target="#details-72" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isEqual</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-72">
<div class="comment"><p>Check if this position is equal to <code>other</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> if the line and character of the given position are equal to
the line and character of this position.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Position.translate"></a><span class="ts" id=78 data-target="#details-78" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">translate</span><span>(</span><span class="ident">lineDelta</span><span>?</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">characterDelta</span><span>?</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-78">
<div class="comment"><p>Create a new position relative to this position.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">lineDelta</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>Delta value for the line value, default is <code>0</code>.</p>
</div></td></tr>
<tr><td><span class="ident">characterDelta</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>Delta value for the character value, default is <code>0</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position which line and character is the sum of the current line and
character and the corresponding deltas.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Position.translate"></a><span class="ts" id=81 data-target="#details-81" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">translate</span><span>(</span><span class="ident">change</span><span>: </span>{characterDelta: <span class="type-intrinsic">number</span>, lineDelta: <span class="type-intrinsic">number</span>}<span>)</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-81">
<div class="comment"><p>Derived a new position relative to this position.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">change</span><span>: </span>{characterDelta: <span class="type-intrinsic">number</span>, lineDelta: <span class="type-intrinsic">number</span>}</td><td><div class="comment"><p>An object that describes a delta to this position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position that reflects the given delta. Will return <code>this</code> position if the change
is not changing anything.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Position.with"></a><span class="ts" id=87 data-target="#details-87" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">with</span><span>(</span><span class="ident">line</span><span>?</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">character</span><span>?</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-87">
<div class="comment"><p>Create a new position derived from this position.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">line</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>Value that should be used as line value, default is the <a href="#Position.line">existing value</a></p>
</div></td></tr>
<tr><td><span class="ident">character</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>Value that should be used as character value, default is the <a href="#Position.character">existing value</a></p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position where line and character are replaced by the given values.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Position.with"></a><span class="ts" id=90 data-target="#details-90" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">with</span><span>(</span><span class="ident">change</span><span>: </span>{character: <span class="type-intrinsic">number</span>, line: <span class="type-intrinsic">number</span>}<span>)</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-90">
<div class="comment"><p>Derived a new position from this position.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">change</span><span>: </span>{character: <span class="type-intrinsic">number</span>, line: <span class="type-intrinsic">number</span>}</td><td><div class="comment"><p>An object that describes a change to this position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position that reflects the given change. Will return <code>this</code> position if the change
is not changing anything.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="PreparedToolInvocation"></a><span class="code-item" id=5194>PreparedToolInvocation</span>



<div class="comment"><p>The result of a call to <a href="#LanguageModelTool.prepareInvocation">LanguageModelTool.prepareInvocation</a>.</p>
</div>

#### Properties



<a name="PreparedToolInvocation.confirmationMessages"></a><span class="ts" id=5196 data-target="#details-5196" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">confirmationMessages</span><span>?</span><span>: </span><a class="type-ref" href="#LanguageModelToolConfirmationMessages">LanguageModelToolConfirmationMessages</a></span>
<div class="details collapse" id="details-5196">
<div class="comment"><p>The presence of this property indicates that the user should be asked to confirm before running the tool. The user
should be asked for confirmation for any tool that has a side-effect or may potentially be dangerous.</p>
</div>
</div>



<a name="PreparedToolInvocation.invocationMessage"></a><span class="ts" id=5195 data-target="#details-5195" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">invocationMessage</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-5195">
<div class="comment"><p>A customized progress message to show while the tool runs.</p>
</div>
</div>

### <a name="PrepareLanguageModelChatModelOptions"></a><span class="code-item" id=5073>PrepareLanguageModelChatModelOptions</span>



<div class="comment"><p>The list of options passed into <a href="#LanguageModelChatProvider.provideLanguageModelChatInformation">LanguageModelChatProvider.provideLanguageModelChatInformation</a></p>
</div>

#### Properties



<a name="PrepareLanguageModelChatModelOptions.silent"></a><span class="ts" id=5074 data-target="#details-5074" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">silent</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-5074">
<div class="comment"><p>Whether or not the user should be prompted via some UI flow, or if models should be attempted to be resolved silently.
If silent is true, all models may not be resolved due to lack of info such as API keys.</p>
</div>
</div>

### <a name="ProcessExecution"></a><span class="code-item" id=2163>ProcessExecution</span>



<div class="comment"><p>The execution of a task happens as an external process
without shell interaction.</p>
</div>

#### Constructors



<a name="ProcessExecution.ProcessExecution"></a><span class="ts" id=2165 data-target="#details-2165" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ProcessExecution</span><span>(</span><span class="ident">process</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#ProcessExecutionOptions">ProcessExecutionOptions</a><span>)</span><span>: </span><a class="type-ref" href="#ProcessExecution">ProcessExecution</a></span>
<div class="details collapse" id="details-2165">
<div class="comment"><p>Creates a process execution.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">process</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The process to start.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#ProcessExecutionOptions">ProcessExecutionOptions</a></td><td><div class="comment"><p>Optional options for the started process.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProcessExecution">ProcessExecution</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="ProcessExecution.ProcessExecution"></a><span class="ts" id=2168 data-target="#details-2168" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ProcessExecution</span><span>(</span><span class="ident">process</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">args</span><span>: </span><span class="type-intrinsic">string</span>[], <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#ProcessExecutionOptions">ProcessExecutionOptions</a><span>)</span><span>: </span><a class="type-ref" href="#ProcessExecution">ProcessExecution</a></span>
<div class="details collapse" id="details-2168">
<div class="comment"><p>Creates a process execution.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">process</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The process to start.</p>
</div></td></tr>
<tr><td><span class="ident">args</span><span>: </span><span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>Arguments to be passed to the process.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#ProcessExecutionOptions">ProcessExecutionOptions</a></td><td><div class="comment"><p>Optional options for the started process.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProcessExecution">ProcessExecution</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="ProcessExecution.args"></a><span class="ts" id=2173 data-target="#details-2173" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">args</span><span>: </span><span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-2173">
<div class="comment"><p>The arguments passed to the process. Defaults to an empty array.</p>
</div>
</div>



<a name="ProcessExecution.options"></a><span class="ts" id=2174 data-target="#details-2174" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#ProcessExecutionOptions">ProcessExecutionOptions</a></span>
<div class="details collapse" id="details-2174">
<div class="comment"><p>The process options used when the process is executed.
Defaults to undefined.</p>
</div>
</div>



<a name="ProcessExecution.process"></a><span class="ts" id=2172 data-target="#details-2172" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">process</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2172">
<div class="comment"><p>The process to be executed.</p>
</div>
</div>

### <a name="ProcessExecutionOptions"></a><span class="code-item" id=2157>ProcessExecutionOptions</span>



<div class="comment"><p>Options for a process execution</p>
</div>

#### Properties



<a name="ProcessExecutionOptions.cwd"></a><span class="ts" id=2158 data-target="#details-2158" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cwd</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2158">
<div class="comment"><p>The current working directory of the executed program or shell.
If omitted the tools current workspace root is used.</p>
</div>
</div>



<a name="ProcessExecutionOptions.env"></a><span class="ts" id=2159 data-target="#details-2159" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">env</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-2159">
<div class="comment"><p>The additional environment of the executed program or shell. If omitted
the parent process&#39; environment is used. If provided it is merged with
the parent process&#39; environment.</p>
</div>
</div>

### <a name="Progress"></a><span class="code-item" id=1930>Progress&lt;T&gt;</span>



<div class="comment"><p>Defines a generalized way of reporting progress updates.</p>
</div>

#### Methods



<a name="Progress.report"></a><span class="ts" id=1933 data-target="#details-1933" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">report</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-ref">T</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1933">
<div class="comment"><p>Report a progress update.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>A progress item, like a message and/or an
report on how much work finished</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="ProgressLocation"></a><span class="code-item" id=3179>ProgressLocation</span>



<div class="comment"><p>A location in the editor at which progress information can be shown. It depends on the
location how progress is visually represented.</p>
</div>

#### Enumeration Members



<a name="ProgressLocation.SourceControl"></a><span class="ts" id=3180 data-target="#details-3180" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SourceControl</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-3180">
<div class="comment"><p>Show progress for the source control viewlet, as overlay for the icon and as progress bar
inside the viewlet (when visible). Neither supports cancellation nor discrete progress nor
a label to describe the operation.</p>
</div>
</div>



<a name="ProgressLocation.Window"></a><span class="ts" id=3181 data-target="#details-3181" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Window</span><span>: </span><span class="type-literal">10</span></span>
<div class="details collapse" id="details-3181">
<div class="comment"><p>Show progress in the status bar of the editor. Neither supports cancellation nor discrete progress.
Supports rendering of <a href="#ThemeIcon">theme icons</a> via the <code>$(&lt;name&gt;)</code>-syntax in the progress label.</p>
</div>
</div>



<a name="ProgressLocation.Notification"></a><span class="ts" id=3182 data-target="#details-3182" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Notification</span><span>: </span><span class="type-literal">15</span></span>
<div class="details collapse" id="details-3182">
<div class="comment"><p>Show progress as notification with an optional cancel button. Supports to show infinite and discrete
progress but does not support rendering of icons.</p>
</div>
</div>

### <a name="ProgressOptions"></a><span class="code-item" id=3183>ProgressOptions</span>



<div class="comment"><p>Value-object describing where and how progress should show.</p>
</div>

#### Properties



<a name="ProgressOptions.cancellable"></a><span class="ts" id=3188 data-target="#details-3188" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cancellable</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3188">
<div class="comment"><p>Controls if a cancel button should show to allow the user to
cancel the long running operation.  Note that currently only
<code>ProgressLocation.Notification</code> is supporting to show a cancel
button.</p>
</div>
</div>



<a name="ProgressOptions.location"></a><span class="ts" id=3184 data-target="#details-3184" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">location</span><span>: </span><a class="type-ref" href="#ProgressLocation">ProgressLocation</a> &#124; {viewId: <span class="type-intrinsic">string</span>}</span>
<div class="details collapse" id="details-3184">
<div class="comment"><p>The location at which progress should show.</p>
</div>
</div>



<a name="ProgressOptions.title"></a><span class="ts" id=3187 data-target="#details-3187" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3187">
<div class="comment"><p>A human-readable string which will be used to describe the
operation.</p>
</div>
</div>

### <a name="ProvideLanguageModelChatResponseOptions"></a><span class="code-item" id=5028>ProvideLanguageModelChatResponseOptions</span>



<div class="comment"><p>The provider version of <a href="#LanguageModelChatRequestOptions">LanguageModelChatRequestOptions</a></p>
</div>

#### Properties



<a name="ProvideLanguageModelChatResponseOptions.modelOptions"></a><span class="ts" id=5029 data-target="#details-5029" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">modelOptions</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-5029">
<div class="comment"><p>A set of options that control the behavior of the language model. These options are specific to the language model.</p>
</div>
</div>



<a name="ProvideLanguageModelChatResponseOptions.toolMode"></a><span class="ts" id=5034 data-target="#details-5034" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">toolMode</span><span>: </span><a class="type-ref" href="#LanguageModelChatToolMode">LanguageModelChatToolMode</a></span>
<div class="details collapse" id="details-5034">
<div class="comment"><p>The tool-selecting mode to use. The provider must implement respecting this.</p>
</div>
</div>



<a name="ProvideLanguageModelChatResponseOptions.tools"></a><span class="ts" id=5033 data-target="#details-5033" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tools</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#LanguageModelChatTool">LanguageModelChatTool</a>[]</span>
<div class="details collapse" id="details-5033">
<div class="comment"><p>An optional list of tools that are available to the language model. These could be registered tools available via
<a href="#lm.tools">lm.tools</a>, or private tools that are just implemented within the calling extension.</p>
<p>If the LLM requests to call one of these tools, it will return a <a href="#LanguageModelToolCallPart">LanguageModelToolCallPart</a> in
<a href="#LanguageModelChatResponse.stream">LanguageModelChatResponse.stream</a>. It&#39;s the caller&#39;s responsibility to invoke the tool. If it&#39;s a tool
registered in <a href="#lm.tools">lm.tools</a>, that means calling <a href="#lm.invokeTool">lm.invokeTool</a>.</p>
<p>Then, the tool result can be provided to the LLM by creating an Assistant-type <a href="#LanguageModelChatMessage">LanguageModelChatMessage</a> with a
<a href="#LanguageModelToolCallPart">LanguageModelToolCallPart</a>, followed by a User-type message with a <a href="#LanguageModelToolResultPart">LanguageModelToolResultPart</a>.</p>
</div>
</div>

### <a name="ProviderResult"></a><span class="code-item" id=588>ProviderResult&lt;T&gt;</span>



<div class="comment"><p>A provider result represents the values a provider, like the <a href="#HoverProvider">HoverProvider</a>,
may return. For once this is the actual result type <code>T</code>, like <code>Hover</code>, or a thenable that resolves
to that type <code>T</code>. In addition, <code>null</code> and <code>undefined</code> can be returned - either directly or from a
thenable.</p>
<p>The snippets below are all valid implementations of the <a href="#HoverProvider">HoverProvider</a>:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">let</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> a</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">HoverProvider</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = {</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  provideHover</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">pos</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">token</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">): </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">ProviderResult</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">Hover</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">> {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">    return</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> new</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26"> Hover</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Hello World'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">};</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">let</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> b</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">HoverProvider</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = {</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  provideHover</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">pos</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">token</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">): </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">ProviderResult</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">Hover</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">> {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">    return</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> new</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99"> Promise</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">resolve</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">      resolve</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26"> Hover</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Hello World'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">));</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    });</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">};</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">let</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> c</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">HoverProvider</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = {</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  provideHover</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">doc</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">pos</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">token</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">): </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">ProviderResult</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">Hover</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">> {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">    return</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">; </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// undefined</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">};</span></span>
<span class="line"></span></code></pre>
</div>



<a name="ProviderResult"></a><span class="ts" id=588 data-target="#details-588" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ProviderResult</span><span>: </span><span class="type-ref">T</span> &#124; <span class="type-intrinsic">undefined</span> &#124; <span class="type-literal">null</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-ref">T</span> &#124; <span class="type-intrinsic">undefined</span> &#124; <span class="type-literal">null</span>&gt;</span>

### <a name="Pseudoterminal"></a><span class="code-item" id=3065>Pseudoterminal</span>



<div class="comment"><p>Defines the interface of a terminal pty, enabling extensions to control a terminal.</p>
</div>

#### Events



<a name="Pseudoterminal.onDidChangeName"></a><span class="ts" id=3069 data-target="#details-3069" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeName</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-3069">
<div class="comment"><p>An event that when fired allows changing the name of the terminal.</p>
<p>Events fired before <a href="#Pseudoterminal.open">Pseudoterminal.open</a> is called will be be ignored.</p>
<p><strong>Example:</strong> Change the terminal name to &quot;My new terminal&quot;.</p>
<pre class="shiki" data-lang="typescript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> writeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">EventEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">string</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">>();</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> changeNameEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">EventEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">string</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">>();</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> pty</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">Pseudoterminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  onDidWrite:</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> writeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  onDidChangeName:</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> changeNameEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  open</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> () </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> changeNameEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">fire</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'My new terminal'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">),</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  close</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> () </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {}</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">};</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createTerminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">name:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'My terminal'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">pty</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span>
<span class="line"></span></code></pre>
</div>
</div>



<a name="Pseudoterminal.onDidClose"></a><span class="ts" id=3068 data-target="#details-3068" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidClose</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3068">
<div class="comment"><p>An event that when fired will signal that the pty is closed and dispose of the terminal.</p>
<p>Events fired before <a href="#Pseudoterminal.open">Pseudoterminal.open</a> is called will be be ignored.</p>
<p>A number can be used to provide an exit code for the terminal. Exit codes must be
positive and a non-zero exit codes signals failure which shows a notification for a
regular terminal and allows dependent tasks to proceed when used with the
<code>CustomExecution</code> API.</p>
<p><strong>Example:</strong> Exit the terminal when &quot;y&quot; is pressed, otherwise show a notification.</p>
<pre class="shiki" data-lang="typescript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> writeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">EventEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">string</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">>();</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> closeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">EventEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">void</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">>();</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> pty</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">Pseudoterminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  onDidWrite:</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> writeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  onDidClose:</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> closeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  open</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> () </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> writeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">fire</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Press y to exit successfully'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">),</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  close</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> () </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {},</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  handleInput</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> data</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">    if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">data</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> !== </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'y'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">      vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">showInformationMessage</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Something went wrong'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    }</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">    closeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">fire</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">();</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">};</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> terminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createTerminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">name:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'Exit example'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">pty</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">terminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">show</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">true</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span></code></pre>
</div>
</div>



<a name="Pseudoterminal.onDidOverrideDimensions"></a><span class="ts" id=3067 data-target="#details-3067" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidOverrideDimensions</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TerminalDimensions">TerminalDimensions</a>&gt;</span>
<div class="details collapse" id="details-3067">
<div class="comment"><p>An event that when fired allows overriding the <a href="#Pseudoterminal.setDimensions">dimensions</a> of the
terminal. Note that when set, the overridden dimensions will only take effect when they
are lower than the actual dimensions of the terminal (ie. there will never be a scroll
bar). Set to <code>undefined</code> for the terminal to go back to the regular dimensions (fit to
the size of the panel).</p>
<p>Events fired before <a href="#Pseudoterminal.open">Pseudoterminal.open</a> is called will be be ignored.</p>
<p><strong>Example:</strong> Override the dimensions of a terminal to 20 columns and 10 rows</p>
<pre class="shiki" data-lang="typescript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> dimensionsEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">EventEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">TerminalDimensions</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">>();</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> pty</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">Pseudoterminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  onDidWrite:</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> writeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  onDidOverrideDimensions:</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> dimensionsEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  open</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> () </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">    dimensionsEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">fire</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">      columns:</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658"> 20</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">      rows:</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658"> 10</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    });</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  },</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  close</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> () </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {}</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">};</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createTerminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">name:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'My terminal'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">pty</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span>
<span class="line"></span></code></pre>
</div>
</div>



<a name="Pseudoterminal.onDidWrite"></a><span class="ts" id=3066 data-target="#details-3066" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidWrite</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-3066">
<div class="comment"><p>An event that when fired will write data to the terminal. Unlike
<a href="#Terminal.sendText">Terminal.sendText</a> which sends text to the underlying child
pseudo-device (the child), this will write the text to parent pseudo-device (the
<em>terminal</em> itself).</p>
<p>Note writing <code>\n</code> will just move the cursor down 1 row, you need to write <code>\r</code> as well
to move the cursor to the left-most cell.</p>
<p>Events fired before <a href="#Pseudoterminal.open">Pseudoterminal.open</a> is called will be be ignored.</p>
<p><strong>Example:</strong> Write red text to the terminal</p>
<pre class="shiki" data-lang="typescript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> writeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">EventEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">string</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">>();</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> pty</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">Pseudoterminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  onDidWrite:</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> writeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  open</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> () </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> writeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">fire</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'</span><span style="--shiki-dark:#D7BA7D;--shiki-light:#EE0000">\x1b</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">[31mHello world</span><span style="--shiki-dark:#D7BA7D;--shiki-light:#EE0000">\x1b</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">[0m'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">),</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  close</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> () </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {}</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">};</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createTerminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">name:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'My terminal'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">pty</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span>
<span class="line"></span></code></pre>
<p><strong>Example:</strong> Move the cursor to the 10th row and 20th column and write an asterisk</p>
<pre class="shiki" data-lang="typescript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">writeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">fire</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'</span><span style="--shiki-dark:#D7BA7D;--shiki-light:#EE0000">\x1b</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">[10;20H*'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span></code></pre>
</div>
</div>

#### Methods



<a name="Pseudoterminal.close"></a><span class="ts" id=3074 data-target="#details-3074" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">close</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3074">
<div class="comment"><p>Implement to handle when the terminal is closed by an act of the user.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="Pseudoterminal.handleInput"></a><span class="ts" id=3076 data-target="#details-3076" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">handleInput</span><span>(</span><span class="ident">data</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3076">
<div class="comment"><p>Implement to handle incoming keystrokes in the terminal or when an extension calls
<a href="#Terminal.sendText">Terminal.sendText</a>. <code>data</code> contains the keystrokes/text serialized into
their corresponding VT sequence representation.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">data</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The incoming data.</p>
<p><strong>Example:</strong> Echo input in the terminal. The sequence for enter (<code>\r</code>) is translated to
CRLF to go to a new line and move the cursor to the start of the line.</p>
<pre class="shiki" data-lang="typescript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> writeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">EventEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">&#x3C;</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">string</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">>();</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> pty</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">Pseudoterminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  onDidWrite:</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> writeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  open</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> () </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {},</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  close</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> () </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {},</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  handleInput</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">:</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> data</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> writeEmitter</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">fire</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">data</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'</span><span style="--shiki-dark:#D7BA7D;--shiki-light:#EE0000">\r</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> ? </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'</span><span style="--shiki-dark:#D7BA7D;--shiki-light:#EE0000">\r\n</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> : </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">data</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">)</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">};</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createTerminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">name:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'Local echo'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">pty</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span>
<span class="line"></span></code></pre>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="Pseudoterminal.open"></a><span class="ts" id=3071 data-target="#details-3071" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">open</span><span>(</span><span class="ident">initialDimensions</span><span>: </span><a class="type-ref" href="#TerminalDimensions">TerminalDimensions</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3071">
<div class="comment"><p>Implement to handle when the pty is open and ready to start firing events.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">initialDimensions</span><span>: </span><a class="type-ref" href="#TerminalDimensions">TerminalDimensions</a></td><td><div class="comment"><p>The dimensions of the terminal, this will be undefined if the
terminal panel has not been opened before this is called.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="Pseudoterminal.setDimensions"></a><span class="ts" id=3079 data-target="#details-3079" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">setDimensions</span><span>(</span><span class="ident">dimensions</span><span>: </span><a class="type-ref" href="#TerminalDimensions">TerminalDimensions</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3079">
<div class="comment"><p>Implement to handle when the number of rows and columns that fit into the terminal panel
changes, for example when font size changes or when the panel is resized. The initial
state of a terminal&#39;s dimensions should be treated as <code>undefined</code> until this is triggered
as the size of a terminal isn&#39;t known until it shows up in the user interface.</p>
<p>When dimensions are overridden by
<a href="#Pseudoterminal.onDidOverrideDimensions">onDidOverrideDimensions</a>, <code>setDimensions</code> will
continue to be called with the regular panel dimensions, allowing the extension continue
to react dimension changes.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">dimensions</span><span>: </span><a class="type-ref" href="#TerminalDimensions">TerminalDimensions</a></td><td><div class="comment"><p>The new dimensions.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="QuickDiffProvider"></a><span class="code-item" id=3961>QuickDiffProvider</span>



<div class="comment"><p>A quick diff provider provides a <a href="#Uri">uri</a> to the original state of a
modified resource. The editor will use this information to render ad&#39;hoc diffs
within the text.</p>
</div>

#### Methods



<a name="QuickDiffProvider.provideOriginalResource"></a><span class="ts" id=3963 data-target="#details-3963" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideOriginalResource</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</span>
<div class="details collapse" id="details-3963">
<div class="comment"><p>Provide a <a href="#Uri">Uri</a> to the original resource of any given resource uri.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the resource open in a text editor.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</td><td><div class="comment"><p>A thenable that resolves to uri of the matching original resource.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="QuickInput"></a><span class="code-item" id=3189>QuickInput</span>



<div class="comment"><p>The base interface for all quick input types.</p>
<p>Quick input provides a unified way for extensions to interact with users through simple UI elements.
A quick input UI is initially not visible. After configuring it through its properties the extension
can make it visible by calling <a href="#QuickInput.show">show</a>.</p>
<p>There are several reasons why this UI might have to be hidden and the extension will be notified
through <a href="#QuickInput.onDidHide">onDidHide</a>. Examples include: an explicit call to
<a href="#QuickInput.hide">hide</a>, the user pressing Esc, some other input UI opening, etc.</p>
<p>A user pressing Enter or some other gesture implying acceptance of the current state does not
automatically hide this UI component. It is up to the extension to decide whether to accept the
user&#39;s input and if the UI should indeed be hidden through a call to <a href="#QuickInput.hide">hide</a>.</p>
<p>When the extension no longer needs this input UI, it should <a href="#QuickInput.dispose">dispose</a> it
to allow for freeing up any resources associated with it.</p>
<p>See <a href="#QuickPick">QuickPick</a> and <a href="#InputBox">InputBox</a> for concrete UIs.</p>
</div>

#### Events



<a name="QuickInput.onDidHide"></a><span class="ts" id=3200 data-target="#details-3200" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidHide</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3200">
<div class="comment"><p>An event signaling when this input UI is hidden.</p>
<p>There are several reasons why this UI might have to be hidden and the extension will be notified
through <a href="#QuickInput.onDidHide">onDidHide</a>. Examples include: an explicit call to
<a href="#QuickInput.hide">hide</a>, the user pressing Esc, some other input UI opening, etc.</p>
</div>
</div>

#### Properties



<a name="QuickInput.busy"></a><span class="ts" id=3194 data-target="#details-3194" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">busy</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3194">
<div class="comment"><p>Determines if the UI should show a progress indicator. Defaults to <code>false</code>.</p>
<p>Change this to <code>true</code>, for example, while loading more data or validating user input.</p>
</div>
</div>



<a name="QuickInput.enabled"></a><span class="ts" id=3193 data-target="#details-3193" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">enabled</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3193">
<div class="comment"><p>Determines if the UI should allow for user input. Defaults to <code>true</code>.</p>
<p>Change this to <code>false</code>, for example, while validating user input or loading data for the next
step in user input.</p>
</div>
</div>



<a name="QuickInput.ignoreFocusOut"></a><span class="ts" id=3195 data-target="#details-3195" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ignoreFocusOut</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3195">
<div class="comment"><p>Determines if the UI should stay open even when losing UI focus. Defaults to <code>false</code>.
This setting is ignored on iPad and is always <code>false</code>.</p>
</div>
</div>



<a name="QuickInput.step"></a><span class="ts" id=3191 data-target="#details-3191" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">step</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3191">
<div class="comment"><p>An optional current step count for multi-step input flows.</p>
</div>
</div>



<a name="QuickInput.title"></a><span class="ts" id=3190 data-target="#details-3190" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3190">
<div class="comment"><p>An optional title for the input UI.</p>
</div>
</div>



<a name="QuickInput.totalSteps"></a><span class="ts" id=3192 data-target="#details-3192" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">totalSteps</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3192">
<div class="comment"><p>An optional total step count for multi-step input flows.</p>
</div>
</div>

#### Methods



<a name="QuickInput.dispose"></a><span class="ts" id=3202 data-target="#details-3202" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3202">
<div class="comment"><p>Dispose of this input UI and any associated resources.</p>
<p>If it is still visible, it is first hidden. After this call the input UI is no longer functional
and no additional methods or properties on it should be accessed. Instead a new input UI should
be created.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="QuickInput.hide"></a><span class="ts" id=3199 data-target="#details-3199" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hide</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3199">
<div class="comment"><p>Hides this input UI.</p>
<p>This will also fire an <a href="#QuickInput.onDidHide">onDidHide</a> event.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="QuickInput.show"></a><span class="ts" id=3197 data-target="#details-3197" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">show</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3197">
<div class="comment"><p>Makes the input UI visible in its current configuration.</p>
<p>Any other input UI will first fire an <a href="#QuickInput.onDidHide">onDidHide</a> event.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="QuickInputButton"></a><span class="code-item" id=3263>QuickInputButton</span>



<div class="comment"><p>A button for an action in a <a href="#QuickPick">QuickPick</a> or <a href="#InputBox">InputBox</a>.</p>
</div>

#### Properties



<a name="QuickInputButton.iconPath"></a><span class="ts" id=3264 data-target="#details-3264" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">iconPath</span><span>: </span><a class="type-ref" href="#IconPath">IconPath</a></span>
<div class="details collapse" id="details-3264">
<div class="comment"><p>The icon for the button.</p>
</div>
</div>



<a name="QuickInputButton.location"></a><span class="ts" id=3266 data-target="#details-3266" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">location</span><span>?</span><span>: </span><a class="type-ref" href="#QuickInputButtonLocation">QuickInputButtonLocation</a></span>
<div class="details collapse" id="details-3266">
<div class="comment"><p>The location where the button should be rendered.</p>
<p>Defaults to <a href="#QuickInputButtonLocation.Title">QuickInputButtonLocation.Title</a>.</p>
<p><strong>Note:</strong> This property is ignored if the button was added to a <a href="#QuickPickItem">QuickPickItem</a>.</p>
</div>
</div>



<a name="QuickInputButton.toggle"></a><span class="ts" id=3267 data-target="#details-3267" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">toggle</span><span>?</span><span>: </span>{checked: <span class="type-intrinsic">boolean</span>}</span>
<div class="details collapse" id="details-3267">
<div class="comment"><p>When present, indicates that the button is a toggle button that can be checked or unchecked.</p>
</div>
<div class="signature variable-declaration-child">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td>checked: <span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Indicates whether the toggle button is currently checked.
This property will be updated when the button is toggled.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="QuickInputButton.tooltip"></a><span class="ts" id=3265 data-target="#details-3265" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3265">
<div class="comment"><p>An optional tooltip displayed when hovering over the button.</p>
</div>
</div>

### <a name="QuickInputButtonLocation"></a><span class="code-item" id=3259>QuickInputButtonLocation</span>



<div class="comment"><p>Specifies the location where a <a href="#QuickInputButton">QuickInputButton</a> should be rendered.</p>
</div>

#### Enumeration Members



<a name="QuickInputButtonLocation.Title"></a><span class="ts" id=3260 data-target="#details-3260" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Title</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-3260">
<div class="comment"><p>The button is rendered in the title bar.</p>
</div>
</div>



<a name="QuickInputButtonLocation.Inline"></a><span class="ts" id=3261 data-target="#details-3261" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Inline</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-3261">
<div class="comment"><p>The button is rendered inline to the right of the input box.</p>
</div>
</div>



<a name="QuickInputButtonLocation.Input"></a><span class="ts" id=3262 data-target="#details-3262" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Input</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-3262">
<div class="comment"><p>The button is rendered at the far end inside the input box.</p>
</div>
</div>

### <a name="QuickInputButtons"></a><span class="code-item" id=3270>QuickInputButtons</span>



<div class="comment"><p>Predefined buttons for <a href="#QuickPick">QuickPick</a> and <a href="#InputBox">InputBox</a>.</p>
</div>

#### Static



<a name="QuickInputButtons.Back"></a><span class="ts" id=3271 data-target="#details-3271" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Back</span><span>: </span><a class="type-ref" href="#QuickInputButton">QuickInputButton</a></span>
<div class="details collapse" id="details-3271">
<div class="comment"><p>A predefined back button for <a href="#QuickPick">QuickPick</a> and <a href="#InputBox">InputBox</a>.</p>
<p>This button should be used for consistency when a navigation back button is needed. It comes
with a predefined icon, tooltip, and location.</p>
</div>
</div>

### <a name="QuickPick"></a><span class="code-item" id=3203>QuickPick&lt;T&gt;</span>



<div class="comment"><p>A concrete <a href="#QuickInput">QuickInput</a> to let the user pick an item from a list of items of type <code>T</code>.</p>
<p>The items can be filtered through a filter text field and there is an option
<a href="#QuickPick.canSelectMany">canSelectMany</a> to allow for selecting multiple items.</p>
<p>Note that in many cases the more convenient <a href="#window.showQuickPick">window.showQuickPick</a> is easier to use.
<a href="#window.createQuickPick">window.createQuickPick</a> should be used when <a href="#window.showQuickPick">window.showQuickPick</a> does not offer
the required flexibility.</p>
</div>

#### Events



<a name="QuickPick.onDidAccept"></a><span class="ts" id=3209 data-target="#details-3209" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidAccept</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3209">
<div class="comment"><p>An event signaling when the user indicated acceptance of the selected item(s).</p>
</div>
</div>



<a name="QuickPick.onDidChangeActive"></a><span class="ts" id=3219 data-target="#details-3219" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeActive</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;readonly <span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-3219">
<div class="comment"><p>An event signaling when the active items have changed.</p>
</div>
</div>



<a name="QuickPick.onDidChangeSelection"></a><span class="ts" id=3221 data-target="#details-3221" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeSelection</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;readonly <span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-3221">
<div class="comment"><p>An event signaling when the selected items have changed.</p>
</div>
</div>



<a name="QuickPick.onDidChangeValue"></a><span class="ts" id=3208 data-target="#details-3208" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeValue</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-3208">
<div class="comment"><p>An event signaling when the value of the filter text has changed.</p>
</div>
</div>



<a name="QuickPick.onDidHide"></a><span class="ts" id=3232 data-target="#details-3232" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidHide</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-3232">
<div class="comment"><p>An event signaling when this input UI is hidden.</p>
<p>There are several reasons why this UI might have to be hidden and the extension will be notified
through <a href="#QuickInput.onDidHide">onDidHide</a>. Examples include: an explicit call to
<a href="#QuickInput.hide">hide</a>, the user pressing Esc, some other input UI opening, etc.</p>
</div>
</div>



<a name="QuickPick.onDidTriggerButton"></a><span class="ts" id=3211 data-target="#details-3211" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidTriggerButton</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#QuickInputButton">QuickInputButton</a>&gt;</span>
<div class="details collapse" id="details-3211">
<div class="comment"><p>An event signaling when a button was triggered.</p>
<p>This event fires for buttons stored in the <a href="#QuickPick.buttons">buttons</a> array. This event does
not fire for buttons on a <a href="#QuickPickItem">QuickPickItem</a>.</p>
</div>
</div>



<a name="QuickPick.onDidTriggerItemButton"></a><span class="ts" id=3212 data-target="#details-3212" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidTriggerItemButton</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#QuickPickItemButtonEvent&amp;lt;T&amp;gt;">QuickPickItemButtonEvent</a>&lt;<span class="type-ref">T</span>&gt;&gt;</span>
<div class="details collapse" id="details-3212">
<div class="comment"><p>An event signaling when a button in a particular <a href="#QuickPickItem">QuickPickItem</a> was triggered.</p>
<p>This event does not fire for buttons in the title bar which are part of <a href="#QuickPick.buttons">buttons</a>.</p>
</div>
</div>

#### Properties



<a name="QuickPick.activeItems"></a><span class="ts" id=3218 data-target="#details-3218" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeItems</span><span>: </span>readonly <span class="type-ref">T</span>[]</span>
<div class="details collapse" id="details-3218">
<div class="comment"><p>Active items. This can be read and updated by the extension.</p>
</div>
</div>



<a name="QuickPick.busy"></a><span class="ts" id=3226 data-target="#details-3226" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">busy</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3226">
<div class="comment"><p>Determines if the UI should show a progress indicator. Defaults to <code>false</code>.</p>
<p>Change this to <code>true</code>, for example, while loading more data or validating user input.</p>
</div>
</div>



<a name="QuickPick.buttons"></a><span class="ts" id=3210 data-target="#details-3210" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">buttons</span><span>: </span>readonly <a class="type-ref" href="#QuickInputButton">QuickInputButton</a>[]</span>
<div class="details collapse" id="details-3210">
<div class="comment"><p>Buttons for actions in the UI.</p>
</div>
</div>



<a name="QuickPick.canSelectMany"></a><span class="ts" id=3214 data-target="#details-3214" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">canSelectMany</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3214">
<div class="comment"><p>Determines if multiple items can be selected at the same time. Defaults to <code>false</code>.</p>
</div>
</div>



<a name="QuickPick.enabled"></a><span class="ts" id=3225 data-target="#details-3225" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">enabled</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3225">
<div class="comment"><p>Determines if the UI should allow for user input. Defaults to <code>true</code>.</p>
<p>Change this to <code>false</code>, for example, while validating user input or loading data for the next
step in user input.</p>
</div>
</div>



<a name="QuickPick.ignoreFocusOut"></a><span class="ts" id=3227 data-target="#details-3227" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ignoreFocusOut</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3227">
<div class="comment"><p>Determines if the UI should stay open even when losing UI focus. Defaults to <code>false</code>.
This setting is ignored on iPad and is always <code>false</code>.</p>
</div>
</div>



<a name="QuickPick.items"></a><span class="ts" id=3213 data-target="#details-3213" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">items</span><span>: </span>readonly <span class="type-ref">T</span>[]</span>
<div class="details collapse" id="details-3213">
<div class="comment"><p>Items to pick from. This can be read and updated by the extension.</p>
</div>
</div>



<a name="QuickPick.keepScrollPosition"></a><span class="ts" id=3217 data-target="#details-3217" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">keepScrollPosition</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3217">
<div class="comment"><p>Determines if the scroll position is maintained when the quick pick items are updated. Defaults to <code>false</code>.</p>
</div>
</div>



<a name="QuickPick.matchOnDescription"></a><span class="ts" id=3215 data-target="#details-3215" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">matchOnDescription</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3215">
<div class="comment"><p>Determines if the filter text should also be matched against the <a href="#QuickPickItem.description">description</a> of the items. Defaults to <code>false</code>.</p>
</div>
</div>



<a name="QuickPick.matchOnDetail"></a><span class="ts" id=3216 data-target="#details-3216" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">matchOnDetail</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3216">
<div class="comment"><p>Determines if the filter text should also be matched against the <a href="#QuickPickItem.detail">detail</a> of the items. Defaults to <code>false</code>.</p>
</div>
</div>



<a name="QuickPick.placeholder"></a><span class="ts" id=3206 data-target="#details-3206" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">placeholder</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3206">
<div class="comment"><p>Optional placeholder text displayed in the filter text box when no value has been entered.</p>
</div>
</div>



<a name="QuickPick.prompt"></a><span class="ts" id=3207 data-target="#details-3207" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prompt</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3207">
<div class="comment"><p>Optional text that provides instructions or context to the user.</p>
<p>The prompt is displayed below the input box and above the list of items.</p>
</div>
</div>



<a name="QuickPick.selectedItems"></a><span class="ts" id=3220 data-target="#details-3220" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selectedItems</span><span>: </span>readonly <span class="type-ref">T</span>[]</span>
<div class="details collapse" id="details-3220">
<div class="comment"><p>Selected items. This can be read and updated by the extension.</p>
</div>
</div>



<a name="QuickPick.step"></a><span class="ts" id=3223 data-target="#details-3223" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">step</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3223">
<div class="comment"><p>An optional current step count for multi-step input flows.</p>
</div>
</div>



<a name="QuickPick.title"></a><span class="ts" id=3222 data-target="#details-3222" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3222">
<div class="comment"><p>An optional title for the input UI.</p>
</div>
</div>



<a name="QuickPick.totalSteps"></a><span class="ts" id=3224 data-target="#details-3224" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">totalSteps</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3224">
<div class="comment"><p>An optional total step count for multi-step input flows.</p>
</div>
</div>



<a name="QuickPick.value"></a><span class="ts" id=3205 data-target="#details-3205" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3205">
<div class="comment"><p>The current value of the filter text.</p>
</div>
</div>

#### Methods



<a name="QuickPick.dispose"></a><span class="ts" id=3234 data-target="#details-3234" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3234">
<div class="comment"><p>Dispose of this input UI and any associated resources.</p>
<p>If it is still visible, it is first hidden. After this call the input UI is no longer functional
and no additional methods or properties on it should be accessed. Instead a new input UI should
be created.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="QuickPick.hide"></a><span class="ts" id=3231 data-target="#details-3231" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hide</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3231">
<div class="comment"><p>Hides this input UI.</p>
<p>This will also fire an <a href="#QuickInput.onDidHide">onDidHide</a> event.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="QuickPick.show"></a><span class="ts" id=3229 data-target="#details-3229" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">show</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3229">
<div class="comment"><p>Makes the input UI visible in its current configuration.</p>
<p>Any other input UI will first fire an <a href="#QuickInput.onDidHide">onDidHide</a> event.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="QuickPickItem"></a><span class="code-item" id=506>QuickPickItem</span>



<div class="comment"><p>Represents an item that can be selected from a list of items.</p>
</div>

#### Properties



<a name="QuickPickItem.alwaysShow"></a><span class="ts" id=514 data-target="#details-514" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">alwaysShow</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-514">
<div class="comment"><p>Determines if this item is always shown, even when filtered out by the user&#39;s input.</p>
<p><strong>Note:</strong> This property is ignored when <a href="#QuickPickItem.kind">kind</a> is set to
<a href="#QuickPickItemKind.Separator">QuickPickItemKind.Separator</a>.</p>
</div>
</div>



<a name="QuickPickItem.buttons"></a><span class="ts" id=515 data-target="#details-515" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">buttons</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#QuickInputButton">QuickInputButton</a>[]</span>
<div class="details collapse" id="details-515">
<div class="comment"><p>Optional buttons that will be rendered on this particular item.</p>
<p>These buttons will trigger an <a href="#QuickPickItemButtonEvent">QuickPickItemButtonEvent</a> when pressed. Buttons are only rendered
when using a quick pick created by the <a href="#window.createQuickPick">createQuickPick</a> API. Buttons are
not rendered when using the <a href="#window.showQuickPick">showQuickPick</a> API.</p>
<p><strong>Note:</strong> This property is ignored when <a href="#QuickPickItem.kind">kind</a> is set to
<a href="#QuickPickItemKind.Separator">QuickPickItemKind.Separator</a>.</p>
</div>
</div>



<a name="QuickPickItem.description"></a><span class="ts" id=510 data-target="#details-510" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">description</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-510">
<div class="comment"><p>A human-readable string which is rendered less prominently in the same line.</p>
<p>Supports rendering of <a href="#ThemeIcon">theme icons</a> via the <code>$(&lt;name&gt;)</code>-syntax.</p>
<p><strong>Note:</strong> This property is ignored when <a href="#QuickPickItem.kind">kind</a> is set to
<a href="#QuickPickItemKind.Separator">QuickPickItemKind.Separator</a>.</p>
</div>
</div>



<a name="QuickPickItem.detail"></a><span class="ts" id=511 data-target="#details-511" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">detail</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-511">
<div class="comment"><p>A human-readable string which is rendered less prominently in a separate line.</p>
<p>Supports rendering of <a href="#ThemeIcon">theme icons</a> via the <code>$(&lt;name&gt;)</code>-syntax.</p>
<p><strong>Note:</strong> This property is ignored when <a href="#QuickPickItem.kind">kind</a> is set to
<a href="#QuickPickItemKind.Separator">QuickPickItemKind.Separator</a>.</p>
</div>
</div>



<a name="QuickPickItem.iconPath"></a><span class="ts" id=509 data-target="#details-509" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">iconPath</span><span>?</span><span>: </span><a class="type-ref" href="#IconPath">IconPath</a></span>
<div class="details collapse" id="details-509">
<div class="comment"><p>The icon for the item.</p>
</div>
</div>



<a name="QuickPickItem.kind"></a><span class="ts" id=508 data-target="#details-508" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>?</span><span>: </span><a class="type-ref" href="#QuickPickItemKind">QuickPickItemKind</a></span>
<div class="details collapse" id="details-508">
<div class="comment"><p>The kind of this item that determines how it is rendered in the quick pick.</p>
<p>When not specified, the default is <a href="#QuickPickItemKind.Default">QuickPickItemKind.Default</a>.</p>
</div>
</div>



<a name="QuickPickItem.label"></a><span class="ts" id=507 data-target="#details-507" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-507">
<div class="comment"><p>A human-readable string which is rendered prominently.</p>
<p>Supports rendering of <a href="#ThemeIcon">theme icons</a> via the <code>$(&lt;name&gt;)</code>-syntax.</p>
<p><strong>Note:</strong> When <a href="#QuickPickItem.kind">kind</a> is set to <a href="#QuickPickItemKind.Default">QuickPickItemKind.Default</a> (so a regular
item instead of a separator), it supports rendering of <a href="#ThemeIcon">theme icons</a> via the
<code>$(&lt;name&gt;)</code>-syntax.</p>
</div>
</div>



<a name="QuickPickItem.picked"></a><span class="ts" id=513 data-target="#details-513" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">picked</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-513">
<div class="comment"><p>Optional flag indicating if this item is initially selected.</p>
<p>This is only honored when using the <a href="#window.showQuickPick">showQuickPick</a> API. To do the same
thing with the <a href="#window.createQuickPick">createQuickPick</a> API, simply set the
<a href="#QuickPick.selectedItems">selectedItems</a> to the items you want selected initially.</p>
<p><strong>Note:</strong> This is only honored when the picker allows multiple selections.</p>
<p><em>See also</em>
<a href="#QuickPickOptions.canPickMany">QuickPickOptions.canPickMany</a></p>
<p><strong>Note:</strong> This property is ignored when <a href="#QuickPickItem.kind">kind</a> is set to
<a href="#QuickPickItemKind.Separator">QuickPickItemKind.Separator</a>.</p>
</div>
</div>



<a name="QuickPickItem.resourceUri"></a><span class="ts" id=512 data-target="#details-512" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resourceUri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-512">
<div class="comment"><p>A <a href="#Uri">Uri</a> representing the resource associated with this item.</p>
<p>When set, this property is used to automatically derive several item properties if they are not explicitly provided:</p>
<ul>
<li><strong>Label</strong>: Derived from the resource&#39;s file name when <a href="#QuickPickItem.label">label</a> is not provided or is empty.</li>
<li><strong>Description</strong>: Derived from the resource&#39;s path when <a href="#QuickPickItem.description">description</a> is not provided or is empty.</li>
<li><strong>Icon</strong>: Derived from the current file icon theme when <a href="#QuickPickItem.iconPath">iconPath</a> is set to
<a href="#ThemeIcon.File">ThemeIcon.File</a> or <a href="#ThemeIcon.Folder">ThemeIcon.Folder</a>.</li>
</ul>
</div>
</div>

### <a name="QuickPickItemButtonEvent"></a><span class="code-item" id=3274>QuickPickItemButtonEvent&lt;T&gt;</span>



<div class="comment"><p>An event describing a button that was pressed on a <a href="#QuickPickItem">QuickPickItem</a>.</p>
</div>

#### Properties



<a name="QuickPickItemButtonEvent.button"></a><span class="ts" id=3276 data-target="#details-3276" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">button</span><span>: </span><a class="type-ref" href="#QuickInputButton">QuickInputButton</a></span>
<div class="details collapse" id="details-3276">
<div class="comment"><p>The button that was pressed.</p>
</div>
</div>



<a name="QuickPickItemButtonEvent.item"></a><span class="ts" id=3277 data-target="#details-3277" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">item</span><span>: </span><span class="type-ref">T</span></span>
<div class="details collapse" id="details-3277">
<div class="comment"><p>The item that the button belongs to.</p>
</div>
</div>

### <a name="QuickPickItemKind"></a><span class="code-item" id=503>QuickPickItemKind</span>



<div class="comment"><p>Defines the kind of <a href="#QuickPickItem">quick pick item</a>.</p>
</div>

#### Enumeration Members



<a name="QuickPickItemKind.Separator"></a><span class="ts" id=504 data-target="#details-504" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Separator</span><span>: </span><span class="type-literal">-1</span></span>
<div class="details collapse" id="details-504">
<div class="comment"><p>A separator item that provides a visual grouping.</p>
<p>When a <a href="#QuickPickItem">QuickPickItem</a> has a kind of <a href="#QuickPickItemKind.Separator">Separator</a>, the item is just a visual separator
and does not represent a selectable item. The only property that applies is
<a href="#QuickPickItem.label">label</a>. All other properties on <a href="#QuickPickItem">QuickPickItem</a> will be ignored
and have no effect.</p>
</div>
</div>



<a name="QuickPickItemKind.Default"></a><span class="ts" id=505 data-target="#details-505" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Default</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-505">
<div class="comment"><p>The default kind for an item that can be selected in the quick pick.</p>
</div>
</div>

### <a name="QuickPickOptions"></a><span class="code-item" id=516>QuickPickOptions</span>



<div class="comment"><p>Options to configure the behavior of the quick pick UI.</p>
</div>

#### Events



<a name="QuickPickOptions.onDidSelectItem"></a><span class="ts" id=525 data-target="#details-525" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidSelectItem</span><span>(</span><span class="ident">item</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#QuickPickItem">QuickPickItem</a><span>)</span><span>: </span><span class="type-intrinsic">any</span></span>
<div class="details collapse" id="details-525">
<div class="comment"><p>An optional function that is invoked whenever an item is selected.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">item</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#QuickPickItem">QuickPickItem</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">any</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="QuickPickOptions.canPickMany"></a><span class="ts" id=523 data-target="#details-523" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">canPickMany</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-523">
<div class="comment"><p>Determines if the picker allows multiple selections. When <code>true</code>, the result is an array of picks.</p>
</div>
</div>



<a name="QuickPickOptions.ignoreFocusOut"></a><span class="ts" id=522 data-target="#details-522" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ignoreFocusOut</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-522">
<div class="comment"><p>Set to <code>true</code> to keep the picker open when focus moves to another part of the editor or to another window.
This setting is ignored on iPad and is always <code>false</code>.</p>
</div>
</div>



<a name="QuickPickOptions.matchOnDescription"></a><span class="ts" id=518 data-target="#details-518" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">matchOnDescription</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-518">
<div class="comment"><p>Determines if the <a href="#QuickPickItem.description">description</a> should be included when filtering items. Defaults to <code>false</code>.</p>
</div>
</div>



<a name="QuickPickOptions.matchOnDetail"></a><span class="ts" id=519 data-target="#details-519" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">matchOnDetail</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-519">
<div class="comment"><p>Determines if the <a href="#QuickPickItem.detail">detail</a> should be included when filtering items. Defaults to <code>false</code>.</p>
</div>
</div>



<a name="QuickPickOptions.placeHolder"></a><span class="ts" id=520 data-target="#details-520" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">placeHolder</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-520">
<div class="comment"><p>An optional string to show as placeholder in the input box to guide the user.</p>
</div>
</div>



<a name="QuickPickOptions.prompt"></a><span class="ts" id=521 data-target="#details-521" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prompt</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-521">
<div class="comment"><p>Optional text that provides instructions or context to the user.</p>
<p>The prompt is displayed below the input box and above the list of items.</p>
</div>
</div>



<a name="QuickPickOptions.title"></a><span class="ts" id=517 data-target="#details-517" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-517">
<div class="comment"><p>An optional title for the quick pick.</p>
</div>
</div>

### <a name="Range"></a><span class="code-item" id=95>Range</span>



<div class="comment"><p>A range represents an ordered pair of two positions.
It is guaranteed that <a href="#Range.start">start</a>.isBeforeOrEqual(<a href="#Range.end">end</a>)</p>
<p>Range objects are <strong>immutable</strong>. Use the <a href="#Range.with">with</a>,
<a href="#Range.intersection">intersection</a>, or <a href="#Range.union">union</a> methods
to derive new ranges from an existing range.</p>
</div>

#### Constructors



<a name="Range.Range"></a><span class="ts" id=97 data-target="#details-97" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Range</span><span>(</span><span class="ident">start</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">end</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-97">
<div class="comment"><p>Create a new range from two positions. If <code>start</code> is not
before or equal to <code>end</code>, the values will be swapped.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">start</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><td><span class="ident">end</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="Range.Range"></a><span class="ts" id=100 data-target="#details-100" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Range</span><span>(</span><span class="ident">startLine</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">startCharacter</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">endLine</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">endCharacter</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-100">
<div class="comment"><p>Create a new range from number coordinates. It is a shorter equivalent of
using <code>new Range(new Position(startLine, startCharacter), new Position(endLine, endCharacter))</code></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">startLine</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A zero-based line value.</p>
</div></td></tr>
<tr><td><span class="ident">startCharacter</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A zero-based character value.</p>
</div></td></tr>
<tr><td><span class="ident">endLine</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A zero-based line value.</p>
</div></td></tr>
<tr><td><span class="ident">endCharacter</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A zero-based character value.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="Range.end"></a><span class="ts" id=106 data-target="#details-106" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">end</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-106">
<div class="comment"><p>The end position. It is after or equal to <a href="#Range.start">start</a>.</p>
</div>
</div>



<a name="Range.isEmpty"></a><span class="ts" id=107 data-target="#details-107" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isEmpty</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-107">
<div class="comment"><p><code>true</code> if <code>start</code> and <code>end</code> are equal.</p>
</div>
</div>



<a name="Range.isSingleLine"></a><span class="ts" id=108 data-target="#details-108" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isSingleLine</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-108">
<div class="comment"><p><code>true</code> if <code>start.line</code> and <code>end.line</code> are equal.</p>
</div>
</div>



<a name="Range.start"></a><span class="ts" id=105 data-target="#details-105" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">start</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-105">
<div class="comment"><p>The start position. It is before or equal to <a href="#Range.end">end</a>.</p>
</div>
</div>

#### Methods



<a name="Range.contains"></a><span class="ts" id=110 data-target="#details-110" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contains</span><span>(</span><span class="ident">positionOrRange</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-110">
<div class="comment"><p>Check if a position or a range is contained in this range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">positionOrRange</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position or a range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> if the position or range is inside or equal
to this range.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Range.intersection"></a><span class="ts" id=116 data-target="#details-116" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">intersection</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a><span>)</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-116">
<div class="comment"><p>Intersect <code>range</code> with this range and returns a new range or <code>undefined</code>
if the ranges have no overlap.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range of the greater start and smaller end positions. Will
return undefined when there is no overlap.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Range.isEqual"></a><span class="ts" id=113 data-target="#details-113" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isEqual</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#Range">Range</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-113">
<div class="comment"><p>Check if <code>other</code> equals this range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> when start and end are <a href="#Position.isEqual">equal</a> to
start and end of this range.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Range.union"></a><span class="ts" id=119 data-target="#details-119" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">union</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#Range">Range</a><span>)</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-119">
<div class="comment"><p>Compute the union of <code>other</code> with this range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range of smaller start position and the greater end position.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Range.with"></a><span class="ts" id=122 data-target="#details-122" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">with</span><span>(</span><span class="ident">start</span><span>?</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">end</span><span>?</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-122">
<div class="comment"><p>Derived a new range from this range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">start</span><span>?</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position that should be used as start. The default value is the <a href="#Range.start">current start</a>.</p>
</div></td></tr>
<tr><td><span class="ident">end</span><span>?</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position that should be used as end. The default value is the <a href="#Range.end">current end</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range derived from this range with the given start and end position.
If start and end are not different <code>this</code> range will be returned.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Range.with"></a><span class="ts" id=125 data-target="#details-125" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">with</span><span>(</span><span class="ident">change</span><span>: </span>{end: <a class="type-ref" href="#Position">Position</a>, start: <a class="type-ref" href="#Position">Position</a>}<span>)</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-125">
<div class="comment"><p>Derived a new range from this range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">change</span><span>: </span>{end: <a class="type-ref" href="#Position">Position</a>, start: <a class="type-ref" href="#Position">Position</a>}</td><td><div class="comment"><p>An object that describes a change to this range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range that reflects the given change. Will return <code>this</code> range if the change
is not changing anything.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="ReferenceContext"></a><span class="code-item" id=883>ReferenceContext</span>



<div class="comment"><p>Value-object that contains additional information when
requesting references.</p>
</div>

#### Properties



<a name="ReferenceContext.includeDeclaration"></a><span class="ts" id=884 data-target="#details-884" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">includeDeclaration</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-884">
<div class="comment"><p>Include the declaration of the current symbol.</p>
</div>
</div>

### <a name="ReferenceProvider"></a><span class="code-item" id=885>ReferenceProvider</span>



<div class="comment"><p>The reference provider interface defines the contract between extensions and
the <a href="https://code.visualstudio.com/docs/editor/editingevolved#_peek">find references</a>-feature.</p>
</div>

#### Methods



<a name="ReferenceProvider.provideReferences"></a><span class="ts" id=887 data-target="#details-887" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideReferences</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">context</span><span>: </span><a class="type-ref" href="#ReferenceContext">ReferenceContext</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Location">Location</a>[]&gt;</span>
<div class="details collapse" id="details-887">
<div class="comment"><p>Provide a set of project-wide references for the given position and document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">context</span><span>: </span><a class="type-ref" href="#ReferenceContext">ReferenceContext</a></td><td><div class="comment"><p>Additional information about the references request.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Location">Location</a>[]&gt;</td><td><div class="comment"><p>An array of locations or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="RelativePattern"></a><span class="code-item" id=573>RelativePattern</span>



<div class="comment"><p>A relative pattern is a helper to construct glob patterns that are matched
relatively to a base file path. The base path can either be an absolute file
path as string or uri or a <a href="#WorkspaceFolder">workspace folder</a>, which is the
preferred way of creating the relative pattern.</p>
</div>

#### Constructors



<a name="RelativePattern.RelativePattern"></a><span class="ts" id=575 data-target="#details-575" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">RelativePattern</span><span>(</span><span class="ident">base</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a>, <span class="ident">pattern</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#RelativePattern">RelativePattern</a></span>
<div class="details collapse" id="details-575">
<div class="comment"><p>Creates a new relative pattern object with a base file path and pattern to match. This pattern
will be matched on file paths relative to the base.</p>
<p>Example:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> folder</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspaceFolders</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">?.[</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">0</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">];</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">folder</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // Match any TypeScript file in the root of this workspace folder</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">  const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> pattern1</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">RelativePattern</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">folder</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'*.ts'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // Match any TypeScript file in `someFolder` inside this workspace folder</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">  const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> pattern2</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">new</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">RelativePattern</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">folder</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'someFolder/*.ts'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">base</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a></td><td><div class="comment"><p>A base to which this pattern will be matched against relatively. It is recommended
to pass in a <a href="#WorkspaceFolder">workspace folder</a> if the pattern should match inside the workspace.
Otherwise, a uri or string should only be used if the pattern is for a file path outside the workspace.</p>
</div></td></tr>
<tr><td><span class="ident">pattern</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A file glob pattern like <code>*.{ts,js}</code> that will be matched on paths relative to the base.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#RelativePattern">RelativePattern</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="RelativePattern.base"></a><span class="ts" id=579 data-target="#details-579" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">base</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-579">
<div class="comment"><p>A base file path to which this pattern will be matched against relatively.</p>
<p>This matches the <code>fsPath</code> value of <a href="#RelativePattern.baseUri">RelativePattern.baseUri</a>.</p>
<p><em>Note:</em> updating this value will update <a href="#RelativePattern.baseUri">RelativePattern.baseUri</a> to
be a uri with <code>file</code> scheme.</p>
<ul>
<li><em>deprecated</em> - This property is deprecated, please use <a href="#RelativePattern.baseUri">RelativePattern.baseUri</a> instead.</li>
</ul>
</div>
</div>



<a name="RelativePattern.baseUri"></a><span class="ts" id=578 data-target="#details-578" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">baseUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-578">
<div class="comment"><p>A base file path to which this pattern will be matched against relatively. The
file path must be absolute, should not have any trailing path separators and
not include any relative segments (<code>.</code> or <code>..</code>).</p>
</div>
</div>



<a name="RelativePattern.pattern"></a><span class="ts" id=580 data-target="#details-580" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">pattern</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-580">
<div class="comment"><p>A file glob pattern like <code>*.{ts,js}</code> that will be matched on file paths
relative to the base path.</p>
<p>Example: Given a base of <code>/home/work/folder</code> and a file path of <code>/home/work/folder/index.js</code>,
the file glob pattern will match on <code>index.js</code>.</p>
</div>
</div>

### <a name="RenameProvider"></a><span class="code-item" id=1073>RenameProvider</span>



<div class="comment"><p>The rename provider interface defines the contract between extensions and
the <a href="https://code.visualstudio.com/docs/editor/editingevolved#_rename-symbol">rename</a>-feature.</p>
</div>

#### Methods



<a name="RenameProvider.prepareRename"></a><span class="ts" id=1081 data-target="#details-1081" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prepareRename</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Range">Range</a> &#124; {placeholder: <span class="type-intrinsic">string</span>, range: <a class="type-ref" href="#Range">Range</a>}&gt;</span>
<div class="details collapse" id="details-1081">
<div class="comment"><p>Optional function for resolving and validating a position <em>before</em> running rename. The result can
be a range or a range and a placeholder text. The placeholder text should be the identifier of the symbol
which is being renamed - when omitted the text in the returned range is used.</p>
<p><em>Note:</em> This function should throw an error or return a rejected thenable when the provided location
doesn&#39;t allow for a rename.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which rename will be invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which rename will be invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Range">Range</a> &#124; {placeholder: <span class="type-intrinsic">string</span>, range: <a class="type-ref" href="#Range">Range</a>}&gt;</td><td><div class="comment"><p>The range or range and placeholder text of the identifier that is to be renamed. The lack of a result can signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="RenameProvider.provideRenameEdits"></a><span class="ts" id=1075 data-target="#details-1075" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideRenameEdits</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">newName</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a>&gt;</span>
<div class="details collapse" id="details-1075">
<div class="comment"><p>Provide an edit that describes changes that have to be made to one
or many resources to rename a symbol to a different name.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">newName</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The new name of the symbol. If the given name is not valid, the provider must return a rejected promise.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a>&gt;</td><td><div class="comment"><p>A workspace edit or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="RunOptions"></a><span class="code-item" id=2221>RunOptions</span>



<div class="comment"><p>Run options for a task.</p>
</div>

#### Properties



<a name="RunOptions.reevaluateOnRerun"></a><span class="ts" id=2222 data-target="#details-2222" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">reevaluateOnRerun</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2222">
<div class="comment"><p>Controls whether task variables are re-evaluated on rerun.</p>
</div>
</div>

### <a name="SaveDialogOptions"></a><span class="code-item" id=541>SaveDialogOptions</span>



<div class="comment"><p>Options to configure the behaviour of a file save dialog.</p>
</div>

#### Properties



<a name="SaveDialogOptions.defaultUri"></a><span class="ts" id=542 data-target="#details-542" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">defaultUri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-542">
<div class="comment"><p>The resource the dialog shows when opened.</p>
</div>
</div>



<a name="SaveDialogOptions.filters"></a><span class="ts" id=544 data-target="#details-544" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">filters</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-544">
<div class="comment"><p>A set of file filters that are used by the dialog. Each entry is a human-readable label,
like &quot;TypeScript&quot;, and an array of extensions, for example:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">{</span></span>
<span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">    'Images'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: [</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'png'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'jpg'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">],</span></span>
<span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">    'TypeScript'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: [</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'ts'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'tsx'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">]</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span></code></pre>
</div>
</div>



<a name="SaveDialogOptions.saveLabel"></a><span class="ts" id=543 data-target="#details-543" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">saveLabel</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-543">
<div class="comment"><p>A human-readable string for the save button.</p>
</div>
</div>



<a name="SaveDialogOptions.title"></a><span class="ts" id=548 data-target="#details-548" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-548">
<div class="comment"><p>Dialog title.</p>
<p>This parameter might be ignored, as not all operating systems display a title on save dialogs
(for example, macOS).</p>
</div>
</div>

### <a name="SecretStorage"></a><span class="code-item" id=2105>SecretStorage</span>



<div class="comment"><p>Represents a storage utility for secrets (or any information that is sensitive)
that will be stored encrypted. The implementation of the secret storage will
be different on each platform and the secrets will not be synced across
machines.</p>
</div>

#### Events



<a name="SecretStorage.onDidChange"></a><span class="ts" id=2118 data-target="#details-2118" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChange</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#SecretStorageChangeEvent">SecretStorageChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-2118">
<div class="comment"><p>Fires when a secret is stored or deleted.</p>
</div>
</div>

#### Methods



<a name="SecretStorage.delete"></a><span class="ts" id=2116 data-target="#details-2116" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">delete</span><span>(</span><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2116">
<div class="comment"><p>Remove a secret from storage.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The key the secret was stored under.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="SecretStorage.get"></a><span class="ts" id=2109 data-target="#details-2109" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">get</span><span>(</span><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-2109">
<div class="comment"><p>Retrieve a secret that was stored with key. Returns undefined if there
is no password matching that key.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The key the secret was stored under.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>&gt;</td><td><div class="comment"><p>The stored value or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="SecretStorage.keys"></a><span class="ts" id=2107 data-target="#details-2107" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">keys</span><span>(</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>[]&gt;</span>
<div class="details collapse" id="details-2107">
<div class="comment"><p>Retrieve the keys of all the secrets stored by this extension.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">string</span>[]&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="SecretStorage.store"></a><span class="ts" id=2112 data-target="#details-2112" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">store</span><span>(</span><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2112">
<div class="comment"><p>Store a secret under a given key.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The key to store the secret under.</p>
</div></td></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The secret.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="SecretStorageChangeEvent"></a><span class="code-item" id=2103>SecretStorageChangeEvent</span>



<div class="comment"><p>The event data that is fired when a secret is added or removed.</p>
</div>

#### Properties



<a name="SecretStorageChangeEvent.key"></a><span class="ts" id=2104 data-target="#details-2104" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2104">
<div class="comment"><p>The key of the secret that has changed.</p>
</div>
</div>

### <a name="SelectedCompletionInfo"></a><span class="code-item" id=1327>SelectedCompletionInfo</span>



<div class="comment"><p>Describes the currently selected completion item.</p>
</div>

#### Properties



<a name="SelectedCompletionInfo.range"></a><span class="ts" id=1328 data-target="#details-1328" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1328">
<div class="comment"><p>The range that will be replaced if this completion item is accepted.</p>
</div>
</div>



<a name="SelectedCompletionInfo.text"></a><span class="ts" id=1329 data-target="#details-1329" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1329">
<div class="comment"><p>The text the range will be replaced with if this completion is accepted.</p>
</div>
</div>

### <a name="Selection"></a><span class="code-item" id=130>Selection</span>



<div class="comment"><p>Represents a text selection in an editor.</p>
</div>

#### Constructors



<a name="Selection.Selection"></a><span class="ts" id=132 data-target="#details-132" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Selection</span><span>(</span><span class="ident">anchor</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">active</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><a class="type-ref" href="#Selection">Selection</a></span>
<div class="details collapse" id="details-132">
<div class="comment"><p>Create a selection from two positions.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">anchor</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><td><span class="ident">active</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Selection">Selection</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="Selection.Selection"></a><span class="ts" id=135 data-target="#details-135" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Selection</span><span>(</span><span class="ident">anchorLine</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">anchorCharacter</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">activeLine</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">activeCharacter</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#Selection">Selection</a></span>
<div class="details collapse" id="details-135">
<div class="comment"><p>Create a selection from four coordinates.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">anchorLine</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A zero-based line value.</p>
</div></td></tr>
<tr><td><span class="ident">anchorCharacter</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A zero-based character value.</p>
</div></td></tr>
<tr><td><span class="ident">activeLine</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A zero-based line value.</p>
</div></td></tr>
<tr><td><span class="ident">activeCharacter</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A zero-based character value.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Selection">Selection</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="Selection.active"></a><span class="ts" id=141 data-target="#details-141" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">active</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-141">
<div class="comment"><p>The position of the cursor.
This position might be before or after <a href="#Selection.anchor">anchor</a>.</p>
</div>
</div>



<a name="Selection.anchor"></a><span class="ts" id=140 data-target="#details-140" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">anchor</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-140">
<div class="comment"><p>The position at which the selection starts.
This position might be before or after <a href="#Selection.active">active</a>.</p>
</div>
</div>



<a name="Selection.end"></a><span class="ts" id=144 data-target="#details-144" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">end</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-144">
<div class="comment"><p>The end position. It is after or equal to <a href="#Range.start">start</a>.</p>
</div>
</div>



<a name="Selection.isEmpty"></a><span class="ts" id=145 data-target="#details-145" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isEmpty</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-145">
<div class="comment"><p><code>true</code> if <code>start</code> and <code>end</code> are equal.</p>
</div>
</div>



<a name="Selection.isReversed"></a><span class="ts" id=142 data-target="#details-142" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isReversed</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-142">
<div class="comment"><p>A selection is reversed if its <a href="#Selection.anchor">anchor</a> is the <a href="#Range.end">end</a> position.</p>
</div>
</div>



<a name="Selection.isSingleLine"></a><span class="ts" id=146 data-target="#details-146" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isSingleLine</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-146">
<div class="comment"><p><code>true</code> if <code>start.line</code> and <code>end.line</code> are equal.</p>
</div>
</div>



<a name="Selection.start"></a><span class="ts" id=143 data-target="#details-143" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">start</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-143">
<div class="comment"><p>The start position. It is before or equal to <a href="#Range.end">end</a>.</p>
</div>
</div>

#### Methods



<a name="Selection.contains"></a><span class="ts" id=148 data-target="#details-148" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contains</span><span>(</span><span class="ident">positionOrRange</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-148">
<div class="comment"><p>Check if a position or a range is contained in this range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">positionOrRange</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position or a range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> if the position or range is inside or equal
to this range.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Selection.intersection"></a><span class="ts" id=154 data-target="#details-154" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">intersection</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a><span>)</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-154">
<div class="comment"><p>Intersect <code>range</code> with this range and returns a new range or <code>undefined</code>
if the ranges have no overlap.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range of the greater start and smaller end positions. Will
return undefined when there is no overlap.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Selection.isEqual"></a><span class="ts" id=151 data-target="#details-151" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isEqual</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#Range">Range</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-151">
<div class="comment"><p>Check if <code>other</code> equals this range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> when start and end are <a href="#Position.isEqual">equal</a> to
start and end of this range.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Selection.union"></a><span class="ts" id=157 data-target="#details-157" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">union</span><span>(</span><span class="ident">other</span><span>: </span><a class="type-ref" href="#Range">Range</a><span>)</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-157">
<div class="comment"><p>Compute the union of <code>other</code> with this range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">other</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range of smaller start position and the greater end position.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Selection.with"></a><span class="ts" id=160 data-target="#details-160" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">with</span><span>(</span><span class="ident">start</span><span>?</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">end</span><span>?</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-160">
<div class="comment"><p>Derived a new range from this range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">start</span><span>?</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position that should be used as start. The default value is the <a href="#Range.start">current start</a>.</p>
</div></td></tr>
<tr><td><span class="ident">end</span><span>?</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position that should be used as end. The default value is the <a href="#Range.end">current end</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range derived from this range with the given start and end position.
If start and end are not different <code>this</code> range will be returned.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Selection.with"></a><span class="ts" id=163 data-target="#details-163" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">with</span><span>(</span><span class="ident">change</span><span>: </span>{end: <a class="type-ref" href="#Position">Position</a>, start: <a class="type-ref" href="#Position">Position</a>}<span>)</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-163">
<div class="comment"><p>Derived a new range from this range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">change</span><span>: </span>{end: <a class="type-ref" href="#Position">Position</a>, start: <a class="type-ref" href="#Position">Position</a>}</td><td><div class="comment"><p>An object that describes a change to this range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range that reflects the given change. Will return <code>this</code> range if the change
is not changing anything.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="SelectionRange"></a><span class="code-item" id=1456>SelectionRange</span>



<div class="comment"><p>A selection range represents a part of a selection hierarchy. A selection range
may have a parent selection range that contains it.</p>
</div>

#### Constructors



<a name="SelectionRange.SelectionRange"></a><span class="ts" id=1458 data-target="#details-1458" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SelectionRange</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">parent</span><span>?</span><span>: </span><a class="type-ref" href="#SelectionRange">SelectionRange</a><span>)</span><span>: </span><a class="type-ref" href="#SelectionRange">SelectionRange</a></span>
<div class="details collapse" id="details-1458">
<div class="comment"><p>Creates a new selection range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range of the selection range.</p>
</div></td></tr>
<tr><td><span class="ident">parent</span><span>?</span><span>: </span><a class="type-ref" href="#SelectionRange">SelectionRange</a></td><td><div class="comment"><p>The parent of the selection range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SelectionRange">SelectionRange</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="SelectionRange.parent"></a><span class="ts" id=1462 data-target="#details-1462" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">parent</span><span>?</span><span>: </span><a class="type-ref" href="#SelectionRange">SelectionRange</a></span>
<div class="details collapse" id="details-1462">
<div class="comment"><p>The parent selection range containing this range.</p>
</div>
</div>



<a name="SelectionRange.range"></a><span class="ts" id=1461 data-target="#details-1461" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1461">
<div class="comment"><p>The <a href="#Range">Range</a> of this selection range.</p>
</div>
</div>

### <a name="SelectionRangeProvider"></a><span class="code-item" id=1463>SelectionRangeProvider</span>



<div class="comment"><p>The selection range provider interface defines the contract between extensions and the &quot;Expand and Shrink Selection&quot; feature.</p>
</div>

#### Methods



<a name="SelectionRangeProvider.provideSelectionRanges"></a><span class="ts" id=1465 data-target="#details-1465" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideSelectionRanges</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">positions</span><span>: </span>readonly <a class="type-ref" href="#Position">Position</a>[], <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#SelectionRange">SelectionRange</a>[]&gt;</span>
<div class="details collapse" id="details-1465">
<div class="comment"><p>Provide selection ranges for the given positions.</p>
<p>Selection ranges should be computed individually and independent for each position. The editor will merge
and deduplicate ranges but providers must return hierarchies of selection ranges so that a range
is <a href="#Range.contains">contained</a> by its parent.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">positions</span><span>: </span>readonly <a class="type-ref" href="#Position">Position</a>[]</td><td><div class="comment"><p>The positions at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#SelectionRange">SelectionRange</a>[]&gt;</td><td><div class="comment"><p>Selection ranges or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="SemanticTokens"></a><span class="code-item" id=1113>SemanticTokens</span>



<div class="comment"><p>Represents semantic tokens, either in a range or in an entire document.</p>
<p><em>See also</em></p>
<ul>
<li><a href="#DocumentSemanticTokensProvider.provideDocumentSemanticTokens">provideDocumentSemanticTokens</a> for an explanation of the format.</li>
<li><a href="#SemanticTokensBuilder">SemanticTokensBuilder</a> for a helper to create an instance.</li>
</ul>
</div>

#### Constructors



<a name="SemanticTokens.SemanticTokens"></a><span class="ts" id=1115 data-target="#details-1115" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SemanticTokens</span><span>(</span><span class="ident">data</span><span>: </span><span class="type-ref-ts">Uint32Array</span>, <span class="ident">resultId</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#SemanticTokens">SemanticTokens</a></span>
<div class="details collapse" id="details-1115">
<div class="comment"><p>Create new semantic tokens.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">data</span><span>: </span><span class="type-ref-ts">Uint32Array</span></td><td><div class="comment"><p>Token data.</p>
</div></td></tr>
<tr><td><span class="ident">resultId</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Result identifier.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SemanticTokens">SemanticTokens</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="SemanticTokens.data"></a><span class="ts" id=1119 data-target="#details-1119" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">data</span><span>: </span><span class="type-ref-ts">Uint32Array</span></span>
<div class="details collapse" id="details-1119">
<div class="comment"><p>The actual tokens data.</p>
<p><em>See also</em>
<a href="#DocumentSemanticTokensProvider.provideDocumentSemanticTokens">provideDocumentSemanticTokens</a> for an explanation of the format.</p>
</div>
</div>



<a name="SemanticTokens.resultId"></a><span class="ts" id=1118 data-target="#details-1118" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resultId</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1118">
<div class="comment"><p>The result id of the tokens.</p>
<p>This is the id that will be passed to <code>DocumentSemanticTokensProvider.provideDocumentSemanticTokensEdits</code> (if implemented).</p>
</div>
</div>

### <a name="SemanticTokensBuilder"></a><span class="code-item" id=1095>SemanticTokensBuilder</span>



<div class="comment"><p>A semantic tokens builder can help with creating a <code>SemanticTokens</code> instance
which contains delta encoded semantic tokens.</p>
</div>

#### Constructors



<a name="SemanticTokensBuilder.SemanticTokensBuilder"></a><span class="ts" id=1097 data-target="#details-1097" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SemanticTokensBuilder</span><span>(</span><span class="ident">legend</span><span>?</span><span>: </span><a class="type-ref" href="#SemanticTokensLegend">SemanticTokensLegend</a><span>)</span><span>: </span><a class="type-ref" href="#SemanticTokensBuilder">SemanticTokensBuilder</a></span>
<div class="details collapse" id="details-1097">
<div class="comment"><p>Creates a semantic tokens builder.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">legend</span><span>?</span><span>: </span><a class="type-ref" href="#SemanticTokensLegend">SemanticTokensLegend</a></td><td><div class="comment"><p>A semantic tokens legend.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SemanticTokensBuilder">SemanticTokensBuilder</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Methods



<a name="SemanticTokensBuilder.build"></a><span class="ts" id=1111 data-target="#details-1111" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">build</span><span>(</span><span class="ident">resultId</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#SemanticTokens">SemanticTokens</a></span>
<div class="details collapse" id="details-1111">
<div class="comment"><p>Finish and create a <code>SemanticTokens</code> instance.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">resultId</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SemanticTokens">SemanticTokens</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="SemanticTokensBuilder.push"></a><span class="ts" id=1100 data-target="#details-1100" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">push</span><span>(</span><span class="ident">line</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">char</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">length</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">tokenType</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">tokenModifiers</span><span>?</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1100">
<div class="comment"><p>Add another token.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">line</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The token start line number (absolute value).</p>
</div></td></tr>
<tr><td><span class="ident">char</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The token start character (absolute value).</p>
</div></td></tr>
<tr><td><span class="ident">length</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The token length in characters.</p>
</div></td></tr>
<tr><td><span class="ident">tokenType</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The encoded token type.</p>
</div></td></tr>
<tr><td><span class="ident">tokenModifiers</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The encoded token modifiers.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="SemanticTokensBuilder.push"></a><span class="ts" id=1106 data-target="#details-1106" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">push</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">tokenType</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">tokenModifiers</span><span>?</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1106">
<div class="comment"><p>Add another token. Use only when providing a legend.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range of the token. Must be single-line.</p>
</div></td></tr>
<tr><td><span class="ident">tokenType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The token type.</p>
</div></td></tr>
<tr><td><span class="ident">tokenModifiers</span><span>?</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>The token modifiers.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="SemanticTokensEdit"></a><span class="code-item" id=1127>SemanticTokensEdit</span>



<div class="comment"><p>Represents an edit to semantic tokens.</p>
<p><em>See also</em>
<a href="#DocumentSemanticTokensProvider.provideDocumentSemanticTokensEdits">provideDocumentSemanticTokensEdits</a> for an explanation of the format.</p>
</div>

#### Constructors



<a name="SemanticTokensEdit.SemanticTokensEdit"></a><span class="ts" id=1129 data-target="#details-1129" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SemanticTokensEdit</span><span>(</span><span class="ident">start</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">deleteCount</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">data</span><span>?</span><span>: </span><span class="type-ref-ts">Uint32Array</span><span>)</span><span>: </span><a class="type-ref" href="#SemanticTokensEdit">SemanticTokensEdit</a></span>
<div class="details collapse" id="details-1129">
<div class="comment"><p>Create a semantic token edit.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">start</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>Start offset</p>
</div></td></tr>
<tr><td><span class="ident">deleteCount</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>Number of elements to remove.</p>
</div></td></tr>
<tr><td><span class="ident">data</span><span>?</span><span>: </span><span class="type-ref-ts">Uint32Array</span></td><td><div class="comment"><p>Elements to insert</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SemanticTokensEdit">SemanticTokensEdit</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="SemanticTokensEdit.data"></a><span class="ts" id=1135 data-target="#details-1135" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">data</span><span>: </span><span class="type-ref-ts">Uint32Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt;</span>
<div class="details collapse" id="details-1135">
<div class="comment"><p>The elements to insert.</p>
</div>
</div>



<a name="SemanticTokensEdit.deleteCount"></a><span class="ts" id=1134 data-target="#details-1134" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">deleteCount</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1134">
<div class="comment"><p>The count of elements to remove.</p>
</div>
</div>



<a name="SemanticTokensEdit.start"></a><span class="ts" id=1133 data-target="#details-1133" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">start</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1133">
<div class="comment"><p>The start offset of the edit.</p>
</div>
</div>

### <a name="SemanticTokensEdits"></a><span class="code-item" id=1120>SemanticTokensEdits</span>



<div class="comment"><p>Represents edits to semantic tokens.</p>
<p><em>See also</em>
<a href="#DocumentSemanticTokensProvider.provideDocumentSemanticTokensEdits">provideDocumentSemanticTokensEdits</a> for an explanation of the format.</p>
</div>

#### Constructors



<a name="SemanticTokensEdits.SemanticTokensEdits"></a><span class="ts" id=1122 data-target="#details-1122" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SemanticTokensEdits</span><span>(</span><span class="ident">edits</span><span>: </span><a class="type-ref" href="#SemanticTokensEdit">SemanticTokensEdit</a>[], <span class="ident">resultId</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#SemanticTokensEdits">SemanticTokensEdits</a></span>
<div class="details collapse" id="details-1122">
<div class="comment"><p>Create new semantic tokens edits.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">edits</span><span>: </span><a class="type-ref" href="#SemanticTokensEdit">SemanticTokensEdit</a>[]</td><td><div class="comment"><p>An array of semantic token edits</p>
</div></td></tr>
<tr><td><span class="ident">resultId</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Result identifier.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SemanticTokensEdits">SemanticTokensEdits</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="SemanticTokensEdits.edits"></a><span class="ts" id=1126 data-target="#details-1126" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">edits</span><span>: </span><a class="type-ref" href="#SemanticTokensEdit">SemanticTokensEdit</a>[]</span>
<div class="details collapse" id="details-1126">
<div class="comment"><p>The edits to the tokens data.
All edits refer to the initial data state.</p>
</div>
</div>



<a name="SemanticTokensEdits.resultId"></a><span class="ts" id=1125 data-target="#details-1125" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resultId</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1125">
<div class="comment"><p>The result id of the tokens.</p>
<p>This is the id that will be passed to <code>DocumentSemanticTokensProvider.provideDocumentSemanticTokensEdits</code> (if implemented).</p>
</div>
</div>

### <a name="SemanticTokensLegend"></a><span class="code-item" id=1088>SemanticTokensLegend</span>



<div class="comment"><p>A semantic tokens legend contains the needed information to decipher
the integer encoded representation of semantic tokens.</p>
</div>

#### Constructors



<a name="SemanticTokensLegend.SemanticTokensLegend"></a><span class="ts" id=1090 data-target="#details-1090" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SemanticTokensLegend</span><span>(</span><span class="ident">tokenTypes</span><span>: </span><span class="type-intrinsic">string</span>[], <span class="ident">tokenModifiers</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>[]<span>)</span><span>: </span><a class="type-ref" href="#SemanticTokensLegend">SemanticTokensLegend</a></span>
<div class="details collapse" id="details-1090">
<div class="comment"><p>Creates a semantic tokens legend.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">tokenTypes</span><span>: </span><span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>An array of token types.</p>
</div></td></tr>
<tr><td><span class="ident">tokenModifiers</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>An array of token modifiers.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SemanticTokensLegend">SemanticTokensLegend</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="SemanticTokensLegend.tokenModifiers"></a><span class="ts" id=1094 data-target="#details-1094" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tokenModifiers</span><span>: </span><span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-1094">
<div class="comment"><p>The possible token modifiers.</p>
</div>
</div>



<a name="SemanticTokensLegend.tokenTypes"></a><span class="ts" id=1093 data-target="#details-1093" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tokenTypes</span><span>: </span><span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-1093">
<div class="comment"><p>The possible token types.</p>
</div>
</div>

### <a name="ShellExecution"></a><span class="code-item" id=2198>ShellExecution</span>



<div class="comment"><p>Represents a task execution that happens inside a shell.</p>
</div>

#### Constructors



<a name="ShellExecution.ShellExecution"></a><span class="ts" id=2200 data-target="#details-2200" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ShellExecution</span><span>(</span><span class="ident">commandLine</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#ShellExecutionOptions">ShellExecutionOptions</a><span>)</span><span>: </span><a class="type-ref" href="#ShellExecution">ShellExecution</a></span>
<div class="details collapse" id="details-2200">
<div class="comment"><p>Creates a shell execution with a full command line.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">commandLine</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The command line to execute.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#ShellExecutionOptions">ShellExecutionOptions</a></td><td><div class="comment"><p>Optional options for the started the shell.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ShellExecution">ShellExecution</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="ShellExecution.ShellExecution"></a><span class="ts" id=2203 data-target="#details-2203" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ShellExecution</span><span>(</span><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ShellQuotedString">ShellQuotedString</a>, <span class="ident">args</span><span>: </span>Array&lt;<span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ShellQuotedString">ShellQuotedString</a>&gt;, <span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#ShellExecutionOptions">ShellExecutionOptions</a><span>)</span><span>: </span><a class="type-ref" href="#ShellExecution">ShellExecution</a></span>
<div class="details collapse" id="details-2203">
<div class="comment"><p>Creates a shell execution with a command and arguments. For the real execution the editor will
construct a command line from the command and the arguments. This is subject to interpretation
especially when it comes to quoting. If full control over the command line is needed please
use the constructor that creates a <code>ShellExecution</code> with the full command line.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ShellQuotedString">ShellQuotedString</a></td><td><div class="comment"><p>The command to execute.</p>
</div></td></tr>
<tr><td><span class="ident">args</span><span>: </span>Array&lt;<span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ShellQuotedString">ShellQuotedString</a>&gt;</td><td><div class="comment"><p>The command arguments.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#ShellExecutionOptions">ShellExecutionOptions</a></td><td><div class="comment"><p>Optional options for the started the shell.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ShellExecution">ShellExecution</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="ShellExecution.args"></a><span class="ts" id=2209 data-target="#details-2209" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">args</span><span>: </span>Array&lt;<span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ShellQuotedString">ShellQuotedString</a>&gt;</span>
<div class="details collapse" id="details-2209">
<div class="comment"><p>The shell args. Is <code>undefined</code> if created with a full command line.</p>
</div>
</div>



<a name="ShellExecution.command"></a><span class="ts" id=2208 data-target="#details-2208" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ShellQuotedString">ShellQuotedString</a></span>
<div class="details collapse" id="details-2208">
<div class="comment"><p>The shell command. Is <code>undefined</code> if created with a full command line.</p>
</div>
</div>



<a name="ShellExecution.commandLine"></a><span class="ts" id=2207 data-target="#details-2207" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">commandLine</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2207">
<div class="comment"><p>The shell command line. Is <code>undefined</code> if created with a command and arguments.</p>
</div>
</div>



<a name="ShellExecution.options"></a><span class="ts" id=2210 data-target="#details-2210" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">options</span><span>?</span><span>: </span><a class="type-ref" href="#ShellExecutionOptions">ShellExecutionOptions</a></span>
<div class="details collapse" id="details-2210">
<div class="comment"><p>The shell options used when the command line is executed in a shell.
Defaults to undefined.</p>
</div>
</div>

### <a name="ShellExecutionOptions"></a><span class="code-item" id=2182>ShellExecutionOptions</span>



<div class="comment"><p>Options for a shell execution</p>
</div>

#### Properties



<a name="ShellExecutionOptions.cwd"></a><span class="ts" id=2186 data-target="#details-2186" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cwd</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2186">
<div class="comment"><p>The current working directory of the executed shell.
If omitted the tools current workspace root is used.</p>
</div>
</div>



<a name="ShellExecutionOptions.env"></a><span class="ts" id=2187 data-target="#details-2187" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">env</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-2187">
<div class="comment"><p>The additional environment of the executed shell. If omitted
the parent process&#39; environment is used. If provided it is merged with
the parent process&#39; environment.</p>
</div>
</div>



<a name="ShellExecutionOptions.executable"></a><span class="ts" id=2183 data-target="#details-2183" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executable</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2183">
<div class="comment"><p>The shell executable.</p>
</div>
</div>



<a name="ShellExecutionOptions.shellArgs"></a><span class="ts" id=2184 data-target="#details-2184" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">shellArgs</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-2184">
<div class="comment"><p>The arguments to be passed to the shell executable used to run the task. Most shells
require special arguments to execute a command. For  example <code>bash</code> requires the <code>-c</code>
argument to execute a command, <code>PowerShell</code> requires <code>-Command</code> and <code>cmd</code> requires both
<code>/d</code> and <code>/c</code>.</p>
</div>
</div>



<a name="ShellExecutionOptions.shellQuoting"></a><span class="ts" id=2185 data-target="#details-2185" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">shellQuoting</span><span>?</span><span>: </span><a class="type-ref" href="#ShellQuotingOptions">ShellQuotingOptions</a></span>
<div class="details collapse" id="details-2185">
<div class="comment"><p>The shell quotes supported by this shell.</p>
</div>
</div>

### <a name="ShellQuotedString"></a><span class="code-item" id=2195>ShellQuotedString</span>



<div class="comment"><p>A string that will be quoted depending on the used shell.</p>
</div>

#### Properties



<a name="ShellQuotedString.quoting"></a><span class="ts" id=2197 data-target="#details-2197" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">quoting</span><span>: </span><a class="type-ref" href="#ShellQuoting">ShellQuoting</a></span>
<div class="details collapse" id="details-2197">
<div class="comment"><p>The quoting style to use.</p>
</div>
</div>



<a name="ShellQuotedString.value"></a><span class="ts" id=2196 data-target="#details-2196" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2196">
<div class="comment"><p>The actual string value.</p>
</div>
</div>

### <a name="ShellQuoting"></a><span class="code-item" id=2191>ShellQuoting</span>



<div class="comment"><p>Defines how an argument should be quoted if it contains
spaces or unsupported characters.</p>
</div>

#### Enumeration Members



<a name="ShellQuoting.Escape"></a><span class="ts" id=2192 data-target="#details-2192" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Escape</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-2192">
<div class="comment"><p>Character escaping should be used. This for example
uses \ on bash and ` on PowerShell.</p>
</div>
</div>



<a name="ShellQuoting.Strong"></a><span class="ts" id=2193 data-target="#details-2193" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Strong</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-2193">
<div class="comment"><p>Strong string quoting should be used. This for example
uses &quot; for Windows cmd and &#39; for bash and PowerShell.
Strong quoting treats arguments as literal strings.
Under PowerShell echo &#39;The value is $(2 * 3)&#39; will
print <code>The value is $(2 * 3)</code></p>
</div>
</div>



<a name="ShellQuoting.Weak"></a><span class="ts" id=2194 data-target="#details-2194" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Weak</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-2194">
<div class="comment"><p>Weak string quoting should be used. This for example
uses &quot; for Windows cmd, bash and PowerShell. Weak quoting
still performs some kind of evaluation inside the quoted
string.  Under PowerShell echo &quot;The value is $(2 * 3)&quot;
will print <code>The value is 6</code></p>
</div>
</div>

### <a name="ShellQuotingOptions"></a><span class="code-item" id=2175>ShellQuotingOptions</span>



<div class="comment"><p>The shell quoting options.</p>
</div>

#### Properties



<a name="ShellQuotingOptions.escape"></a><span class="ts" id=2176 data-target="#details-2176" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">escape</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; {charsToEscape: <span class="type-intrinsic">string</span>, escapeChar: <span class="type-intrinsic">string</span>}</span>
<div class="details collapse" id="details-2176">
<div class="comment"><p>The character used to do character escaping. If a string is provided only spaces
are escaped. If a <code>{ escapeChar, charsToEscape }</code> literal is provide all characters
in <code>charsToEscape</code> are escaped using the <code>escapeChar</code>.</p>
</div>
</div>



<a name="ShellQuotingOptions.strong"></a><span class="ts" id=2180 data-target="#details-2180" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">strong</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2180">
<div class="comment"><p>The character used for strong quoting. The string&#39;s length must be 1.</p>
</div>
</div>



<a name="ShellQuotingOptions.weak"></a><span class="ts" id=2181 data-target="#details-2181" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">weak</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2181">
<div class="comment"><p>The character used for weak quoting. The string&#39;s length must be 1.</p>
</div>
</div>

### <a name="SignatureHelp"></a><span class="code-item" id=1202>SignatureHelp</span>



<div class="comment"><p>Signature help represents the signature of something
callable. There can be multiple signatures but only one
active and only one active parameter.</p>
</div>

#### Constructors



<a name="SignatureHelp.SignatureHelp"></a><span class="ts" id=1204 data-target="#details-1204" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SignatureHelp</span><span>(</span><span>)</span><span>: </span><a class="type-ref" href="#SignatureHelp">SignatureHelp</a></span>
<div class="details collapse" id="details-1204">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SignatureHelp">SignatureHelp</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="SignatureHelp.activeParameter"></a><span class="ts" id=1207 data-target="#details-1207" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeParameter</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1207">
<div class="comment"><p>The active parameter of the active signature.</p>
</div>
</div>



<a name="SignatureHelp.activeSignature"></a><span class="ts" id=1206 data-target="#details-1206" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeSignature</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1206">
<div class="comment"><p>The active signature.</p>
</div>
</div>



<a name="SignatureHelp.signatures"></a><span class="ts" id=1205 data-target="#details-1205" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">signatures</span><span>: </span><a class="type-ref" href="#SignatureInformation">SignatureInformation</a>[]</span>
<div class="details collapse" id="details-1205">
<div class="comment"><p>One or more signatures.</p>
</div>
</div>

### <a name="SignatureHelpContext"></a><span class="code-item" id=1212>SignatureHelpContext</span>



<div class="comment"><p>Additional information about the context in which a
<a href="#SignatureHelpProvider.provideSignatureHelp">SignatureHelpProvider</a> was triggered.</p>
</div>

#### Properties



<a name="SignatureHelpContext.activeSignatureHelp"></a><span class="ts" id=1216 data-target="#details-1216" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeSignatureHelp</span><span>: </span><a class="type-ref" href="#SignatureHelp">SignatureHelp</a></span>
<div class="details collapse" id="details-1216">
<div class="comment"><p>The currently active <a href="#SignatureHelp">SignatureHelp</a>.</p>
<p>The <code>activeSignatureHelp</code> has its <a href="#SignatureHelp.activeSignature">activeSignature</a> field updated based on
the user arrowing through available signatures.</p>
</div>
</div>



<a name="SignatureHelpContext.isRetrigger"></a><span class="ts" id=1215 data-target="#details-1215" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isRetrigger</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1215">
<div class="comment"><p><code>true</code> if signature help was already showing when it was triggered.</p>
<p>Retriggers occur when the signature help is already active and can be caused by actions such as
typing a trigger character, a cursor move, or document content changes.</p>
</div>
</div>



<a name="SignatureHelpContext.triggerCharacter"></a><span class="ts" id=1214 data-target="#details-1214" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">triggerCharacter</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1214">
<div class="comment"><p>Character that caused signature help to be triggered.</p>
<p>This is <code>undefined</code> when signature help is not triggered by typing, such as when manually invoking
signature help or when moving the cursor.</p>
</div>
</div>



<a name="SignatureHelpContext.triggerKind"></a><span class="ts" id=1213 data-target="#details-1213" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">triggerKind</span><span>: </span><a class="type-ref" href="#SignatureHelpTriggerKind">SignatureHelpTriggerKind</a></span>
<div class="details collapse" id="details-1213">
<div class="comment"><p>Action that caused signature help to be triggered.</p>
</div>
</div>

### <a name="SignatureHelpProvider"></a><span class="code-item" id=1217>SignatureHelpProvider</span>



<div class="comment"><p>The signature help provider interface defines the contract between extensions and
the <a href="https://code.visualstudio.com/docs/editor/intellisense">parameter hints</a>-feature.</p>
</div>

#### Methods



<a name="SignatureHelpProvider.provideSignatureHelp"></a><span class="ts" id=1219 data-target="#details-1219" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideSignatureHelp</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a>, <span class="ident">context</span><span>: </span><a class="type-ref" href="#SignatureHelpContext">SignatureHelpContext</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#SignatureHelp">SignatureHelp</a>&gt;</span>
<div class="details collapse" id="details-1219">
<div class="comment"><p>Provide help for the signature at the given position and document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><td><span class="ident">context</span><span>: </span><a class="type-ref" href="#SignatureHelpContext">SignatureHelpContext</a></td><td><div class="comment"><p>Information about how signature help was triggered.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#SignatureHelp">SignatureHelp</a>&gt;</td><td><div class="comment"><p>Signature help or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="SignatureHelpProviderMetadata"></a><span class="code-item" id=1224>SignatureHelpProviderMetadata</span>



<div class="comment"><p>Metadata about a registered <a href="#SignatureHelpProvider">SignatureHelpProvider</a>.</p>
</div>

#### Properties



<a name="SignatureHelpProviderMetadata.retriggerCharacters"></a><span class="ts" id=1226 data-target="#details-1226" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">retriggerCharacters</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-1226">
<div class="comment"><p>List of characters that re-trigger signature help.</p>
<p>These trigger characters are only active when signature help is already showing. All trigger characters
are also counted as re-trigger characters.</p>
</div>
</div>



<a name="SignatureHelpProviderMetadata.triggerCharacters"></a><span class="ts" id=1225 data-target="#details-1225" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">triggerCharacters</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-1225">
<div class="comment"><p>List of characters that trigger signature help.</p>
</div>
</div>

### <a name="SignatureHelpTriggerKind"></a><span class="code-item" id=1208>SignatureHelpTriggerKind</span>



<div class="comment"><p>How a <a href="#SignatureHelpProvider">SignatureHelpProvider</a> was triggered.</p>
</div>

#### Enumeration Members



<a name="SignatureHelpTriggerKind.Invoke"></a><span class="ts" id=1209 data-target="#details-1209" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Invoke</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1209">
<div class="comment"><p>Signature help was invoked manually by the user or by a command.</p>
</div>
</div>



<a name="SignatureHelpTriggerKind.TriggerCharacter"></a><span class="ts" id=1210 data-target="#details-1210" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TriggerCharacter</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1210">
<div class="comment"><p>Signature help was triggered by a trigger character.</p>
</div>
</div>



<a name="SignatureHelpTriggerKind.ContentChange"></a><span class="ts" id=1211 data-target="#details-1211" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ContentChange</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-1211">
<div class="comment"><p>Signature help was triggered by the cursor moving or by the document content changing.</p>
</div>
</div>

### <a name="SignatureInformation"></a><span class="code-item" id=1193>SignatureInformation</span>



<div class="comment"><p>Represents the signature of something callable. A signature
can have a label, like a function-name, a doc-comment, and
a set of parameters.</p>
</div>

#### Constructors



<a name="SignatureInformation.SignatureInformation"></a><span class="ts" id=1195 data-target="#details-1195" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SignatureInformation</span><span>(</span><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">documentation</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a><span>)</span><span>: </span><a class="type-ref" href="#SignatureInformation">SignatureInformation</a></span>
<div class="details collapse" id="details-1195">
<div class="comment"><p>Creates a new signature information object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A label string.</p>
</div></td></tr>
<tr><td><span class="ident">documentation</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></td><td><div class="comment"><p>A doc string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SignatureInformation">SignatureInformation</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="SignatureInformation.activeParameter"></a><span class="ts" id=1201 data-target="#details-1201" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeParameter</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1201">
<div class="comment"><p>The index of the active parameter.</p>
<p>If provided, this is used in place of <a href="#SignatureHelp.activeParameter">SignatureHelp.activeParameter</a>.</p>
</div>
</div>



<a name="SignatureInformation.documentation"></a><span class="ts" id=1199 data-target="#details-1199" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">documentation</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-1199">
<div class="comment"><p>The human-readable doc-comment of this signature. Will be shown
in the UI but can be omitted.</p>
</div>
</div>



<a name="SignatureInformation.label"></a><span class="ts" id=1198 data-target="#details-1198" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1198">
<div class="comment"><p>The label of this signature. Will be shown in
the UI.</p>
</div>
</div>



<a name="SignatureInformation.parameters"></a><span class="ts" id=1200 data-target="#details-1200" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">parameters</span><span>: </span><a class="type-ref" href="#ParameterInformation">ParameterInformation</a>[]</span>
<div class="details collapse" id="details-1200">
<div class="comment"><p>The parameters of this signature.</p>
</div>
</div>

### <a name="SnippetString"></a><span class="code-item" id=1044>SnippetString</span>



<div class="comment"><p>A snippet string is a template which allows to insert text
and to control the editor cursor when insertion happens.</p>
<p>A snippet can define tab stops and placeholders with <code>$1</code>, <code>$2</code>
and <code>${3:foo}</code>. <code>$0</code> defines the final tab stop, it defaults to
the end of the snippet. Variables are defined with <code>$name</code> and
<code>${name:default value}</code>. Also see
<a href="https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets">the full snippet syntax</a>.</p>
</div>

#### Constructors



<a name="SnippetString.SnippetString"></a><span class="ts" id=1046 data-target="#details-1046" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SnippetString</span><span>(</span><span class="ident">value</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a></span>
<div class="details collapse" id="details-1046">
<div class="comment"><p>Create a new snippet string.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A snippet string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SnippetString">SnippetString</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="SnippetString.value"></a><span class="ts" id=1048 data-target="#details-1048" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1048">
<div class="comment"><p>The snippet string.</p>
</div>
</div>

#### Methods



<a name="SnippetString.appendChoice"></a><span class="ts" id=1063 data-target="#details-1063" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendChoice</span><span>(</span><span class="ident">values</span><span>: </span>readonly <span class="type-intrinsic">string</span>[], <span class="ident">number</span><span>?</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a></span>
<div class="details collapse" id="details-1063">
<div class="comment"><p>Builder-function that appends a choice (<code>${1|a,b,c|}</code>) to
the <a href="#SnippetString.value">value</a> of this snippet string.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">values</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>The values for choices - the array of strings</p>
</div></td></tr>
<tr><td><span class="ident">number</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The number of this tabstop, defaults to an auto-increment
value starting at 1.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SnippetString">SnippetString</a></td><td><div class="comment"><p>This snippet string.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="SnippetString.appendPlaceholder"></a><span class="ts" id=1056 data-target="#details-1056" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendPlaceholder</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span> &#124; (snippet: <a class="type-ref" href="#SnippetString">SnippetString</a>) =&gt; <span class="type-intrinsic">any</span>, <span class="ident">number</span><span>?</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a></span>
<div class="details collapse" id="details-1056">
<div class="comment"><p>Builder-function that appends a placeholder (<code>${1:value}</code>) to
the <a href="#SnippetString.value">value</a> of this snippet string.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span> &#124; (snippet: <a class="type-ref" href="#SnippetString">SnippetString</a>) =&gt; <span class="type-intrinsic">any</span></td><td><div class="comment"><p>The value of this placeholder - either a string or a function
with which a nested snippet can be created.</p>
</div></td></tr>
<tr><td><span class="ident">number</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The number of this tabstop, defaults to an auto-increment
value starting at 1.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SnippetString">SnippetString</a></td><td><div class="comment"><p>This snippet string.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="SnippetString.appendTabstop"></a><span class="ts" id=1053 data-target="#details-1053" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendTabstop</span><span>(</span><span class="ident">number</span><span>?</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a></span>
<div class="details collapse" id="details-1053">
<div class="comment"><p>Builder-function that appends a tabstop (<code>$1</code>, <code>$2</code> etc) to
the <a href="#SnippetString.value">value</a> of this snippet string.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">number</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The number of this tabstop, defaults to an auto-increment
value starting at 1.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SnippetString">SnippetString</a></td><td><div class="comment"><p>This snippet string.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="SnippetString.appendText"></a><span class="ts" id=1050 data-target="#details-1050" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendText</span><span>(</span><span class="ident">string</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a></span>
<div class="details collapse" id="details-1050">
<div class="comment"><p>Builder-function that appends the given string to
the <a href="#SnippetString.value">value</a> of this snippet string.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">string</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A value to append &#39;as given&#39;. The string will be escaped.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SnippetString">SnippetString</a></td><td><div class="comment"><p>This snippet string.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="SnippetString.appendVariable"></a><span class="ts" id=1067 data-target="#details-1067" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendVariable</span><span>(</span><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">defaultValue</span><span>: </span><span class="type-intrinsic">string</span> &#124; (snippet: <a class="type-ref" href="#SnippetString">SnippetString</a>) =&gt; <span class="type-intrinsic">any</span><span>)</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a></span>
<div class="details collapse" id="details-1067">
<div class="comment"><p>Builder-function that appends a variable (<code>${VAR}</code>) to
the <a href="#SnippetString.value">value</a> of this snippet string.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The name of the variable - excluding the <code>$</code>.</p>
</div></td></tr>
<tr><td><span class="ident">defaultValue</span><span>: </span><span class="type-intrinsic">string</span> &#124; (snippet: <a class="type-ref" href="#SnippetString">SnippetString</a>) =&gt; <span class="type-intrinsic">any</span></td><td><div class="comment"><p>The default value which is used when the variable name cannot
be resolved - either a string or a function with which a nested snippet can be created.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SnippetString">SnippetString</a></td><td><div class="comment"><p>This snippet string.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="SnippetTextEdit"></a><span class="code-item" id=914>SnippetTextEdit</span>



<div class="comment"><p>A snippet edit represents an interactive edit that is performed by
the editor.</p>
<p><em>Note</em> that a snippet edit can always be performed as a normal <a href="#TextEdit">text edit</a>.
This will happen when no matching editor is open or when a <a href="#WorkspaceEdit">workspace edit</a>
contains snippet edits for multiple files. In that case only those that match the active editor
will be performed as snippet edits and the others as normal text edits.</p>
</div>

#### Static



<a name="SnippetTextEdit.insert"></a><span class="ts" id=920 data-target="#details-920" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">insert</span><span>(</span><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">snippet</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a><span>)</span><span>: </span><a class="type-ref" href="#SnippetTextEdit">SnippetTextEdit</a></span>
<div class="details collapse" id="details-920">
<div class="comment"><p>Utility to create an insert snippet edit.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position, will become an empty range.</p>
</div></td></tr>
<tr><td><span class="ident">snippet</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a></td><td><div class="comment"><p>A snippet string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SnippetTextEdit">SnippetTextEdit</a></td><td><div class="comment"><p>A new snippet edit object.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="SnippetTextEdit.replace"></a><span class="ts" id=916 data-target="#details-916" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">replace</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">snippet</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a><span>)</span><span>: </span><a class="type-ref" href="#SnippetTextEdit">SnippetTextEdit</a></span>
<div class="details collapse" id="details-916">
<div class="comment"><p>Utility to create a replace snippet edit.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><td><span class="ident">snippet</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a></td><td><div class="comment"><p>A snippet string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SnippetTextEdit">SnippetTextEdit</a></td><td><div class="comment"><p>A new snippet edit object.</p>
</div></td></tr>
</table>
</div>
</div>

#### Constructors



<a name="SnippetTextEdit.SnippetTextEdit"></a><span class="ts" id=924 data-target="#details-924" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SnippetTextEdit</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">snippet</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a><span>)</span><span>: </span><a class="type-ref" href="#SnippetTextEdit">SnippetTextEdit</a></span>
<div class="details collapse" id="details-924">
<div class="comment"><p>Create a new snippet edit.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><td><span class="ident">snippet</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a></td><td><div class="comment"><p>A snippet string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SnippetTextEdit">SnippetTextEdit</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="SnippetTextEdit.keepWhitespace"></a><span class="ts" id=929 data-target="#details-929" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">keepWhitespace</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-929">
<div class="comment"><p>Whether the snippet edit should be applied with existing whitespace preserved.</p>
</div>
</div>



<a name="SnippetTextEdit.range"></a><span class="ts" id=927 data-target="#details-927" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-927">
<div class="comment"><p>The range this edit applies to.</p>
</div>
</div>



<a name="SnippetTextEdit.snippet"></a><span class="ts" id=928 data-target="#details-928" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">snippet</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a></span>
<div class="details collapse" id="details-928">
<div class="comment"><p>The <a href="#SnippetString">snippet</a> this edit will perform.</p>
</div>
</div>

### <a name="SourceBreakpoint"></a><span class="code-item" id=4142>SourceBreakpoint</span>



<div class="comment"><p>A breakpoint specified by a source location.</p>
</div>

#### Constructors



<a name="SourceBreakpoint.SourceBreakpoint"></a><span class="ts" id=4144 data-target="#details-4144" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SourceBreakpoint</span><span>(</span><span class="ident">location</span><span>: </span><a class="type-ref" href="#Location">Location</a>, <span class="ident">enabled</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span>, <span class="ident">condition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">hitCondition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">logMessage</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#SourceBreakpoint">SourceBreakpoint</a></span>
<div class="details collapse" id="details-4144">
<div class="comment"><p>Create a new breakpoint for a source location.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">location</span><span>: </span><a class="type-ref" href="#Location">Location</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">enabled</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">condition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">hitCondition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">logMessage</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SourceBreakpoint">SourceBreakpoint</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="SourceBreakpoint.condition"></a><span class="ts" id=4153 data-target="#details-4153" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">condition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4153">
<div class="comment"><p>An optional expression for conditional breakpoints.</p>
</div>
</div>



<a name="SourceBreakpoint.enabled"></a><span class="ts" id=4152 data-target="#details-4152" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">enabled</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4152">
<div class="comment"><p>Is breakpoint enabled.</p>
</div>
</div>



<a name="SourceBreakpoint.hitCondition"></a><span class="ts" id=4154 data-target="#details-4154" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hitCondition</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4154">
<div class="comment"><p>An optional expression that controls how many hits of the breakpoint are ignored.</p>
</div>
</div>



<a name="SourceBreakpoint.id"></a><span class="ts" id=4151 data-target="#details-4151" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4151">
<div class="comment"><p>The unique ID of the breakpoint.</p>
</div>
</div>



<a name="SourceBreakpoint.location"></a><span class="ts" id=4150 data-target="#details-4150" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">location</span><span>: </span><a class="type-ref" href="#Location">Location</a></span>
<div class="details collapse" id="details-4150">
<div class="comment"><p>The source and line position of this breakpoint.</p>
</div>
</div>



<a name="SourceBreakpoint.logMessage"></a><span class="ts" id=4155 data-target="#details-4155" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">logMessage</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4155">
<div class="comment"><p>An optional message that gets logged when this breakpoint is hit. Embedded expressions within {} are interpolated by the debug adapter.</p>
</div>
</div>

### <a name="SourceControl"></a><span class="code-item" id=3988>SourceControl</span>



<div class="comment"><p>An source control is able to provide <a href="#SourceControlResourceState">resource states</a>
to the editor and interact with the editor in several source control related ways.</p>
</div>

#### Properties



<a name="SourceControl.acceptInputCommand"></a><span class="ts" id=3996 data-target="#details-3996" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">acceptInputCommand</span><span>?</span><span>: </span><a class="type-ref" href="#Command">Command</a></span>
<div class="details collapse" id="details-3996">
<div class="comment"><p>Optional accept input command.</p>
<p>This command will be invoked when the user accepts the value
in the Source Control input.</p>
</div>
</div>



<a name="SourceControl.commitTemplate"></a><span class="ts" id=3995 data-target="#details-3995" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">commitTemplate</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3995">
<div class="comment"><p>Optional commit template string.</p>
<p>The Source Control viewlet will populate the Source Control
input with this value when appropriate.</p>
</div>
</div>



<a name="SourceControl.count"></a><span class="ts" id=3993 data-target="#details-3993" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">count</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3993">
<div class="comment"><p>The UI-visible count of <a href="#SourceControlResourceState">resource states</a> of
this source control.</p>
<p>If undefined, this source control will</p>
<ul>
<li>display its UI-visible count as zero, and</li>
<li>contribute the count of its <a href="#SourceControlResourceState">resource states</a> to the UI-visible aggregated count for all source controls</li>
</ul>
</div>
</div>



<a name="SourceControl.id"></a><span class="ts" id=3989 data-target="#details-3989" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3989">
<div class="comment"><p>The id of this source control.</p>
</div>
</div>



<a name="SourceControl.inputBox"></a><span class="ts" id=3992 data-target="#details-3992" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">inputBox</span><span>: </span><a class="type-ref" href="#SourceControlInputBox">SourceControlInputBox</a></span>
<div class="details collapse" id="details-3992">
<div class="comment"><p>The <a href="#SourceControlInputBox">input box</a> for this source control.</p>
</div>
</div>



<a name="SourceControl.label"></a><span class="ts" id=3990 data-target="#details-3990" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3990">
<div class="comment"><p>The human-readable label of this source control.</p>
</div>
</div>



<a name="SourceControl.quickDiffProvider"></a><span class="ts" id=3994 data-target="#details-3994" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">quickDiffProvider</span><span>?</span><span>: </span><a class="type-ref" href="#QuickDiffProvider">QuickDiffProvider</a></span>
<div class="details collapse" id="details-3994">
<div class="comment"><p>An optional <a href="#QuickDiffProvider">quick diff provider</a>.</p>
</div>
</div>



<a name="SourceControl.rootUri"></a><span class="ts" id=3991 data-target="#details-3991" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">rootUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-3991">
<div class="comment"><p>The (optional) Uri of the root of this source control.</p>
</div>
</div>



<a name="SourceControl.statusBarCommands"></a><span class="ts" id=3997 data-target="#details-3997" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">statusBarCommands</span><span>?</span><span>: </span><a class="type-ref" href="#Command">Command</a>[]</span>
<div class="details collapse" id="details-3997">
<div class="comment"><p>Optional status bar commands.</p>
<p>These commands will be displayed in the editor&#39;s status bar.</p>
</div>
</div>

#### Methods



<a name="SourceControl.createResourceGroup"></a><span class="ts" id=3999 data-target="#details-3999" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createResourceGroup</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#SourceControlResourceGroup">SourceControlResourceGroup</a></span>
<div class="details collapse" id="details-3999">
<div class="comment"><p>Create a new <a href="#SourceControlResourceGroup">resource group</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SourceControlResourceGroup">SourceControlResourceGroup</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="SourceControl.dispose"></a><span class="ts" id=4003 data-target="#details-4003" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4003">
<div class="comment"><p>Dispose this source control.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="SourceControlInputBox"></a><span class="code-item" id=3956>SourceControlInputBox</span>



<div class="comment"><p>Represents the input box in the Source Control viewlet.</p>
</div>

#### Properties



<a name="SourceControlInputBox.enabled"></a><span class="ts" id=3959 data-target="#details-3959" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">enabled</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3959">
<div class="comment"><p>Controls whether the input box is enabled (default is <code>true</code>).</p>
</div>
</div>



<a name="SourceControlInputBox.placeholder"></a><span class="ts" id=3958 data-target="#details-3958" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">placeholder</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3958">
<div class="comment"><p>A string to show as placeholder in the input box to guide the user.</p>
</div>
</div>



<a name="SourceControlInputBox.value"></a><span class="ts" id=3957 data-target="#details-3957" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3957">
<div class="comment"><p>Setter and getter for the contents of the input box.</p>
</div>
</div>



<a name="SourceControlInputBox.visible"></a><span class="ts" id=3960 data-target="#details-3960" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">visible</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3960">
<div class="comment"><p>Controls whether the input box is visible (default is <code>true</code>).</p>
</div>
</div>

### <a name="SourceControlResourceDecorations"></a><span class="code-item" id=3968>SourceControlResourceDecorations</span>



<div class="comment"><p>The decorations for a <a href="#SourceControlResourceState">source control resource state</a>.
Can be independently specified for light and dark themes.</p>
</div>

#### Properties



<a name="SourceControlResourceDecorations.dark"></a><span class="ts" id=3973 data-target="#details-3973" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dark</span><span>?</span><span>: </span><a class="type-ref" href="#SourceControlResourceThemableDecorations">SourceControlResourceThemableDecorations</a></span>
<div class="details collapse" id="details-3973">
<div class="comment"><p>The dark theme decorations.</p>
</div>
</div>



<a name="SourceControlResourceDecorations.faded"></a><span class="ts" id=3970 data-target="#details-3970" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">faded</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3970">
<div class="comment"><p>Whether the <a href="#SourceControlResourceState">source control resource state</a> should
be faded in the UI.</p>
</div>
</div>



<a name="SourceControlResourceDecorations.iconPath"></a><span class="ts" id=3974 data-target="#details-3974" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">iconPath</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#ThemeIcon">ThemeIcon</a></span>
<div class="details collapse" id="details-3974">
<div class="comment"><p>The icon path for a specific
<a href="#SourceControlResourceState">source control resource state</a>.</p>
</div>
</div>



<a name="SourceControlResourceDecorations.light"></a><span class="ts" id=3972 data-target="#details-3972" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">light</span><span>?</span><span>: </span><a class="type-ref" href="#SourceControlResourceThemableDecorations">SourceControlResourceThemableDecorations</a></span>
<div class="details collapse" id="details-3972">
<div class="comment"><p>The light theme decorations.</p>
</div>
</div>



<a name="SourceControlResourceDecorations.strikeThrough"></a><span class="ts" id=3969 data-target="#details-3969" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">strikeThrough</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3969">
<div class="comment"><p>Whether the <a href="#SourceControlResourceState">source control resource state</a> should
be striked-through in the UI.</p>
</div>
</div>



<a name="SourceControlResourceDecorations.tooltip"></a><span class="ts" id=3971 data-target="#details-3971" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3971">
<div class="comment"><p>The title for a specific
<a href="#SourceControlResourceState">source control resource state</a>.</p>
</div>
</div>

### <a name="SourceControlResourceGroup"></a><span class="code-item" id=3980>SourceControlResourceGroup</span>



<div class="comment"><p>A source control resource group is a collection of
<a href="#SourceControlResourceState">source control resource states</a>.</p>
</div>

#### Properties



<a name="SourceControlResourceGroup.contextValue"></a><span class="ts" id=3984 data-target="#details-3984" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contextValue</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3984">
<div class="comment"><p>Context value of the resource group. This can be used to contribute resource group specific actions.
For example, if a resource group is given a context value of <code>exportable</code>, when contributing actions to <code>scm/resourceGroup/context</code>
using <code>menus</code> extension point, you can specify context value for key <code>scmResourceGroupState</code> in <code>when</code> expressions, like <code>scmResourceGroupState == exportable</code>.</p>
<pre class="shiki" data-lang="json" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"contributes"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">  "menus"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">    "scm/resourceGroup/context"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: [</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">      {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">        "command"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"extension.export"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">        "when"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"scmResourceGroupState == exportable"</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">      }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    ]</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span></code></pre>
<p>This will show action <code>extension.export</code> only for resource groups with <code>contextValue</code> equal to <code>exportable</code>.</p>
</div>
</div>



<a name="SourceControlResourceGroup.hideWhenEmpty"></a><span class="ts" id=3983 data-target="#details-3983" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hideWhenEmpty</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3983">
<div class="comment"><p>Whether this source control resource group is hidden when it contains
no <a href="#SourceControlResourceState">source control resource states</a>.</p>
</div>
</div>



<a name="SourceControlResourceGroup.id"></a><span class="ts" id=3981 data-target="#details-3981" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3981">
<div class="comment"><p>The id of this source control resource group.</p>
</div>
</div>



<a name="SourceControlResourceGroup.label"></a><span class="ts" id=3982 data-target="#details-3982" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3982">
<div class="comment"><p>The label of this source control resource group.</p>
</div>
</div>



<a name="SourceControlResourceGroup.resourceStates"></a><span class="ts" id=3985 data-target="#details-3985" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resourceStates</span><span>: </span><a class="type-ref" href="#SourceControlResourceState">SourceControlResourceState</a>[]</span>
<div class="details collapse" id="details-3985">
<div class="comment"><p>This group&#39;s collection of
<a href="#SourceControlResourceState">source control resource states</a>.</p>
</div>
</div>

#### Methods



<a name="SourceControlResourceGroup.dispose"></a><span class="ts" id=3987 data-target="#details-3987" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3987">
<div class="comment"><p>Dispose this source control resource group.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="SourceControlResourceState"></a><span class="code-item" id=3975>SourceControlResourceState</span>



<div class="comment"><p>An source control resource state represents the state of an underlying workspace
resource within a certain <a href="#SourceControlResourceGroup">source control group</a>.</p>
</div>

#### Properties



<a name="SourceControlResourceState.command"></a><span class="ts" id=3977 data-target="#details-3977" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>?</span><span>: </span><a class="type-ref" href="#Command">Command</a></span>
<div class="details collapse" id="details-3977">
<div class="comment"><p>The <a href="#Command">Command</a> which should be run when the resource
state is open in the Source Control viewlet.</p>
</div>
</div>



<a name="SourceControlResourceState.contextValue"></a><span class="ts" id=3979 data-target="#details-3979" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contextValue</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3979">
<div class="comment"><p>Context value of the resource state. This can be used to contribute resource specific actions.
For example, if a resource is given a context value as <code>diffable</code>. When contributing actions to <code>scm/resourceState/context</code>
using <code>menus</code> extension point, you can specify context value for key <code>scmResourceState</code> in <code>when</code> expressions, like <code>scmResourceState == diffable</code>.</p>
<pre class="shiki" data-lang="json" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"contributes"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">  "menus"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">    "scm/resourceState/context"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: [</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">      {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">        "command"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"extension.diff"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">        "when"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"scmResourceState == diffable"</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">      }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    ]</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span></code></pre>
<p>This will show action <code>extension.diff</code> only for resources with <code>contextValue</code> is <code>diffable</code>.</p>
</div>
</div>



<a name="SourceControlResourceState.decorations"></a><span class="ts" id=3978 data-target="#details-3978" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">decorations</span><span>?</span><span>: </span><a class="type-ref" href="#SourceControlResourceDecorations">SourceControlResourceDecorations</a></span>
<div class="details collapse" id="details-3978">
<div class="comment"><p>The <a href="#SourceControlResourceDecorations">decorations</a> for this source control
resource state.</p>
</div>
</div>



<a name="SourceControlResourceState.resourceUri"></a><span class="ts" id=3976 data-target="#details-3976" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resourceUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-3976">
<div class="comment"><p>The <a href="#Uri">Uri</a> of the underlying resource inside the workspace.</p>
</div>
</div>

### <a name="SourceControlResourceThemableDecorations"></a><span class="code-item" id=3966>SourceControlResourceThemableDecorations</span>



<div class="comment"><p>The theme-aware decorations for a
<a href="#SourceControlResourceState">source control resource state</a>.</p>
</div>

#### Properties



<a name="SourceControlResourceThemableDecorations.iconPath"></a><span class="ts" id=3967 data-target="#details-3967" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">iconPath</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a> &#124; <a class="type-ref" href="#ThemeIcon">ThemeIcon</a></span>
<div class="details collapse" id="details-3967">
<div class="comment"><p>The icon path for a specific
<a href="#SourceControlResourceState">source control resource state</a>.</p>
</div>
</div>

### <a name="StatementCoverage"></a><span class="code-item" id=4635>StatementCoverage</span>



<div class="comment"><p>Contains coverage information for a single statement or line.</p>
</div>

#### Constructors



<a name="StatementCoverage.StatementCoverage"></a><span class="ts" id=4637 data-target="#details-4637" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">StatementCoverage</span><span>(</span><span class="ident">executed</span><span>: </span><span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span>, <span class="ident">location</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a>, <span class="ident">branches</span><span>?</span><span>: </span><a class="type-ref" href="#BranchCoverage">BranchCoverage</a>[]<span>)</span><span>: </span><a class="type-ref" href="#StatementCoverage">StatementCoverage</a></span>
<div class="details collapse" id="details-4637">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">executed</span><span>: </span><span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>The number of times this statement was executed, or a
boolean indicating  whether it was executed if the exact count is
unknown. If zero or false, the statement will be marked as un-covered.</p>
</div></td></tr>
<tr><td><span class="ident">location</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The statement position.</p>
</div></td></tr>
<tr><td><span class="ident">branches</span><span>?</span><span>: </span><a class="type-ref" href="#BranchCoverage">BranchCoverage</a>[]</td><td><div class="comment"><p>Coverage from branches of this line.  If it&#39;s not a
conditional, this should be omitted.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#StatementCoverage">StatementCoverage</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="StatementCoverage.branches"></a><span class="ts" id=4643 data-target="#details-4643" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">branches</span><span>: </span><a class="type-ref" href="#BranchCoverage">BranchCoverage</a>[]</span>
<div class="details collapse" id="details-4643">
<div class="comment"><p>Coverage from branches of this line or statement. If it&#39;s not a
conditional, this will be empty.</p>
</div>
</div>



<a name="StatementCoverage.executed"></a><span class="ts" id=4641 data-target="#details-4641" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executed</span><span>: </span><span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4641">
<div class="comment"><p>The number of times this statement was executed, or a boolean indicating
whether it was executed if the exact count is unknown. If zero or false,
the statement will be marked as un-covered.</p>
</div>
</div>



<a name="StatementCoverage.location"></a><span class="ts" id=4642 data-target="#details-4642" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">location</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-4642">
<div class="comment"><p>Statement location.</p>
</div>
</div>

### <a name="StatusBarAlignment"></a><span class="code-item" id=1910>StatusBarAlignment</span>



<div class="comment"><p>Represents the alignment of status bar items.</p>
</div>

#### Enumeration Members



<a name="StatusBarAlignment.Left"></a><span class="ts" id=1911 data-target="#details-1911" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Left</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1911">
<div class="comment"><p>Aligned to the left side.</p>
</div>
</div>



<a name="StatusBarAlignment.Right"></a><span class="ts" id=1912 data-target="#details-1912" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Right</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1912">
<div class="comment"><p>Aligned to the right side.</p>
</div>
</div>

### <a name="StatusBarItem"></a><span class="code-item" id=1913>StatusBarItem</span>



<div class="comment"><p>A status bar item is a status bar contribution that can
show text and icons and run a command on click.</p>
</div>

#### Properties



<a name="StatusBarItem.accessibilityInformation"></a><span class="ts" id=1923 data-target="#details-1923" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">accessibilityInformation</span><span>: </span><a class="type-ref" href="#AccessibilityInformation">AccessibilityInformation</a></span>
<div class="details collapse" id="details-1923">
<div class="comment"><p>Accessibility information used when a screen reader interacts with this StatusBar item</p>
</div>
</div>



<a name="StatusBarItem.alignment"></a><span class="ts" id=1915 data-target="#details-1915" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">alignment</span><span>: </span><a class="type-ref" href="#StatusBarAlignment">StatusBarAlignment</a></span>
<div class="details collapse" id="details-1915">
<div class="comment"><p>The alignment of this item.</p>
</div>
</div>



<a name="StatusBarItem.backgroundColor"></a><span class="ts" id=1921 data-target="#details-1921" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">backgroundColor</span><span>: </span><a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-1921">
<div class="comment"><p>The background color for this entry.</p>
<p><em>Note</em>: only the following colors are supported:</p>
<ul>
<li><code>new ThemeColor(&#39;statusBarItem.errorBackground&#39;)</code></li>
<li><code>new ThemeColor(&#39;statusBarItem.warningBackground&#39;)</code></li>
</ul>
<p>More background colors may be supported in the future.</p>
<p><em>Note</em>: when a background color is set, the statusbar may override
the <code>color</code> choice to ensure the entry is readable in all themes.</p>
</div>
</div>



<a name="StatusBarItem.color"></a><span class="ts" id=1920 data-target="#details-1920" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">color</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-1920">
<div class="comment"><p>The foreground color for this entry.</p>
</div>
</div>



<a name="StatusBarItem.command"></a><span class="ts" id=1922 data-target="#details-1922" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Command">Command</a></span>
<div class="details collapse" id="details-1922">
<div class="comment"><p><a href="#Command">Command</a> or identifier of a command to run on click.</p>
<p>The command must be <a href="#commands.getCommands">known</a>.</p>
<p>Note that if this is a <a href="#Command">Command</a> object, only the <a href="#Command.command">command</a> and <a href="#Command.arguments">arguments</a>
are used by the editor.</p>
</div>
</div>



<a name="StatusBarItem.id"></a><span class="ts" id=1914 data-target="#details-1914" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1914">
<div class="comment"><p>The identifier of this item.</p>
<p><em>Note</em>: if no identifier was provided by the <a href="#window.createStatusBarItem">window.createStatusBarItem</a>
method, the identifier will match the <a href="#Extension.id">extension identifier</a>.</p>
</div>
</div>



<a name="StatusBarItem.name"></a><span class="ts" id=1917 data-target="#details-1917" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1917">
<div class="comment"><p>The name of the entry, like &#39;Python Language Indicator&#39;, &#39;Git Status&#39; etc.
Try to keep the length of the name short, yet descriptive enough that
users can understand what the status bar item is about.</p>
</div>
</div>



<a name="StatusBarItem.priority"></a><span class="ts" id=1916 data-target="#details-1916" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">priority</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1916">
<div class="comment"><p>The priority of this item. Higher value means the item should
be shown more to the left.</p>
</div>
</div>



<a name="StatusBarItem.text"></a><span class="ts" id=1918 data-target="#details-1918" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1918">
<div class="comment"><p>The text to show for the entry. You can embed icons in the text by leveraging the syntax:</p>
<p><code>My text $(icon-name) contains icons like $(icon-name) this one.</code></p>
<p>Where the icon-name is taken from the ThemeIcon <a href="https://code.visualstudio.com/api/references/icons-in-labels#icon-listing">icon set</a>, e.g.
<code>light-bulb</code>, <code>thumbsup</code>, <code>zap</code> etc.</p>
</div>
</div>



<a name="StatusBarItem.tooltip"></a><span class="ts" id=1919 data-target="#details-1919" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tooltip</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-1919">
<div class="comment"><p>The tooltip text when you hover over this entry.</p>
</div>
</div>

#### Methods



<a name="StatusBarItem.dispose"></a><span class="ts" id=1929 data-target="#details-1929" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1929">
<div class="comment"><p>Dispose and free associated resources. Call
<a href="#StatusBarItem.hide">hide</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="StatusBarItem.hide"></a><span class="ts" id=1927 data-target="#details-1927" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hide</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1927">
<div class="comment"><p>Hide the entry in the status bar.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="StatusBarItem.show"></a><span class="ts" id=1925 data-target="#details-1925" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">show</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1925">
<div class="comment"><p>Shows the entry in the status bar.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="SymbolInformation"></a><span class="code-item" id=833>SymbolInformation</span>



<div class="comment"><p>Represents information about programming constructs like variables, classes,
interfaces etc.</p>
</div>

#### Constructors



<a name="SymbolInformation.SymbolInformation"></a><span class="ts" id=835 data-target="#details-835" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SymbolInformation</span><span>(</span><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a>, <span class="ident">containerName</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">location</span><span>: </span><a class="type-ref" href="#Location">Location</a><span>)</span><span>: </span><a class="type-ref" href="#SymbolInformation">SymbolInformation</a></span>
<div class="details collapse" id="details-835">
<div class="comment"><p>Creates a new symbol information object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The name of the symbol.</p>
</div></td></tr>
<tr><td><span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a></td><td><div class="comment"><p>The kind of the symbol.</p>
</div></td></tr>
<tr><td><span class="ident">containerName</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The name of the symbol containing the symbol.</p>
</div></td></tr>
<tr><td><span class="ident">location</span><span>: </span><a class="type-ref" href="#Location">Location</a></td><td><div class="comment"><p>The location of the symbol.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SymbolInformation">SymbolInformation</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="SymbolInformation.SymbolInformation"></a><span class="ts" id=840 data-target="#details-840" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">SymbolInformation</span><span>(</span><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a>, <span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">uri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">containerName</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#SymbolInformation">SymbolInformation</a></span>
<div class="details collapse" id="details-840">
<div class="comment"><p>Creates a new symbol information object.</p>
<ul>
<li><em>deprecated</em> - Please use the constructor taking a <a href="#Location">Location</a> object.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The name of the symbol.</p>
</div></td></tr>
<tr><td><span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a></td><td><div class="comment"><p>The kind of the symbol.</p>
</div></td></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The range of the location of the symbol.</p>
</div></td></tr>
<tr><td><span class="ident">uri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The resource of the location of symbol, defaults to the current document.</p>
</div></td></tr>
<tr><td><span class="ident">containerName</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The name of the symbol containing the symbol.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#SymbolInformation">SymbolInformation</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="SymbolInformation.containerName"></a><span class="ts" id=847 data-target="#details-847" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">containerName</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-847">
<div class="comment"><p>The name of the symbol containing this symbol.</p>
</div>
</div>



<a name="SymbolInformation.kind"></a><span class="ts" id=848 data-target="#details-848" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a></span>
<div class="details collapse" id="details-848">
<div class="comment"><p>The kind of this symbol.</p>
</div>
</div>



<a name="SymbolInformation.location"></a><span class="ts" id=850 data-target="#details-850" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">location</span><span>: </span><a class="type-ref" href="#Location">Location</a></span>
<div class="details collapse" id="details-850">
<div class="comment"><p>The location of this symbol.</p>
</div>
</div>



<a name="SymbolInformation.name"></a><span class="ts" id=846 data-target="#details-846" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-846">
<div class="comment"><p>The name of this symbol.</p>
</div>
</div>



<a name="SymbolInformation.tags"></a><span class="ts" id=849 data-target="#details-849" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tags</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#SymbolTag">SymbolTag</a>[]</span>
<div class="details collapse" id="details-849">
<div class="comment"><p>Tags for this symbol.</p>
</div>
</div>

### <a name="SymbolKind"></a><span class="code-item" id=804>SymbolKind</span>



<div class="comment"><p>A symbol kind.</p>
</div>

#### Enumeration Members



<a name="SymbolKind.File"></a><span class="ts" id=805 data-target="#details-805" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">File</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-805">
<div class="comment"><p>The <code>File</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Module"></a><span class="ts" id=806 data-target="#details-806" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Module</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-806">
<div class="comment"><p>The <code>Module</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Namespace"></a><span class="ts" id=807 data-target="#details-807" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Namespace</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-807">
<div class="comment"><p>The <code>Namespace</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Package"></a><span class="ts" id=808 data-target="#details-808" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Package</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-808">
<div class="comment"><p>The <code>Package</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Class"></a><span class="ts" id=809 data-target="#details-809" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Class</span><span>: </span><span class="type-literal">4</span></span>
<div class="details collapse" id="details-809">
<div class="comment"><p>The <code>Class</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Method"></a><span class="ts" id=810 data-target="#details-810" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Method</span><span>: </span><span class="type-literal">5</span></span>
<div class="details collapse" id="details-810">
<div class="comment"><p>The <code>Method</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Property"></a><span class="ts" id=811 data-target="#details-811" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Property</span><span>: </span><span class="type-literal">6</span></span>
<div class="details collapse" id="details-811">
<div class="comment"><p>The <code>Property</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Field"></a><span class="ts" id=812 data-target="#details-812" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Field</span><span>: </span><span class="type-literal">7</span></span>
<div class="details collapse" id="details-812">
<div class="comment"><p>The <code>Field</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Constructor"></a><span class="ts" id=813 data-target="#details-813" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Constructor</span><span>: </span><span class="type-literal">8</span></span>
<div class="details collapse" id="details-813">
<div class="comment"><p>The <code>Constructor</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Enum"></a><span class="ts" id=814 data-target="#details-814" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Enum</span><span>: </span><span class="type-literal">9</span></span>
<div class="details collapse" id="details-814">
<div class="comment"><p>The <code>Enum</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Interface"></a><span class="ts" id=815 data-target="#details-815" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Interface</span><span>: </span><span class="type-literal">10</span></span>
<div class="details collapse" id="details-815">
<div class="comment"><p>The <code>Interface</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Function"></a><span class="ts" id=816 data-target="#details-816" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Function</span><span>: </span><span class="type-literal">11</span></span>
<div class="details collapse" id="details-816">
<div class="comment"><p>The <code>Function</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Variable"></a><span class="ts" id=817 data-target="#details-817" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Variable</span><span>: </span><span class="type-literal">12</span></span>
<div class="details collapse" id="details-817">
<div class="comment"><p>The <code>Variable</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Constant"></a><span class="ts" id=818 data-target="#details-818" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Constant</span><span>: </span><span class="type-literal">13</span></span>
<div class="details collapse" id="details-818">
<div class="comment"><p>The <code>Constant</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.String"></a><span class="ts" id=819 data-target="#details-819" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">String</span><span>: </span><span class="type-literal">14</span></span>
<div class="details collapse" id="details-819">
<div class="comment"><p>The <code>String</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Number"></a><span class="ts" id=820 data-target="#details-820" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Number</span><span>: </span><span class="type-literal">15</span></span>
<div class="details collapse" id="details-820">
<div class="comment"><p>The <code>Number</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Boolean"></a><span class="ts" id=821 data-target="#details-821" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Boolean</span><span>: </span><span class="type-literal">16</span></span>
<div class="details collapse" id="details-821">
<div class="comment"><p>The <code>Boolean</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Array"></a><span class="ts" id=822 data-target="#details-822" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Array</span><span>: </span><span class="type-literal">17</span></span>
<div class="details collapse" id="details-822">
<div class="comment"><p>The <code>Array</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Object"></a><span class="ts" id=823 data-target="#details-823" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Object</span><span>: </span><span class="type-literal">18</span></span>
<div class="details collapse" id="details-823">
<div class="comment"><p>The <code>Object</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Key"></a><span class="ts" id=824 data-target="#details-824" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Key</span><span>: </span><span class="type-literal">19</span></span>
<div class="details collapse" id="details-824">
<div class="comment"><p>The <code>Key</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Null"></a><span class="ts" id=825 data-target="#details-825" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Null</span><span>: </span><span class="type-literal">20</span></span>
<div class="details collapse" id="details-825">
<div class="comment"><p>The <code>Null</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.EnumMember"></a><span class="ts" id=826 data-target="#details-826" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">EnumMember</span><span>: </span><span class="type-literal">21</span></span>
<div class="details collapse" id="details-826">
<div class="comment"><p>The <code>EnumMember</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Struct"></a><span class="ts" id=827 data-target="#details-827" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Struct</span><span>: </span><span class="type-literal">22</span></span>
<div class="details collapse" id="details-827">
<div class="comment"><p>The <code>Struct</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Event"></a><span class="ts" id=828 data-target="#details-828" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Event</span><span>: </span><span class="type-literal">23</span></span>
<div class="details collapse" id="details-828">
<div class="comment"><p>The <code>Event</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.Operator"></a><span class="ts" id=829 data-target="#details-829" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Operator</span><span>: </span><span class="type-literal">24</span></span>
<div class="details collapse" id="details-829">
<div class="comment"><p>The <code>Operator</code> symbol kind.</p>
</div>
</div>



<a name="SymbolKind.TypeParameter"></a><span class="ts" id=830 data-target="#details-830" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TypeParameter</span><span>: </span><span class="type-literal">25</span></span>
<div class="details collapse" id="details-830">
<div class="comment"><p>The <code>TypeParameter</code> symbol kind.</p>
</div>
</div>

### <a name="SymbolTag"></a><span class="code-item" id=831>SymbolTag</span>



<div class="comment"><p>Symbol tags are extra annotations that tweak the rendering of a symbol.</p>
</div>

#### Enumeration Members



<a name="SymbolTag.Deprecated"></a><span class="ts" id=832 data-target="#details-832" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Deprecated</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-832">
<div class="comment"><p>Render a symbol as obsolete, usually using a strike-out.</p>
</div>
</div>

### <a name="SyntaxTokenType"></a><span class="code-item" id=1665>SyntaxTokenType</span>



<div class="comment"><p>Enumeration of commonly encountered syntax token types.</p>
</div>

#### Enumeration Members



<a name="SyntaxTokenType.Other"></a><span class="ts" id=1666 data-target="#details-1666" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Other</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-1666">
<div class="comment"><p>Everything except tokens that are part of comments, string literals and regular expressions.</p>
</div>
</div>



<a name="SyntaxTokenType.Comment"></a><span class="ts" id=1667 data-target="#details-1667" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Comment</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1667">
<div class="comment"><p>A comment.</p>
</div>
</div>



<a name="SyntaxTokenType.String"></a><span class="ts" id=1668 data-target="#details-1668" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">String</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1668">
<div class="comment"><p>A string literal.</p>
</div>
</div>



<a name="SyntaxTokenType.RegEx"></a><span class="ts" id=1669 data-target="#details-1669" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">RegEx</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-1669">
<div class="comment"><p>A regular expression.</p>
</div>
</div>

### <a name="Tab"></a><span class="code-item" id=4706>Tab</span>



<div class="comment"><p>Represents a tab within a <a href="#TabGroup">group of tabs</a>.
Tabs are merely the graphical representation within the editor area.
A backing editor is not a guarantee.</p>
</div>

#### Properties



<a name="Tab.group"></a><span class="ts" id=4708 data-target="#details-4708" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">group</span><span>: </span><a class="type-ref" href="#TabGroup">TabGroup</a></span>
<div class="details collapse" id="details-4708">
<div class="comment"><p>The group which the tab belongs to.</p>
</div>
</div>



<a name="Tab.input"></a><span class="ts" id=4709 data-target="#details-4709" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">input</span><span>: </span><span class="type-intrinsic">unknown</span></span>
<div class="details collapse" id="details-4709">
<div class="comment"><p>Defines the structure of the tab i.e. text, notebook, custom, etc.
Resource and other useful properties are defined on the tab kind.</p>
</div>
</div>



<a name="Tab.isActive"></a><span class="ts" id=4710 data-target="#details-4710" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isActive</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4710">
<div class="comment"><p>Whether or not the tab is currently active.
This is dictated by being the selected tab in the group.</p>
</div>
</div>



<a name="Tab.isDirty"></a><span class="ts" id=4711 data-target="#details-4711" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isDirty</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4711">
<div class="comment"><p>Whether or not the dirty indicator is present on the tab.</p>
</div>
</div>



<a name="Tab.isPinned"></a><span class="ts" id=4712 data-target="#details-4712" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isPinned</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4712">
<div class="comment"><p>Whether or not the tab is pinned (pin icon is present).</p>
</div>
</div>



<a name="Tab.isPreview"></a><span class="ts" id=4713 data-target="#details-4713" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isPreview</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4713">
<div class="comment"><p>Whether or not the tab is in preview mode.</p>
</div>
</div>



<a name="Tab.label"></a><span class="ts" id=4707 data-target="#details-4707" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4707">
<div class="comment"><p>The text displayed on the tab.</p>
</div>
</div>

### <a name="TabChangeEvent"></a><span class="code-item" id=4714>TabChangeEvent</span>



<div class="comment"><p>An event describing change to tabs.</p>
</div>

#### Properties



<a name="TabChangeEvent.changed"></a><span class="ts" id=4717 data-target="#details-4717" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">changed</span><span>: </span>readonly <a class="type-ref" href="#Tab">Tab</a>[]</span>
<div class="details collapse" id="details-4717">
<div class="comment"><p>Tabs that have changed, e.g have changed
their <a href="#Tab.isActive">active</a> state.</p>
</div>
</div>



<a name="TabChangeEvent.closed"></a><span class="ts" id=4716 data-target="#details-4716" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">closed</span><span>: </span>readonly <a class="type-ref" href="#Tab">Tab</a>[]</span>
<div class="details collapse" id="details-4716">
<div class="comment"><p>The tabs that have been closed.</p>
</div>
</div>



<a name="TabChangeEvent.opened"></a><span class="ts" id=4715 data-target="#details-4715" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">opened</span><span>: </span>readonly <a class="type-ref" href="#Tab">Tab</a>[]</span>
<div class="details collapse" id="details-4715">
<div class="comment"><p>The tabs that have been opened.</p>
</div>
</div>

### <a name="TabGroup"></a><span class="code-item" id=4722>TabGroup</span>



<div class="comment"><p>Represents a group of tabs. A tab group itself consists of multiple tabs.</p>
</div>

#### Properties



<a name="TabGroup.activeTab"></a><span class="ts" id=4725 data-target="#details-4725" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeTab</span><span>: </span><a class="type-ref" href="#Tab">Tab</a></span>
<div class="details collapse" id="details-4725">
<div class="comment"><p>The active <a href="#Tab">tab</a> in the group. This is the tab whose contents are currently
being rendered.</p>
<p><em>Note</em> that there can be one active tab per group but there can only be one <a href="#TabGroups.activeTabGroup">active group</a>.</p>
</div>
</div>



<a name="TabGroup.isActive"></a><span class="ts" id=4723 data-target="#details-4723" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isActive</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4723">
<div class="comment"><p>Whether or not the group is currently active.</p>
<p><em>Note</em> that only one tab group is active at a time, but that multiple tab
groups can have an <a href="#TabGroup.activeTab">active tab</a>.</p>
<p><em>See also</em>
<a href="#Tab.isActive">Tab.isActive</a></p>
</div>
</div>



<a name="TabGroup.tabs"></a><span class="ts" id=4726 data-target="#details-4726" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tabs</span><span>: </span>readonly <a class="type-ref" href="#Tab">Tab</a>[]</span>
<div class="details collapse" id="details-4726">
<div class="comment"><p>The list of tabs contained within the group.
This can be empty if the group has no tabs open.</p>
</div>
</div>



<a name="TabGroup.viewColumn"></a><span class="ts" id=4724 data-target="#details-4724" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">viewColumn</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a></span>
<div class="details collapse" id="details-4724">
<div class="comment"><p>The view column of the group.</p>
</div>
</div>

### <a name="TabGroupChangeEvent"></a><span class="code-item" id=4718>TabGroupChangeEvent</span>



<div class="comment"><p>An event describing changes to tab groups.</p>
</div>

#### Properties



<a name="TabGroupChangeEvent.changed"></a><span class="ts" id=4721 data-target="#details-4721" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">changed</span><span>: </span>readonly <a class="type-ref" href="#TabGroup">TabGroup</a>[]</span>
<div class="details collapse" id="details-4721">
<div class="comment"><p>Tab groups that have changed, e.g have changed
their <a href="#TabGroup.isActive">active</a> state.</p>
</div>
</div>



<a name="TabGroupChangeEvent.closed"></a><span class="ts" id=4720 data-target="#details-4720" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">closed</span><span>: </span>readonly <a class="type-ref" href="#TabGroup">TabGroup</a>[]</span>
<div class="details collapse" id="details-4720">
<div class="comment"><p>Tab groups that have been closed.</p>
</div>
</div>



<a name="TabGroupChangeEvent.opened"></a><span class="ts" id=4719 data-target="#details-4719" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">opened</span><span>: </span>readonly <a class="type-ref" href="#TabGroup">TabGroup</a>[]</span>
<div class="details collapse" id="details-4719">
<div class="comment"><p>Tab groups that have been opened.</p>
</div>
</div>

### <a name="TabGroups"></a><span class="code-item" id=4727>TabGroups</span>



<div class="comment"><p>Represents the main editor area which consists of multiple groups which contain tabs.</p>
</div>

#### Events



<a name="TabGroups.onDidChangeTabGroups"></a><span class="ts" id=4730 data-target="#details-4730" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeTabGroups</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TabGroupChangeEvent">TabGroupChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-4730">
<div class="comment"><p>An <a href="#Event">event</a> which fires when <a href="#TabGroup">tab groups</a> have changed.</p>
</div>
</div>



<a name="TabGroups.onDidChangeTabs"></a><span class="ts" id=4731 data-target="#details-4731" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeTabs</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TabChangeEvent">TabChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-4731">
<div class="comment"><p>An <a href="#Event">event</a> which fires when <a href="#Tab">tabs</a> have changed.</p>
</div>
</div>

#### Properties



<a name="TabGroups.activeTabGroup"></a><span class="ts" id=4729 data-target="#details-4729" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">activeTabGroup</span><span>: </span><a class="type-ref" href="#TabGroup">TabGroup</a></span>
<div class="details collapse" id="details-4729">
<div class="comment"><p>The currently active group.</p>
</div>
</div>



<a name="TabGroups.all"></a><span class="ts" id=4728 data-target="#details-4728" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">all</span><span>: </span>readonly <a class="type-ref" href="#TabGroup">TabGroup</a>[]</span>
<div class="details collapse" id="details-4728">
<div class="comment"><p>All the groups within the group container.</p>
</div>
</div>

#### Methods



<a name="TabGroups.close"></a><span class="ts" id=4733 data-target="#details-4733" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">close</span><span>(</span><span class="ident">tab</span><span>: </span><a class="type-ref" href="#Tab">Tab</a> &#124; readonly <a class="type-ref" href="#Tab">Tab</a>[], <span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-4733">
<div class="comment"><p>Closes the tab. This makes the tab object invalid and the tab
should no longer be used for further actions.
Note: In the case of a dirty tab, a confirmation dialog will be shown which may be cancelled. If cancelled the tab is still valid</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">tab</span><span>: </span><a class="type-ref" href="#Tab">Tab</a> &#124; readonly <a class="type-ref" href="#Tab">Tab</a>[]</td><td><div class="comment"><p>The tab to close.</p>
</div></td></tr>
<tr><td><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>When <code>true</code> focus will remain in its current position. If <code>false</code> it will jump to the next tab.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>A promise that resolves to <code>true</code> when all tabs have been closed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TabGroups.close"></a><span class="ts" id=4736 data-target="#details-4736" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">close</span><span>(</span><span class="ident">tabGroup</span><span>: </span><a class="type-ref" href="#TabGroup">TabGroup</a> &#124; readonly <a class="type-ref" href="#TabGroup">TabGroup</a>[], <span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-4736">
<div class="comment"><p>Closes the tab group. This makes the tab group object invalid and the tab group
should no longer be used for further actions.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">tabGroup</span><span>: </span><a class="type-ref" href="#TabGroup">TabGroup</a> &#124; readonly <a class="type-ref" href="#TabGroup">TabGroup</a>[]</td><td><div class="comment"><p>The tab group to close.</p>
</div></td></tr>
<tr><td><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>When <code>true</code> focus will remain in its current position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>A promise that resolves to <code>true</code> when all tab groups have been closed.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="TabInputCustom"></a><span class="code-item" id=4675>TabInputCustom</span>



<div class="comment"><p>The tab represents a custom editor.</p>
</div>

#### Constructors



<a name="TabInputCustom.TabInputCustom"></a><span class="ts" id=4677 data-target="#details-4677" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TabInputCustom</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#TabInputCustom">TabInputCustom</a></span>
<div class="details collapse" id="details-4677">
<div class="comment"><p>Constructs a custom editor tab input.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the tab.</p>
</div></td></tr>
<tr><td><span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The viewtype of the custom editor.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TabInputCustom">TabInputCustom</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TabInputCustom.uri"></a><span class="ts" id=4680 data-target="#details-4680" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4680">
<div class="comment"><p>The uri that the tab is representing.</p>
</div>
</div>



<a name="TabInputCustom.viewType"></a><span class="ts" id=4681 data-target="#details-4681" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4681">
<div class="comment"><p>The type of custom editor.</p>
</div>
</div>

### <a name="TabInputNotebook"></a><span class="code-item" id=4687>TabInputNotebook</span>



<div class="comment"><p>The tab represents a notebook.</p>
</div>

#### Constructors



<a name="TabInputNotebook.TabInputNotebook"></a><span class="ts" id=4689 data-target="#details-4689" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TabInputNotebook</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#TabInputNotebook">TabInputNotebook</a></span>
<div class="details collapse" id="details-4689">
<div class="comment"><p>Constructs a new tab input for a notebook.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the notebook.</p>
</div></td></tr>
<tr><td><span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The type of notebook. Maps to <a href="#NotebookDocument.notebookType">NotebookDocuments&#39;s notebookType</a></p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TabInputNotebook">TabInputNotebook</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TabInputNotebook.notebookType"></a><span class="ts" id=4693 data-target="#details-4693" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4693">
<div class="comment"><p>The type of notebook. Maps to <a href="#NotebookDocument.notebookType">NotebookDocuments&#39;s notebookType</a></p>
</div>
</div>



<a name="TabInputNotebook.uri"></a><span class="ts" id=4692 data-target="#details-4692" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4692">
<div class="comment"><p>The uri that the tab is representing.</p>
</div>
</div>

### <a name="TabInputNotebookDiff"></a><span class="code-item" id=4694>TabInputNotebookDiff</span>



<div class="comment"><p>The tabs represents two notebooks in a diff configuration.</p>
</div>

#### Constructors



<a name="TabInputNotebookDiff.TabInputNotebookDiff"></a><span class="ts" id=4696 data-target="#details-4696" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TabInputNotebookDiff</span><span>(</span><span class="ident">original</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">modified</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#TabInputNotebookDiff">TabInputNotebookDiff</a></span>
<div class="details collapse" id="details-4696">
<div class="comment"><p>Constructs a notebook diff tab input.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">original</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the original unmodified notebook.</p>
</div></td></tr>
<tr><td><span class="ident">modified</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the modified notebook.</p>
</div></td></tr>
<tr><td><span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The type of notebook. Maps to <a href="#NotebookDocument.notebookType">NotebookDocuments&#39;s notebookType</a></p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TabInputNotebookDiff">TabInputNotebookDiff</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TabInputNotebookDiff.modified"></a><span class="ts" id=4701 data-target="#details-4701" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">modified</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4701">
<div class="comment"><p>The uri of the modified notebook.</p>
</div>
</div>



<a name="TabInputNotebookDiff.notebookType"></a><span class="ts" id=4702 data-target="#details-4702" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">notebookType</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4702">
<div class="comment"><p>The type of notebook. Maps to <a href="#NotebookDocument.notebookType">NotebookDocuments&#39;s notebookType</a></p>
</div>
</div>



<a name="TabInputNotebookDiff.original"></a><span class="ts" id=4700 data-target="#details-4700" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">original</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4700">
<div class="comment"><p>The uri of the original notebook.</p>
</div>
</div>

### <a name="TabInputTerminal"></a><span class="code-item" id=4703>TabInputTerminal</span>



<div class="comment"><p>The tab represents a terminal in the editor area.</p>
</div>

#### Constructors



<a name="TabInputTerminal.TabInputTerminal"></a><span class="ts" id=4705 data-target="#details-4705" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TabInputTerminal</span><span>(</span><span>)</span><span>: </span><a class="type-ref" href="#TabInputTerminal">TabInputTerminal</a></span>
<div class="details collapse" id="details-4705">
<div class="comment"><p>Constructs a terminal tab input.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TabInputTerminal">TabInputTerminal</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TabInputText"></a><span class="code-item" id=4663>TabInputText</span>



<div class="comment"><p>The tab represents a single text based resource.</p>
</div>

#### Constructors



<a name="TabInputText.TabInputText"></a><span class="ts" id=4665 data-target="#details-4665" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TabInputText</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#TabInputText">TabInputText</a></span>
<div class="details collapse" id="details-4665">
<div class="comment"><p>Constructs a text tab input with the given URI.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The URI of the tab.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TabInputText">TabInputText</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TabInputText.uri"></a><span class="ts" id=4667 data-target="#details-4667" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4667">
<div class="comment"><p>The uri represented by the tab.</p>
</div>
</div>

### <a name="TabInputTextDiff"></a><span class="code-item" id=4668>TabInputTextDiff</span>



<div class="comment"><p>The tab represents two text based resources
being rendered as a diff.</p>
</div>

#### Constructors



<a name="TabInputTextDiff.TabInputTextDiff"></a><span class="ts" id=4670 data-target="#details-4670" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TabInputTextDiff</span><span>(</span><span class="ident">original</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">modified</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#TabInputTextDiff">TabInputTextDiff</a></span>
<div class="details collapse" id="details-4670">
<div class="comment"><p>Constructs a new text diff tab input with the given URIs.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">original</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the original text resource.</p>
</div></td></tr>
<tr><td><span class="ident">modified</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the modified text resource.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TabInputTextDiff">TabInputTextDiff</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TabInputTextDiff.modified"></a><span class="ts" id=4674 data-target="#details-4674" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">modified</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4674">
<div class="comment"><p>The uri of the modified text resource.</p>
</div>
</div>



<a name="TabInputTextDiff.original"></a><span class="ts" id=4673 data-target="#details-4673" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">original</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4673">
<div class="comment"><p>The uri of the original text resource.</p>
</div>
</div>

### <a name="TabInputWebview"></a><span class="code-item" id=4682>TabInputWebview</span>



<div class="comment"><p>The tab represents a webview.</p>
</div>

#### Constructors



<a name="TabInputWebview.TabInputWebview"></a><span class="ts" id=4684 data-target="#details-4684" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TabInputWebview</span><span>(</span><span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#TabInputWebview">TabInputWebview</a></span>
<div class="details collapse" id="details-4684">
<div class="comment"><p>Constructs a webview tab input with the given view type.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The type of webview. Maps to <a href="#WebviewPanel.viewType">WebviewPanel&#39;s viewType</a></p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TabInputWebview">TabInputWebview</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TabInputWebview.viewType"></a><span class="ts" id=4686 data-target="#details-4686" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4686">
<div class="comment"><p>The type of webview. Maps to <a href="#WebviewPanel.viewType">WebviewPanel&#39;s viewType</a></p>
</div>
</div>

### <a name="Task"></a><span class="code-item" id=2223>Task</span>



<div class="comment"><p>A task to execute</p>
</div>

#### Constructors



<a name="Task.Task"></a><span class="ts" id=2225 data-target="#details-2225" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Task</span><span>(</span><span class="ident">taskDefinition</span><span>: </span><a class="type-ref" href="#TaskDefinition">TaskDefinition</a>, <span class="ident">scope</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a> &#124; <a class="type-ref" href="#Global">Global</a> &#124; <a class="type-ref" href="#Workspace">Workspace</a>, <span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">source</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">execution</span><span>?</span><span>: </span><a class="type-ref" href="#ProcessExecution">ProcessExecution</a> &#124; <a class="type-ref" href="#ShellExecution">ShellExecution</a> &#124; <a class="type-ref" href="#CustomExecution">CustomExecution</a>, <span class="ident">problemMatchers</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">string</span>[]<span>)</span><span>: </span><a class="type-ref" href="#Task">Task</a></span>
<div class="details collapse" id="details-2225">
<div class="comment"><p>Creates a new task.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">taskDefinition</span><span>: </span><a class="type-ref" href="#TaskDefinition">TaskDefinition</a></td><td><div class="comment"><p>The task definition as defined in the taskDefinitions extension point.</p>
</div></td></tr>
<tr><td><span class="ident">scope</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a> &#124; <a class="type-ref" href="#Global">Global</a> &#124; <a class="type-ref" href="#Workspace">Workspace</a></td><td><div class="comment"><p>Specifies the task&#39;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.</p>
</div></td></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The task&#39;s name. Is presented in the user interface.</p>
</div></td></tr>
<tr><td><span class="ident">source</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The task&#39;s source (e.g. &#39;gulp&#39;, &#39;npm&#39;, ...). Is presented in the user interface.</p>
</div></td></tr>
<tr><td><span class="ident">execution</span><span>?</span><span>: </span><a class="type-ref" href="#ProcessExecution">ProcessExecution</a> &#124; <a class="type-ref" href="#ShellExecution">ShellExecution</a> &#124; <a class="type-ref" href="#CustomExecution">CustomExecution</a></td><td><div class="comment"><p>The process or shell execution.</p>
</div></td></tr>
<tr><td><span class="ident">problemMatchers</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>the names of problem matchers to use, like &#39;$tsc&#39;
 or &#39;$eslint&#39;. Problem matchers can be contributed by an extension using
 the <code>problemMatchers</code> extension point.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Task">Task</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="Task.Task"></a><span class="ts" id=2232 data-target="#details-2232" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Task</span><span>(</span><span class="ident">taskDefinition</span><span>: </span><a class="type-ref" href="#TaskDefinition">TaskDefinition</a>, <span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">source</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">execution</span><span>?</span><span>: </span><a class="type-ref" href="#ProcessExecution">ProcessExecution</a> &#124; <a class="type-ref" href="#ShellExecution">ShellExecution</a>, <span class="ident">problemMatchers</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">string</span>[]<span>)</span><span>: </span><a class="type-ref" href="#Task">Task</a></span>
<div class="details collapse" id="details-2232">
<div class="comment"><p>Creates a new task.</p>
<ul>
<li><em>deprecated</em> - Use the new constructors that allow specifying a scope for the task.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">taskDefinition</span><span>: </span><a class="type-ref" href="#TaskDefinition">TaskDefinition</a></td><td><div class="comment"><p>The task definition as defined in the taskDefinitions extension point.</p>
</div></td></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The task&#39;s name. Is presented in the user interface.</p>
</div></td></tr>
<tr><td><span class="ident">source</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The task&#39;s source (e.g. &#39;gulp&#39;, &#39;npm&#39;, ...). Is presented in the user interface.</p>
</div></td></tr>
<tr><td><span class="ident">execution</span><span>?</span><span>: </span><a class="type-ref" href="#ProcessExecution">ProcessExecution</a> &#124; <a class="type-ref" href="#ShellExecution">ShellExecution</a></td><td><div class="comment"><p>The process or shell execution.</p>
</div></td></tr>
<tr><td><span class="ident">problemMatchers</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>the names of problem matchers to use, like &#39;$tsc&#39;
 or &#39;$eslint&#39;. Problem matchers can be contributed by an extension using
 the <code>problemMatchers</code> extension point.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Task">Task</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="Task.definition"></a><span class="ts" id=2238 data-target="#details-2238" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">definition</span><span>: </span><a class="type-ref" href="#TaskDefinition">TaskDefinition</a></span>
<div class="details collapse" id="details-2238">
<div class="comment"><p>The task&#39;s definition.</p>
</div>
</div>



<a name="Task.detail"></a><span class="ts" id=2241 data-target="#details-2241" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">detail</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2241">
<div class="comment"><p>A human-readable string which is rendered less prominently on a separate line in places
where the task&#39;s name is displayed. Supports rendering of <a href="#ThemeIcon">theme icons</a>
via the <code>$(&lt;name&gt;)</code>-syntax.</p>
</div>
</div>



<a name="Task.execution"></a><span class="ts" id=2242 data-target="#details-2242" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">execution</span><span>?</span><span>: </span><a class="type-ref" href="#ProcessExecution">ProcessExecution</a> &#124; <a class="type-ref" href="#ShellExecution">ShellExecution</a> &#124; <a class="type-ref" href="#CustomExecution">CustomExecution</a></span>
<div class="details collapse" id="details-2242">
<div class="comment"><p>The task&#39;s execution engine</p>
</div>
</div>



<a name="Task.group"></a><span class="ts" id=2245 data-target="#details-2245" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">group</span><span>?</span><span>: </span><a class="type-ref" href="#TaskGroup">TaskGroup</a></span>
<div class="details collapse" id="details-2245">
<div class="comment"><p>The task group this tasks belongs to. See TaskGroup
for a predefined set of available groups.
Defaults to undefined meaning that the task doesn&#39;t
belong to any special group.</p>
</div>
</div>



<a name="Task.isBackground"></a><span class="ts" id=2243 data-target="#details-2243" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isBackground</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2243">
<div class="comment"><p>Whether the task is a background task or not.</p>
</div>
</div>



<a name="Task.name"></a><span class="ts" id=2240 data-target="#details-2240" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2240">
<div class="comment"><p>The task&#39;s name</p>
</div>
</div>



<a name="Task.presentationOptions"></a><span class="ts" id=2246 data-target="#details-2246" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">presentationOptions</span><span>: </span><a class="type-ref" href="#TaskPresentationOptions">TaskPresentationOptions</a></span>
<div class="details collapse" id="details-2246">
<div class="comment"><p>The presentation options. Defaults to an empty literal.</p>
</div>
</div>



<a name="Task.problemMatchers"></a><span class="ts" id=2247 data-target="#details-2247" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">problemMatchers</span><span>: </span><span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-2247">
<div class="comment"><p>The problem matchers attached to the task. Defaults to an empty
array.</p>
</div>
</div>



<a name="Task.runOptions"></a><span class="ts" id=2248 data-target="#details-2248" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">runOptions</span><span>: </span><a class="type-ref" href="#RunOptions">RunOptions</a></span>
<div class="details collapse" id="details-2248">
<div class="comment"><p>Run options for the task</p>
</div>
</div>



<a name="Task.scope"></a><span class="ts" id=2239 data-target="#details-2239" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">scope</span><span>: </span><a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a> &#124; <a class="type-ref" href="#Global">Global</a> &#124; <a class="type-ref" href="#Workspace">Workspace</a></span>
<div class="details collapse" id="details-2239">
<div class="comment"><p>The task&#39;s scope.</p>
</div>
</div>



<a name="Task.source"></a><span class="ts" id=2244 data-target="#details-2244" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">source</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2244">
<div class="comment"><p>A human-readable string describing the source of this shell task, e.g. &#39;gulp&#39;
or &#39;npm&#39;. Supports rendering of <a href="#ThemeIcon">theme icons</a> via the <code>$(&lt;name&gt;)</code>-syntax.</p>
</div>
</div>

### <a name="TaskDefinition"></a><span class="code-item" id=2153>TaskDefinition</span>



<div class="comment"><p>A structure that defines a task kind in the system.
The value must be JSON-stringifyable.</p>
</div>

#### Properties



<a name="TaskDefinition.type"></a><span class="ts" id=2154 data-target="#details-2154" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">type</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2154">
<div class="comment"><p>The task definition describing the task provided by an extension.
Usually a task provider defines more properties to identify
a task. They need to be defined in the package.json of the
extension under the &#39;taskDefinitions&#39; extension point. The npm
task definition for example looks like this</p>
<pre class="shiki" data-lang="typescript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">interface</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99"> NpmTaskDefinition</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> extends</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99"> TaskDefinition</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  script</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">string</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span>
<span class="line"></span></code></pre>
<p>Note that type identifier starting with a &#39;$&#39; are reserved for internal
usages and shouldn&#39;t be used by extensions.</p>
</div>
</div>

### <a name="TaskEndEvent"></a><span class="code-item" id=2264>TaskEndEvent</span>



<div class="comment"><p>An event signaling the end of an executed task.</p>
<p>This interface is not intended to be implemented.</p>
</div>

#### Properties



<a name="TaskEndEvent.execution"></a><span class="ts" id=2265 data-target="#details-2265" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">execution</span><span>: </span><a class="type-ref" href="#TaskExecution">TaskExecution</a></span>
<div class="details collapse" id="details-2265">
<div class="comment"><p>The task item representing the task that finished.</p>
</div>
</div>

### <a name="TaskExecution"></a><span class="code-item" id=2258>TaskExecution</span>



<div class="comment"><p>An object representing an executed Task. It can be used
to terminate a task.</p>
<p>This interface is not intended to be implemented.</p>
</div>

#### Properties



<a name="TaskExecution.task"></a><span class="ts" id=2259 data-target="#details-2259" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">task</span><span>: </span><a class="type-ref" href="#Task">Task</a></span>
<div class="details collapse" id="details-2259">
<div class="comment"><p>The task that got started.</p>
</div>
</div>

#### Methods



<a name="TaskExecution.terminate"></a><span class="ts" id=2261 data-target="#details-2261" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">terminate</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-2261">
<div class="comment"><p>Terminates the task execution.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TaskFilter"></a><span class="code-item" id=2272>TaskFilter</span>



<div class="comment"><p>A task filter denotes tasks by their version and types</p>
</div>

#### Properties



<a name="TaskFilter.type"></a><span class="ts" id=2274 data-target="#details-2274" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">type</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2274">
<div class="comment"><p>The task type to return;</p>
</div>
</div>



<a name="TaskFilter.version"></a><span class="ts" id=2273 data-target="#details-2273" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">version</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2273">
<div class="comment"><p>The task version as used in the tasks.json file.
The string support the package.json semver notation.</p>
</div>
</div>

### <a name="TaskGroup"></a><span class="code-item" id=2142>TaskGroup</span>



<div class="comment"><p>A grouping for tasks. The editor by default supports the
&#39;Clean&#39;, &#39;Build&#39;, &#39;RebuildAll&#39; and &#39;Test&#39; group.</p>
</div>

#### Static



<a name="TaskGroup.Build"></a><span class="ts" id=2144 data-target="#details-2144" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Build</span><span>: </span><a class="type-ref" href="#TaskGroup">TaskGroup</a></span>
<div class="details collapse" id="details-2144">
<div class="comment"><p>The build task group;</p>
</div>
</div>



<a name="TaskGroup.Clean"></a><span class="ts" id=2143 data-target="#details-2143" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Clean</span><span>: </span><a class="type-ref" href="#TaskGroup">TaskGroup</a></span>
<div class="details collapse" id="details-2143">
<div class="comment"><p>The clean task group;</p>
</div>
</div>



<a name="TaskGroup.Rebuild"></a><span class="ts" id=2145 data-target="#details-2145" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Rebuild</span><span>: </span><a class="type-ref" href="#TaskGroup">TaskGroup</a></span>
<div class="details collapse" id="details-2145">
<div class="comment"><p>The rebuild all task group;</p>
</div>
</div>



<a name="TaskGroup.Test"></a><span class="ts" id=2146 data-target="#details-2146" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Test</span><span>: </span><a class="type-ref" href="#TaskGroup">TaskGroup</a></span>
<div class="details collapse" id="details-2146">
<div class="comment"><p>The test all task group;</p>
</div>
</div>

#### Properties



<a name="TaskGroup.id"></a><span class="ts" id=2152 data-target="#details-2152" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2152">
<div class="comment"><p>The ID of the task group. Is one of TaskGroup.Clean.id, TaskGroup.Build.id, TaskGroup.Rebuild.id, or TaskGroup.Test.id.</p>
</div>
</div>



<a name="TaskGroup.isDefault"></a><span class="ts" id=2151 data-target="#details-2151" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isDefault</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2151">
<div class="comment"><p>Whether the task that is part of this group is the default for the group.
This property cannot be set through API, and is controlled by a user&#39;s task configurations.</p>
</div>
</div>

### <a name="TaskPanelKind"></a><span class="code-item" id=2130>TaskPanelKind</span>



<div class="comment"><p>Controls how the task channel is used between tasks</p>
</div>

#### Enumeration Members



<a name="TaskPanelKind.Shared"></a><span class="ts" id=2131 data-target="#details-2131" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Shared</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-2131">
<div class="comment"><p>Shares a panel with other tasks. This is the default.</p>
</div>
</div>



<a name="TaskPanelKind.Dedicated"></a><span class="ts" id=2132 data-target="#details-2132" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Dedicated</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-2132">
<div class="comment"><p>Uses a dedicated panel for this tasks. The panel is not
shared with other tasks.</p>
</div>
</div>



<a name="TaskPanelKind.New"></a><span class="ts" id=2133 data-target="#details-2133" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">New</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-2133">
<div class="comment"><p>Creates a new panel whenever this task is executed.</p>
</div>
</div>

### <a name="TaskPresentationOptions"></a><span class="code-item" id=2134>TaskPresentationOptions</span>



<div class="comment"><p>Controls how the task is presented in the UI.</p>
</div>

#### Properties



<a name="TaskPresentationOptions.clear"></a><span class="ts" id=2140 data-target="#details-2140" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">clear</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2140">
<div class="comment"><p>Controls whether the terminal is cleared before executing the task.</p>
</div>
</div>



<a name="TaskPresentationOptions.close"></a><span class="ts" id=2141 data-target="#details-2141" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">close</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2141">
<div class="comment"><p>Controls whether the terminal is closed after executing the task.</p>
</div>
</div>



<a name="TaskPresentationOptions.echo"></a><span class="ts" id=2136 data-target="#details-2136" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">echo</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2136">
<div class="comment"><p>Controls whether the command associated with the task is echoed
in the user interface.</p>
</div>
</div>



<a name="TaskPresentationOptions.focus"></a><span class="ts" id=2137 data-target="#details-2137" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">focus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2137">
<div class="comment"><p>Controls whether the panel showing the task output is taking focus.</p>
</div>
</div>



<a name="TaskPresentationOptions.panel"></a><span class="ts" id=2138 data-target="#details-2138" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">panel</span><span>?</span><span>: </span><a class="type-ref" href="#TaskPanelKind">TaskPanelKind</a></span>
<div class="details collapse" id="details-2138">
<div class="comment"><p>Controls if the task panel is used for this task only (dedicated),
shared between tasks (shared) or if a new panel is created on
every task execution (new). Defaults to <code>TaskInstanceKind.Shared</code></p>
</div>
</div>



<a name="TaskPresentationOptions.reveal"></a><span class="ts" id=2135 data-target="#details-2135" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">reveal</span><span>?</span><span>: </span><a class="type-ref" href="#TaskRevealKind">TaskRevealKind</a></span>
<div class="details collapse" id="details-2135">
<div class="comment"><p>Controls whether the task output is reveal in the user interface.
Defaults to <code>RevealKind.Always</code>.</p>
</div>
</div>



<a name="TaskPresentationOptions.showReuseMessage"></a><span class="ts" id=2139 data-target="#details-2139" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showReuseMessage</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2139">
<div class="comment"><p>Controls whether to show the &quot;Terminal will be reused by tasks, press any key to close it&quot; message.</p>
</div>
</div>

### <a name="TaskProcessEndEvent"></a><span class="code-item" id=2269>TaskProcessEndEvent</span>



<div class="comment"><p>An event signaling the end of a process execution
triggered through a task</p>
</div>

#### Properties



<a name="TaskProcessEndEvent.execution"></a><span class="ts" id=2270 data-target="#details-2270" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">execution</span><span>: </span><a class="type-ref" href="#TaskExecution">TaskExecution</a></span>
<div class="details collapse" id="details-2270">
<div class="comment"><p>The task execution for which the process got started.</p>
</div>
</div>



<a name="TaskProcessEndEvent.exitCode"></a><span class="ts" id=2271 data-target="#details-2271" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">exitCode</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-2271">
<div class="comment"><p>The process&#39;s exit code. Will be <code>undefined</code> when the task is terminated.</p>
</div>
</div>

### <a name="TaskProcessStartEvent"></a><span class="code-item" id=2266>TaskProcessStartEvent</span>



<div class="comment"><p>An event signaling the start of a process execution
triggered through a task</p>
</div>

#### Properties



<a name="TaskProcessStartEvent.execution"></a><span class="ts" id=2267 data-target="#details-2267" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">execution</span><span>: </span><a class="type-ref" href="#TaskExecution">TaskExecution</a></span>
<div class="details collapse" id="details-2267">
<div class="comment"><p>The task execution for which the process got started.</p>
</div>
</div>



<a name="TaskProcessStartEvent.processId"></a><span class="ts" id=2268 data-target="#details-2268" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">processId</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-2268">
<div class="comment"><p>The underlying process id.</p>
</div>
</div>

### <a name="TaskProvider"></a><span class="code-item" id=2249>TaskProvider&lt;T&gt;</span>



<div class="comment"><p>A task provider allows to add tasks to the task service.
A task provider is registered via <a href="#tasks.registerTaskProvider">tasks.registerTaskProvider</a>.</p>
</div>

#### Methods



<a name="TaskProvider.provideTasks"></a><span class="ts" id=2252 data-target="#details-2252" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideTasks</span><span>(</span><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-2252">
<div class="comment"><p>Provides tasks.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>an array of tasks</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TaskProvider.resolveTask"></a><span class="ts" id=2255 data-target="#details-2255" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveTask</span><span>(</span><span class="ident">task</span><span>: </span><span class="type-ref">T</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2255">
<div class="comment"><p>Resolves a task that has no <a href="#Task.execution">execution</a> set. Tasks are
often created from information found in the <code>tasks.json</code>-file. Such tasks miss
the information on how to execute them and a task provider must fill in
the missing information in the <code>resolveTask</code>-method. This method will not be
called for tasks returned from the above <code>provideTasks</code> method since those
tasks are always fully resolved. A valid default implementation for the
<code>resolveTask</code> method is to return <code>undefined</code>.</p>
<p>Note that when filling in the properties of <code>task</code>, you <em>must</em> be sure to
use the exact same <code>TaskDefinition</code> and not create a new one. Other properties
may be changed.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">task</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The task to resolve.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>The resolved task</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="TaskRevealKind"></a><span class="code-item" id=2126>TaskRevealKind</span>



<div class="comment"><p>Controls the behaviour of the terminal&#39;s visibility.</p>
</div>

#### Enumeration Members



<a name="TaskRevealKind.Always"></a><span class="ts" id=2127 data-target="#details-2127" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Always</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-2127">
<div class="comment"><p>Always brings the terminal to front if the task is executed.</p>
</div>
</div>



<a name="TaskRevealKind.Silent"></a><span class="ts" id=2128 data-target="#details-2128" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Silent</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-2128">
<div class="comment"><p>Only brings the terminal to front if a problem is detected executing the task
(e.g. the task couldn&#39;t be started because).</p>
</div>
</div>



<a name="TaskRevealKind.Never"></a><span class="ts" id=2129 data-target="#details-2129" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Never</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-2129">
<div class="comment"><p>The terminal never comes to front when the task is executed.</p>
</div>
</div>

### <a name="TaskScope"></a><span class="code-item" id=2218>TaskScope</span>



<div class="comment"><p>The scope of a task.</p>
</div>

#### Enumeration Members



<a name="TaskScope.Global"></a><span class="ts" id=2219 data-target="#details-2219" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Global</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-2219">
<div class="comment"><p>The task is a global task. Global tasks are currently not supported.</p>
</div>
</div>



<a name="TaskScope.Workspace"></a><span class="ts" id=2220 data-target="#details-2220" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Workspace</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-2220">
<div class="comment"><p>The task is a workspace task</p>
</div>
</div>

### <a name="TaskStartEvent"></a><span class="code-item" id=2262>TaskStartEvent</span>



<div class="comment"><p>An event signaling the start of a task execution.</p>
<p>This interface is not intended to be implemented.</p>
</div>

#### Properties



<a name="TaskStartEvent.execution"></a><span class="ts" id=2263 data-target="#details-2263" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">execution</span><span>: </span><a class="type-ref" href="#TaskExecution">TaskExecution</a></span>
<div class="details collapse" id="details-2263">
<div class="comment"><p>The task item representing the task that got started.</p>
</div>
</div>

### <a name="TelemetryLogger"></a><span class="code-item" id=4746>TelemetryLogger</span>



<div class="comment"><p>A telemetry logger which can be used by extensions to log usage and error telemetry.</p>
<p>A logger wraps around an <a href="#TelemetrySender">sender</a> but it guarantees that</p>
<ul>
<li>user settings to disable or tweak telemetry are respected, and that</li>
<li>potential sensitive data is removed</li>
</ul>
<p>It also enables an &quot;echo UI&quot; that prints whatever data is send and it allows the editor
to forward unhandled errors to the respective extensions.</p>
<p>To get an instance of a <code>TelemetryLogger</code>, use
<a href="#env.createTelemetryLogger"><code>createTelemetryLogger</code></a>.</p>
</div>

#### Events



<a name="TelemetryLogger.onDidChangeEnableStates"></a><span class="ts" id=4747 data-target="#details-4747" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeEnableStates</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TelemetryLogger">TelemetryLogger</a>&gt;</span>
<div class="details collapse" id="details-4747">
<div class="comment"><p>An <a href="#Event">Event</a> which fires when the enablement state of usage or error telemetry changes.</p>
</div>
</div>

#### Properties



<a name="TelemetryLogger.isErrorsEnabled"></a><span class="ts" id=4749 data-target="#details-4749" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isErrorsEnabled</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4749">
<div class="comment"><p>Whether or not error telemetry is enabled for this logger.</p>
</div>
</div>



<a name="TelemetryLogger.isUsageEnabled"></a><span class="ts" id=4748 data-target="#details-4748" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isUsageEnabled</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4748">
<div class="comment"><p>Whether or not usage telemetry is enabled for this logger.</p>
</div>
</div>

#### Methods



<a name="TelemetryLogger.dispose"></a><span class="ts" id=4762 data-target="#details-4762" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4762">
<div class="comment"><p>Dispose this object and free resources.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TelemetryLogger.logError"></a><span class="ts" id=4755 data-target="#details-4755" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">logError</span><span>(</span><span class="ident">eventName</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">data</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">any</span> &#124; <a class="type-ref" href="#TelemetryTrustedValue&amp;lt;T&amp;gt;">TelemetryTrustedValue</a>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4755">
<div class="comment"><p>Log an error event.</p>
<p>After completing cleaning, telemetry setting checks, and data mix-in calls <code>TelemetrySender.sendEventData</code> to log the event. Differs from <code>logUsage</code> in that it will log the event if the telemetry setting is Error+.
Automatically supports echoing to extension telemetry output channel.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">eventName</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The event name to log</p>
</div></td></tr>
<tr><td><span class="ident">data</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">any</span> &#124; <a class="type-ref" href="#TelemetryTrustedValue&amp;lt;T&amp;gt;">TelemetryTrustedValue</a>&gt;</td><td><div class="comment"><p>The data to log</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TelemetryLogger.logError"></a><span class="ts" id=4758 data-target="#details-4758" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">logError</span><span>(</span><span class="ident">error</span><span>: </span><span class="type-ref-ts">Error</span>, <span class="ident">data</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">any</span> &#124; <a class="type-ref" href="#TelemetryTrustedValue&amp;lt;T&amp;gt;">TelemetryTrustedValue</a>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4758">
<div class="comment"><p>Log an error event.</p>
<p>Calls <code>TelemetrySender.sendErrorData</code>. Does cleaning, telemetry checks, and data mix-in.
Automatically supports echoing to extension telemetry output channel.
Will also automatically log any exceptions thrown within the extension host process.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">error</span><span>: </span><span class="type-ref-ts">Error</span></td><td><div class="comment"><p>The error object which contains the stack trace cleaned of PII</p>
</div></td></tr>
<tr><td><span class="ident">data</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">any</span> &#124; <a class="type-ref" href="#TelemetryTrustedValue&amp;lt;T&amp;gt;">TelemetryTrustedValue</a>&gt;</td><td><div class="comment"><p>Additional data to log alongside the stack trace</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TelemetryLogger.logUsage"></a><span class="ts" id=4751 data-target="#details-4751" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">logUsage</span><span>(</span><span class="ident">eventName</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">data</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">any</span> &#124; <a class="type-ref" href="#TelemetryTrustedValue&amp;lt;T&amp;gt;">TelemetryTrustedValue</a>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4751">
<div class="comment"><p>Log a usage event.</p>
<p>After completing cleaning, telemetry setting checks, and data mix-in calls <code>TelemetrySender.sendEventData</code> to log the event.
Automatically supports echoing to extension telemetry output channel.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">eventName</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The event name to log</p>
</div></td></tr>
<tr><td><span class="ident">data</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">any</span> &#124; <a class="type-ref" href="#TelemetryTrustedValue&amp;lt;T&amp;gt;">TelemetryTrustedValue</a>&gt;</td><td><div class="comment"><p>The data to log</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TelemetryLoggerOptions"></a><span class="code-item" id=4774>TelemetryLoggerOptions</span>



<div class="comment"><p>Options for creating a <a href="#TelemetryLogger">TelemetryLogger</a></p>
</div>

#### Properties



<a name="TelemetryLoggerOptions.additionalCommonProperties"></a><span class="ts" id=4777 data-target="#details-4777" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">additionalCommonProperties</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">any</span>&gt;</span>
<div class="details collapse" id="details-4777">
<div class="comment"><p>Any additional common properties which should be injected into the data object.</p>
</div>
</div>



<a name="TelemetryLoggerOptions.ignoreBuiltInCommonProperties"></a><span class="ts" id=4775 data-target="#details-4775" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ignoreBuiltInCommonProperties</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4775">
<div class="comment"><p>Whether or not you want to avoid having the built-in common properties such as os, extension name, etc injected into the data object.
Defaults to <code>false</code> if not defined.</p>
</div>
</div>



<a name="TelemetryLoggerOptions.ignoreUnhandledErrors"></a><span class="ts" id=4776 data-target="#details-4776" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ignoreUnhandledErrors</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4776">
<div class="comment"><p>Whether or not unhandled errors on the extension host caused by your extension should be logged to your sender.
Defaults to <code>false</code> if not defined.</p>
</div>
</div>

### <a name="TelemetrySender"></a><span class="code-item" id=4763>TelemetrySender</span>



<div class="comment"><p>The telemetry sender is the contract between a telemetry logger and some telemetry service. <strong>Note</strong> that extensions must NOT
call the methods of their sender directly as the logger provides extra guards and cleaning.</p>
<pre class="shiki" data-lang="js" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> sender</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">TelemetrySender</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = {...};</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> logger</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">env</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createTelemetryLogger</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">sender</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// GOOD - uses the logger</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">logger</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">logUsage</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'myEvent'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, { </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">myData:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'myValue'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// BAD - uses the sender directly: no data cleansing, ignores user settings, no echoing to the telemetry output channel etc</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">sender</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">logEvent</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'myEvent'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, { </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">myData:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'myValue'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span></code></pre>
</div>

#### Methods



<a name="TelemetrySender.flush"></a><span class="ts" id=4773 data-target="#details-4773" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">flush</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-4773">
<div class="comment"><p>Optional flush function which will give this sender a chance to send any remaining events
as its <a href="#TelemetryLogger">TelemetryLogger</a> is being disposed</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TelemetrySender.sendErrorData"></a><span class="ts" id=4769 data-target="#details-4769" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">sendErrorData</span><span>(</span><span class="ident">error</span><span>: </span><span class="type-ref-ts">Error</span>, <span class="ident">data</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">any</span>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4769">
<div class="comment"><p>Function to send an error. Used within a <a href="#TelemetryLogger">TelemetryLogger</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">error</span><span>: </span><span class="type-ref-ts">Error</span></td><td><div class="comment"><p>The error being logged</p>
</div></td></tr>
<tr><td><span class="ident">data</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">any</span>&gt;</td><td><div class="comment"><p>Any additional data to be collected with the exception</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TelemetrySender.sendEventData"></a><span class="ts" id=4765 data-target="#details-4765" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">sendEventData</span><span>(</span><span class="ident">eventName</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">data</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">any</span>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4765">
<div class="comment"><p>Function to send event data without a stacktrace. Used within a <a href="#TelemetryLogger">TelemetryLogger</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">eventName</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The name of the event which you are logging</p>
</div></td></tr>
<tr><td><span class="ident">data</span><span>?</span><span>: </span><span class="type-ref-ts">Record</span>&lt;<span class="type-intrinsic">string</span>, <span class="type-intrinsic">any</span>&gt;</td><td><div class="comment"><p>A serializable key value pair that is being logged</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TelemetryTrustedValue"></a><span class="code-item" id=4739>TelemetryTrustedValue&lt;T&gt;</span>



<div class="comment"><p>A special value wrapper denoting a value that is safe to not clean.
This is to be used when you can guarantee no identifiable information is contained in the value and the cleaning is improperly redacting it.</p>
</div>

#### Constructors



<a name="TelemetryTrustedValue.TelemetryTrustedValue"></a><span class="ts" id=4742 data-target="#details-4742" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TelemetryTrustedValue</span><span>&lt;</span>T<span>&gt;</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-ref">T</span><span>)</span><span>: </span><a class="type-ref" href="#TelemetryTrustedValue&amp;lt;T&amp;gt;">TelemetryTrustedValue</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-4742">
<div class="comment"><p>Creates a new telemetry trusted value.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>A value to trust</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TelemetryTrustedValue&amp;lt;T&amp;gt;">TelemetryTrustedValue</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TelemetryTrustedValue.value"></a><span class="ts" id=4745 data-target="#details-4745" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-ref">T</span></span>
<div class="details collapse" id="details-4745">
<div class="comment"><p>The value that is trusted to not contain PII.</p>
</div>
</div>

### <a name="Terminal"></a><span class="code-item" id=1935>Terminal</span>



<div class="comment"><p>An individual terminal instance within the integrated terminal.</p>
</div>

#### Properties



<a name="Terminal.creationOptions"></a><span class="ts" id=1938 data-target="#details-1938" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">creationOptions</span><span>: </span><span class="type-ref-ts">Readonly</span>&lt;<a class="type-ref" href="#TerminalOptions">TerminalOptions</a> &#124; <a class="type-ref" href="#ExtensionTerminalOptions">ExtensionTerminalOptions</a>&gt;</span>
<div class="details collapse" id="details-1938">
<div class="comment"><p>The object used to initialize the terminal, this is useful for example to detecting the
shell type of when the terminal was not launched by this extension or for detecting what
folder the shell was launched in.</p>
</div>
</div>



<a name="Terminal.exitStatus"></a><span class="ts" id=1939 data-target="#details-1939" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">exitStatus</span><span>: </span><a class="type-ref" href="#TerminalExitStatus">TerminalExitStatus</a></span>
<div class="details collapse" id="details-1939">
<div class="comment"><p>The exit status of the terminal, this will be undefined while the terminal is active.</p>
<p><strong>Example:</strong> Show a notification with the exit code when the terminal exits with a
non-zero exit code.</p>
<pre class="shiki" data-lang="typescript" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onDidCloseTerminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">t</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">  if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">t</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">exitStatus</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> &#x26;&#x26; </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">t</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">exitStatus</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">code</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">    vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">showInformationMessage</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`Exit code: </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">${</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">t</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">exitStatus</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">code</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">}</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"></span></code></pre>
</div>
</div>



<a name="Terminal.name"></a><span class="ts" id=1936 data-target="#details-1936" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1936">
<div class="comment"><p>The name of the terminal.</p>
</div>
</div>



<a name="Terminal.processId"></a><span class="ts" id=1937 data-target="#details-1937" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">processId</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">number</span>&gt;</span>
<div class="details collapse" id="details-1937">
<div class="comment"><p>The process ID of the shell process.</p>
</div>
</div>



<a name="Terminal.shellIntegration"></a><span class="ts" id=1941 data-target="#details-1941" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">shellIntegration</span><span>: </span><a class="type-ref" href="#TerminalShellIntegration">TerminalShellIntegration</a></span>
<div class="details collapse" id="details-1941">
<div class="comment"><p>An object that contains <a href="https://code.visualstudio.com/docs/terminal/shell-integration">shell integration</a>-powered
features for the terminal. This will always be <code>undefined</code> immediately after the terminal
is created. Listen to <a href="#window.onDidChangeTerminalShellIntegration">window.onDidChangeTerminalShellIntegration</a> to be notified
when shell integration is activated for a terminal.</p>
<p>Note that this object may remain undefined if shell integration never activates. For
example Command Prompt does not support shell integration and a user&#39;s shell setup could
conflict with the automatic shell integration activation.</p>
</div>
</div>



<a name="Terminal.state"></a><span class="ts" id=1940 data-target="#details-1940" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">state</span><span>: </span><a class="type-ref" href="#TerminalState">TerminalState</a></span>
<div class="details collapse" id="details-1940">
<div class="comment"><p>The current state of the <a href="#Terminal">Terminal</a>.</p>
</div>
</div>

#### Methods



<a name="Terminal.dispose"></a><span class="ts" id=1952 data-target="#details-1952" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1952">
<div class="comment"><p>Dispose and free associated resources.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="Terminal.hide"></a><span class="ts" id=1950 data-target="#details-1950" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hide</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1950">
<div class="comment"><p>Hide the terminal panel if this terminal is currently showing.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="Terminal.sendText"></a><span class="ts" id=1943 data-target="#details-1943" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">sendText</span><span>(</span><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">shouldExecute</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1943">
<div class="comment"><p>Send text to the terminal. The text is written to the stdin of the underlying pty process
(shell) of the terminal.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The text to send.</p>
</div></td></tr>
<tr><td><span class="ident">shouldExecute</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Indicates that the text being sent should be executed rather than just inserted in the terminal.
The character(s) added are <code>\n</code> or <code>\r\n</code>, depending on the platform. This defaults to <code>true</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="Terminal.show"></a><span class="ts" id=1947 data-target="#details-1947" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">show</span><span>(</span><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1947">
<div class="comment"><p>Show the terminal panel and reveal this terminal in the UI.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>When <code>true</code> the terminal will not take focus.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TerminalDimensions"></a><span class="code-item" id=3081>TerminalDimensions</span>



<div class="comment"><p>Represents the dimensions of a terminal.</p>
</div>

#### Properties



<a name="TerminalDimensions.columns"></a><span class="ts" id=3082 data-target="#details-3082" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">columns</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3082">
<div class="comment"><p>The number of columns in the terminal.</p>
</div>
</div>



<a name="TerminalDimensions.rows"></a><span class="ts" id=3083 data-target="#details-3083" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">rows</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3083">
<div class="comment"><p>The number of rows in the terminal.</p>
</div>
</div>

### <a name="TerminalEditorLocationOptions"></a><span class="code-item" id=1956>TerminalEditorLocationOptions</span>



<div class="comment"><p>Assumes a <a href="#TerminalLocation">TerminalLocation</a> of editor and allows specifying a <a href="#ViewColumn">ViewColumn</a> and
<a href="#TerminalEditorLocationOptions.preserveFocus">preserveFocus </a> property</p>
</div>

#### Properties



<a name="TerminalEditorLocationOptions.preserveFocus"></a><span class="ts" id=1958 data-target="#details-1958" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1958">
<div class="comment"><p>An optional flag that when <code>true</code> will stop the <a href="#Terminal">Terminal</a> from taking focus.</p>
</div>
</div>



<a name="TerminalEditorLocationOptions.viewColumn"></a><span class="ts" id=1957 data-target="#details-1957" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">viewColumn</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a></span>
<div class="details collapse" id="details-1957">
<div class="comment"><p>A view column in which the <a href="#Terminal">terminal</a> should be shown in the editor area.
The default is the <a href="#ViewColumn.Active">active</a>. Columns that do not exist
will be created as needed up to the maximum of <a href="#ViewColumn.Nine">ViewColumn.Nine</a>.
Use <a href="#ViewColumn.Beside">ViewColumn.Beside</a> to open the editor to the side of the currently
active one.</p>
</div>
</div>

### <a name="TerminalExitReason"></a><span class="code-item" id=3087>TerminalExitReason</span>



<div class="comment"><p>Terminal exit reason kind.</p>
</div>

#### Enumeration Members



<a name="TerminalExitReason.Unknown"></a><span class="ts" id=3088 data-target="#details-3088" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Unknown</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-3088">
<div class="comment"><p>Unknown reason.</p>
</div>
</div>



<a name="TerminalExitReason.Shutdown"></a><span class="ts" id=3089 data-target="#details-3089" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Shutdown</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-3089">
<div class="comment"><p>The window closed/reloaded.</p>
</div>
</div>



<a name="TerminalExitReason.Process"></a><span class="ts" id=3090 data-target="#details-3090" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Process</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-3090">
<div class="comment"><p>The shell process exited.</p>
</div>
</div>



<a name="TerminalExitReason.User"></a><span class="ts" id=3091 data-target="#details-3091" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">User</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-3091">
<div class="comment"><p>The user closed the terminal.</p>
</div>
</div>



<a name="TerminalExitReason.Extension"></a><span class="ts" id=3092 data-target="#details-3092" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Extension</span><span>: </span><span class="type-literal">4</span></span>
<div class="details collapse" id="details-3092">
<div class="comment"><p>An extension disposed the terminal.</p>
</div>
</div>

### <a name="TerminalExitStatus"></a><span class="code-item" id=3084>TerminalExitStatus</span>



<div class="comment"><p>Represents how a terminal exited.</p>
</div>

#### Properties



<a name="TerminalExitStatus.code"></a><span class="ts" id=3085 data-target="#details-3085" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">code</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3085">
<div class="comment"><p>The exit code that a terminal exited with, it can have the following values:</p>
<ul>
<li>Zero: the terminal process or custom execution succeeded.</li>
<li>Non-zero: the terminal process or custom execution failed.</li>
<li><code>undefined</code>: the user forcibly closed the terminal or a custom execution exited
without providing an exit code.</li>
</ul>
</div>
</div>



<a name="TerminalExitStatus.reason"></a><span class="ts" id=3086 data-target="#details-3086" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">reason</span><span>: </span><a class="type-ref" href="#TerminalExitReason">TerminalExitReason</a></span>
<div class="details collapse" id="details-3086">
<div class="comment"><p>The reason that triggered the exit of a terminal.</p>
</div>
</div>

### <a name="TerminalLink"></a><span class="code-item" id=2009>TerminalLink</span>



<div class="comment"><p>A link on a terminal line.</p>
</div>

#### Constructors



<a name="TerminalLink.TerminalLink"></a><span class="ts" id=2011 data-target="#details-2011" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TerminalLink</span><span>(</span><span class="ident">startIndex</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">length</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#TerminalLink">TerminalLink</a></span>
<div class="details collapse" id="details-2011">
<div class="comment"><p>Creates a new terminal link.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">startIndex</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The start index of the link on <a href="#TerminalLinkContext.line">TerminalLinkContext.line</a>.</p>
</div></td></tr>
<tr><td><span class="ident">length</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>The length of the link on <a href="#TerminalLinkContext.line">TerminalLinkContext.line</a>.</p>
</div></td></tr>
<tr><td><span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The tooltip text when you hover over this link.</p>
<p>If a tooltip is provided, is will be displayed in a string that includes instructions on
how to trigger the link, such as <code>{0} (ctrl + click)</code>. The specific instructions vary
depending on OS, user settings, and localization.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TerminalLink">TerminalLink</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TerminalLink.length"></a><span class="ts" id=2016 data-target="#details-2016" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">length</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-2016">
<div class="comment"><p>The length of the link on <a href="#TerminalLinkContext.line">TerminalLinkContext.line</a>.</p>
</div>
</div>



<a name="TerminalLink.startIndex"></a><span class="ts" id=2015 data-target="#details-2015" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">startIndex</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-2015">
<div class="comment"><p>The start index of the link on <a href="#TerminalLinkContext.line">TerminalLinkContext.line</a>.</p>
</div>
</div>



<a name="TerminalLink.tooltip"></a><span class="ts" id=2017 data-target="#details-2017" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2017">
<div class="comment"><p>The tooltip text when you hover over this link.</p>
<p>If a tooltip is provided, is will be displayed in a string that includes instructions on
how to trigger the link, such as <code>{0} (ctrl + click)</code>. The specific instructions vary
depending on OS, user settings, and localization.</p>
</div>
</div>

### <a name="TerminalLinkContext"></a><span class="code-item" id=1997>TerminalLinkContext</span>



<div class="comment"><p>Provides information on a line in a terminal in order to provide links for it.</p>
</div>

#### Properties



<a name="TerminalLinkContext.line"></a><span class="ts" id=1998 data-target="#details-1998" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">line</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1998">
<div class="comment"><p>This is the text from the unwrapped line in the terminal.</p>
</div>
</div>



<a name="TerminalLinkContext.terminal"></a><span class="ts" id=1999 data-target="#details-1999" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">terminal</span><span>: </span><a class="type-ref" href="#Terminal">Terminal</a></span>
<div class="details collapse" id="details-1999">
<div class="comment"><p>The terminal the link belongs to.</p>
</div>
</div>

### <a name="TerminalLinkProvider"></a><span class="code-item" id=2000>TerminalLinkProvider&lt;T&gt;</span>



<div class="comment"><p>A provider that enables detection and handling of links within terminals.</p>
</div>

#### Methods



<a name="TerminalLinkProvider.handleTerminalLink"></a><span class="ts" id=2007 data-target="#details-2007" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">handleTerminalLink</span><span>(</span><span class="ident">link</span><span>: </span><span class="type-ref">T</span><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2007">
<div class="comment"><p>Handle an activated terminal link.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">link</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The link to handle.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TerminalLinkProvider.provideTerminalLinks"></a><span class="ts" id=2003 data-target="#details-2003" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideTerminalLinks</span><span>(</span><span class="ident">context</span><span>: </span><a class="type-ref" href="#TerminalLinkContext">TerminalLinkContext</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-2003">
<div class="comment"><p>Provide terminal links for the given context. Note that this can be called multiple times
even before previous calls resolve, make sure to not share global objects (eg. <code>RegExp</code>)
that could have problems when asynchronous usage may overlap.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">context</span><span>: </span><a class="type-ref" href="#TerminalLinkContext">TerminalLinkContext</a></td><td><div class="comment"><p>Information about what links are being provided for.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>A list of terminal links for the given line.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="TerminalLocation"></a><span class="code-item" id=1953>TerminalLocation</span>



<div class="comment"><p>The location of the terminal.</p>
</div>

#### Enumeration Members



<a name="TerminalLocation.Panel"></a><span class="ts" id=1954 data-target="#details-1954" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Panel</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1954">
<div class="comment"><p>In the terminal view</p>
</div>
</div>



<a name="TerminalLocation.Editor"></a><span class="ts" id=1955 data-target="#details-1955" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Editor</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1955">
<div class="comment"><p>In the editor area</p>
</div>
</div>

### <a name="TerminalOptions"></a><span class="code-item" id=3040>TerminalOptions</span>



<div class="comment"><p>Value-object describing what options a terminal should use.</p>
</div>

#### Properties



<a name="TerminalOptions.color"></a><span class="ts" id=3053 data-target="#details-3053" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">color</span><span>?</span><span>: </span><a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-3053">
<div class="comment"><p>The icon <a href="#ThemeColor">ThemeColor</a> for the terminal.
The <code>terminal.ansi*</code> theme keys are
recommended for the best contrast and consistency across themes.</p>
</div>
</div>



<a name="TerminalOptions.cwd"></a><span class="ts" id=3044 data-target="#details-3044" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cwd</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-3044">
<div class="comment"><p>A path or Uri for the current working directory to be used for the terminal.</p>
</div>
</div>



<a name="TerminalOptions.env"></a><span class="ts" id=3045 data-target="#details-3045" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">env</span><span>?</span><span>: </span></span>
<div class="details collapse" id="details-3045">
<div class="comment"><p>Object with environment variables that will be added to the editor process.</p>
</div>
</div>



<a name="TerminalOptions.hideFromUser"></a><span class="ts" id=3050 data-target="#details-3050" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hideFromUser</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3050">
<div class="comment"><p>When enabled the terminal will run the process as normal but not be surfaced to the user
until <code>Terminal.show</code> is called. The typical usage for this is when you need to run
something that may need interactivity but only want to tell the user about it when
interaction is needed. Note that the terminals will still be exposed to all extensions
as normal. The hidden terminals will not be restored when the workspace is next opened.</p>
</div>
</div>



<a name="TerminalOptions.iconPath"></a><span class="ts" id=3052 data-target="#details-3052" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">iconPath</span><span>?</span><span>: </span><a class="type-ref" href="#IconPath">IconPath</a></span>
<div class="details collapse" id="details-3052">
<div class="comment"><p>The icon path or <a href="#ThemeIcon">ThemeIcon</a> for the terminal.</p>
</div>
</div>



<a name="TerminalOptions.isTransient"></a><span class="ts" id=3055 data-target="#details-3055" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isTransient</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3055">
<div class="comment"><p>Opt-out of the default terminal persistence on restart and reload.
This will only take effect when <code>terminal.integrated.enablePersistentSessions</code> is enabled.</p>
</div>
</div>



<a name="TerminalOptions.location"></a><span class="ts" id=3054 data-target="#details-3054" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">location</span><span>?</span><span>: </span><a class="type-ref" href="#TerminalEditorLocationOptions">TerminalEditorLocationOptions</a> &#124; <a class="type-ref" href="#TerminalSplitLocationOptions">TerminalSplitLocationOptions</a> &#124; <a class="type-ref" href="#TerminalLocation">TerminalLocation</a></span>
<div class="details collapse" id="details-3054">
<div class="comment"><p>The <a href="#TerminalLocation">TerminalLocation</a> or <a href="#TerminalEditorLocationOptions">TerminalEditorLocationOptions</a> or <a href="#TerminalSplitLocationOptions">TerminalSplitLocationOptions</a> for the terminal.</p>
</div>
</div>



<a name="TerminalOptions.message"></a><span class="ts" id=3051 data-target="#details-3051" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">message</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3051">
<div class="comment"><p>A message to write to the terminal on first launch, note that this is not sent to the
process but, rather written directly to the terminal. This supports escape sequences such
a setting text style.</p>
</div>
</div>



<a name="TerminalOptions.name"></a><span class="ts" id=3041 data-target="#details-3041" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3041">
<div class="comment"><p>A human-readable string which will be used to represent the terminal in the UI.</p>
</div>
</div>



<a name="TerminalOptions.shellArgs"></a><span class="ts" id=3043 data-target="#details-3043" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">shellArgs</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-3043">
<div class="comment"><p>Args for the custom shell executable. A string can be used on Windows only which allows
specifying shell args in <a href="https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6">command-line format</a>.</p>
</div>
</div>



<a name="TerminalOptions.shellIntegrationNonce"></a><span class="ts" id=3056 data-target="#details-3056" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">shellIntegrationNonce</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3056">
<div class="comment"><p>The nonce to use to verify shell integration sequences are coming from a trusted source.
An example impact of UX of this is if the command line is reported with a nonce, it will
not need to verify with the user that the command line is correct before rerunning it
via the <a href="https://code.visualstudio.com/docs/terminal/shell-integration#_command-decorations-and-the-overview-ruler">shell integration command decoration</a>.</p>
<p>This should be used if the terminal includes <a href="https://code.visualstudio.com/docs/terminal/shell-integration#_supported-escape-sequences">custom shell integration support</a>.
It should be set to a random GUID which will then set the <code>VSCODE_NONCE</code> environment
variable. Inside the shell, this should then be removed from the environment so as to
protect it from general access. Once that is done it can be passed through in the
relevant sequences to make them trusted.</p>
</div>
</div>



<a name="TerminalOptions.shellPath"></a><span class="ts" id=3042 data-target="#details-3042" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">shellPath</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3042">
<div class="comment"><p>A path to a custom shell executable to be used in the terminal.</p>
</div>
</div>



<a name="TerminalOptions.strictEnv"></a><span class="ts" id=3049 data-target="#details-3049" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">strictEnv</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3049">
<div class="comment"><p>Whether the terminal process environment should be exactly as provided in
<code>TerminalOptions.env</code>. When this is false (default), the environment will be based on the
window&#39;s environment and also apply configured platform settings like
<code>terminal.integrated.env.windows</code> on top. When this is true, the complete environment
must be provided as nothing will be inherited from the process or any configuration.</p>
</div>
</div>

### <a name="TerminalProfile"></a><span class="code-item" id=2022>TerminalProfile</span>



<div class="comment"><p>A terminal profile defines how a terminal will be launched.</p>
</div>

#### Constructors



<a name="TerminalProfile.TerminalProfile"></a><span class="ts" id=2024 data-target="#details-2024" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TerminalProfile</span><span>(</span><span class="ident">options</span><span>: </span><a class="type-ref" href="#TerminalOptions">TerminalOptions</a> &#124; <a class="type-ref" href="#ExtensionTerminalOptions">ExtensionTerminalOptions</a><span>)</span><span>: </span><a class="type-ref" href="#TerminalProfile">TerminalProfile</a></span>
<div class="details collapse" id="details-2024">
<div class="comment"><p>Creates a new terminal profile.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">options</span><span>: </span><a class="type-ref" href="#TerminalOptions">TerminalOptions</a> &#124; <a class="type-ref" href="#ExtensionTerminalOptions">ExtensionTerminalOptions</a></td><td><div class="comment"><p>The options that the terminal will launch with.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TerminalProfile">TerminalProfile</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TerminalProfile.options"></a><span class="ts" id=2026 data-target="#details-2026" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">options</span><span>: </span><a class="type-ref" href="#TerminalOptions">TerminalOptions</a> &#124; <a class="type-ref" href="#ExtensionTerminalOptions">ExtensionTerminalOptions</a></span>
<div class="details collapse" id="details-2026">
<div class="comment"><p>The options that the terminal will launch with.</p>
</div>
</div>

### <a name="TerminalProfileProvider"></a><span class="code-item" id=2018>TerminalProfileProvider</span>



<div class="comment"><p>Provides a terminal profile for the contributed terminal profile when launched via the UI or
command.</p>
</div>

#### Methods



<a name="TerminalProfileProvider.provideTerminalProfile"></a><span class="ts" id=2020 data-target="#details-2020" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideTerminalProfile</span><span>(</span><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TerminalProfile">TerminalProfile</a>&gt;</span>
<div class="details collapse" id="details-2020">
<div class="comment"><p>Provide the terminal profile.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token that indicates the result is no longer needed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TerminalProfile">TerminalProfile</a>&gt;</td><td><div class="comment"><p>The terminal profile.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="TerminalShellExecution"></a><span class="code-item" id=1972>TerminalShellExecution</span>



<div class="comment"><p>A command that was executed in a terminal.</p>
</div>

#### Properties



<a name="TerminalShellExecution.commandLine"></a><span class="ts" id=1973 data-target="#details-1973" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">commandLine</span><span>: </span><a class="type-ref" href="#TerminalShellExecutionCommandLine">TerminalShellExecutionCommandLine</a></span>
<div class="details collapse" id="details-1973">
<div class="comment"><p>The command line that was executed. The <a href="#TerminalShellExecutionCommandLineConfidence">confidence</a>
of this value depends on the specific shell&#39;s shell integration implementation. This
value may become more accurate after <a href="#window.onDidEndTerminalShellExecution">window.onDidEndTerminalShellExecution</a> is
fired.</p>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Log the details of the command line on start and end</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onDidStartTerminalShellExecution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">  const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">execution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`Command started</span><span style="--shiki-dark:#D7BA7D;--shiki-light:#EE0000">\n</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">${</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">summarizeCommandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">)</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">}</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onDidEndTerminalShellExecution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">  const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">execution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`Command ended</span><span style="--shiki-dark:#D7BA7D;--shiki-light:#EE0000">\n</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">${</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">summarizeCommandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">)</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">}</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">function</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26"> summarizeCommandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#4EC9B0;--shiki-light:#267F99">TerminalShellExecutionCommandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">  return</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> [</span></span>
<span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">    `  Command line: </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">${</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">command</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">value</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">}</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">    `  Confidence: </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">${</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">command</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">confidence</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">}</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">    `  Trusted: </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">${</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">command</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">isTrusted</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">}</span></span>
<span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">  ].join('</span><span style="--shiki-dark:#D7BA7D;--shiki-light:#EE0000">\n</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">');</span></span>
<span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">}</span></span></code></pre>
</div>
</div>



<a name="TerminalShellExecution.cwd"></a><span class="ts" id=1974 data-target="#details-1974" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cwd</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-1974">
<div class="comment"><p>The working directory that was reported by the shell when this command executed. This
<a href="#Uri">Uri</a> may represent a file on another machine (eg. ssh into another machine). This
requires the shell integration to support working directory reporting.</p>
</div>
</div>

#### Methods



<a name="TerminalShellExecution.read"></a><span class="ts" id=1976 data-target="#details-1976" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">read</span><span>(</span><span>)</span><span>: </span><span class="type-ref-ts">AsyncIterable</span>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-1976">
<div class="comment"><p>Creates a stream of raw data (including escape sequences) that is written to the
terminal. This will only include data that was written after <code>read</code> was called for
the first time, ie. you must call <code>read</code> immediately after the command is executed via
<a href="#TerminalShellIntegration.executeCommand">TerminalShellIntegration.executeCommand</a> or
<a href="#window.onDidStartTerminalShellExecution">window.onDidStartTerminalShellExecution</a> to not miss any data.</p>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Log all data written to the terminal for a command</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> command</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">term</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">shellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">executeCommand</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commandLine:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'echo "Hello world"'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> stream</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">command</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">read</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">();</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">for</span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB"> await</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> data</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> of</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> stream</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">data</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref-ts">AsyncIterable</span>&lt;<span class="type-intrinsic">string</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TerminalShellExecutionCommandLine"></a><span class="code-item" id=1977>TerminalShellExecutionCommandLine</span>



<div class="comment"><p>A command line that was executed in a terminal.</p>
</div>

#### Properties



<a name="TerminalShellExecutionCommandLine.confidence"></a><span class="ts" id=1980 data-target="#details-1980" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">confidence</span><span>: </span><a class="type-ref" href="#TerminalShellExecutionCommandLineConfidence">TerminalShellExecutionCommandLineConfidence</a></span>
<div class="details collapse" id="details-1980">
<div class="comment"><p>The confidence of the command line value which is determined by how the value was
obtained. This depends upon the implementation of the shell integration script.</p>
</div>
</div>



<a name="TerminalShellExecutionCommandLine.isTrusted"></a><span class="ts" id=1979 data-target="#details-1979" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isTrusted</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1979">
<div class="comment"><p>Whether the command line value came from a trusted source and is therefore safe to
execute without user additional confirmation, such as a notification that asks &quot;Do you
want to execute (command)?&quot;. This verification is likely only needed if you are going to
execute the command again.</p>
<p>This is <code>true</code> only when the command line was reported explicitly by the shell
integration script (ie. <a href="#TerminalShellExecutionCommandLineConfidence.High">high confidence</a>)
and it used a nonce for verification.</p>
</div>
</div>



<a name="TerminalShellExecutionCommandLine.value"></a><span class="ts" id=1978 data-target="#details-1978" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1978">
<div class="comment"><p>The full command line that was executed, including both the command and its arguments.</p>
</div>
</div>

### <a name="TerminalShellExecutionCommandLineConfidence"></a><span class="code-item" id=1981>TerminalShellExecutionCommandLineConfidence</span>



<div class="comment"><p>The confidence of a <a href="#TerminalShellExecutionCommandLine">TerminalShellExecutionCommandLine</a> value.</p>
</div>

#### Enumeration Members



<a name="TerminalShellExecutionCommandLineConfidence.Low"></a><span class="ts" id=1982 data-target="#details-1982" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Low</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-1982">
<div class="comment"><p>The command line value confidence is low. This means that the value was read from the
terminal buffer using markers reported by the shell integration script. Additionally one
of the following conditions will be met:</p>
<ul>
<li>The command started on the very left-most column which is unusual, or</li>
<li>The command is multi-line which is more difficult to accurately detect due to line
continuation characters and right prompts.</li>
<li>Command line markers were not reported by the shell integration script.</li>
</ul>
</div>
</div>



<a name="TerminalShellExecutionCommandLineConfidence.Medium"></a><span class="ts" id=1983 data-target="#details-1983" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Medium</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1983">
<div class="comment"><p>The command line value confidence is medium. This means that the value was read from the
terminal buffer using markers reported by the shell integration script. The command is
single-line and does not start on the very left-most column (which is unusual).</p>
</div>
</div>



<a name="TerminalShellExecutionCommandLineConfidence.High"></a><span class="ts" id=1984 data-target="#details-1984" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">High</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1984">
<div class="comment"><p>The command line value confidence is high. This means that the value was explicitly sent
from the shell integration script or the command was executed via the
<a href="#TerminalShellIntegration.executeCommand">TerminalShellIntegration.executeCommand</a> API.</p>
</div>
</div>

### <a name="TerminalShellExecutionEndEvent"></a><span class="code-item" id=1992>TerminalShellExecutionEndEvent</span>



<div class="comment"><p>An event signalling that an execution has ended in a terminal.</p>
</div>

#### Properties



<a name="TerminalShellExecutionEndEvent.execution"></a><span class="ts" id=1995 data-target="#details-1995" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">execution</span><span>: </span><a class="type-ref" href="#TerminalShellExecution">TerminalShellExecution</a></span>
<div class="details collapse" id="details-1995">
<div class="comment"><p>The terminal shell execution that has ended.</p>
</div>
</div>



<a name="TerminalShellExecutionEndEvent.exitCode"></a><span class="ts" id=1996 data-target="#details-1996" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">exitCode</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-1996">
<div class="comment"><p>The exit code reported by the shell.</p>
<p>When this is <code>undefined</code> it can mean several things:</p>
<ul>
<li>The shell either did not report an exit  code (ie. the shell integration script is
misbehaving)</li>
<li>The shell reported a command started before the command finished (eg. a sub-shell was
opened).</li>
<li>The user canceled the command via ctrl+c.</li>
<li>The user pressed enter when there was no input.</li>
</ul>
<p>Generally this should not happen. Depending on the use case, it may be best to treat this
as a failure.</p>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> execution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">shellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">executeCommand</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  command:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'echo'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  args:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> [</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Hello world'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">]</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onDidEndTerminalShellExecution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">  if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">execution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">execution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">    if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">exitCode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">undefined</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">      console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Command finished but exit code is unknown'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    } </span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">else</span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB"> if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">exitCode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">0</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">      console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Command succeeded'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    } </span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">else</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">      console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Command failed'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"></span></code></pre>
</div>
</div>



<a name="TerminalShellExecutionEndEvent.shellIntegration"></a><span class="ts" id=1994 data-target="#details-1994" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">shellIntegration</span><span>: </span><a class="type-ref" href="#TerminalShellIntegration">TerminalShellIntegration</a></span>
<div class="details collapse" id="details-1994">
<div class="comment"><p>The shell integration object.</p>
</div>
</div>



<a name="TerminalShellExecutionEndEvent.terminal"></a><span class="ts" id=1993 data-target="#details-1993" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">terminal</span><span>: </span><a class="type-ref" href="#Terminal">Terminal</a></span>
<div class="details collapse" id="details-1993">
<div class="comment"><p>The terminal that shell integration has been activated in.</p>
</div>
</div>

### <a name="TerminalShellExecutionStartEvent"></a><span class="code-item" id=1988>TerminalShellExecutionStartEvent</span>



<div class="comment"><p>An event signalling that an execution has started in a terminal.</p>
</div>

#### Properties



<a name="TerminalShellExecutionStartEvent.execution"></a><span class="ts" id=1991 data-target="#details-1991" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">execution</span><span>: </span><a class="type-ref" href="#TerminalShellExecution">TerminalShellExecution</a></span>
<div class="details collapse" id="details-1991">
<div class="comment"><p>The terminal shell execution that has ended.</p>
</div>
</div>



<a name="TerminalShellExecutionStartEvent.shellIntegration"></a><span class="ts" id=1990 data-target="#details-1990" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">shellIntegration</span><span>: </span><a class="type-ref" href="#TerminalShellIntegration">TerminalShellIntegration</a></span>
<div class="details collapse" id="details-1990">
<div class="comment"><p>The shell integration object.</p>
</div>
</div>



<a name="TerminalShellExecutionStartEvent.terminal"></a><span class="ts" id=1989 data-target="#details-1989" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">terminal</span><span>: </span><a class="type-ref" href="#Terminal">Terminal</a></span>
<div class="details collapse" id="details-1989">
<div class="comment"><p>The terminal that shell integration has been activated in.</p>
</div>
</div>

### <a name="TerminalShellIntegration"></a><span class="code-item" id=1964>TerminalShellIntegration</span>



<div class="comment"><p><a href="https://code.visualstudio.com/docs/terminal/shell-integration">Shell integration</a>-powered capabilities owned by a terminal.</p>
</div>

#### Properties



<a name="TerminalShellIntegration.cwd"></a><span class="ts" id=1965 data-target="#details-1965" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cwd</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-1965">
<div class="comment"><p>The current working directory of the terminal. This <a href="#Uri">Uri</a> may represent a file on
another machine (eg. ssh into another machine). This requires the shell integration to
support working directory reporting.</p>
</div>
</div>

#### Methods



<a name="TerminalShellIntegration.executeCommand"></a><span class="ts" id=1967 data-target="#details-1967" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executeCommand</span><span>(</span><span class="ident">commandLine</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#TerminalShellExecution">TerminalShellExecution</a></span>
<div class="details collapse" id="details-1967">
<div class="comment"><p>Execute a command, sending ^C as necessary to interrupt any running command if needed.</p>
<ul>
<li><em>throws</em> - When run on a terminal doesn&#39;t support this API, such as task terminals.</li>
</ul>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Execute a command in a terminal immediately after being created</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> myTerm</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createTerminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">();</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onDidChangeTerminalShellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">async</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> ({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">terminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">shellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> }) </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">  if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">terminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">myTerm</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">    const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> execution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">shellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">executeCommand</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'echo "Hello world"'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">    window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onDidEndTerminalShellExecution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">      if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">execution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">execution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">        console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`Command exited with code </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">${</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">exitCode</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">}</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">      }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    });</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}));</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Fallback to sendText if there is no shell integration within 3 seconds of launching</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">setTimeout</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(() </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">  if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (!</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">myTerm</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">shellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">    myTerm</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">sendText</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'echo "Hello world"'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">    // Without shell integration, we can't know when the command has finished or what the</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">    // exit code was.</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}, </span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">3000</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span></code></pre>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Send command to terminal that has been alive for a while</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'echo "Hello world"'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">term</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">shellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">  const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> execution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">shellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">executeCommand</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onDidEndTerminalShellExecution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">    if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">execution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">execution</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">      console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`Command exited with code </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">${</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">exitCode</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">}</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  });</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">} </span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">else</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  term</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">sendText</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // Without shell integration, we can't know when the command has finished or what the</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // exit code was.</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">commandLine</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The command line to execute, this is the exact text that will be sent
to the terminal.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TerminalShellExecution">TerminalShellExecution</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TerminalShellIntegration.executeCommand"></a><span class="ts" id=1969 data-target="#details-1969" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">executeCommand</span><span>(</span><span class="ident">executable</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">args</span><span>: </span><span class="type-intrinsic">string</span>[]<span>)</span><span>: </span><a class="type-ref" href="#TerminalShellExecution">TerminalShellExecution</a></span>
<div class="details collapse" id="details-1969">
<div class="comment"><p>Execute a command, sending ^C as necessary to interrupt any running command if needed.</p>
<p><em>Note</em> This is not guaranteed to work as <a href="https://code.visualstudio.com/docs/terminal/shell-integration">shell integration</a>
must be activated. Check whether <a href="#TerminalShellExecution.exitCode">TerminalShellExecution.exitCode</a> is rejected to
verify whether it was successful.</p>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Execute a command in a terminal immediately after being created</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> myTerm</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">createTerminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">();</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">window</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onDidChangeTerminalShellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">async</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> ({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">terminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">shellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> }) </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">  if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">terminal</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">myTerm</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">    const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> command</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">shellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">executeCommand</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">      command:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'echo'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">      args:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> [</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Hello world'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">]</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    });</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">    const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> code</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">await</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> command</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">exitCode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">    console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`Command exited with code </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">${</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">code</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">}</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}));</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Fallback to sendText if there is no shell integration within 3 seconds of launching</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">setTimeout</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(() </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">  if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (!</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">myTerm</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">shellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">    myTerm</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">sendText</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'echo "Hello world"'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">    // Without shell integration, we can't know when the command has finished or what the</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">    // exit code was.</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}, </span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">3000</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span></code></pre>
<p><strong>Example</strong></p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Send command to terminal that has been alive for a while</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'echo "Hello world"'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">if</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> (</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">term</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">shellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">) {</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">  const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> command</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">term</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">shellIntegration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">executeCommand</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">    command:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'echo'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">    args:</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> [</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'Hello world'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">]</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  });</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">  const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> code</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">await</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> command</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">exitCode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  console</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">log</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`Command exited with code </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">${</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">code</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">}</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">} </span><span style="--shiki-dark:#C586C0;--shiki-light:#AF00DB">else</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  term</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">sendText</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">commandLine</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // Without shell integration, we can't know when the command has finished or what the</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // exit code was.</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">executable</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A command to run.</p>
</div></td></tr>
<tr><td><span class="ident">args</span><span>: </span><span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>Arguments to launch the executable with. The arguments will be escaped such
that they are interpreted as single arguments when the argument both contains whitespace
and does not include any single quote, double quote or backtick characters.</p>
<p>Note that this escaping is not intended to be a security measure, be careful when passing
untrusted data to this API as strings like <code>$(...)</code> can often be used in shells to
execute code within a string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TerminalShellExecution">TerminalShellExecution</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TerminalShellIntegrationChangeEvent"></a><span class="code-item" id=1985>TerminalShellIntegrationChangeEvent</span>



<div class="comment"><p>An event signalling that a terminal&#39;s shell integration has changed.</p>
</div>

#### Properties



<a name="TerminalShellIntegrationChangeEvent.shellIntegration"></a><span class="ts" id=1987 data-target="#details-1987" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">shellIntegration</span><span>: </span><a class="type-ref" href="#TerminalShellIntegration">TerminalShellIntegration</a></span>
<div class="details collapse" id="details-1987">
<div class="comment"><p>The shell integration object.</p>
</div>
</div>



<a name="TerminalShellIntegrationChangeEvent.terminal"></a><span class="ts" id=1986 data-target="#details-1986" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">terminal</span><span>: </span><a class="type-ref" href="#Terminal">Terminal</a></span>
<div class="details collapse" id="details-1986">
<div class="comment"><p>The terminal that shell integration has been activated in.</p>
</div>
</div>

### <a name="TerminalSplitLocationOptions"></a><span class="code-item" id=1959>TerminalSplitLocationOptions</span>



<div class="comment"><p>Uses the parent <a href="#Terminal">Terminal</a>&#39;s location for the terminal</p>
</div>

#### Properties



<a name="TerminalSplitLocationOptions.parentTerminal"></a><span class="ts" id=1960 data-target="#details-1960" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">parentTerminal</span><span>: </span><a class="type-ref" href="#Terminal">Terminal</a></span>
<div class="details collapse" id="details-1960">
<div class="comment"><p>The parent terminal to split this terminal beside. This works whether the parent terminal
is in the panel or the editor area.</p>
</div>
</div>

### <a name="TerminalState"></a><span class="code-item" id=1961>TerminalState</span>



<div class="comment"><p>Represents the state of a <a href="#Terminal">Terminal</a>.</p>
</div>

#### Properties



<a name="TerminalState.isInteractedWith"></a><span class="ts" id=1962 data-target="#details-1962" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isInteractedWith</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1962">
<div class="comment"><p>Whether the <a href="#Terminal">Terminal</a> has been interacted with. Interaction means that the
terminal has sent data to the process which depending on the terminal&#39;s <em>mode</em>. By
default input is sent when a key is pressed or when a command or extension sends text,
but based on the terminal&#39;s mode it can also happen on:</p>
<ul>
<li>a pointer click event</li>
<li>a pointer scroll event</li>
<li>a pointer move event</li>
<li>terminal focus in/out</li>
</ul>
<p>For more information on events that can send data see &quot;DEC Private Mode Set (DECSET)&quot; on
<a href="https://invisible-island.net/xterm/ctlseqs/ctlseqs.html">https://invisible-island.net/xterm/ctlseqs/ctlseqs.html</a></p>
</div>
</div>



<a name="TerminalState.shell"></a><span class="ts" id=1963 data-target="#details-1963" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">shell</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1963">
<div class="comment"><p>The detected shell type of the <a href="#Terminal">Terminal</a>. This will be <code>undefined</code> when there is
not a clear signal as to what the shell is, or the shell is not supported yet. This
value should change to the shell type of a sub-shell when launched (for example, running
<code>bash</code> inside <code>zsh</code>).</p>
<p>Note that the possible values are currently defined as any of the following:
&#39;bash&#39;, &#39;cmd&#39;, &#39;csh&#39;, &#39;fish&#39;, &#39;gitbash&#39;, &#39;julia&#39;, &#39;ksh&#39;, &#39;node&#39;, &#39;nu&#39;, &#39;pwsh&#39;, &#39;python&#39;,
&#39;sh&#39;, &#39;wsl&#39;, &#39;xonsh&#39;, &#39;zsh&#39;.</p>
</div>
</div>

### <a name="TestController"></a><span class="code-item" id=4462>TestController</span>



<div class="comment"><p>Entry point to discover and execute tests. It contains <a href="#TestController.items">TestController.items</a> which
are used to populate the editor UI, and is associated with
<a href="#TestController.createRunProfile">run profiles</a> to allow
for tests to be executed.</p>
</div>

#### Properties



<a name="TestController.id"></a><span class="ts" id=4463 data-target="#details-4463" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4463">
<div class="comment"><p>The id of the controller passed in <a href="#tests.createTestController">tests.createTestController</a>.
This must be globally unique.</p>
</div>
</div>



<a name="TestController.items"></a><span class="ts" id=4465 data-target="#details-4465" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">items</span><span>: </span><a class="type-ref" href="#TestItemCollection">TestItemCollection</a></span>
<div class="details collapse" id="details-4465">
<div class="comment"><p>A collection of &quot;top-level&quot; <a href="#TestItem">TestItem</a> instances, which can in
turn have their own <a href="#TestItem.children">children</a> to form the
&quot;test tree.&quot;</p>
<p>The extension controls when to add tests. For example, extensions should
add tests for a file when <a href="#workspace.onDidOpenTextDocument">workspace.onDidOpenTextDocument</a>
fires in order for decorations for tests within a file to be visible.</p>
<p>However, the editor may sometimes explicitly request children using the
<a href="#TestController.resolveHandler">resolveHandler</a> See the documentation on that method for more details.</p>
</div>
</div>



<a name="TestController.label"></a><span class="ts" id=4464 data-target="#details-4464" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4464">
<div class="comment"><p>Human-readable label for the test controller.</p>
</div>
</div>



<a name="TestController.refreshHandler"></a><span class="ts" id=4482 data-target="#details-4482" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">refreshHandler</span><span>: </span>(token: <a class="type-ref" href="#CancellationToken">CancellationToken</a>) =&gt; <span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-4482">
<div class="comment"><p>If this method is present, a refresh button will be present in the
UI, and this method will be invoked when it&#39;s clicked. When called,
the extension should scan the workspace for any new, changed, or
removed tests.</p>
<p>It&#39;s recommended that extensions try to update tests in realtime, using
a <a href="#FileSystemWatcher">FileSystemWatcher</a> for example, and use this method as a fallback.</p>
</div>
<div class="comment"></div>
<div class="signature variable-declaration-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>A thenable that resolves when tests have been refreshed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TestController.resolveHandler"></a><span class="ts" id=4478 data-target="#details-4478" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveHandler</span><span>?</span><span>: </span>(item: <a class="type-ref" href="#TestItem">TestItem</a>) =&gt; <span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-4478">
<div class="comment"><p>A function provided by the extension that the editor may call to request
children of a test item, if the <a href="#TestItem.canResolveChildren">TestItem.canResolveChildren</a> is
<code>true</code>. When called, the item should discover children and call
<a href="#TestController.createTestItem">TestController.createTestItem</a> as children are discovered.</p>
<p>Generally the extension manages the lifecycle of test items, but under
certain conditions the editor may request the children of a specific
item to be loaded. For example, if the user requests to re-run tests
after reloading the editor, the editor may need to call this method
to resolve the previously-run tests.</p>
<p>The item in the explorer will automatically be marked as &quot;busy&quot; until
the function returns or the returned thenable resolves.</p>
</div>
<div class="comment"></div>
<div class="signature variable-declaration-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">item</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a></td><td><div class="comment"><p>An unresolved test item for which children are being
requested, or <code>undefined</code> to resolve the controller&#39;s initial <a href="#TestController.items">items</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Methods



<a name="TestController.createRunProfile"></a><span class="ts" id=4467 data-target="#details-4467" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createRunProfile</span><span>(</span><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">kind</span><span>: </span><a class="type-ref" href="#TestRunProfileKind">TestRunProfileKind</a>, <span class="ident">runHandler</span><span>: </span>(request: <a class="type-ref" href="#TestRunRequest">TestRunRequest</a>, token: <a class="type-ref" href="#CancellationToken">CancellationToken</a>) =&gt; <span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;, <span class="ident">isDefault</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span>, <span class="ident">tag</span><span>?</span><span>: </span><a class="type-ref" href="#TestTag">TestTag</a>, <span class="ident">supportsContinuousRun</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><a class="type-ref" href="#TestRunProfile">TestRunProfile</a></span>
<div class="details collapse" id="details-4467">
<div class="comment"><p>Creates a profile used for running tests. Extensions must create
at least one profile in order for tests to be run.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A human-readable label for this profile.</p>
</div></td></tr>
<tr><td><span class="ident">kind</span><span>: </span><a class="type-ref" href="#TestRunProfileKind">TestRunProfileKind</a></td><td><div class="comment"><p>Configures what kind of execution this profile manages.</p>
</div></td></tr>
<tr><td><span class="ident">runHandler</span><span>: </span>(request: <a class="type-ref" href="#TestRunRequest">TestRunRequest</a>, token: <a class="type-ref" href="#CancellationToken">CancellationToken</a>) =&gt; <span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>Function called to start a test run.</p>
</div></td></tr>
<tr><td><span class="ident">isDefault</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Whether this is the default action for its kind.</p>
</div></td></tr>
<tr><td><span class="ident">tag</span><span>?</span><span>: </span><a class="type-ref" href="#TestTag">TestTag</a></td><td><div class="comment"><p>Profile test tag.</p>
</div></td></tr>
<tr><td><span class="ident">supportsContinuousRun</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Whether the profile supports continuous running.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TestRunProfile">TestRunProfile</a></td><td><div class="comment"><p>An instance of a <a href="#TestRunProfile">TestRunProfile</a>, which is automatically
associated with this controller.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TestController.createTestItem"></a><span class="ts" id=4492 data-target="#details-4492" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createTestItem</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">uri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a></span>
<div class="details collapse" id="details-4492">
<div class="comment"><p>Creates a new managed <a href="#TestItem">TestItem</a> instance. It can be added into
the <a href="#TestItem.children">TestItem.children</a> of an existing item, or into the
<a href="#TestController.items">TestController.items</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Identifier for the TestItem. The test item&#39;s ID must be unique
in the <a href="#TestItemCollection">TestItemCollection</a> it&#39;s added to.</p>
</div></td></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Human-readable label of the test item.</p>
</div></td></tr>
<tr><td><span class="ident">uri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>URI this TestItem is associated with. May be a file or directory.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TestItem">TestItem</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestController.createTestRun"></a><span class="ts" id=4487 data-target="#details-4487" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createTestRun</span><span>(</span><span class="ident">request</span><span>: </span><a class="type-ref" href="#TestRunRequest">TestRunRequest</a>, <span class="ident">name</span><span>?</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">persist</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><a class="type-ref" href="#TestRun">TestRun</a></span>
<div class="details collapse" id="details-4487">
<div class="comment"><p>Creates a <a href="#TestRun">TestRun</a>. This should be called by the
<a href="#TestRunProfile">TestRunProfile</a> when a request is made to execute tests, and may
also be called if a test run is detected externally. Once created, tests
that are included in the request will be moved into the queued state.</p>
<p>All runs created using the same <code>request</code> instance will be grouped
together. This is useful if, for example, a single suite of tests is
run on multiple platforms.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">request</span><span>: </span><a class="type-ref" href="#TestRunRequest">TestRunRequest</a></td><td><div class="comment"><p>Test run request. Only tests inside the <code>include</code> may be
modified, and tests in its <code>exclude</code> are ignored.</p>
</div></td></tr>
<tr><td><span class="ident">name</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The human-readable name of the run. This can be used to
disambiguate multiple sets of results in a test run. It is useful if
tests are run across multiple platforms, for example.</p>
</div></td></tr>
<tr><td><span class="ident">persist</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Whether the results created by the run should be
persisted in the editor. This may be false if the results are coming from
a file already saved externally, such as a coverage information file.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TestRun">TestRun</a></td><td><div class="comment"><p>An instance of the <a href="#TestRun">TestRun</a>. It will be considered &quot;running&quot;
from the moment this method is invoked until <a href="#TestRun.end">TestRun.end</a> is called.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TestController.dispose"></a><span class="ts" id=4500 data-target="#details-4500" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4500">
<div class="comment"><p>Unregisters the test controller, disposing of its associated tests
and unpersisted results.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestController.invalidateTestResults"></a><span class="ts" id=4497 data-target="#details-4497" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">invalidateTestResults</span><span>(</span><span class="ident">items</span><span>?</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a> &#124; readonly <a class="type-ref" href="#TestItem">TestItem</a>[]<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4497">
<div class="comment"><p>Marks an item&#39;s results as being outdated. This is commonly called when
code or configuration changes and previous results should no longer
be considered relevant. The same logic used to mark results as outdated
may be used to drive <a href="#TestRunRequest.continuous">continuous test runs</a>.</p>
<p>If an item is passed to this method, test results for the item and all of
its children will be marked as outdated. If no item is passed, then all
test owned by the TestController will be marked as outdated.</p>
<p>Any test runs started before the moment this method is called, including
runs which may still be ongoing, will be marked as outdated and deprioritized
in the editor&#39;s UI.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">items</span><span>?</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a> &#124; readonly <a class="type-ref" href="#TestItem">TestItem</a>[]</td><td><div class="comment"><p>Item to mark as outdated. If undefined, all the controller&#39;s items are marked outdated.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TestCoverageCount"></a><span class="code-item" id=4611>TestCoverageCount</span>



<div class="comment"><p>A class that contains information about a covered resource. A count can
be give for lines, branches, and declarations in a file.</p>
</div>

#### Constructors



<a name="TestCoverageCount.TestCoverageCount"></a><span class="ts" id=4613 data-target="#details-4613" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TestCoverageCount</span><span>(</span><span class="ident">covered</span><span>: </span><span class="type-intrinsic">number</span>, <span class="ident">total</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#TestCoverageCount">TestCoverageCount</a></span>
<div class="details collapse" id="details-4613">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">covered</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>Value for <a href="#TestCoverageCount.covered">TestCoverageCount.covered</a></p>
</div></td></tr>
<tr><td><span class="ident">total</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>Value for <a href="#TestCoverageCount.total">TestCoverageCount.total</a></p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TestCoverageCount">TestCoverageCount</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TestCoverageCount.covered"></a><span class="ts" id=4616 data-target="#details-4616" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">covered</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-4616">
<div class="comment"><p>Number of items covered in the file.</p>
</div>
</div>



<a name="TestCoverageCount.total"></a><span class="ts" id=4617 data-target="#details-4617" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">total</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-4617">
<div class="comment"><p>Total number of covered items in the file.</p>
</div>
</div>

### <a name="TestItem"></a><span class="code-item" id=4574>TestItem</span>



<div class="comment"><p>An item shown in the &quot;test explorer&quot; view.</p>
<p>A <code>TestItem</code> can represent either a test suite or a test itself, since
they both have similar capabilities.</p>
</div>

#### Properties



<a name="TestItem.busy"></a><span class="ts" id=4581 data-target="#details-4581" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">busy</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4581">
<div class="comment"><p>Controls whether the item is shown as &quot;busy&quot; in the Test Explorer view.
This is useful for showing status while discovering children.</p>
<p>Defaults to <code>false</code>.</p>
</div>
</div>



<a name="TestItem.canResolveChildren"></a><span class="ts" id=4580 data-target="#details-4580" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">canResolveChildren</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4580">
<div class="comment"><p>Indicates whether this test item may have children discovered by resolving.</p>
<p>If true, this item is shown as expandable in the Test Explorer view and
expanding the item will cause <a href="#TestController.resolveHandler">TestController.resolveHandler</a>
to be invoked with the item.</p>
<p>Default to <code>false</code>.</p>
</div>
</div>



<a name="TestItem.children"></a><span class="ts" id=4577 data-target="#details-4577" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">children</span><span>: </span><a class="type-ref" href="#TestItemCollection">TestItemCollection</a></span>
<div class="details collapse" id="details-4577">
<div class="comment"><p>The children of this test item. For a test suite, this may contain the
individual test cases or nested suites.</p>
</div>
</div>



<a name="TestItem.description"></a><span class="ts" id=4583 data-target="#details-4583" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">description</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4583">
<div class="comment"><p>Optional description that appears next to the label.</p>
</div>
</div>



<a name="TestItem.error"></a><span class="ts" id=4586 data-target="#details-4586" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">error</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-4586">
<div class="comment"><p>Optional error encountered while loading the test.</p>
<p>Note that this is not a test result and should only be used to represent errors in
test discovery, such as syntax errors.</p>
</div>
</div>



<a name="TestItem.id"></a><span class="ts" id=4575 data-target="#details-4575" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4575">
<div class="comment"><p>Identifier for the <code>TestItem</code>. This is used to correlate
test results and tests in the document with those in the workspace
(test explorer). This cannot change for the lifetime of the <code>TestItem</code>,
and must be unique among its parent&#39;s direct children.</p>
</div>
</div>



<a name="TestItem.label"></a><span class="ts" id=4582 data-target="#details-4582" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4582">
<div class="comment"><p>Display name describing the test case.</p>
</div>
</div>



<a name="TestItem.parent"></a><span class="ts" id=4578 data-target="#details-4578" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">parent</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a></span>
<div class="details collapse" id="details-4578">
<div class="comment"><p>The parent of this item. It&#39;s set automatically, and is undefined
top-level items in the <a href="#TestController.items">TestController.items</a> and for items that
aren&#39;t yet included in another item&#39;s <a href="#TestItem.children">children</a>.</p>
</div>
</div>



<a name="TestItem.range"></a><span class="ts" id=4585 data-target="#details-4585" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-4585">
<div class="comment"><p>Location of the test item in its <a href="#TestItem.uri">uri</a>.</p>
<p>This is only meaningful if the <code>uri</code> points to a file.</p>
</div>
</div>



<a name="TestItem.sortText"></a><span class="ts" id=4584 data-target="#details-4584" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">sortText</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4584">
<div class="comment"><p>A string that should be used when comparing this item
with other items. When <code>falsy</code> the <a href="#TestItem.label">label</a>
is used.</p>
</div>
</div>



<a name="TestItem.tags"></a><span class="ts" id=4579 data-target="#details-4579" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tags</span><span>: </span>readonly <a class="type-ref" href="#TestTag">TestTag</a>[]</span>
<div class="details collapse" id="details-4579">
<div class="comment"><p>Tags associated with this test item. May be used in combination with
<a href="#TestRunProfile.tag">tags</a>, or simply as an organizational feature.</p>
</div>
</div>



<a name="TestItem.uri"></a><span class="ts" id=4576 data-target="#details-4576" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4576">
<div class="comment"><p>URI this <code>TestItem</code> is associated with. May be a file or directory.</p>
</div>
</div>

### <a name="TestItemCollection"></a><span class="code-item" id=4552>TestItemCollection</span>



<div class="comment"><p>Collection of test items, found in <a href="#TestItem.children">TestItem.children</a> and
<a href="#TestController.items">TestController.items</a>.</p>
</div>

#### Properties



<a name="TestItemCollection.size"></a><span class="ts" id=4553 data-target="#details-4553" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">size</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-4553">
<div class="comment"><p>Gets the number of items in the collection.</p>
</div>
</div>

#### Methods



<a name="TestItemCollection.add"></a><span class="ts" id=4566 data-target="#details-4566" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">add</span><span>(</span><span class="ident">item</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4566">
<div class="comment"><p>Adds the test item to the children. If an item with the same ID already
exists, it&#39;ll be replaced.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">item</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a></td><td><div class="comment"><p>Item to add.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestItemCollection.delete"></a><span class="ts" id=4569 data-target="#details-4569" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">delete</span><span>(</span><span class="ident">itemId</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4569">
<div class="comment"><p>Removes a single test item from the collection.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">itemId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Item ID to delete.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestItemCollection.forEach"></a><span class="ts" id=4558 data-target="#details-4558" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">forEach</span><span>(</span><span class="ident">callback</span><span>: </span>(item: <a class="type-ref" href="#TestItem">TestItem</a>, collection: <a class="type-ref" href="#TestItemCollection">TestItemCollection</a>) =&gt; <span class="type-intrinsic">unknown</span>, <span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4558">
<div class="comment"><p>Iterate over each entry in this collection.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">callback</span><span>: </span>(item: <a class="type-ref" href="#TestItem">TestItem</a>, collection: <a class="type-ref" href="#TestItemCollection">TestItemCollection</a>) =&gt; <span class="type-intrinsic">unknown</span></td><td><div class="comment"><p>Function to execute for each entry.</p>
</div></td></tr>
<tr><td><span class="ident">thisArg</span><span>?</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>The <code>this</code> context used when invoking the handler function.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestItemCollection.get"></a><span class="ts" id=4572 data-target="#details-4572" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">get</span><span>(</span><span class="ident">itemId</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a></span>
<div class="details collapse" id="details-4572">
<div class="comment"><p>Efficiently gets a test item by ID, if it exists, in the children.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">itemId</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Item ID to get.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TestItem">TestItem</a></td><td><div class="comment"><p>The found item or undefined if it does not exist.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TestItemCollection.replace"></a><span class="ts" id=4555 data-target="#details-4555" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">replace</span><span>(</span><span class="ident">items</span><span>: </span>readonly <a class="type-ref" href="#TestItem">TestItem</a>[]<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4555">
<div class="comment"><p>Replaces the items stored by the collection.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">items</span><span>: </span>readonly <a class="type-ref" href="#TestItem">TestItem</a>[]</td><td><div class="comment"><p>Items to store.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TestMessage"></a><span class="code-item" id=4596>TestMessage</span>



<div class="comment"><p>Message associated with the test state. Can be linked to a specific
source range -- useful for assertion failures, for example.</p>
</div>

#### Static



<a name="TestMessage.diff"></a><span class="ts" id=4598 data-target="#details-4598" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">diff</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a>, <span class="ident">expected</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">actual</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#TestMessage">TestMessage</a></span>
<div class="details collapse" id="details-4598">
<div class="comment"><p>Creates a new TestMessage that will present as a diff in the editor.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></td><td><div class="comment"><p>Message to display to the user.</p>
</div></td></tr>
<tr><td><span class="ident">expected</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Expected output.</p>
</div></td></tr>
<tr><td><span class="ident">actual</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Actual output.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TestMessage">TestMessage</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Constructors



<a name="TestMessage.TestMessage"></a><span class="ts" id=4603 data-target="#details-4603" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TestMessage</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a><span>)</span><span>: </span><a class="type-ref" href="#TestMessage">TestMessage</a></span>
<div class="details collapse" id="details-4603">
<div class="comment"><p>Creates a new TestMessage instance.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></td><td><div class="comment"><p>The message to show to the user.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TestMessage">TestMessage</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TestMessage.actualOutput"></a><span class="ts" id=4607 data-target="#details-4607" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">actualOutput</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4607">
<div class="comment"><p>Actual test output. If given with <a href="#TestMessage.expectedOutput">expectedOutput </a>, a diff view will be shown.</p>
</div>
</div>



<a name="TestMessage.contextValue"></a><span class="ts" id=4609 data-target="#details-4609" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contextValue</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4609">
<div class="comment"><p>Context value of the test item. This can be used to contribute message-
specific actions to the test peek view. The value set here can be found
in the <code>testMessage</code> property of the following <code>menus</code> contribution points:</p>
<ul>
<li><code>testing/message/context</code> - context menu for the message in the results tree</li>
<li><code>testing/message/content</code> - a prominent button overlaying editor content where
 the message is displayed.</li>
</ul>
<p>For example:</p>
<pre class="shiki" data-lang="json" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"contributes"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">  "menus"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">    "testing/message/content"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: [</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">      {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">        "command"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"extension.deleteCommentThread"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">        "when"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"testMessage == canApplyRichDiff"</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">      }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    ]</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span></code></pre>
<p>The command will be called with an object containing:</p>
<ul>
<li><code>test</code>: the <a href="#TestItem">TestItem</a> the message is associated with, <em>if</em> it
 is still present in the <a href="#TestController.items">TestController.items</a> collection.</li>
<li><code>message</code>: the <a href="#TestMessage">TestMessage</a> instance.</li>
</ul>
</div>
</div>



<a name="TestMessage.expectedOutput"></a><span class="ts" id=4606 data-target="#details-4606" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">expectedOutput</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4606">
<div class="comment"><p>Expected test output. If given with <a href="#TestMessage.actualOutput">actualOutput </a>, a diff view will be shown.</p>
</div>
</div>



<a name="TestMessage.location"></a><span class="ts" id=4608 data-target="#details-4608" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">location</span><span>?</span><span>: </span><a class="type-ref" href="#Location">Location</a></span>
<div class="details collapse" id="details-4608">
<div class="comment"><p>Associated file location.</p>
</div>
</div>



<a name="TestMessage.message"></a><span class="ts" id=4605 data-target="#details-4605" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">message</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-4605">
<div class="comment"><p>Human-readable message text to display.</p>
</div>
</div>



<a name="TestMessage.stackTrace"></a><span class="ts" id=4610 data-target="#details-4610" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">stackTrace</span><span>?</span><span>: </span><a class="type-ref" href="#TestMessageStackFrame">TestMessageStackFrame</a>[]</span>
<div class="details collapse" id="details-4610">
<div class="comment"><p>The stack trace associated with the message or failure.</p>
</div>
</div>

### <a name="TestMessageStackFrame"></a><span class="code-item" id=4587>TestMessageStackFrame</span>



<div class="comment"><p>A stack frame found in the <a href="#TestMessage.stackTrace">TestMessage.stackTrace</a>.</p>
</div>

#### Constructors



<a name="TestMessageStackFrame.TestMessageStackFrame"></a><span class="ts" id=4589 data-target="#details-4589" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TestMessageStackFrame</span><span>(</span><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">uri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">position</span><span>?</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><a class="type-ref" href="#TestMessageStackFrame">TestMessageStackFrame</a></span>
<div class="details collapse" id="details-4589">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The name of the stack frame</p>
</div></td></tr>
<tr><td><span class="ident">uri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">position</span><span>?</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position of the stack frame within the file</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TestMessageStackFrame">TestMessageStackFrame</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TestMessageStackFrame.label"></a><span class="ts" id=4595 data-target="#details-4595" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4595">
<div class="comment"><p>The name of the stack frame, typically a method or function name.</p>
</div>
</div>



<a name="TestMessageStackFrame.position"></a><span class="ts" id=4594 data-target="#details-4594" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">position</span><span>?</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-4594">
<div class="comment"><p>Position of the stack frame within the file.</p>
</div>
</div>



<a name="TestMessageStackFrame.uri"></a><span class="ts" id=4593 data-target="#details-4593" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-4593">
<div class="comment"><p>The location of this stack frame. This should be provided as a URI if the
location of the call frame can be accessed by the editor.</p>
</div>
</div>

### <a name="TestRun"></a><span class="code-item" id=4514>TestRun</span>



<div class="comment"><p>A TestRun represents an in-progress or completed test run and
provides methods to report the state of individual tests in the run.</p>
</div>

#### Events



<a name="TestRun.onDidDispose"></a><span class="ts" id=4551 data-target="#details-4551" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidDispose</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-4551">
<div class="comment"><p>An event fired when the editor is no longer interested in data
associated with the test run.</p>
</div>
</div>

#### Properties



<a name="TestRun.isPersisted"></a><span class="ts" id=4517 data-target="#details-4517" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isPersisted</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4517">
<div class="comment"><p>Whether the test run will be persisted across reloads by the editor.</p>
</div>
</div>



<a name="TestRun.name"></a><span class="ts" id=4515 data-target="#details-4515" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4515">
<div class="comment"><p>The human-readable name of the run. This can be used to
disambiguate multiple sets of results in a test run. It is useful if
tests are run across multiple platforms, for example.</p>
</div>
</div>



<a name="TestRun.token"></a><span class="ts" id=4516 data-target="#details-4516" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></span>
<div class="details collapse" id="details-4516">
<div class="comment"><p>A cancellation token which will be triggered when the test run is
canceled from the UI.</p>
</div>
</div>

#### Methods



<a name="TestRun.addCoverage"></a><span class="ts" id=4547 data-target="#details-4547" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">addCoverage</span><span>(</span><span class="ident">fileCoverage</span><span>: </span><a class="type-ref" href="#FileCoverage">FileCoverage</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4547">
<div class="comment"><p>Adds coverage for a file in the run.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">fileCoverage</span><span>: </span><a class="type-ref" href="#FileCoverage">FileCoverage</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestRun.appendOutput"></a><span class="ts" id=4542 data-target="#details-4542" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">appendOutput</span><span>(</span><span class="ident">output</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">location</span><span>?</span><span>: </span><a class="type-ref" href="#Location">Location</a>, <span class="ident">test</span><span>?</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4542">
<div class="comment"><p>Appends raw output from the test runner. On the user&#39;s request, the
output will be displayed in a terminal. ANSI escape sequences,
such as colors and text styles, are supported. New lines must be given
as CRLF (<code>\r\n</code>) rather than LF (<code>\n</code>).</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">output</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Output text to append.</p>
</div></td></tr>
<tr><td><span class="ident">location</span><span>?</span><span>: </span><a class="type-ref" href="#Location">Location</a></td><td><div class="comment"><p>Indicate that the output was logged at the given
location.</p>
</div></td></tr>
<tr><td><span class="ident">test</span><span>?</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a></td><td><div class="comment"><p>Test item to associate the output with.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestRun.end"></a><span class="ts" id=4550 data-target="#details-4550" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">end</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4550">
<div class="comment"><p>Signals the end of the test run. Any tests included in the run whose
states have not been updated will have their state reset.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestRun.enqueued"></a><span class="ts" id=4519 data-target="#details-4519" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">enqueued</span><span>(</span><span class="ident">test</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4519">
<div class="comment"><p>Indicates a test is queued for later execution.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">test</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a></td><td><div class="comment"><p>Test item to update.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestRun.errored"></a><span class="ts" id=4533 data-target="#details-4533" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">errored</span><span>(</span><span class="ident">test</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a>, <span class="ident">message</span><span>: </span><a class="type-ref" href="#TestMessage">TestMessage</a> &#124; readonly <a class="type-ref" href="#TestMessage">TestMessage</a>[], <span class="ident">duration</span><span>?</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4533">
<div class="comment"><p>Indicates a test has errored. You should pass one or more
<a href="#TestMessage">TestMessages</a> to describe the failure. This differs
from the &quot;failed&quot; state in that it indicates a test that couldn&#39;t be
executed at all, from a compilation error for example.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">test</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a></td><td><div class="comment"><p>Test item to update.</p>
</div></td></tr>
<tr><td><span class="ident">message</span><span>: </span><a class="type-ref" href="#TestMessage">TestMessage</a> &#124; readonly <a class="type-ref" href="#TestMessage">TestMessage</a>[]</td><td><div class="comment"><p>Messages associated with the test failure.</p>
</div></td></tr>
<tr><td><span class="ident">duration</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>How long the test took to execute, in milliseconds.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestRun.failed"></a><span class="ts" id=4528 data-target="#details-4528" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">failed</span><span>(</span><span class="ident">test</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a>, <span class="ident">message</span><span>: </span><a class="type-ref" href="#TestMessage">TestMessage</a> &#124; readonly <a class="type-ref" href="#TestMessage">TestMessage</a>[], <span class="ident">duration</span><span>?</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4528">
<div class="comment"><p>Indicates a test has failed. You should pass one or more
<a href="#TestMessage">TestMessages</a> to describe the failure.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">test</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a></td><td><div class="comment"><p>Test item to update.</p>
</div></td></tr>
<tr><td><span class="ident">message</span><span>: </span><a class="type-ref" href="#TestMessage">TestMessage</a> &#124; readonly <a class="type-ref" href="#TestMessage">TestMessage</a>[]</td><td><div class="comment"><p>Messages associated with the test failure.</p>
</div></td></tr>
<tr><td><span class="ident">duration</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>How long the test took to execute, in milliseconds.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestRun.passed"></a><span class="ts" id=4538 data-target="#details-4538" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">passed</span><span>(</span><span class="ident">test</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a>, <span class="ident">duration</span><span>?</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4538">
<div class="comment"><p>Indicates a test has passed.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">test</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a></td><td><div class="comment"><p>Test item to update.</p>
</div></td></tr>
<tr><td><span class="ident">duration</span><span>?</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>How long the test took to execute, in milliseconds.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestRun.skipped"></a><span class="ts" id=4525 data-target="#details-4525" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">skipped</span><span>(</span><span class="ident">test</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4525">
<div class="comment"><p>Indicates a test has been skipped.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">test</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a></td><td><div class="comment"><p>Test item to update.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestRun.started"></a><span class="ts" id=4522 data-target="#details-4522" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">started</span><span>(</span><span class="ident">test</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4522">
<div class="comment"><p>Indicates a test has started running.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">test</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a></td><td><div class="comment"><p>Test item to update.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TestRunProfile"></a><span class="code-item" id=4432>TestRunProfile</span>



<div class="comment"><p>A TestRunProfile describes one way to execute tests in a <a href="#TestController">TestController</a>.</p>
</div>

#### Events



<a name="TestRunProfile.onDidChangeDefault"></a><span class="ts" id=4436 data-target="#details-4436" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeDefault</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-4436">
<div class="comment"><p>Fired when a user has changed whether this is a default profile. The
event contains the new value of <a href="#TestRunProfile.isDefault">isDefault</a></p>
</div>
</div>

#### Properties



<a name="TestRunProfile.configureHandler"></a><span class="ts" id=4439 data-target="#details-4439" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">configureHandler</span><span>: </span>() =&gt; <span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4439">
<div class="comment"><p>If this method is present, a configuration gear will be present in the
UI, and this method will be invoked when it&#39;s clicked. When called,
you can take other editor actions, such as showing a quick pick or
opening a configuration file.</p>
</div>
<div class="comment"></div>
<div class="signature variable-declaration-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestRunProfile.isDefault"></a><span class="ts" id=4435 data-target="#details-4435" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isDefault</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4435">
<div class="comment"><p>Controls whether this profile is the default action that will
be taken when its kind is actioned. For example, if the user clicks
the generic &quot;run all&quot; button, then the default profile for
<a href="#TestRunProfileKind.Run">TestRunProfileKind.Run</a> will be executed, although the
user can configure this.</p>
<p>Changes the user makes in their default profiles will be reflected
in this property after a <a href="#TestRunProfile.onDidChangeDefault">onDidChangeDefault</a> event.</p>
</div>
</div>



<a name="TestRunProfile.kind"></a><span class="ts" id=4434 data-target="#details-4434" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>: </span><a class="type-ref" href="#TestRunProfileKind">TestRunProfileKind</a></span>
<div class="details collapse" id="details-4434">
<div class="comment"><p>Configures what kind of execution this profile controls. If there
are no profiles for a kind, it will not be available in the UI.</p>
</div>
</div>



<a name="TestRunProfile.label"></a><span class="ts" id=4433 data-target="#details-4433" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4433">
<div class="comment"><p>Label shown to the user in the UI.</p>
<p>Note that the label has some significance if the user requests that
tests be re-run in a certain way. For example, if tests were run
normally and the user requests to re-run them in debug mode, the editor
will attempt use a configuration with the same label of the <code>Debug</code>
kind. If there is no such configuration, the default will be used.</p>
</div>
</div>



<a name="TestRunProfile.loadDetailedCoverage"></a><span class="ts" id=4447 data-target="#details-4447" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">loadDetailedCoverage</span><span>?</span><span>: </span>(testRun: <a class="type-ref" href="#TestRun">TestRun</a>, fileCoverage: <a class="type-ref" href="#FileCoverage">FileCoverage</a>, token: <a class="type-ref" href="#CancellationToken">CancellationToken</a>) =&gt; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#FileCoverageDetail">FileCoverageDetail</a>[]&gt;</span>
<div class="details collapse" id="details-4447">
<div class="comment"><p>An extension-provided function that provides detailed statement and
function-level coverage for a file. The editor will call this when more
detail is needed for a file, such as when it&#39;s opened in an editor or
expanded in the <strong>Test Coverage</strong> view.</p>
<p>The <a href="#FileCoverage">FileCoverage</a> object passed to this function is the same instance
emitted on <a href="#TestRun.addCoverage">TestRun.addCoverage</a> calls associated with this profile.</p>
</div>
<div class="comment"></div>
<div class="signature variable-declaration-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">testRun</span><span>: </span><a class="type-ref" href="#TestRun">TestRun</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">fileCoverage</span><span>: </span><a class="type-ref" href="#FileCoverage">FileCoverage</a></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#FileCoverageDetail">FileCoverageDetail</a>[]&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestRunProfile.loadDetailedCoverageForTest"></a><span class="ts" id=4453 data-target="#details-4453" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">loadDetailedCoverageForTest</span><span>?</span><span>: </span>(testRun: <a class="type-ref" href="#TestRun">TestRun</a>, fileCoverage: <a class="type-ref" href="#FileCoverage">FileCoverage</a>, fromTestItem: <a class="type-ref" href="#TestItem">TestItem</a>, token: <a class="type-ref" href="#CancellationToken">CancellationToken</a>) =&gt; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#FileCoverageDetail">FileCoverageDetail</a>[]&gt;</span>
<div class="details collapse" id="details-4453">
<div class="comment"><p>An extension-provided function that provides detailed statement and
function-level coverage for a single test in a file. This is the per-test
sibling of <a href="#TestRunProfile.loadDetailedCoverage">TestRunProfile.loadDetailedCoverage</a>, called only if
a test item is provided in <a href="#FileCoverage.includesTests">FileCoverage.includesTests</a> and only
for files where such data is reported.</p>
<p>Often <a href="#TestRunProfile.loadDetailedCoverage">TestRunProfile.loadDetailedCoverage</a> will be called first
when a user opens a file, and then this method will be called if they
drill down into specific per-test coverage information. This method
should then return coverage data only for statements and declarations
executed by the specific test during the run.</p>
<p>The <a href="#FileCoverage">FileCoverage</a> object passed to this function is the same
instance emitted on <a href="#TestRun.addCoverage">TestRun.addCoverage</a> calls associated with this profile.</p>
</div>
<div class="comment"></div>
<div class="signature variable-declaration-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">testRun</span><span>: </span><a class="type-ref" href="#TestRun">TestRun</a></td><td><div class="comment"><p>The test run that generated the coverage data.</p>
</div></td></tr>
<tr><td><span class="ident">fileCoverage</span><span>: </span><a class="type-ref" href="#FileCoverage">FileCoverage</a></td><td><div class="comment"><p>The file coverage object to load detailed coverage for.</p>
</div></td></tr>
<tr><td><span class="ident">fromTestItem</span><span>: </span><a class="type-ref" href="#TestItem">TestItem</a></td><td><div class="comment"><p>The test item to request coverage information for.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token that indicates the operation should be cancelled.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#FileCoverageDetail">FileCoverageDetail</a>[]&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestRunProfile.runHandler"></a><span class="ts" id=4442 data-target="#details-4442" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">runHandler</span><span>: </span>(request: <a class="type-ref" href="#TestRunRequest">TestRunRequest</a>, token: <a class="type-ref" href="#CancellationToken">CancellationToken</a>) =&gt; <span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-4442">
<div class="comment"><p>Handler called to start a test run. When invoked, the function should call
<a href="#TestController.createTestRun">TestController.createTestRun</a> at least once, and all test runs
associated with the request should be created before the function returns
or the returned promise is resolved.</p>
<p>If <a href="#TestRunProfile.supportsContinuousRun">supportsContinuousRun</a> is set, then <a href="#TestRunRequest.continuous">TestRunRequest.continuous</a>
may be <code>true</code>. In this case, the profile should observe changes to
source code and create new test runs by calling <a href="#TestController.createTestRun">TestController.createTestRun</a>,
until the cancellation is requested on the <code>token</code>.</p>
</div>
<div class="comment"></div>
<div class="signature variable-declaration-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">request</span><span>: </span><a class="type-ref" href="#TestRunRequest">TestRunRequest</a></td><td><div class="comment"><p>Request information for the test run.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>Token that signals the used asked to abort the
test run. If cancellation is requested on this token, all <a href="#TestRun">TestRun</a>
instances associated with the request will be
automatically cancelled as well.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TestRunProfile.supportsContinuousRun"></a><span class="ts" id=4437 data-target="#details-4437" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">supportsContinuousRun</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4437">
<div class="comment"><p>Whether this profile supports continuous running of requests. If so,
then <a href="#TestRunRequest.continuous">TestRunRequest.continuous</a> may be set to <code>true</code>. Defaults
to false.</p>
</div>
</div>



<a name="TestRunProfile.tag"></a><span class="ts" id=4438 data-target="#details-4438" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tag</span><span>: </span><a class="type-ref" href="#TestTag">TestTag</a></span>
<div class="details collapse" id="details-4438">
<div class="comment"><p>Associated tag for the profile. If this is set, only <a href="#TestItem">TestItem</a>
instances with the same tag will be eligible to execute in this profile.</p>
</div>
</div>

#### Methods



<a name="TestRunProfile.dispose"></a><span class="ts" id=4461 data-target="#details-4461" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-4461">
<div class="comment"><p>Deletes the run profile.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TestRunProfileKind"></a><span class="code-item" id=4423>TestRunProfileKind</span>



<div class="comment"><p>The kind of executions that <a href="#TestRunProfile">TestRunProfiles</a> control.</p>
</div>

#### Enumeration Members



<a name="TestRunProfileKind.Run"></a><span class="ts" id=4424 data-target="#details-4424" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Run</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-4424">
<div class="comment"><p>The <code>Run</code> test profile kind.</p>
</div>
</div>



<a name="TestRunProfileKind.Debug"></a><span class="ts" id=4425 data-target="#details-4425" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Debug</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-4425">
<div class="comment"><p>The <code>Debug</code> test profile kind.</p>
</div>
</div>



<a name="TestRunProfileKind.Coverage"></a><span class="ts" id=4426 data-target="#details-4426" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Coverage</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-4426">
<div class="comment"><p>The <code>Coverage</code> test profile kind.</p>
</div>
</div>

### <a name="TestRunRequest"></a><span class="code-item" id=4501>TestRunRequest</span>



<div class="comment"><p>A TestRunRequest is a precursor to a <a href="#TestRun">TestRun</a>, which in turn is
created by passing a request to <a href="#TestController.createTestRun">TestController.createTestRun</a>. The
TestRunRequest contains information about which tests should be run, which
should not be run, and how they are run (via the <a href="#TestRunRequest.profile">profile</a>).</p>
<p>In general, TestRunRequests are created by the editor and pass to
<a href="#TestRunProfile.runHandler">TestRunProfile.runHandler</a>, however you can also create test
requests and runs outside of the <code>runHandler</code>.</p>
</div>

#### Constructors



<a name="TestRunRequest.TestRunRequest"></a><span class="ts" id=4503 data-target="#details-4503" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TestRunRequest</span><span>(</span><span class="ident">include</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#TestItem">TestItem</a>[], <span class="ident">exclude</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#TestItem">TestItem</a>[], <span class="ident">profile</span><span>?</span><span>: </span><a class="type-ref" href="#TestRunProfile">TestRunProfile</a>, <span class="ident">continuous</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span>, <span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><a class="type-ref" href="#TestRunRequest">TestRunRequest</a></span>
<div class="details collapse" id="details-4503">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">include</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#TestItem">TestItem</a>[]</td><td><div class="comment"><p>Array of specific tests to run, or undefined to run all tests</p>
</div></td></tr>
<tr><td><span class="ident">exclude</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#TestItem">TestItem</a>[]</td><td><div class="comment"><p>An array of tests to exclude from the run.</p>
</div></td></tr>
<tr><td><span class="ident">profile</span><span>?</span><span>: </span><a class="type-ref" href="#TestRunProfile">TestRunProfile</a></td><td><div class="comment"><p>The run profile used for this request.</p>
</div></td></tr>
<tr><td><span class="ident">continuous</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Whether to run tests continuously as source changes.</p>
</div></td></tr>
<tr><td><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Whether to preserve the user&#39;s focus when the run is started</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TestRunRequest">TestRunRequest</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TestRunRequest.continuous"></a><span class="ts" id=4512 data-target="#details-4512" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">continuous</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4512">
<div class="comment"><p>Whether the profile should run continuously as source code changes. Only
relevant for profiles that set <a href="#TestRunProfile.supportsContinuousRun">TestRunProfile.supportsContinuousRun</a>.</p>
</div>
</div>



<a name="TestRunRequest.exclude"></a><span class="ts" id=4510 data-target="#details-4510" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">exclude</span><span>: </span>readonly <a class="type-ref" href="#TestItem">TestItem</a>[]</span>
<div class="details collapse" id="details-4510">
<div class="comment"><p>An array of tests the user has marked as excluded from the test included
in this run; exclusions should apply after inclusions.</p>
<p>May be omitted if no exclusions were requested. Test controllers should
not run excluded tests or any children of excluded tests.</p>
</div>
</div>



<a name="TestRunRequest.include"></a><span class="ts" id=4509 data-target="#details-4509" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">include</span><span>: </span>readonly <a class="type-ref" href="#TestItem">TestItem</a>[]</span>
<div class="details collapse" id="details-4509">
<div class="comment"><p>A filter for specific tests to run. If given, the extension should run
all of the included tests and all their children, excluding any tests
that appear in <a href="#TestRunRequest.exclude">TestRunRequest.exclude</a>. If this property is
undefined, then the extension should simply run all tests.</p>
<p>The process of running tests should resolve the children of any test
items who have not yet been resolved.</p>
</div>
</div>



<a name="TestRunRequest.preserveFocus"></a><span class="ts" id=4513 data-target="#details-4513" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">preserveFocus</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-4513">
<div class="comment"><p>Controls how test Test Results view is focused.  If true, the editor
will keep the maintain the user&#39;s focus. If false, the editor will
prefer to move focus into the Test Results view, although
this may be configured by users.</p>
</div>
</div>



<a name="TestRunRequest.profile"></a><span class="ts" id=4511 data-target="#details-4511" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">profile</span><span>: </span><a class="type-ref" href="#TestRunProfile">TestRunProfile</a></span>
<div class="details collapse" id="details-4511">
<div class="comment"><p>The profile used for this request. This will always be defined
for requests issued from the editor UI, though extensions may
programmatically create requests not associated with any profile.</p>
</div>
</div>

### <a name="TestTag"></a><span class="code-item" id=4427>TestTag</span>



<div class="comment"><p>Tags can be associated with <a href="#TestItem">TestItems</a> and
<a href="#TestRunProfile">TestRunProfiles</a>. A profile with a tag can only
execute tests that include that tag in their <a href="#TestItem.tags">TestItem.tags</a> array.</p>
</div>

#### Constructors



<a name="TestTag.TestTag"></a><span class="ts" id=4429 data-target="#details-4429" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TestTag</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#TestTag">TestTag</a></span>
<div class="details collapse" id="details-4429">
<div class="comment"><p>Creates a new TestTag instance.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>ID of the test tag.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TestTag">TestTag</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TestTag.id"></a><span class="ts" id=4431 data-target="#details-4431" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-4431">
<div class="comment"><p>ID of the test tag. <code>TestTag</code> instances with the same ID are considered
to be identical.</p>
</div>
</div>

### <a name="TextDocument"></a><span class="code-item" id=15>TextDocument</span>



<div class="comment"><p>Represents a text document, such as a source file. Text documents have
<a href="#TextLine">lines</a> and knowledge about an underlying resource like a file.</p>
</div>

#### Properties



<a name="TextDocument.encoding"></a><span class="ts" id=20 data-target="#details-20" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">encoding</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-20">
<div class="comment"><p>The file encoding of this document that will be used when the document is saved.</p>
<p>Use the <a href="#workspace.onDidChangeTextDocument">onDidChangeTextDocument</a>-event to
get notified when the document encoding changes.</p>
<p>Note that the possible encoding values are currently defined as any of the following:
&#39;utf8&#39;, &#39;utf8bom&#39;, &#39;utf16le&#39;, &#39;utf16be&#39;, &#39;windows1252&#39;, &#39;iso88591&#39;, &#39;iso88593&#39;,
&#39;iso885915&#39;, &#39;macroman&#39;, &#39;cp437&#39;, &#39;windows1256&#39;, &#39;iso88596&#39;, &#39;windows1257&#39;,
&#39;iso88594&#39;, &#39;iso885914&#39;, &#39;windows1250&#39;, &#39;iso88592&#39;, &#39;cp852&#39;, &#39;windows1251&#39;,
&#39;cp866&#39;, &#39;cp1125&#39;, &#39;iso88595&#39;, &#39;koi8r&#39;, &#39;koi8u&#39;, &#39;iso885913&#39;, &#39;windows1253&#39;,
&#39;iso88597&#39;, &#39;windows1255&#39;, &#39;iso88598&#39;, &#39;iso885910&#39;, &#39;iso885916&#39;, &#39;windows1254&#39;,
&#39;iso88599&#39;, &#39;windows1258&#39;, &#39;gbk&#39;, &#39;gb18030&#39;, &#39;cp950&#39;, &#39;big5hkscs&#39;, &#39;shiftjis&#39;,
&#39;eucjp&#39;, &#39;euckr&#39;, &#39;windows874&#39;, &#39;iso885911&#39;, &#39;koi8ru&#39;, &#39;koi8t&#39;, &#39;gb2312&#39;,
&#39;cp865&#39;, &#39;cp850&#39;, &#39;cp857&#39;.</p>
</div>
</div>



<a name="TextDocument.eol"></a><span class="ts" id=26 data-target="#details-26" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">eol</span><span>: </span><a class="type-ref" href="#EndOfLine">EndOfLine</a></span>
<div class="details collapse" id="details-26">
<div class="comment"><p>The <a href="#EndOfLine">end of line</a> sequence that is predominately
used in this document.</p>
</div>
</div>



<a name="TextDocument.fileName"></a><span class="ts" id=17 data-target="#details-17" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fileName</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-17">
<div class="comment"><p>The file system path of the associated resource. Shorthand
notation for <a href="#TextDocument.uri">TextDocument.uri.fsPath</a>. Independent of the uri scheme.</p>
</div>
</div>



<a name="TextDocument.isClosed"></a><span class="ts" id=23 data-target="#details-23" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isClosed</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-23">
<div class="comment"><p><code>true</code> if the document has been closed. A closed document isn&#39;t synchronized anymore
and won&#39;t be re-used when the same resource is opened again.</p>
</div>
</div>



<a name="TextDocument.isDirty"></a><span class="ts" id=22 data-target="#details-22" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isDirty</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-22">
<div class="comment"><p><code>true</code> if there are unpersisted changes.</p>
</div>
</div>



<a name="TextDocument.isUntitled"></a><span class="ts" id=18 data-target="#details-18" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isUntitled</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-18">
<div class="comment"><p>Is this document representing an untitled file which has never been saved yet. <em>Note</em> that
this does not mean the document will be saved to disk, use <a href="#Uri.scheme">Uri.scheme</a>
to figure out where a document will be <a href="#FileSystemProvider">saved</a>, e.g. <code>file</code>, <code>ftp</code> etc.</p>
</div>
</div>



<a name="TextDocument.languageId"></a><span class="ts" id=19 data-target="#details-19" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">languageId</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-19">
<div class="comment"><p>The identifier of the language associated with this document.</p>
</div>
</div>



<a name="TextDocument.lineCount"></a><span class="ts" id=27 data-target="#details-27" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">lineCount</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-27">
<div class="comment"><p>The number of lines in this document.</p>
</div>
</div>



<a name="TextDocument.uri"></a><span class="ts" id=16 data-target="#details-16" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-16">
<div class="comment"><p>The associated uri for this document.</p>
<p><em>Note</em> that most documents use the <code>file</code>-scheme, which means they are files on disk. However, <strong>not</strong> all documents are
saved on disk and therefore the <code>scheme</code> must be checked before trying to access the underlying file or siblings on disk.</p>
<p><em>See also</em></p>
<ul>
<li><a href="#FileSystemProvider">FileSystemProvider</a></li>
<li><a href="#TextDocumentContentProvider">TextDocumentContentProvider</a></li>
</ul>
</div>
</div>



<a name="TextDocument.version"></a><span class="ts" id=21 data-target="#details-21" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">version</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-21">
<div class="comment"><p>The version number of this document (it will strictly increase after each
change, including undo/redo).</p>
</div>
</div>

#### Methods



<a name="TextDocument.getText"></a><span class="ts" id=40 data-target="#details-40" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getText</span><span>(</span><span class="ident">range</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a><span>)</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-40">
<div class="comment"><p>Get the text of this document. A substring can be retrieved by providing
a range. The range will be <a href="#TextDocument.validateRange">adjusted</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>Include only the text included by the range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The text inside the provided range or the entire text.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TextDocument.getWordRangeAtPosition"></a><span class="ts" id=43 data-target="#details-43" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getWordRangeAtPosition</span><span>(</span><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">regex</span><span>?</span><span>: </span><span class="type-ref-ts">RegExp</span><span>)</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-43">
<div class="comment"><p>Get a word-range at the given position. By default words are defined by
common separators, like space, -, _, etc. In addition, per language custom
[word definitions] can be defined. It
is also possible to provide a custom regular expression.</p>
<ul>
<li><em>Note 1:</em> A custom regular expression must not match the empty string and
if it does, it will be ignored.</li>
<li><em>Note 2:</em> A custom regular expression will fail to match multiline strings
and in the name of speed regular expressions should not match words with
spaces. Use <a href="#TextLine.text">TextLine.text</a> for more complex, non-wordy, scenarios.</li>
</ul>
<p>The position will be <a href="#TextDocument.validatePosition">adjusted</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><td><span class="ident">regex</span><span>?</span><span>: </span><span class="type-ref-ts">RegExp</span></td><td><div class="comment"><p>Optional regular expression that describes what a word is.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range spanning a word, or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TextDocument.lineAt"></a><span class="ts" id=29 data-target="#details-29" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">lineAt</span><span>(</span><span class="ident">line</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#TextLine">TextLine</a></span>
<div class="details collapse" id="details-29">
<div class="comment"><p>Returns a text line denoted by the line number. Note
that the returned object is <em>not</em> live and changes to the
document are not reflected.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">line</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A line number in <code>[0, lineCount)</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TextLine">TextLine</a></td><td><div class="comment"><p>A <a href="#TextLine">line</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TextDocument.lineAt"></a><span class="ts" id=31 data-target="#details-31" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">lineAt</span><span>(</span><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><a class="type-ref" href="#TextLine">TextLine</a></span>
<div class="details collapse" id="details-31">
<div class="comment"><p>Returns a text line denoted by the position. Note
that the returned object is <em>not</em> live and changes to the
document are not reflected.</p>
<p>The position will be <a href="#TextDocument.validatePosition">adjusted</a>.</p>
<p><em>See also</em>
<a href="#TextDocument.lineAt">TextDocument.lineAt</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TextLine">TextLine</a></td><td><div class="comment"><p>A <a href="#TextLine">line</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TextDocument.offsetAt"></a><span class="ts" id=34 data-target="#details-34" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">offsetAt</span><span>(</span><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-34">
<div class="comment"><p>Converts the position to a zero-based offset.</p>
<p>The position will be <a href="#TextDocument.validatePosition">adjusted</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A valid zero-based offset in UTF-16 <a href="https://developer.mozilla.org/en-US/docs/Glossary/Code_unit">code units</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TextDocument.positionAt"></a><span class="ts" id=37 data-target="#details-37" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">positionAt</span><span>(</span><span class="ident">offset</span><span>: </span><span class="type-intrinsic">number</span><span>)</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-37">
<div class="comment"><p>Converts a zero-based offset to a position.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">offset</span><span>: </span><span class="type-intrinsic">number</span></td><td><div class="comment"><p>A zero-based offset into the document. This offset is in UTF-16 <a href="https://developer.mozilla.org/en-US/docs/Glossary/Code_unit">code units</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A valid <a href="#Position">Position</a>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TextDocument.save"></a><span class="ts" id=25 data-target="#details-25" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">save</span><span>(</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-25">
<div class="comment"><p>Save the underlying file.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>A promise that will resolve to <code>true</code> when the file
has been saved. If the save failed, will return <code>false</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TextDocument.validatePosition"></a><span class="ts" id=50 data-target="#details-50" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">validatePosition</span><span>(</span><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a><span>)</span><span>: </span><a class="type-ref" href="#Position">Position</a></span>
<div class="details collapse" id="details-50">
<div class="comment"><p>Ensure a position is contained in the range of this document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The given position or a new, adjusted position.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TextDocument.validateRange"></a><span class="ts" id=47 data-target="#details-47" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">validateRange</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a><span>)</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-47">
<div class="comment"><p>Ensure a range is completely contained in this document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The given range or a new, adjusted range.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="TextDocumentChangeEvent"></a><span class="code-item" id=3286>TextDocumentChangeEvent</span>



<div class="comment"><p>An event describing a transactional <a href="#TextDocument">document</a> change.</p>
</div>

#### Properties



<a name="TextDocumentChangeEvent.contentChanges"></a><span class="ts" id=3288 data-target="#details-3288" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contentChanges</span><span>: </span>readonly <a class="type-ref" href="#TextDocumentContentChangeEvent">TextDocumentContentChangeEvent</a>[]</span>
<div class="details collapse" id="details-3288">
<div class="comment"><p>An array of content changes.</p>
</div>
</div>



<a name="TextDocumentChangeEvent.document"></a><span class="ts" id=3287 data-target="#details-3287" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></span>
<div class="details collapse" id="details-3287">
<div class="comment"><p>The affected document.</p>
</div>
</div>



<a name="TextDocumentChangeEvent.reason"></a><span class="ts" id=3289 data-target="#details-3289" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">reason</span><span>: </span><a class="type-ref" href="#TextDocumentChangeReason">TextDocumentChangeReason</a></span>
<div class="details collapse" id="details-3289">
<div class="comment"><p>The reason why the document was changed.
Is <code>undefined</code> if the reason is not known.</p>
</div>
</div>

### <a name="TextDocumentChangeReason"></a><span class="code-item" id=3283>TextDocumentChangeReason</span>



<div class="comment"><p>Reasons for why a text document has changed.</p>
</div>

#### Enumeration Members



<a name="TextDocumentChangeReason.Undo"></a><span class="ts" id=3284 data-target="#details-3284" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Undo</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-3284">
<div class="comment"><p>The text change is caused by an undo operation.</p>
</div>
</div>



<a name="TextDocumentChangeReason.Redo"></a><span class="ts" id=3285 data-target="#details-3285" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Redo</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-3285">
<div class="comment"><p>The text change is caused by an redo operation.</p>
</div>
</div>

### <a name="TextDocumentContentChangeEvent"></a><span class="code-item" id=3278>TextDocumentContentChangeEvent</span>



<div class="comment"><p>An event describing an individual change in the text of a <a href="#TextDocument">document</a>.</p>
</div>

#### Properties



<a name="TextDocumentContentChangeEvent.range"></a><span class="ts" id=3279 data-target="#details-3279" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-3279">
<div class="comment"><p>The range that got replaced.</p>
</div>
</div>



<a name="TextDocumentContentChangeEvent.rangeLength"></a><span class="ts" id=3281 data-target="#details-3281" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">rangeLength</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3281">
<div class="comment"><p>The length of the range that got replaced.</p>
</div>
</div>



<a name="TextDocumentContentChangeEvent.rangeOffset"></a><span class="ts" id=3280 data-target="#details-3280" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">rangeOffset</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3280">
<div class="comment"><p>The offset of the range that got replaced.</p>
</div>
</div>



<a name="TextDocumentContentChangeEvent.text"></a><span class="ts" id=3282 data-target="#details-3282" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3282">
<div class="comment"><p>The new text for the range.</p>
</div>
</div>

### <a name="TextDocumentContentProvider"></a><span class="code-item" id=497>TextDocumentContentProvider</span>



<div class="comment"><p>A text document content provider allows to add readonly documents
to the editor, such as source from a dll or generated html from md.</p>
<p>Content providers are <a href="#workspace.registerTextDocumentContentProvider">registered</a>
for a <a href="#Uri.scheme">uri-scheme</a>. When a uri with that scheme is to
be <a href="#workspace.openTextDocument">loaded</a> the content provider is
asked.</p>
</div>

#### Events



<a name="TextDocumentContentProvider.onDidChange"></a><span class="ts" id=498 data-target="#details-498" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChange</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#Uri">Uri</a>&gt;</span>
<div class="details collapse" id="details-498">
<div class="comment"><p>An event to signal a resource has changed.</p>
</div>
</div>

#### Methods



<a name="TextDocumentContentProvider.provideTextDocumentContent"></a><span class="ts" id=500 data-target="#details-500" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideTextDocumentContent</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-intrinsic">string</span>&gt;</span>
<div class="details collapse" id="details-500">
<div class="comment"><p>Provide textual content for a given uri.</p>
<p>The editor will use the returned string-content to create a readonly
<a href="#TextDocument">document</a>. Resources allocated should be released when
the corresponding document has been <a href="#workspace.onDidCloseTextDocument">closed</a>.</p>
<p><strong>Note</strong>: The contents of the created <a href="#TextDocument">document</a> might not be
identical to the provided text due to end-of-line-sequence normalization.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>An uri which scheme matches the scheme this provider was <a href="#workspace.registerTextDocumentContentProvider">registered</a> for.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-intrinsic">string</span>&gt;</td><td><div class="comment"><p>A string or a thenable that resolves to such.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="TextDocumentSaveReason"></a><span class="code-item" id=3290>TextDocumentSaveReason</span>



<div class="comment"><p>Represents reasons why a text document is saved.</p>
</div>

#### Enumeration Members



<a name="TextDocumentSaveReason.Manual"></a><span class="ts" id=3291 data-target="#details-3291" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Manual</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-3291">
<div class="comment"><p>Manually triggered, e.g. by the user pressing save, by starting debugging,
or by an API call.</p>
</div>
</div>



<a name="TextDocumentSaveReason.AfterDelay"></a><span class="ts" id=3292 data-target="#details-3292" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">AfterDelay</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-3292">
<div class="comment"><p>Automatic after a delay.</p>
</div>
</div>



<a name="TextDocumentSaveReason.FocusOut"></a><span class="ts" id=3293 data-target="#details-3293" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">FocusOut</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-3293">
<div class="comment"><p>When the editor lost focus.</p>
</div>
</div>

### <a name="TextDocumentShowOptions"></a><span class="code-item" id=222>TextDocumentShowOptions</span>



<div class="comment"><p>Represents options to configure the behavior of showing a <a href="#TextDocument">document</a> in an <a href="#TextEditor">editor</a>.</p>
</div>

#### Properties



<a name="TextDocumentShowOptions.preserveFocus"></a><span class="ts" id=224 data-target="#details-224" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-224">
<div class="comment"><p>An optional flag that when <code>true</code> will stop the <a href="#TextEditor">editor</a> from taking focus.</p>
</div>
</div>



<a name="TextDocumentShowOptions.preview"></a><span class="ts" id=225 data-target="#details-225" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">preview</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-225">
<div class="comment"><p>An optional flag that controls if an <a href="#TextEditor">editor</a>-tab shows as preview. Preview tabs will
be replaced and reused until set to stay - either explicitly or through editing.</p>
<p><em>Note</em> that the flag is ignored if a user has disabled preview editors in settings.</p>
</div>
</div>



<a name="TextDocumentShowOptions.selection"></a><span class="ts" id=226 data-target="#details-226" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selection</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-226">
<div class="comment"><p>An optional selection to apply for the document in the <a href="#TextEditor">editor</a>.</p>
</div>
</div>



<a name="TextDocumentShowOptions.viewColumn"></a><span class="ts" id=223 data-target="#details-223" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">viewColumn</span><span>?</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a></span>
<div class="details collapse" id="details-223">
<div class="comment"><p>An optional view column in which the <a href="#TextEditor">editor</a> should be shown.
The default is the <a href="#ViewColumn.Active">active</a>. Columns that do not exist
will be created as needed up to the maximum of <a href="#ViewColumn.Nine">ViewColumn.Nine</a>.
Use <a href="#ViewColumn.Beside">ViewColumn.Beside</a> to open the editor to the side of the currently
active one.</p>
</div>
</div>

### <a name="TextDocumentWillSaveEvent"></a><span class="code-item" id=3294>TextDocumentWillSaveEvent</span>



<div class="comment"><p>An event that is fired when a <a href="#TextDocument">document</a> will be saved.</p>
<p>To make modifications to the document before it is being saved, call the
<a href="#TextDocumentWillSaveEvent.waitUntil">waitUntil</a>-function with a thenable
that resolves to an array of <a href="#TextEdit">text edits</a>.</p>
</div>

#### Properties



<a name="TextDocumentWillSaveEvent.document"></a><span class="ts" id=3295 data-target="#details-3295" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></span>
<div class="details collapse" id="details-3295">
<div class="comment"><p>The document that will be saved.</p>
</div>
</div>



<a name="TextDocumentWillSaveEvent.reason"></a><span class="ts" id=3296 data-target="#details-3296" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">reason</span><span>: </span><a class="type-ref" href="#TextDocumentSaveReason">TextDocumentSaveReason</a></span>
<div class="details collapse" id="details-3296">
<div class="comment"><p>The reason why save was triggered.</p>
</div>
</div>

#### Methods



<a name="TextDocumentWillSaveEvent.waitUntil"></a><span class="ts" id=3298 data-target="#details-3298" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">waitUntil</span><span>(</span><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;readonly <a class="type-ref" href="#TextEdit">TextEdit</a>[]&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3298">
<div class="comment"><p>Allows to pause the event loop and to apply <a href="#TextEdit">pre-save-edits</a>.
Edits of subsequent calls to this function will be applied in order. The
edits will be <em>ignored</em> if concurrent modifications of the document happened.</p>
<p><em>Note:</em> This function can only be called during event dispatch and not
in an asynchronous manner:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">onWillSaveTextDocument</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">event</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF"> =></span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> {</span></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // async, will *throw* an error</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">  setTimeout</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(() </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">=></span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">waitUntil</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">promise</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">));</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">  // sync, OK</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  event</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">waitUntil</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">promise</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">});</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;readonly <a class="type-ref" href="#TextEdit">TextEdit</a>[]&gt;</td><td><div class="comment"><p>A thenable that resolves to <a href="#TextEdit">pre-save-edits</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TextDocumentWillSaveEvent.waitUntil"></a><span class="ts" id=3300 data-target="#details-3300" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">waitUntil</span><span>(</span><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-3300">
<div class="comment"><p>Allows to pause the event loop until the provided thenable resolved.</p>
<p><em>Note:</em> This function can only be called during event dispatch.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">thenable</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">any</span>&gt;</td><td><div class="comment"><p>A thenable that delays saving.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TextEdit"></a><span class="code-item" id=892>TextEdit</span>



<div class="comment"><p>A text edit represents edits that should be applied
to a document.</p>
</div>

#### Static



<a name="TextEdit.delete"></a><span class="ts" id=902 data-target="#details-902" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">delete</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a><span>)</span><span>: </span><a class="type-ref" href="#TextEdit">TextEdit</a></span>
<div class="details collapse" id="details-902">
<div class="comment"><p>Utility to create a delete edit.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TextEdit">TextEdit</a></td><td><div class="comment"><p>A new text edit object.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TextEdit.insert"></a><span class="ts" id=898 data-target="#details-898" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">insert</span><span>(</span><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">newText</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#TextEdit">TextEdit</a></span>
<div class="details collapse" id="details-898">
<div class="comment"><p>Utility to create an insert edit.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position, will become an empty range.</p>
</div></td></tr>
<tr><td><span class="ident">newText</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TextEdit">TextEdit</a></td><td><div class="comment"><p>A new text edit object.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TextEdit.replace"></a><span class="ts" id=894 data-target="#details-894" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">replace</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">newText</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#TextEdit">TextEdit</a></span>
<div class="details collapse" id="details-894">
<div class="comment"><p>Utility to create a replace edit.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><td><span class="ident">newText</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TextEdit">TextEdit</a></td><td><div class="comment"><p>A new text edit object.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TextEdit.setEndOfLine"></a><span class="ts" id=905 data-target="#details-905" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">setEndOfLine</span><span>(</span><span class="ident">eol</span><span>: </span><a class="type-ref" href="#EndOfLine">EndOfLine</a><span>)</span><span>: </span><a class="type-ref" href="#TextEdit">TextEdit</a></span>
<div class="details collapse" id="details-905">
<div class="comment"><p>Utility to create an eol-edit.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">eol</span><span>: </span><a class="type-ref" href="#EndOfLine">EndOfLine</a></td><td><div class="comment"><p>An eol-sequence</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TextEdit">TextEdit</a></td><td><div class="comment"><p>A new text edit object.</p>
</div></td></tr>
</table>
</div>
</div>

#### Constructors



<a name="TextEdit.TextEdit"></a><span class="ts" id=908 data-target="#details-908" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TextEdit</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">newText</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#TextEdit">TextEdit</a></span>
<div class="details collapse" id="details-908">
<div class="comment"><p>Create a new TextEdit.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><td><span class="ident">newText</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TextEdit">TextEdit</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TextEdit.newEol"></a><span class="ts" id=913 data-target="#details-913" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">newEol</span><span>?</span><span>: </span><a class="type-ref" href="#EndOfLine">EndOfLine</a></span>
<div class="details collapse" id="details-913">
<div class="comment"><p>The eol-sequence used in the document.</p>
<p><em>Note</em> that the eol-sequence will be applied to the
whole document.</p>
</div>
</div>



<a name="TextEdit.newText"></a><span class="ts" id=912 data-target="#details-912" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">newText</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-912">
<div class="comment"><p>The string this edit will insert.</p>
</div>
</div>



<a name="TextEdit.range"></a><span class="ts" id=911 data-target="#details-911" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-911">
<div class="comment"><p>The range this edit applies to.</p>
</div>
</div>

### <a name="TextEditor"></a><span class="code-item" id=334>TextEditor</span>



<div class="comment"><p>Represents an editor that is attached to a <a href="#TextDocument">document</a>.</p>
</div>

#### Properties



<a name="TextEditor.document"></a><span class="ts" id=335 data-target="#details-335" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></span>
<div class="details collapse" id="details-335">
<div class="comment"><p>The document associated with this text editor. The document will be the same for the entire lifetime of this text editor.</p>
</div>
</div>



<a name="TextEditor.options"></a><span class="ts" id=339 data-target="#details-339" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">options</span><span>: </span><a class="type-ref" href="#TextEditorOptions">TextEditorOptions</a></span>
<div class="details collapse" id="details-339">
<div class="comment"><p>Text editor options.</p>
</div>
</div>



<a name="TextEditor.selection"></a><span class="ts" id=336 data-target="#details-336" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selection</span><span>: </span><a class="type-ref" href="#Selection">Selection</a></span>
<div class="details collapse" id="details-336">
<div class="comment"><p>The primary selection on this text editor. Shorthand for <code>TextEditor.selections[0]</code>.</p>
</div>
</div>



<a name="TextEditor.selections"></a><span class="ts" id=337 data-target="#details-337" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selections</span><span>: </span>readonly <a class="type-ref" href="#Selection">Selection</a>[]</span>
<div class="details collapse" id="details-337">
<div class="comment"><p>The selections in this text editor. The primary selection is always at index 0.</p>
</div>
</div>



<a name="TextEditor.viewColumn"></a><span class="ts" id=340 data-target="#details-340" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">viewColumn</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a></span>
<div class="details collapse" id="details-340">
<div class="comment"><p>The column in which this editor shows. Will be <code>undefined</code> in case this
isn&#39;t one of the main editors, e.g. an embedded editor, or when the editor
column is larger than three.</p>
</div>
</div>



<a name="TextEditor.visibleRanges"></a><span class="ts" id=338 data-target="#details-338" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">visibleRanges</span><span>: </span>readonly <a class="type-ref" href="#Range">Range</a>[]</span>
<div class="details collapse" id="details-338">
<div class="comment"><p>The current visible ranges in the editor (vertically).
This accounts only for vertical scrolling, and not for horizontal scrolling.</p>
</div>
</div>

#### Methods



<a name="TextEditor.edit"></a><span class="ts" id=342 data-target="#details-342" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">edit</span><span>(</span><span class="ident">callback</span><span>: </span>(editBuilder: <a class="type-ref" href="#TextEditorEdit">TextEditorEdit</a>) =&gt; <span class="type-intrinsic">void</span>, <span class="ident">options</span><span>?</span><span>: </span>{undoStopAfter: <span class="type-intrinsic">boolean</span>, undoStopBefore: <span class="type-intrinsic">boolean</span>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-342">
<div class="comment"><p>Perform an edit on the document associated with this text editor.</p>
<p>The given callback-function is invoked with an <a href="#TextEditorEdit">edit-builder</a> which must
be used to make edits. Note that the edit-builder is only valid while the
callback executes.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">callback</span><span>: </span>(editBuilder: <a class="type-ref" href="#TextEditorEdit">TextEditorEdit</a>) =&gt; <span class="type-intrinsic">void</span></td><td><div class="comment"><p>A function which can create edits using an <a href="#TextEditorEdit">edit-builder</a>.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{undoStopAfter: <span class="type-intrinsic">boolean</span>, undoStopBefore: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"><p>The undo/redo behavior around this edit. By default, undo stops will be created before and after this edit.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>A promise that resolves with a value indicating if the edits could be applied.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TextEditor.hide"></a><span class="ts" id=372 data-target="#details-372" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">hide</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-372">
<div class="comment"><p>Hide the text editor.</p>
<ul>
<li><em>deprecated</em> - Use the command <code>workbench.action.closeActiveEditor</code> instead.
This method shows unexpected behavior and will be removed in the next major update.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TextEditor.insertSnippet"></a><span class="ts" id=352 data-target="#details-352" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">insertSnippet</span><span>(</span><span class="ident">snippet</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a>, <span class="ident">location</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a> &#124; readonly <a class="type-ref" href="#Range">Range</a>[] &#124; readonly <a class="type-ref" href="#Position">Position</a>[], <span class="ident">options</span><span>?</span><span>: </span>{keepWhitespace: <span class="type-intrinsic">boolean</span>, undoStopAfter: <span class="type-intrinsic">boolean</span>, undoStopBefore: <span class="type-intrinsic">boolean</span>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-352">
<div class="comment"><p>Insert a <a href="#SnippetString">snippet</a> and put the editor into snippet mode. &quot;Snippet mode&quot;
means the editor adds placeholders and additional cursors so that the user can complete
or accept the snippet.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">snippet</span><span>: </span><a class="type-ref" href="#SnippetString">SnippetString</a></td><td><div class="comment"><p>The snippet to insert in this edit.</p>
</div></td></tr>
<tr><td><span class="ident">location</span><span>?</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a> &#124; readonly <a class="type-ref" href="#Range">Range</a>[] &#124; readonly <a class="type-ref" href="#Position">Position</a>[]</td><td><div class="comment"><p>Position or range at which to insert the snippet, defaults to the current editor selection or selections.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{keepWhitespace: <span class="type-intrinsic">boolean</span>, undoStopAfter: <span class="type-intrinsic">boolean</span>, undoStopBefore: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"><p>The undo/redo behavior around this edit. By default, undo stops will be created before and after this edit.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>A promise that resolves with a value indicating if the snippet could be inserted. Note that the promise does not signal
that the snippet is completely filled-in or accepted.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TextEditor.revealRange"></a><span class="ts" id=365 data-target="#details-365" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">revealRange</span><span>(</span><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">revealType</span><span>?</span><span>: </span><a class="type-ref" href="#TextEditorRevealType">TextEditorRevealType</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-365">
<div class="comment"><p>Scroll as indicated by <code>revealType</code> in order to reveal the given range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><td><span class="ident">revealType</span><span>?</span><span>: </span><a class="type-ref" href="#TextEditorRevealType">TextEditorRevealType</a></td><td><div class="comment"><p>The scrolling strategy for revealing <code>range</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TextEditor.setDecorations"></a><span class="ts" id=361 data-target="#details-361" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">setDecorations</span><span>(</span><span class="ident">decorationType</span><span>: </span><a class="type-ref" href="#TextEditorDecorationType">TextEditorDecorationType</a>, <span class="ident">rangesOrOptions</span><span>: </span>readonly <a class="type-ref" href="#Range">Range</a>[] &#124; readonly <a class="type-ref" href="#DecorationOptions">DecorationOptions</a>[]<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-361">
<div class="comment"><p>Adds a set of decorations to the text editor. If a set of decorations already exists with
the given <a href="#TextEditorDecorationType">decoration type</a>, they will be replaced. If
<code>rangesOrOptions</code> is empty, the existing decorations with the given <a href="#TextEditorDecorationType">decoration type</a>
will be removed.</p>
<p><em>See also</em>
<a href="#window.createTextEditorDecorationType">createTextEditorDecorationType</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">decorationType</span><span>: </span><a class="type-ref" href="#TextEditorDecorationType">TextEditorDecorationType</a></td><td><div class="comment"><p>A decoration type.</p>
</div></td></tr>
<tr><td><span class="ident">rangesOrOptions</span><span>: </span>readonly <a class="type-ref" href="#Range">Range</a>[] &#124; readonly <a class="type-ref" href="#DecorationOptions">DecorationOptions</a>[]</td><td><div class="comment"><p>Either <a href="#Range">ranges</a> or more detailed <a href="#DecorationOptions">options</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TextEditor.show"></a><span class="ts" id=369 data-target="#details-369" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">show</span><span>(</span><span class="ident">column</span><span>?</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-369">
<div class="comment"><p>Show the text editor.</p>
<ul>
<li><em>deprecated</em> - Use <a href="#window.showTextDocument">window.showTextDocument</a> instead.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">column</span><span>?</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a></td><td><div class="comment"><p>The <a href="#ViewColumn">column</a> in which to show this editor.
This method shows unexpected behavior and will be removed in the next major update.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TextEditorCursorStyle"></a><span class="code-item" id=185>TextEditorCursorStyle</span>



<div class="comment"><p>Rendering style of the cursor.</p>
</div>

#### Enumeration Members



<a name="TextEditorCursorStyle.Line"></a><span class="ts" id=186 data-target="#details-186" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Line</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-186">
<div class="comment"><p>Render the cursor as a vertical thick line.</p>
</div>
</div>



<a name="TextEditorCursorStyle.Block"></a><span class="ts" id=187 data-target="#details-187" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Block</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-187">
<div class="comment"><p>Render the cursor as a block filled.</p>
</div>
</div>



<a name="TextEditorCursorStyle.Underline"></a><span class="ts" id=188 data-target="#details-188" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Underline</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-188">
<div class="comment"><p>Render the cursor as a thick horizontal line.</p>
</div>
</div>



<a name="TextEditorCursorStyle.LineThin"></a><span class="ts" id=189 data-target="#details-189" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">LineThin</span><span>: </span><span class="type-literal">4</span></span>
<div class="details collapse" id="details-189">
<div class="comment"><p>Render the cursor as a vertical thin line.</p>
</div>
</div>



<a name="TextEditorCursorStyle.BlockOutline"></a><span class="ts" id=190 data-target="#details-190" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">BlockOutline</span><span>: </span><span class="type-literal">5</span></span>
<div class="details collapse" id="details-190">
<div class="comment"><p>Render the cursor as a block outlined.</p>
</div>
</div>



<a name="TextEditorCursorStyle.UnderlineThin"></a><span class="ts" id=191 data-target="#details-191" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">UnderlineThin</span><span>: </span><span class="type-literal">6</span></span>
<div class="details collapse" id="details-191">
<div class="comment"><p>Render the cursor as a thin horizontal line.</p>
</div>
</div>

### <a name="TextEditorDecorationType"></a><span class="code-item" id=203>TextEditorDecorationType</span>



<div class="comment"><p>Represents a handle to a set of decorations
sharing the same <a href="#DecorationRenderOptions">styling options</a> in a <a href="#TextEditor">text editor</a>.</p>
<p>To get an instance of a <code>TextEditorDecorationType</code> use
<a href="#window.createTextEditorDecorationType">createTextEditorDecorationType</a>.</p>
</div>

#### Properties



<a name="TextEditorDecorationType.key"></a><span class="ts" id=204 data-target="#details-204" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">key</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-204">
<div class="comment"><p>Internal representation of the handle.</p>
</div>
</div>

#### Methods



<a name="TextEditorDecorationType.dispose"></a><span class="ts" id=206 data-target="#details-206" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-206">
<div class="comment"><p>Remove this decoration type and all decorations on all text editors using it.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TextEditorEdit"></a><span class="code-item" id=376>TextEditorEdit</span>



<div class="comment"><p>A complex edit that will be applied in one transaction on a TextEditor.
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.)
they can be applied on a <a href="#TextDocument">document</a> associated with a <a href="#TextEditor">text editor</a>.</p>
</div>

#### Methods



<a name="TextEditorEdit.delete"></a><span class="ts" id=386 data-target="#details-386" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">delete</span><span>(</span><span class="ident">location</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Selection">Selection</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-386">
<div class="comment"><p>Delete a certain text region.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">location</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Selection">Selection</a></td><td><div class="comment"><p>The range this operation should remove.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TextEditorEdit.insert"></a><span class="ts" id=382 data-target="#details-382" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">insert</span><span>(</span><span class="ident">location</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-382">
<div class="comment"><p>Insert text at a location.
You can use <code>\r\n</code> or <code>\n</code> in <code>value</code> and they will be normalized to the current <a href="#TextDocument">document</a>.
Although the equivalent text edit can be made with <a href="#TextEditorEdit.replace">replace</a>, <code>insert</code> will produce a different resulting selection (it will get moved).</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">location</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position where the new text should be inserted.</p>
</div></td></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The new text this operation should insert.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TextEditorEdit.replace"></a><span class="ts" id=378 data-target="#details-378" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">replace</span><span>(</span><span class="ident">location</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a> &#124; <a class="type-ref" href="#Selection">Selection</a>, <span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-378">
<div class="comment"><p>Replace a certain text region with a new value.
You can use <code>\r\n</code> or <code>\n</code> in <code>value</code> and they will be normalized to the current <a href="#TextDocument">document</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">location</span><span>: </span><a class="type-ref" href="#Range">Range</a> &#124; <a class="type-ref" href="#Position">Position</a> &#124; <a class="type-ref" href="#Selection">Selection</a></td><td><div class="comment"><p>The range this operation should remove.</p>
</div></td></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The new text this operation should insert after removing <code>location</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TextEditorEdit.setEndOfLine"></a><span class="ts" id=389 data-target="#details-389" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">setEndOfLine</span><span>(</span><span class="ident">endOfLine</span><span>: </span><a class="type-ref" href="#EndOfLine">EndOfLine</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-389">
<div class="comment"><p>Set the end of line sequence.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">endOfLine</span><span>: </span><a class="type-ref" href="#EndOfLine">EndOfLine</a></td><td><div class="comment"><p>The new end of line for the <a href="#TextDocument">document</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TextEditorLineNumbersStyle"></a><span class="code-item" id=192>TextEditorLineNumbersStyle</span>



<div class="comment"><p>Rendering style of the line numbers.</p>
</div>

#### Enumeration Members



<a name="TextEditorLineNumbersStyle.Off"></a><span class="ts" id=193 data-target="#details-193" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Off</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-193">
<div class="comment"><p>Do not render the line numbers.</p>
</div>
</div>



<a name="TextEditorLineNumbersStyle.On"></a><span class="ts" id=194 data-target="#details-194" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">On</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-194">
<div class="comment"><p>Render the line numbers.</p>
</div>
</div>



<a name="TextEditorLineNumbersStyle.Relative"></a><span class="ts" id=195 data-target="#details-195" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Relative</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-195">
<div class="comment"><p>Render the line numbers with values relative to the primary cursor location.</p>
</div>
</div>



<a name="TextEditorLineNumbersStyle.Interval"></a><span class="ts" id=196 data-target="#details-196" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Interval</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-196">
<div class="comment"><p>Render the line numbers on every 10th line number.</p>
</div>
</div>

### <a name="TextEditorOptions"></a><span class="code-item" id=197>TextEditorOptions</span>



<div class="comment"><p>Represents a <a href="#TextEditor">text editor</a>&#39;s <a href="#TextEditor.options">options</a>.</p>
</div>

#### Properties



<a name="TextEditorOptions.cursorStyle"></a><span class="ts" id=201 data-target="#details-201" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cursorStyle</span><span>?</span><span>: </span><a class="type-ref" href="#TextEditorCursorStyle">TextEditorCursorStyle</a></span>
<div class="details collapse" id="details-201">
<div class="comment"><p>The rendering style of the cursor in this editor.
When getting a text editor&#39;s options, this property will always be present.
When setting a text editor&#39;s options, this property is optional.</p>
</div>
</div>



<a name="TextEditorOptions.indentSize"></a><span class="ts" id=199 data-target="#details-199" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">indentSize</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-199">
<div class="comment"><p>The number of spaces to insert when <a href="#TextEditorOptions.insertSpaces">insertSpaces</a> is true.</p>
<p>When getting a text editor&#39;s options, this property will always be a number (resolved).
When setting a text editor&#39;s options, this property is optional and it can be a number or <code>&quot;tabSize&quot;</code>.</p>
</div>
</div>



<a name="TextEditorOptions.insertSpaces"></a><span class="ts" id=200 data-target="#details-200" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">insertSpaces</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-200">
<div class="comment"><p>When pressing Tab insert <a href="#TextEditorOptions.tabSize">n</a> spaces.
When getting a text editor&#39;s options, this property will always be a boolean (resolved).
When setting a text editor&#39;s options, this property is optional and it can be a boolean or <code>&quot;auto&quot;</code>.</p>
</div>
</div>



<a name="TextEditorOptions.lineNumbers"></a><span class="ts" id=202 data-target="#details-202" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">lineNumbers</span><span>?</span><span>: </span><a class="type-ref" href="#TextEditorLineNumbersStyle">TextEditorLineNumbersStyle</a></span>
<div class="details collapse" id="details-202">
<div class="comment"><p>Render relative line numbers w.r.t. the current line number.
When getting a text editor&#39;s options, this property will always be present.
When setting a text editor&#39;s options, this property is optional.</p>
</div>
</div>



<a name="TextEditorOptions.tabSize"></a><span class="ts" id=198 data-target="#details-198" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tabSize</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-198">
<div class="comment"><p>The size in spaces a tab takes. This is used for two purposes:</p>
<ul>
<li>the rendering width of a tab character;</li>
<li>the number of spaces to insert when <a href="#TextEditorOptions.insertSpaces">insertSpaces</a> is true
and <code>indentSize</code> is set to <code>&quot;tabSize&quot;</code>.</li>
</ul>
<p>When getting a text editor&#39;s options, this property will always be a number (resolved).
When setting a text editor&#39;s options, this property is optional and it can be a number or <code>&quot;auto&quot;</code>.</p>
</div>
</div>

### <a name="TextEditorOptionsChangeEvent"></a><span class="code-item" id=179>TextEditorOptionsChangeEvent</span>



<div class="comment"><p>Represents an event describing the change in a <a href="#TextEditor.options">text editor&#39;s options</a>.</p>
</div>

#### Properties



<a name="TextEditorOptionsChangeEvent.options"></a><span class="ts" id=181 data-target="#details-181" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">options</span><span>: </span><a class="type-ref" href="#TextEditorOptions">TextEditorOptions</a></span>
<div class="details collapse" id="details-181">
<div class="comment"><p>The new value for the <a href="#TextEditor.options">text editor&#39;s options</a>.</p>
</div>
</div>



<a name="TextEditorOptionsChangeEvent.textEditor"></a><span class="ts" id=180 data-target="#details-180" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">textEditor</span><span>: </span><a class="type-ref" href="#TextEditor">TextEditor</a></span>
<div class="details collapse" id="details-180">
<div class="comment"><p>The <a href="#TextEditor">text editor</a> for which the options have changed.</p>
</div>
</div>

### <a name="TextEditorRevealType"></a><span class="code-item" id=207>TextEditorRevealType</span>



<div class="comment"><p>Represents different <a href="#TextEditor.revealRange">reveal</a> strategies in a text editor.</p>
</div>

#### Enumeration Members



<a name="TextEditorRevealType.Default"></a><span class="ts" id=208 data-target="#details-208" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Default</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-208">
<div class="comment"><p>The range will be revealed with as little scrolling as possible.</p>
</div>
</div>



<a name="TextEditorRevealType.InCenter"></a><span class="ts" id=209 data-target="#details-209" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">InCenter</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-209">
<div class="comment"><p>The range will always be revealed in the center of the viewport.</p>
</div>
</div>



<a name="TextEditorRevealType.InCenterIfOutsideViewport"></a><span class="ts" id=210 data-target="#details-210" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">InCenterIfOutsideViewport</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-210">
<div class="comment"><p>If the range is outside the viewport, it will be revealed in the center of the viewport.
Otherwise, it will be revealed with as little scrolling as possible.</p>
</div>
</div>



<a name="TextEditorRevealType.AtTop"></a><span class="ts" id=211 data-target="#details-211" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">AtTop</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-211">
<div class="comment"><p>The range will always be revealed at the top of the viewport.</p>
</div>
</div>

### <a name="TextEditorSelectionChangeEvent"></a><span class="code-item" id=172>TextEditorSelectionChangeEvent</span>



<div class="comment"><p>Represents an event describing the change in a <a href="#TextEditor.selections">text editor&#39;s selections</a>.</p>
</div>

#### Properties



<a name="TextEditorSelectionChangeEvent.kind"></a><span class="ts" id=175 data-target="#details-175" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>: </span><a class="type-ref" href="#TextEditorSelectionChangeKind">TextEditorSelectionChangeKind</a></span>
<div class="details collapse" id="details-175">
<div class="comment"><p>The <a href="#TextEditorSelectionChangeKind">change kind</a> which has triggered this
event. Can be <code>undefined</code>.</p>
</div>
</div>



<a name="TextEditorSelectionChangeEvent.selections"></a><span class="ts" id=174 data-target="#details-174" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selections</span><span>: </span>readonly <a class="type-ref" href="#Selection">Selection</a>[]</span>
<div class="details collapse" id="details-174">
<div class="comment"><p>The new value for the <a href="#TextEditor.selections">text editor&#39;s selections</a>.</p>
</div>
</div>



<a name="TextEditorSelectionChangeEvent.textEditor"></a><span class="ts" id=173 data-target="#details-173" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">textEditor</span><span>: </span><a class="type-ref" href="#TextEditor">TextEditor</a></span>
<div class="details collapse" id="details-173">
<div class="comment"><p>The <a href="#TextEditor">text editor</a> for which the selections have changed.</p>
</div>
</div>

### <a name="TextEditorSelectionChangeKind"></a><span class="code-item" id=168>TextEditorSelectionChangeKind</span>



<div class="comment"><p>Represents sources that can cause <a href="#window.onDidChangeTextEditorSelection">selection change events</a>.</p>
</div>

#### Enumeration Members



<a name="TextEditorSelectionChangeKind.Keyboard"></a><span class="ts" id=169 data-target="#details-169" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Keyboard</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-169">
<div class="comment"><p>Selection changed due to typing in the editor.</p>
</div>
</div>



<a name="TextEditorSelectionChangeKind.Mouse"></a><span class="ts" id=170 data-target="#details-170" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Mouse</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-170">
<div class="comment"><p>Selection change due to clicking in the editor.</p>
</div>
</div>



<a name="TextEditorSelectionChangeKind.Command"></a><span class="ts" id=171 data-target="#details-171" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Command</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-171">
<div class="comment"><p>Selection changed because a command ran.</p>
</div>
</div>

### <a name="TextEditorViewColumnChangeEvent"></a><span class="code-item" id=182>TextEditorViewColumnChangeEvent</span>



<div class="comment"><p>Represents an event describing the change of a <a href="#TextEditor.viewColumn">text editor&#39;s view column</a>.</p>
</div>

#### Properties



<a name="TextEditorViewColumnChangeEvent.textEditor"></a><span class="ts" id=183 data-target="#details-183" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">textEditor</span><span>: </span><a class="type-ref" href="#TextEditor">TextEditor</a></span>
<div class="details collapse" id="details-183">
<div class="comment"><p>The <a href="#TextEditor">text editor</a> for which the view column has changed.</p>
</div>
</div>



<a name="TextEditorViewColumnChangeEvent.viewColumn"></a><span class="ts" id=184 data-target="#details-184" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">viewColumn</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a></span>
<div class="details collapse" id="details-184">
<div class="comment"><p>The new value for the <a href="#TextEditor.viewColumn">text editor&#39;s view column</a>.</p>
</div>
</div>

### <a name="TextEditorVisibleRangesChangeEvent"></a><span class="code-item" id=176>TextEditorVisibleRangesChangeEvent</span>



<div class="comment"><p>Represents an event describing the change in a <a href="#TextEditor.visibleRanges">text editor&#39;s visible ranges</a>.</p>
</div>

#### Properties



<a name="TextEditorVisibleRangesChangeEvent.textEditor"></a><span class="ts" id=177 data-target="#details-177" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">textEditor</span><span>: </span><a class="type-ref" href="#TextEditor">TextEditor</a></span>
<div class="details collapse" id="details-177">
<div class="comment"><p>The <a href="#TextEditor">text editor</a> for which the visible ranges have changed.</p>
</div>
</div>



<a name="TextEditorVisibleRangesChangeEvent.visibleRanges"></a><span class="ts" id=178 data-target="#details-178" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">visibleRanges</span><span>: </span>readonly <a class="type-ref" href="#Range">Range</a>[]</span>
<div class="details collapse" id="details-178">
<div class="comment"><p>The new value for the <a href="#TextEditor.visibleRanges">text editor&#39;s visible ranges</a>.</p>
</div>
</div>

### <a name="TextLine"></a><span class="code-item" id=8>TextLine</span>



<div class="comment"><p>Represents a line of text, such as a line of source code.</p>
<p>TextLine objects are <strong>immutable</strong>. When a <a href="#TextDocument">document</a> changes,
previously retrieved lines will not represent the latest state.</p>
</div>

#### Properties



<a name="TextLine.firstNonWhitespaceCharacterIndex"></a><span class="ts" id=13 data-target="#details-13" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">firstNonWhitespaceCharacterIndex</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-13">
<div class="comment"><p>The offset of the first character which is not a whitespace character as defined
by <code>/\s/</code>. <strong>Note</strong> that if a line is all whitespace the length of the line is returned.</p>
</div>
</div>



<a name="TextLine.isEmptyOrWhitespace"></a><span class="ts" id=14 data-target="#details-14" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isEmptyOrWhitespace</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-14">
<div class="comment"><p>Whether this line is whitespace only, shorthand
for <a href="#TextLine.firstNonWhitespaceCharacterIndex">TextLine.firstNonWhitespaceCharacterIndex</a> === <a href="#TextLine.text">TextLine.text.length</a>.</p>
</div>
</div>



<a name="TextLine.lineNumber"></a><span class="ts" id=9 data-target="#details-9" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">lineNumber</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-9">
<div class="comment"><p>The zero-based line number.</p>
</div>
</div>



<a name="TextLine.range"></a><span class="ts" id=11 data-target="#details-11" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-11">
<div class="comment"><p>The range this line covers without the line separator characters.</p>
</div>
</div>



<a name="TextLine.rangeIncludingLineBreak"></a><span class="ts" id=12 data-target="#details-12" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">rangeIncludingLineBreak</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-12">
<div class="comment"><p>The range this line covers with the line separator characters.</p>
</div>
</div>



<a name="TextLine.text"></a><span class="ts" id=10 data-target="#details-10" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">text</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-10">
<div class="comment"><p>The text of this line without the line separator characters.</p>
</div>
</div>

### <a name="ThemableDecorationAttachmentRenderOptions"></a><span class="code-item" id=280>ThemableDecorationAttachmentRenderOptions</span>



<div class="comment"><p>Represents theme specific rendering styles for <a href="#ThemableDecorationRenderOptions.before">before</a> and
<a href="#ThemableDecorationRenderOptions.after">after</a> the content of text decorations.</p>
</div>

#### Properties



<a name="ThemableDecorationAttachmentRenderOptions.backgroundColor"></a><span class="ts" id=289 data-target="#details-289" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">backgroundColor</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-289">
<div class="comment"><p>CSS styling property that will be applied to the decoration attachment.</p>
</div>
</div>



<a name="ThemableDecorationAttachmentRenderOptions.border"></a><span class="ts" id=283 data-target="#details-283" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">border</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-283">
<div class="comment"><p>CSS styling property that will be applied to the decoration attachment.</p>
</div>
</div>



<a name="ThemableDecorationAttachmentRenderOptions.borderColor"></a><span class="ts" id=284 data-target="#details-284" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">borderColor</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-284">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="ThemableDecorationAttachmentRenderOptions.color"></a><span class="ts" id=288 data-target="#details-288" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">color</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-288">
<div class="comment"><p>CSS styling property that will be applied to the decoration attachment.</p>
</div>
</div>



<a name="ThemableDecorationAttachmentRenderOptions.contentIconPath"></a><span class="ts" id=282 data-target="#details-282" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contentIconPath</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-282">
<div class="comment"><p>An <strong>absolute path</strong> or an URI to an image to be rendered in the attachment. Either an icon
or a text can be shown, but not both.</p>
</div>
</div>



<a name="ThemableDecorationAttachmentRenderOptions.contentText"></a><span class="ts" id=281 data-target="#details-281" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contentText</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-281">
<div class="comment"><p>Defines a text content that is shown in the attachment. Either an icon or a text can be shown, but not both.</p>
</div>
</div>



<a name="ThemableDecorationAttachmentRenderOptions.fontStyle"></a><span class="ts" id=285 data-target="#details-285" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fontStyle</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-285">
<div class="comment"><p>CSS styling property that will be applied to the decoration attachment.</p>
</div>
</div>



<a name="ThemableDecorationAttachmentRenderOptions.fontWeight"></a><span class="ts" id=286 data-target="#details-286" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fontWeight</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-286">
<div class="comment"><p>CSS styling property that will be applied to the decoration attachment.</p>
</div>
</div>



<a name="ThemableDecorationAttachmentRenderOptions.height"></a><span class="ts" id=292 data-target="#details-292" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">height</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-292">
<div class="comment"><p>CSS styling property that will be applied to the decoration attachment.</p>
</div>
</div>



<a name="ThemableDecorationAttachmentRenderOptions.margin"></a><span class="ts" id=290 data-target="#details-290" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">margin</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-290">
<div class="comment"><p>CSS styling property that will be applied to the decoration attachment.</p>
</div>
</div>



<a name="ThemableDecorationAttachmentRenderOptions.textDecoration"></a><span class="ts" id=287 data-target="#details-287" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">textDecoration</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-287">
<div class="comment"><p>CSS styling property that will be applied to the decoration attachment.</p>
</div>
</div>



<a name="ThemableDecorationAttachmentRenderOptions.width"></a><span class="ts" id=291 data-target="#details-291" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">width</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-291">
<div class="comment"><p>CSS styling property that will be applied to the decoration attachment.</p>
</div>
</div>

### <a name="ThemableDecorationInstanceRenderOptions"></a><span class="code-item" id=326>ThemableDecorationInstanceRenderOptions</span>



<div class="comment"><p>Represents themable render options for decoration instances.</p>
</div>

#### Properties



<a name="ThemableDecorationInstanceRenderOptions.after"></a><span class="ts" id=328 data-target="#details-328" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">after</span><span>?</span><span>: </span><a class="type-ref" href="#ThemableDecorationAttachmentRenderOptions">ThemableDecorationAttachmentRenderOptions</a></span>
<div class="details collapse" id="details-328">
<div class="comment"><p>Defines the rendering options of the attachment that is inserted after the decorated text.</p>
</div>
</div>



<a name="ThemableDecorationInstanceRenderOptions.before"></a><span class="ts" id=327 data-target="#details-327" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">before</span><span>?</span><span>: </span><a class="type-ref" href="#ThemableDecorationAttachmentRenderOptions">ThemableDecorationAttachmentRenderOptions</a></span>
<div class="details collapse" id="details-327">
<div class="comment"><p>Defines the rendering options of the attachment that is inserted before the decorated text.</p>
</div>
</div>

### <a name="ThemableDecorationRenderOptions"></a><span class="code-item" id=256>ThemableDecorationRenderOptions</span>



<div class="comment"><p>Represents theme specific rendering styles for a <a href="#TextEditorDecorationType">text editor decoration</a>.</p>
</div>

#### Properties



<a name="ThemableDecorationRenderOptions.after"></a><span class="ts" id=279 data-target="#details-279" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">after</span><span>?</span><span>: </span><a class="type-ref" href="#ThemableDecorationAttachmentRenderOptions">ThemableDecorationAttachmentRenderOptions</a></span>
<div class="details collapse" id="details-279">
<div class="comment"><p>Defines the rendering options of the attachment that is inserted after the decorated text.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.backgroundColor"></a><span class="ts" id=257 data-target="#details-257" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">backgroundColor</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-257">
<div class="comment"><p>Background color of the decoration. Use rgba() and define transparent background colors to play well with other decorations.
Alternatively a color from the color registry can be <a href="#ThemeColor">referenced</a>.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.before"></a><span class="ts" id=278 data-target="#details-278" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">before</span><span>?</span><span>: </span><a class="type-ref" href="#ThemableDecorationAttachmentRenderOptions">ThemableDecorationAttachmentRenderOptions</a></span>
<div class="details collapse" id="details-278">
<div class="comment"><p>Defines the rendering options of the attachment that is inserted before the decorated text.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.border"></a><span class="ts" id=262 data-target="#details-262" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">border</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-262">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.borderColor"></a><span class="ts" id=263 data-target="#details-263" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">borderColor</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-263">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;border&#39; for setting one or more of the individual border properties.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.borderRadius"></a><span class="ts" id=264 data-target="#details-264" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">borderRadius</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-264">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;border&#39; for setting one or more of the individual border properties.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.borderSpacing"></a><span class="ts" id=265 data-target="#details-265" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">borderSpacing</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-265">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;border&#39; for setting one or more of the individual border properties.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.borderStyle"></a><span class="ts" id=266 data-target="#details-266" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">borderStyle</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-266">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;border&#39; for setting one or more of the individual border properties.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.borderWidth"></a><span class="ts" id=267 data-target="#details-267" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">borderWidth</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-267">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;border&#39; for setting one or more of the individual border properties.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.color"></a><span class="ts" id=272 data-target="#details-272" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">color</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-272">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.cursor"></a><span class="ts" id=271 data-target="#details-271" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cursor</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-271">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.fontStyle"></a><span class="ts" id=268 data-target="#details-268" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fontStyle</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-268">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.fontWeight"></a><span class="ts" id=269 data-target="#details-269" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fontWeight</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-269">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.gutterIconPath"></a><span class="ts" id=275 data-target="#details-275" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">gutterIconPath</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-275">
<div class="comment"><p>An <strong>absolute path</strong> or an URI to an image to be rendered in the gutter.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.gutterIconSize"></a><span class="ts" id=276 data-target="#details-276" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">gutterIconSize</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-276">
<div class="comment"><p>Specifies the size of the gutter icon.
Available values are &#39;auto&#39;, &#39;contain&#39;, &#39;cover&#39; and any percentage value.
For further information: <a href="https://msdn.microsoft.com/en-us/library/jj127316(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/jj127316(v=vs.85).aspx</a></p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.letterSpacing"></a><span class="ts" id=274 data-target="#details-274" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">letterSpacing</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-274">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.opacity"></a><span class="ts" id=273 data-target="#details-273" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">opacity</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-273">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.outline"></a><span class="ts" id=258 data-target="#details-258" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">outline</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-258">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.outlineColor"></a><span class="ts" id=259 data-target="#details-259" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">outlineColor</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-259">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;outline&#39; for setting one or more of the individual outline properties.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.outlineStyle"></a><span class="ts" id=260 data-target="#details-260" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">outlineStyle</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-260">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;outline&#39; for setting one or more of the individual outline properties.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.outlineWidth"></a><span class="ts" id=261 data-target="#details-261" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">outlineWidth</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-261">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.
Better use &#39;outline&#39; for setting one or more of the individual outline properties.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.overviewRulerColor"></a><span class="ts" id=277 data-target="#details-277" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">overviewRulerColor</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-277">
<div class="comment"><p>The color of the decoration in the overview ruler. Use rgba() and define transparent colors to play well with other decorations.</p>
</div>
</div>



<a name="ThemableDecorationRenderOptions.textDecoration"></a><span class="ts" id=270 data-target="#details-270" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">textDecoration</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-270">
<div class="comment"><p>CSS styling property that will be applied to text enclosed by a decoration.</p>
</div>
</div>

### <a name="ThemeColor"></a><span class="code-item" id=238>ThemeColor</span>



<div class="comment"><p>A reference to one of the workbench colors as defined in <a href="https://code.visualstudio.com/api/references/theme-color">https://code.visualstudio.com/api/references/theme-color</a>.
Using a theme color is preferred over a custom color as it gives theme authors and users the possibility to change the color.</p>
</div>

#### Constructors



<a name="ThemeColor.ThemeColor"></a><span class="ts" id=240 data-target="#details-240" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ThemeColor</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-240">
<div class="comment"><p>Creates a reference to a theme color.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>of the color. The available colors are listed in <a href="https://code.visualstudio.com/api/references/theme-color">https://code.visualstudio.com/api/references/theme-color</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ThemeColor">ThemeColor</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="ThemeColor.id"></a><span class="ts" id=242 data-target="#details-242" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-242">
<div class="comment"><p>The id of this color.</p>
</div>
</div>

### <a name="ThemeIcon"></a><span class="code-item" id=243>ThemeIcon</span>



<div class="comment"><p>A reference to a named icon. Currently, <a href="#ThemeIcon.File">File</a>, <a href="#ThemeIcon.Folder">Folder</a>,
and <a href="https://code.visualstudio.com/api/references/icons-in-labels#icon-listing">ThemeIcon ids</a> are supported.
Using a theme icon is preferred over a custom icon as it gives product theme authors the possibility to change the icons.</p>
<p><em>Note</em> that theme icons can also be rendered inside labels and descriptions. Places that support theme icons spell this out
and they use the <code>$(&lt;name&gt;)</code>-syntax, for instance <code>quickPick.label = &quot;Hello World $(globe)&quot;</code>.</p>
</div>

#### Static



<a name="ThemeIcon.File"></a><span class="ts" id=244 data-target="#details-244" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">File</span><span>: </span><a class="type-ref" href="#ThemeIcon">ThemeIcon</a></span>
<div class="details collapse" id="details-244">
<div class="comment"><p>Reference to an icon representing a file. The icon is taken from the current file icon theme or a placeholder icon is used.</p>
</div>
</div>



<a name="ThemeIcon.Folder"></a><span class="ts" id=245 data-target="#details-245" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Folder</span><span>: </span><a class="type-ref" href="#ThemeIcon">ThemeIcon</a></span>
<div class="details collapse" id="details-245">
<div class="comment"><p>Reference to an icon representing a folder. The icon is taken from the current file icon theme or a placeholder icon is used.</p>
</div>
</div>

#### Constructors



<a name="ThemeIcon.ThemeIcon"></a><span class="ts" id=247 data-target="#details-247" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ThemeIcon</span><span>(</span><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">color</span><span>?</span><span>: </span><a class="type-ref" href="#ThemeColor">ThemeColor</a><span>)</span><span>: </span><a class="type-ref" href="#ThemeIcon">ThemeIcon</a></span>
<div class="details collapse" id="details-247">
<div class="comment"><p>Creates a reference to a theme icon.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>id of the icon. The available icons are listed in <a href="https://code.visualstudio.com/api/references/icons-in-labels#icon-listing">https://code.visualstudio.com/api/references/icons-in-labels#icon-listing</a>.</p>
</div></td></tr>
<tr><td><span class="ident">color</span><span>?</span><span>: </span><a class="type-ref" href="#ThemeColor">ThemeColor</a></td><td><div class="comment"><p>optional <code>ThemeColor</code> for the icon. The color is currently only used in <a href="#TreeItem">TreeItem</a>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ThemeIcon">ThemeIcon</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="ThemeIcon.color"></a><span class="ts" id=251 data-target="#details-251" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">color</span><span>?</span><span>: </span><a class="type-ref" href="#ThemeColor">ThemeColor</a></span>
<div class="details collapse" id="details-251">
<div class="comment"><p>The optional ThemeColor of the icon. The color is currently only used in <a href="#TreeItem">TreeItem</a>.</p>
</div>
</div>



<a name="ThemeIcon.id"></a><span class="ts" id=250 data-target="#details-250" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-250">
<div class="comment"><p>The id of the icon. The available icons are listed in <a href="https://code.visualstudio.com/api/references/icons-in-labels#icon-listing">https://code.visualstudio.com/api/references/icons-in-labels#icon-listing</a>.</p>
</div>
</div>

### <a name="TreeCheckboxChangeEvent"></a><span class="code-item" id=2964>TreeCheckboxChangeEvent&lt;T&gt;</span>



<div class="comment"><p>An event describing the change in a tree item&#39;s checkbox state.</p>
</div>

#### Properties



<a name="TreeCheckboxChangeEvent.items"></a><span class="ts" id=2966 data-target="#details-2966" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">items</span><span>: </span>ReadonlyArray&lt;[<span class="type-ref">T</span>, <a class="type-ref" href="#TreeItemCheckboxState">TreeItemCheckboxState</a>]&gt;</span>
<div class="details collapse" id="details-2966">
<div class="comment"><p>The items that were checked or unchecked.</p>
</div>
</div>

### <a name="TreeDataProvider"></a><span class="code-item" id=2990>TreeDataProvider&lt;T&gt;</span>



<div class="comment"><p>A data provider that provides tree data</p>
</div>

#### Events



<a name="TreeDataProvider.onDidChangeTreeData"></a><span class="ts" id=2992 data-target="#details-2992" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeTreeData</span><span>?</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span> &#124; <span class="type-ref">T</span> &#124; <span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-2992">
<div class="comment"><p>An optional event to signal that an element or root has changed.
This will trigger the view to update the changed element/root and its children recursively (if shown).
To signal that root has changed, do not pass any argument or pass <code>undefined</code> or <code>null</code>.</p>
</div>
</div>

#### Methods



<a name="TreeDataProvider.getChildren"></a><span class="ts" id=2997 data-target="#details-2997" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getChildren</span><span>(</span><span class="ident">element</span><span>?</span><span>: </span><span class="type-ref">T</span><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-2997">
<div class="comment"><p>Get the children of <code>element</code> or root if no element is passed.</p>
<p><em>Note:</em> The result is not mutated by the API consumer; readonly arrays may be cast to <code>T[]</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">element</span><span>?</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The element from which the provider gets children. Can be <code>undefined</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>Children of <code>element</code> or root if no element is passed.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TreeDataProvider.getParent"></a><span class="ts" id=3000 data-target="#details-3000" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getParent</span><span>(</span><span class="ident">element</span><span>: </span><span class="type-ref">T</span><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-3000">
<div class="comment"><p>Optional method to return the parent of <code>element</code>.
Return <code>null</code> or <code>undefined</code> if <code>element</code> is a child of root.</p>
<p><strong>NOTE:</strong> This method should be implemented in order to access <a href="#TreeView.reveal">reveal</a> API.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">element</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The element for which the parent has to be returned.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>Parent of <code>element</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TreeDataProvider.getTreeItem"></a><span class="ts" id=2994 data-target="#details-2994" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">getTreeItem</span><span>(</span><span class="ident">element</span><span>: </span><span class="type-ref">T</span><span>)</span><span>: </span><a class="type-ref" href="#TreeItem">TreeItem</a> &#124; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TreeItem">TreeItem</a>&gt;</span>
<div class="details collapse" id="details-2994">
<div class="comment"><p>Get <a href="#TreeItem">TreeItem</a> representation of the <code>element</code></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">element</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The element for which <a href="#TreeItem">TreeItem</a> representation is asked for.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TreeItem">TreeItem</a> &#124; <span class="type-ref">Thenable</span>&lt;<a class="type-ref" href="#TreeItem">TreeItem</a>&gt;</td><td><div class="comment"><p>TreeItem representation of the element.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TreeDataProvider.resolveTreeItem"></a><span class="ts" id=3003 data-target="#details-3003" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveTreeItem</span><span>(</span><span class="ident">item</span><span>: </span><a class="type-ref" href="#TreeItem">TreeItem</a>, <span class="ident">element</span><span>: </span><span class="type-ref">T</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TreeItem">TreeItem</a>&gt;</span>
<div class="details collapse" id="details-3003">
<div class="comment"><p>Called on hover to resolve the <a href="#TreeItem.tooltip">TreeItem</a> property if it is undefined.
Called on tree item click/open to resolve the <a href="#TreeItem.command">TreeItem</a> property if it is undefined.
Only properties that were undefined can be resolved in <code>resolveTreeItem</code>.
Functionality may be expanded later to include being called to resolve other missing
properties on selection and/or on open.</p>
<p>Will only ever be called once per TreeItem.</p>
<p>onDidChangeTreeData should not be triggered from within resolveTreeItem.</p>
<p><em>Note</em> that this function is called when tree items are already showing in the UI.
Because of that, no property that changes the presentation (label, description, etc.)
can be changed.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">item</span><span>: </span><a class="type-ref" href="#TreeItem">TreeItem</a></td><td><div class="comment"><p>Undefined properties of <code>item</code> should be set then <code>item</code> should be returned.</p>
</div></td></tr>
<tr><td><span class="ident">element</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The object associated with the TreeItem.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TreeItem">TreeItem</a>&gt;</td><td><div class="comment"><p>The resolved tree item or a thenable that resolves to such. It is OK to return the given
<code>item</code>. When no result is returned, the given <code>item</code> will be used.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="TreeDragAndDropController"></a><span class="code-item" id=2947>TreeDragAndDropController&lt;T&gt;</span>



<div class="comment"><p>Provides support for drag and drop in <code>TreeView</code>.</p>
</div>

#### Properties



<a name="TreeDragAndDropController.dragMimeTypes"></a><span class="ts" id=2950 data-target="#details-2950" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dragMimeTypes</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-2950">
<div class="comment"><p>The mime types that the <a href="#TreeDragAndDropController.handleDrag"><code>handleDrag</code></a> method of this <code>TreeDragAndDropController</code> may add to the tree data transfer.
This could be well-defined, existing, mime types, and also mime types defined by the extension.</p>
<p>The recommended mime type of the tree (<code>application/vnd.code.tree.&lt;treeidlowercase&gt;</code>) will be automatically added.</p>
</div>
</div>



<a name="TreeDragAndDropController.dropMimeTypes"></a><span class="ts" id=2949 data-target="#details-2949" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dropMimeTypes</span><span>: </span>readonly <span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-2949">
<div class="comment"><p>The mime types that the <a href="#TreeDragAndDropController.handleDrop"><code>handleDrop</code></a> method of this <code>DragAndDropController</code> supports.
This could be well-defined, existing, mime types, and also mime types defined by the extension.</p>
<p>To support drops from trees, you will need to add the mime type of that tree.
This includes drops from within the same tree.
The mime type of a tree is recommended to be of the format <code>application/vnd.code.tree.&lt;treeidlowercase&gt;</code>.</p>
<p>Use the special <code>files</code> mime type to support all types of dropped files <a href="#DataTransferFile">files</a>, regardless of the file&#39;s actual mime type.</p>
<p>To learn the mime type of a dragged item:</p>
<ol>
<li>Set up your <code>DragAndDropController</code></li>
<li>Use the Developer: Set Log Level... command to set the level to &quot;Debug&quot;</li>
<li>Open the developer tools and drag the item with unknown mime type over your tree. The mime types will be logged to the developer console</li>
</ol>
<p>Note that mime types that cannot be sent to the extension will be omitted.</p>
</div>
</div>

#### Methods



<a name="TreeDragAndDropController.handleDrag"></a><span class="ts" id=2952 data-target="#details-2952" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">handleDrag</span><span>(</span><span class="ident">source</span><span>: </span>readonly <span class="type-ref">T</span>[], <span class="ident">dataTransfer</span><span>: </span><a class="type-ref" href="#DataTransfer">DataTransfer</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2952">
<div class="comment"><p>When the user starts dragging items from this <code>DragAndDropController</code>, <code>handleDrag</code> will be called.
Extensions can use <code>handleDrag</code> to add their <a href="#DataTransferItem"><code>DataTransferItem</code></a> items to the drag and drop.</p>
<p>Mime types added in <code>handleDrag</code> won&#39;t be available outside the application.</p>
<p>When the items are dropped on <strong>another tree item</strong> in <strong>the same tree</strong>, your <code>DataTransferItem</code> objects
will be preserved. Use the recommended mime type for the tree (<code>application/vnd.code.tree.&lt;treeidlowercase&gt;</code>) to add
tree objects in a data transfer. See the documentation for <code>DataTransferItem</code> for how best to take advantage of this.</p>
<p>To add a data transfer item that can be dragged into the editor, use the application specific mime type &quot;text/uri-list&quot;.
The data for &quot;text/uri-list&quot; should be a string with <code>toString()</code>ed Uris separated by <code>\r\n</code>. To specify a cursor position in the file,
set the Uri&#39;s fragment to <code>L3,5</code>, where 3 is the line number and 5 is the column number.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">source</span><span>: </span>readonly <span class="type-ref">T</span>[]</td><td><div class="comment"><p>The source items for the drag and drop operation.</p>
</div></td></tr>
<tr><td><span class="ident">dataTransfer</span><span>: </span><a class="type-ref" href="#DataTransfer">DataTransfer</a></td><td><div class="comment"><p>The data transfer associated with this drag.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token indicating that drag has been cancelled.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TreeDragAndDropController.handleDrop"></a><span class="ts" id=2957 data-target="#details-2957" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">handleDrop</span><span>(</span><span class="ident">target</span><span>: </span><span class="type-ref">T</span>, <span class="ident">dataTransfer</span><span>: </span><a class="type-ref" href="#DataTransfer">DataTransfer</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2957">
<div class="comment"><p>Called when a drag and drop action results in a drop on the tree that this <code>DragAndDropController</code> belongs to.</p>
<p>Extensions should fire <a href="#TreeDataProvider.onDidChangeTreeData">onDidChangeTreeData</a> for any elements that need to be refreshed.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">target</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The target tree element that the drop is occurring on. When undefined, the target is the root.</p>
</div></td></tr>
<tr><td><span class="ident">dataTransfer</span><span>: </span><a class="type-ref" href="#DataTransfer">DataTransfer</a></td><td><div class="comment"><p>The data transfer items of the source of the drag.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token indicating that the drop has been cancelled.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TreeItem"></a><span class="code-item" id=3007>TreeItem</span>



<div class="comment"><p>A tree item is an UI element of the tree. Tree items are created by the <a href="#TreeDataProvider">data provider</a>.</p>
</div>

#### Constructors



<a name="TreeItem.TreeItem"></a><span class="ts" id=3009 data-target="#details-3009" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TreeItem</span><span>(</span><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#TreeItemLabel">TreeItemLabel</a>, <span class="ident">collapsibleState</span><span>?</span><span>: </span><a class="type-ref" href="#TreeItemCollapsibleState">TreeItemCollapsibleState</a><span>)</span><span>: </span><a class="type-ref" href="#TreeItem">TreeItem</a></span>
<div class="details collapse" id="details-3009">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#TreeItemLabel">TreeItemLabel</a></td><td><div class="comment"><p>A human-readable string describing this item</p>
</div></td></tr>
<tr><td><span class="ident">collapsibleState</span><span>?</span><span>: </span><a class="type-ref" href="#TreeItemCollapsibleState">TreeItemCollapsibleState</a></td><td><div class="comment"><p><a href="#TreeItemCollapsibleState">TreeItemCollapsibleState</a> of the tree item. Default is <a href="#TreeItemCollapsibleState.None">TreeItemCollapsibleState.None</a></p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TreeItem">TreeItem</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TreeItem.TreeItem"></a><span class="ts" id=3012 data-target="#details-3012" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TreeItem</span><span>(</span><span class="ident">resourceUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">collapsibleState</span><span>?</span><span>: </span><a class="type-ref" href="#TreeItemCollapsibleState">TreeItemCollapsibleState</a><span>)</span><span>: </span><a class="type-ref" href="#TreeItem">TreeItem</a></span>
<div class="details collapse" id="details-3012">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">resourceUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The <a href="#Uri">Uri</a> of the resource representing this item.</p>
</div></td></tr>
<tr><td><span class="ident">collapsibleState</span><span>?</span><span>: </span><a class="type-ref" href="#TreeItemCollapsibleState">TreeItemCollapsibleState</a></td><td><div class="comment"><p><a href="#TreeItemCollapsibleState">TreeItemCollapsibleState</a> of the tree item. Default is <a href="#TreeItemCollapsibleState.None">TreeItemCollapsibleState.None</a></p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TreeItem">TreeItem</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TreeItem.accessibilityInformation"></a><span class="ts" id=3024 data-target="#details-3024" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">accessibilityInformation</span><span>?</span><span>: </span><a class="type-ref" href="#AccessibilityInformation">AccessibilityInformation</a></span>
<div class="details collapse" id="details-3024">
<div class="comment"><p>Accessibility information used when screen reader interacts with this tree item.
Generally, a TreeItem has no need to set the <code>role</code> of the accessibilityInformation;
however, there are cases where a TreeItem is not displayed in a tree-like way where setting the <code>role</code> may make sense.</p>
</div>
</div>



<a name="TreeItem.checkboxState"></a><span class="ts" id=3025 data-target="#details-3025" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">checkboxState</span><span>?</span><span>: </span><a class="type-ref" href="#TreeItemCheckboxState">TreeItemCheckboxState</a> &#124; {accessibilityInformation: <a class="type-ref" href="#AccessibilityInformation">AccessibilityInformation</a>, state: <a class="type-ref" href="#TreeItemCheckboxState">TreeItemCheckboxState</a>, tooltip: <span class="type-intrinsic">string</span>}</span>
<div class="details collapse" id="details-3025">
<div class="comment"><p><a href="#TreeItemCheckboxState">TreeItemCheckboxState</a> of the tree item.
<a href="#TreeDataProvider.onDidChangeTreeData">onDidChangeTreeData</a> should be fired when <a href="#TreeItem.checkboxState">checkboxState</a> changes.</p>
</div>
</div>



<a name="TreeItem.collapsibleState"></a><span class="ts" id=3022 data-target="#details-3022" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">collapsibleState</span><span>?</span><span>: </span><a class="type-ref" href="#TreeItemCollapsibleState">TreeItemCollapsibleState</a></span>
<div class="details collapse" id="details-3022">
<div class="comment"><p><a href="#TreeItemCollapsibleState">TreeItemCollapsibleState</a> of the tree item.</p>
</div>
</div>



<a name="TreeItem.command"></a><span class="ts" id=3021 data-target="#details-3021" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">command</span><span>?</span><span>: </span><a class="type-ref" href="#Command">Command</a></span>
<div class="details collapse" id="details-3021">
<div class="comment"><p>The <a href="#Command">Command</a> that should be executed when the tree item is selected.</p>
<p>Please use <code>vscode.open</code> or <code>vscode.diff</code> as command IDs when the tree item is opening
something in the editor. Using these commands ensures that the resulting editor will
appear consistent with how other built-in trees open editors.</p>
</div>
</div>



<a name="TreeItem.contextValue"></a><span class="ts" id=3023 data-target="#details-3023" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">contextValue</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3023">
<div class="comment"><p>Context value of the tree item. This can be used to contribute item specific actions in the tree.
For example, a tree item is given a context value as <code>folder</code>. When contributing actions to <code>view/item/context</code>
using <code>menus</code> extension point, you can specify context value for key <code>viewItem</code> in <code>when</code> expression like <code>viewItem == folder</code>.</p>
<pre class="shiki" data-lang="json" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"contributes"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">  "menus"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">    "view/item/context"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: [</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">      {</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">        "command"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"extension.deleteFolder"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#0451A5">        "when"</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">: </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">"viewItem == folder"</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">      }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">    ]</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">  }</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">}</span></span></code></pre>
<p>This will show action <code>extension.deleteFolder</code> only for items with <code>contextValue</code> is <code>folder</code>.</p>
</div>
</div>



<a name="TreeItem.description"></a><span class="ts" id=3018 data-target="#details-3018" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">description</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-3018">
<div class="comment"><p>A human-readable string which is rendered less prominent.
When <code>true</code>, it is derived from <a href="#TreeItem.resourceUri">resourceUri</a> and when <code>falsy</code>, it is not shown.</p>
</div>
</div>



<a name="TreeItem.iconPath"></a><span class="ts" id=3017 data-target="#details-3017" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">iconPath</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#IconPath">IconPath</a></span>
<div class="details collapse" id="details-3017">
<div class="comment"><p>The icon path or <a href="#ThemeIcon">ThemeIcon</a> for the tree item.
When <code>falsy</code>, <a href="#ThemeIcon.Folder">Folder Theme Icon</a> is assigned, if item is collapsible otherwise <a href="#ThemeIcon.File">File Theme Icon</a>.
When a file or folder <a href="#ThemeIcon">ThemeIcon</a> is specified, icon is derived from the current file icon theme for the specified theme icon using <a href="#TreeItem.resourceUri">resourceUri</a> (if provided).</p>
</div>
</div>



<a name="TreeItem.id"></a><span class="ts" id=3016 data-target="#details-3016" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">id</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3016">
<div class="comment"><p>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.</p>
<p>If not provided, an id is generated using the tree item&#39;s label. <strong>Note</strong> that when labels change, ids will change and that selection and expansion state cannot be kept stable anymore.</p>
</div>
</div>



<a name="TreeItem.label"></a><span class="ts" id=3015 data-target="#details-3015" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#TreeItemLabel">TreeItemLabel</a></span>
<div class="details collapse" id="details-3015">
<div class="comment"><p>A human-readable string describing this item. When <code>falsy</code>, it is derived from <a href="#TreeItem.resourceUri">resourceUri</a>.</p>
</div>
</div>



<a name="TreeItem.resourceUri"></a><span class="ts" id=3019 data-target="#details-3019" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resourceUri</span><span>?</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-3019">
<div class="comment"><p>A <a href="#Uri">Uri</a> representing the resource associated with this item.</p>
<p>When set, this property is used to automatically derive several item properties if they are not explicitly provided:</p>
<ul>
<li><strong>Label</strong>: Derived from the resource&#39;s file name when <a href="#TreeItem.label">label</a> is not provided.</li>
<li><strong>Description</strong>: Derived from the resource&#39;s path when <a href="#TreeItem.description">description</a> is set to <code>true</code>.</li>
<li><strong>Icon</strong>: Derived from the current file icon theme when <a href="#TreeItem.iconPath">iconPath</a> is set to
<a href="#ThemeIcon.File">ThemeIcon.File</a> or <a href="#ThemeIcon.Folder">ThemeIcon.Folder</a>.</li>
</ul>
</div>
</div>



<a name="TreeItem.tooltip"></a><span class="ts" id=3020 data-target="#details-3020" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tooltip</span><span>?</span><span>: </span><span class="type-intrinsic">string</span> &#124; <a class="type-ref" href="#MarkdownString">MarkdownString</a></span>
<div class="details collapse" id="details-3020">
<div class="comment"><p>The tooltip text when you hover over this item.</p>
</div>
</div>

### <a name="TreeItemCheckboxState"></a><span class="code-item" id=3037>TreeItemCheckboxState</span>



<div class="comment"><p>Checkbox state of the tree item</p>
</div>

#### Enumeration Members



<a name="TreeItemCheckboxState.Unchecked"></a><span class="ts" id=3038 data-target="#details-3038" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Unchecked</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-3038">
<div class="comment"><p>Determines an item is unchecked</p>
</div>
</div>



<a name="TreeItemCheckboxState.Checked"></a><span class="ts" id=3039 data-target="#details-3039" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Checked</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-3039">
<div class="comment"><p>Determines an item is checked</p>
</div>
</div>

### <a name="TreeItemCollapsibleState"></a><span class="code-item" id=3030>TreeItemCollapsibleState</span>



<div class="comment"><p>Collapsible state of the tree item</p>
</div>

#### Enumeration Members



<a name="TreeItemCollapsibleState.None"></a><span class="ts" id=3031 data-target="#details-3031" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">None</span><span>: </span><span class="type-literal">0</span></span>
<div class="details collapse" id="details-3031">
<div class="comment"><p>Determines an item can be neither collapsed nor expanded. Implies it has no children.</p>
</div>
</div>



<a name="TreeItemCollapsibleState.Collapsed"></a><span class="ts" id=3032 data-target="#details-3032" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Collapsed</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-3032">
<div class="comment"><p>Determines an item is collapsed</p>
</div>
</div>



<a name="TreeItemCollapsibleState.Expanded"></a><span class="ts" id=3033 data-target="#details-3033" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Expanded</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-3033">
<div class="comment"><p>Determines an item is expanded</p>
</div>
</div>

### <a name="TreeItemLabel"></a><span class="code-item" id=3034>TreeItemLabel</span>



<div class="comment"><p>Label describing the <a href="#TreeItem">Tree item</a></p>
</div>

#### Properties



<a name="TreeItemLabel.highlights"></a><span class="ts" id=3036 data-target="#details-3036" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">highlights</span><span>?</span><span>: </span>Array&lt;[<span class="type-intrinsic">number</span>, <span class="type-intrinsic">number</span>]&gt;</span>
<div class="details collapse" id="details-3036">
<div class="comment"><p>Ranges in the label to highlight. A range is defined as a tuple of two number where the
first is the inclusive start index and the second the exclusive end index</p>
</div>
</div>



<a name="TreeItemLabel.label"></a><span class="ts" id=3035 data-target="#details-3035" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3035">
<div class="comment"><p>A human-readable string describing the <a href="#TreeItem">Tree item</a>.</p>
</div>
</div>

### <a name="TreeView"></a><span class="code-item" id=2967>TreeView&lt;T&gt;</span>



<div class="comment"><p>Represents a Tree view</p>
</div>

#### Events



<a name="TreeView.onDidChangeCheckboxState"></a><span class="ts" id=2975 data-target="#details-2975" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeCheckboxState</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TreeCheckboxChangeEvent&amp;lt;T&amp;gt;">TreeCheckboxChangeEvent</a>&lt;<span class="type-ref">T</span>&gt;&gt;</span>
<div class="details collapse" id="details-2975">
<div class="comment"><p>An event to signal that an element or root has either been checked or unchecked.</p>
</div>
</div>



<a name="TreeView.onDidChangeSelection"></a><span class="ts" id=2972 data-target="#details-2972" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeSelection</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TreeViewSelectionChangeEvent&amp;lt;T&amp;gt;">TreeViewSelectionChangeEvent</a>&lt;<span class="type-ref">T</span>&gt;&gt;</span>
<div class="details collapse" id="details-2972">
<div class="comment"><p>Event that is fired when the <a href="#TreeView.selection">selection</a> has changed</p>
</div>
</div>



<a name="TreeView.onDidChangeVisibility"></a><span class="ts" id=2974 data-target="#details-2974" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeVisibility</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TreeViewVisibilityChangeEvent">TreeViewVisibilityChangeEvent</a>&gt;</span>
<div class="details collapse" id="details-2974">
<div class="comment"><p>Event that is fired when <a href="#TreeView.visible">visibility</a> has changed</p>
</div>
</div>



<a name="TreeView.onDidCollapseElement"></a><span class="ts" id=2970 data-target="#details-2970" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidCollapseElement</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TreeViewExpansionEvent&amp;lt;T&amp;gt;">TreeViewExpansionEvent</a>&lt;<span class="type-ref">T</span>&gt;&gt;</span>
<div class="details collapse" id="details-2970">
<div class="comment"><p>Event that is fired when an element is collapsed</p>
</div>
</div>



<a name="TreeView.onDidExpandElement"></a><span class="ts" id=2969 data-target="#details-2969" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidExpandElement</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#TreeViewExpansionEvent&amp;lt;T&amp;gt;">TreeViewExpansionEvent</a>&lt;<span class="type-ref">T</span>&gt;&gt;</span>
<div class="details collapse" id="details-2969">
<div class="comment"><p>Event that is fired when an element is expanded</p>
</div>
</div>

#### Properties



<a name="TreeView.badge"></a><span class="ts" id=2979 data-target="#details-2979" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">badge</span><span>?</span><span>: </span><a class="type-ref" href="#ViewBadge">ViewBadge</a></span>
<div class="details collapse" id="details-2979">
<div class="comment"><p>The badge to display for this TreeView.
To remove the badge, set to undefined.</p>
</div>
</div>



<a name="TreeView.description"></a><span class="ts" id=2978 data-target="#details-2978" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">description</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2978">
<div class="comment"><p>An optional human-readable description which is rendered less prominently in the title of the view.
Setting the title description to null, undefined, or empty string will remove the description from the view.</p>
</div>
</div>



<a name="TreeView.message"></a><span class="ts" id=2976 data-target="#details-2976" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">message</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2976">
<div class="comment"><p>An optional human-readable message that will be rendered in the view.
Setting the message to null, undefined, or empty string will remove the message from the view.</p>
</div>
</div>



<a name="TreeView.selection"></a><span class="ts" id=2971 data-target="#details-2971" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selection</span><span>: </span>readonly <span class="type-ref">T</span>[]</span>
<div class="details collapse" id="details-2971">
<div class="comment"><p>Currently selected elements.</p>
</div>
</div>



<a name="TreeView.title"></a><span class="ts" id=2977 data-target="#details-2977" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2977">
<div class="comment"><p>The tree view title is initially taken from the extension package.json
Changes to the title property will be properly reflected in the UI in the title of the view.</p>
</div>
</div>



<a name="TreeView.visible"></a><span class="ts" id=2973 data-target="#details-2973" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">visible</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2973">
<div class="comment"><p><code>true</code> if the <a href="#TreeView">tree view</a> is visible otherwise <code>false</code>.</p>
</div>
</div>

#### Methods



<a name="TreeView.dispose"></a><span class="ts" id=2989 data-target="#details-2989" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">any</span></span>
<div class="details collapse" id="details-2989">
<div class="comment"><p>Dispose this object.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">any</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="TreeView.reveal"></a><span class="ts" id=2981 data-target="#details-2981" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">reveal</span><span>(</span><span class="ident">element</span><span>: </span><span class="type-ref">T</span>, <span class="ident">options</span><span>?</span><span>: </span>{expand: <span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span>, focus: <span class="type-intrinsic">boolean</span>, select: <span class="type-intrinsic">boolean</span>}<span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2981">
<div class="comment"><p>Reveals the given element in the tree view.
If the tree view is not visible then the tree view is shown and element is revealed.</p>
<p>By default revealed element is selected.
In order to not to select, set the option <code>select</code> to <code>false</code>.
In order to focus, set the option <code>focus</code> to <code>true</code>.
In order to expand the revealed element, set the option <code>expand</code> to <code>true</code>. To expand recursively set <code>expand</code> to the number of levels to expand.</p>
<ul>
<li><em>NOTE:</em> You can expand only to 3 levels maximum.</li>
<li><em>NOTE:</em> The <a href="#TreeDataProvider">TreeDataProvider</a> that the <code>TreeView</code> <a href="#window.createTreeView">is registered with</a> with must implement <a href="#TreeDataProvider.getParent">getParent</a> method to access this API.</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">element</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{expand: <span class="type-intrinsic">number</span> &#124; <span class="type-intrinsic">boolean</span>, focus: <span class="type-intrinsic">boolean</span>, select: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="TreeViewExpansionEvent"></a><span class="code-item" id=2904>TreeViewExpansionEvent&lt;T&gt;</span>



<div class="comment"><p>The event that is fired when an element in the <a href="#TreeView">TreeView</a> is expanded or collapsed</p>
</div>

#### Properties



<a name="TreeViewExpansionEvent.element"></a><span class="ts" id=2906 data-target="#details-2906" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">element</span><span>: </span><span class="type-ref">T</span></span>
<div class="details collapse" id="details-2906">
<div class="comment"><p>Element that is expanded or collapsed.</p>
</div>
</div>

### <a name="TreeViewOptions"></a><span class="code-item" id=2897>TreeViewOptions&lt;T&gt;</span>



<div class="comment"><p>Options for creating a <a href="#TreeView">TreeView</a></p>
</div>

#### Properties



<a name="TreeViewOptions.canSelectMany"></a><span class="ts" id=2901 data-target="#details-2901" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">canSelectMany</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2901">
<div class="comment"><p>Whether the tree supports multi-select. When the tree supports multi-select and a command is executed from the tree,
the first argument to the command is the tree item that the command was executed on and the second argument is an
array containing all selected tree items.</p>
</div>
</div>



<a name="TreeViewOptions.dragAndDropController"></a><span class="ts" id=2902 data-target="#details-2902" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dragAndDropController</span><span>?</span><span>: </span><a class="type-ref" href="#TreeDragAndDropController&amp;lt;T&amp;gt;">TreeDragAndDropController</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2902">
<div class="comment"><p>An optional interface to implement drag and drop in the tree view.</p>
</div>
</div>



<a name="TreeViewOptions.manageCheckboxStateManually"></a><span class="ts" id=2903 data-target="#details-2903" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">manageCheckboxStateManually</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2903">
<div class="comment"><p>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.
If the tree item is collapsed by default (meaning that the children haven&#39;t yet been fetched) then child checkboxes will not be updated.
To override this behavior and manage child and parent checkbox state in the extension, set this to <code>true</code>.</p>
<p>Examples where <a href="#TreeViewOptions.manageCheckboxStateManually">TreeViewOptions.manageCheckboxStateManually</a> is false, the default behavior:</p>
<ol>
<li><p>A tree item is checked, then its children are fetched. The children will be checked.</p>
</li>
<li><p>A tree item&#39;s parent is checked. The tree item and all of it&#39;s siblings will be checked.</p>
</li>
</ol>
<ul>
<li><input disabled="" type="checkbox"> Parent<ul>
<li><input disabled="" type="checkbox"> Child 1</li>
<li><input disabled="" type="checkbox"> Child 2
When the user checks Parent, the tree will look like this:</li>
</ul>
</li>
<li><input checked="" disabled="" type="checkbox"> Parent<ul>
<li><input checked="" disabled="" type="checkbox"> Child 1</li>
<li><input checked="" disabled="" type="checkbox"> Child 2</li>
</ul>
</li>
</ul>
<ol start="3">
<li>A tree item and all of it&#39;s siblings are checked. The parent will be checked.</li>
</ol>
<ul>
<li><input disabled="" type="checkbox"> Parent<ul>
<li><input disabled="" type="checkbox"> Child 1</li>
<li><input disabled="" type="checkbox"> Child 2
When the user checks Child 1 and Child 2, the tree will look like this:</li>
</ul>
</li>
<li><input checked="" disabled="" type="checkbox"> Parent<ul>
<li><input checked="" disabled="" type="checkbox"> Child 1</li>
<li><input checked="" disabled="" type="checkbox"> Child 2</li>
</ul>
</li>
</ul>
<ol start="4">
<li>A tree item is unchecked. The parent will be unchecked.</li>
</ol>
<ul>
<li><input checked="" disabled="" type="checkbox"> Parent<ul>
<li><input checked="" disabled="" type="checkbox"> Child 1</li>
<li><input checked="" disabled="" type="checkbox"> Child 2
When the user unchecks Child 1, the tree will look like this:</li>
</ul>
</li>
<li><input disabled="" type="checkbox"> Parent<ul>
<li><input disabled="" type="checkbox"> Child 1</li>
<li><input checked="" disabled="" type="checkbox"> Child 2</li>
</ul>
</li>
</ul>
</div>
</div>



<a name="TreeViewOptions.showCollapseAll"></a><span class="ts" id=2900 data-target="#details-2900" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">showCollapseAll</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2900">
<div class="comment"><p>Whether to show collapse all action or not.</p>
</div>
</div>



<a name="TreeViewOptions.treeDataProvider"></a><span class="ts" id=2899 data-target="#details-2899" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">treeDataProvider</span><span>: </span><a class="type-ref" href="#TreeDataProvider&amp;lt;T&amp;gt;">TreeDataProvider</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-2899">
<div class="comment"><p>A data provider that provides tree data.</p>
</div>
</div>

### <a name="TreeViewSelectionChangeEvent"></a><span class="code-item" id=2907>TreeViewSelectionChangeEvent&lt;T&gt;</span>



<div class="comment"><p>The event that is fired when there is a change in <a href="#TreeView.selection">tree view&#39;s selection</a></p>
</div>

#### Properties



<a name="TreeViewSelectionChangeEvent.selection"></a><span class="ts" id=2909 data-target="#details-2909" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selection</span><span>: </span>readonly <span class="type-ref">T</span>[]</span>
<div class="details collapse" id="details-2909">
<div class="comment"><p>Selected elements.</p>
</div>
</div>

### <a name="TreeViewVisibilityChangeEvent"></a><span class="code-item" id=2910>TreeViewVisibilityChangeEvent</span>



<div class="comment"><p>The event that is fired when there is a change in <a href="#TreeView.visible">tree view&#39;s visibility</a></p>
</div>

#### Properties



<a name="TreeViewVisibilityChangeEvent.visible"></a><span class="ts" id=2911 data-target="#details-2911" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">visible</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2911">
<div class="comment"><p><code>true</code> if the <a href="#TreeView">tree view</a> is visible otherwise <code>false</code>.</p>
</div>
</div>

### <a name="TypeDefinitionProvider"></a><span class="code-item" id=687>TypeDefinitionProvider</span>



<div class="comment"><p>The type definition provider defines the contract between extensions and
the go to type definition feature.</p>
</div>

#### Methods



<a name="TypeDefinitionProvider.provideTypeDefinition"></a><span class="ts" id=689 data-target="#details-689" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideTypeDefinition</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Definition">Definition</a> &#124; <a class="type-ref" href="#LocationLink">LocationLink</a>[]&gt;</span>
<div class="details collapse" id="details-689">
<div class="comment"><p>Provide the type definition of the symbol at the given position and document.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#Definition">Definition</a> &#124; <a class="type-ref" href="#LocationLink">LocationLink</a>[]&gt;</td><td><div class="comment"><p>A definition or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="TypeHierarchyItem"></a><span class="code-item" id=1513>TypeHierarchyItem</span>



<div class="comment"><p>Represents an item of a type hierarchy, like a class or an interface.</p>
</div>

#### Constructors



<a name="TypeHierarchyItem.TypeHierarchyItem"></a><span class="ts" id=1515 data-target="#details-1515" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">TypeHierarchyItem</span><span>(</span><span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a>, <span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">detail</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">selectionRange</span><span>: </span><a class="type-ref" href="#Range">Range</a><span>)</span><span>: </span><a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a></span>
<div class="details collapse" id="details-1515">
<div class="comment"><p>Creates a new type hierarchy item.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a></td><td><div class="comment"><p>The kind of the item.</p>
</div></td></tr>
<tr><td><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The name of the item.</p>
</div></td></tr>
<tr><td><span class="ident">detail</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The details of the item.</p>
</div></td></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The Uri of the item.</p>
</div></td></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The whole range of the item.</p>
</div></td></tr>
<tr><td><span class="ident">selectionRange</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>The selection range of the item.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="TypeHierarchyItem.detail"></a><span class="ts" id=1525 data-target="#details-1525" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">detail</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1525">
<div class="comment"><p>More detail for this item, e.g. the signature of a function.</p>
</div>
</div>



<a name="TypeHierarchyItem.kind"></a><span class="ts" id=1523 data-target="#details-1523" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">kind</span><span>: </span><a class="type-ref" href="#SymbolKind">SymbolKind</a></span>
<div class="details collapse" id="details-1523">
<div class="comment"><p>The kind of this item.</p>
</div>
</div>



<a name="TypeHierarchyItem.name"></a><span class="ts" id=1522 data-target="#details-1522" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-1522">
<div class="comment"><p>The name of this item.</p>
</div>
</div>



<a name="TypeHierarchyItem.range"></a><span class="ts" id=1527 data-target="#details-1527" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1527">
<div class="comment"><p>The range enclosing this symbol not including leading/trailing whitespace
but everything else, e.g. comments and code.</p>
</div>
</div>



<a name="TypeHierarchyItem.selectionRange"></a><span class="ts" id=1528 data-target="#details-1528" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">selectionRange</span><span>: </span><a class="type-ref" href="#Range">Range</a></span>
<div class="details collapse" id="details-1528">
<div class="comment"><p>The range that should be selected and revealed when this symbol is being
picked, e.g. the name of a class. Must be contained by the <a href="#TypeHierarchyItem.range">range</a>-property.</p>
</div>
</div>



<a name="TypeHierarchyItem.tags"></a><span class="ts" id=1524 data-target="#details-1524" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tags</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#SymbolTag">SymbolTag</a>[]</span>
<div class="details collapse" id="details-1524">
<div class="comment"><p>Tags for this item.</p>
</div>
</div>



<a name="TypeHierarchyItem.uri"></a><span class="ts" id=1526 data-target="#details-1526" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-1526">
<div class="comment"><p>The resource identifier of this item.</p>
</div>
</div>

### <a name="TypeHierarchyProvider"></a><span class="code-item" id=1529>TypeHierarchyProvider</span>



<div class="comment"><p>The type hierarchy provider interface describes the contract between extensions
and the type hierarchy feature.</p>
</div>

#### Methods



<a name="TypeHierarchyProvider.prepareTypeHierarchy"></a><span class="ts" id=1531 data-target="#details-1531" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">prepareTypeHierarchy</span><span>(</span><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a> &#124; <a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a>[]&gt;</span>
<div class="details collapse" id="details-1531">
<div class="comment"><p>Bootstraps type hierarchy by returning the item that is denoted by the given document
and position. This item will be used as entry into the type graph. Providers should
return <code>undefined</code> or <code>null</code> when there is no item at the given location.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">document</span><span>: </span><a class="type-ref" href="#TextDocument">TextDocument</a></td><td><div class="comment"><p>The document in which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>The position at which the command was invoked.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a> &#124; <a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a>[]&gt;</td><td><div class="comment"><p>One or multiple type hierarchy items or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TypeHierarchyProvider.provideTypeHierarchySubtypes"></a><span class="ts" id=1540 data-target="#details-1540" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideTypeHierarchySubtypes</span><span>(</span><span class="ident">item</span><span>: </span><a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a>[]&gt;</span>
<div class="details collapse" id="details-1540">
<div class="comment"><p>Provide all subtypes for an item, e.g all types which are derived/inherited from the given item. In
graph terms this describes directed and annotated edges inside the type graph, e.g the given item is the starting
node and the result is the nodes that can be reached.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">item</span><span>: </span><a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a></td><td><div class="comment"><p>The hierarchy item for which subtypes should be computed.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a>[]&gt;</td><td><div class="comment"><p>A set of direct subtypes or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="TypeHierarchyProvider.provideTypeHierarchySupertypes"></a><span class="ts" id=1536 data-target="#details-1536" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideTypeHierarchySupertypes</span><span>(</span><span class="ident">item</span><span>: </span><a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a>[]&gt;</span>
<div class="details collapse" id="details-1536">
<div class="comment"><p>Provide all supertypes for an item, e.g all types from which a type is derived/inherited. In graph terms this describes directed
and annotated edges inside the type graph, e.g the given item is the starting node and the result is the nodes
that can be reached.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">item</span><span>: </span><a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a></td><td><div class="comment"><p>The hierarchy item for which super types should be computed.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<a class="type-ref" href="#TypeHierarchyItem">TypeHierarchyItem</a>[]&gt;</td><td><div class="comment"><p>A set of direct supertypes or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code> or <code>null</code>.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="UIKind"></a><span class="code-item" id=2572>UIKind</span>



<div class="comment"><p>Possible kinds of UI that can use extensions.</p>
</div>

#### Enumeration Members



<a name="UIKind.Desktop"></a><span class="ts" id=2573 data-target="#details-2573" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Desktop</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-2573">
<div class="comment"><p>Extensions are accessed from a desktop application.</p>
</div>
</div>



<a name="UIKind.Web"></a><span class="ts" id=2574 data-target="#details-2574" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Web</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-2574">
<div class="comment"><p>Extensions are accessed from a web browser.</p>
</div>
</div>

### <a name="Uri"></a><span class="code-item" id=391>Uri</span>



<div class="comment"><p>A universal resource identifier representing either a file on disk
or another resource, like untitled resources.</p>
</div>

#### Static



<a name="Uri.file"></a><span class="ts" id=397 data-target="#details-397" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">file</span><span>(</span><span class="ident">path</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-397">
<div class="comment"><p>Create an URI from a file system path. The <a href="#Uri.scheme">scheme</a>
will be <code>file</code>.</p>
<p>The <em>difference</em> between <a href="#Uri.parse">Uri.parse</a> and <a href="#Uri.file">Uri.file</a> is that the latter treats the argument
as path, not as stringified-uri. E.g. <code>Uri.file(path)</code> is <em>not</em> the same as
<code>Uri.parse(&#39;file://&#39; + path)</code> because the path might contain characters that are
interpreted (# and ?). See the following sample:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> good</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1">URI</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">file</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'/coding/c#/project1'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">good</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">scheme</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'file'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">good</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">path</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'/coding/c#/project1'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">good</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">fragment</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">''</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> bad</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1">URI</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">parse</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'file://'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> + </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'/coding/c#/project1'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">bad</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">scheme</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'file'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">bad</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">path</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'/coding/c'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">; </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// path is now broken</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">bad</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">fragment</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'/project1'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">path</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A file system or UNC path.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A new Uri instance.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Uri.from"></a><span class="ts" id=404 data-target="#details-404" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">from</span><span>(</span><span class="ident">components</span><span>: </span>{authority: <span class="type-intrinsic">string</span>, fragment: <span class="type-intrinsic">string</span>, path: <span class="type-intrinsic">string</span>, query: <span class="type-intrinsic">string</span>, scheme: <span class="type-intrinsic">string</span>}<span>)</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-404">
<div class="comment"><p>Create an URI from its component parts</p>
<p><em>See also</em>
<a href="#Uri.toString">Uri.toString</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">components</span><span>: </span>{authority: <span class="type-intrinsic">string</span>, fragment: <span class="type-intrinsic">string</span>, path: <span class="type-intrinsic">string</span>, query: <span class="type-intrinsic">string</span>, scheme: <span class="type-intrinsic">string</span>}</td><td><div class="comment"><p>The component parts of an Uri.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A new Uri instance.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Uri.joinPath"></a><span class="ts" id=400 data-target="#details-400" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">joinPath</span><span>(</span><span class="ident">base</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span>...</span><span class="ident">pathSegments</span><span>: </span><span class="type-intrinsic">string</span>[]<span>)</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-400">
<div class="comment"><p>Create a new uri which path is the result of joining
the path of the base uri with the provided path segments.</p>
<ul>
<li>Note 1: <code>joinPath</code> only affects the path component
and all other components (scheme, authority, query, and fragment) are
left as they are.</li>
<li>Note 2: The base uri must have a path; an error is thrown otherwise.</li>
</ul>
<p>The path segments are normalized in the following ways:</p>
<ul>
<li>sequences of path separators (<code>/</code> or <code>\</code>) are replaced with a single separator</li>
<li>for <code>file</code>-uris on windows, the backslash-character (``) is considered a path-separator</li>
<li>the <code>..</code>-segment denotes the parent segment, the <code>.</code> denotes the current segment</li>
<li>paths have a root which always remains, for instance on windows drive-letters are roots
so that is true: <code>joinPath(Uri.file(&#39;file:///c:/root&#39;), &#39;../../other&#39;).fsPath === &#39;c:/other&#39;</code></li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">base</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>An uri. Must have a path.</p>
</div></td></tr>
<tr><td><span>...</span><span class="ident">pathSegments</span><span>: </span><span class="type-intrinsic">string</span>[]</td><td><div class="comment"><p>One more more path fragments</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A new uri which path is joined with the given fragments</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Uri.parse"></a><span class="ts" id=393 data-target="#details-393" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">parse</span><span>(</span><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">strict</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-393">
<div class="comment"><p>Create an URI from a string, e.g. <code>http://www.example.com/some/path</code>,
<code>file:///usr/home</code>, or <code>scheme:with/path</code>.</p>
<p><em>Note</em> that for a while uris without a <code>scheme</code> were accepted. That is not correct
as all uris should have a scheme. To avoid breakage of existing code the optional
<code>strict</code>-argument has been added. We <em>strongly</em> advise to use it, e.g. <code>Uri.parse(&#39;my:uri&#39;, true)</code></p>
<p><em>See also</em>
<a href="#Uri.toString">Uri.toString</a></p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>The string value of an Uri.</p>
</div></td></tr>
<tr><td><span class="ident">strict</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Throw an error when <code>value</code> is empty or when no <code>scheme</code> can be parsed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A new Uri instance.</p>
</div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="Uri.authority"></a><span class="ts" id=420 data-target="#details-420" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">authority</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-420">
<div class="comment"><p>Authority is the <code>www.example.com</code> part of <code>http://www.example.com/some/path?query#fragment</code>.
The part between the first double slashes and the next slash.</p>
</div>
</div>



<a name="Uri.fragment"></a><span class="ts" id=423 data-target="#details-423" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fragment</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-423">
<div class="comment"><p>Fragment is the <code>fragment</code> part of <code>http://www.example.com/some/path?query#fragment</code>.</p>
</div>
</div>



<a name="Uri.fsPath"></a><span class="ts" id=424 data-target="#details-424" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">fsPath</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-424">
<div class="comment"><p>The string representing the corresponding file system path of this Uri.</p>
<p>Will handle UNC paths and normalize windows drive letters to lower-case. Also
uses the platform specific path separator.</p>
<ul>
<li>Will <em>not</em> validate the path for invalid characters and semantics.</li>
<li>Will <em>not</em> look at the scheme of this Uri.</li>
<li>The resulting string shall <em>not</em> be used for display purposes but
for disk operations, like <code>readFile</code> et al.</li>
</ul>
<p>The <em>difference</em> to the <a href="#Uri.path">path</a>-property is the use of the platform specific
path separator and the handling of UNC paths. The sample below outlines the difference:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> u</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1">URI</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">parse</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'file://server/c$/folder/file.txt'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">u</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">authority</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'server'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">u</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">path</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'/c$/folder/file.txt'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">u</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">fsPath</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> === </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'</span><span style="--shiki-dark:#D7BA7D;--shiki-light:#EE0000">\\</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">serverc$</span><span style="--shiki-dark:#D7BA7D;--shiki-light:#EE0000">\f</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">older</span><span style="--shiki-dark:#D7BA7D;--shiki-light:#EE0000">\f</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">ile.txt'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"></span></code></pre>
</div>
</div>



<a name="Uri.path"></a><span class="ts" id=421 data-target="#details-421" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">path</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-421">
<div class="comment"><p>Path is the <code>/some/path</code> part of <code>http://www.example.com/some/path?query#fragment</code>.</p>
</div>
</div>



<a name="Uri.query"></a><span class="ts" id=422 data-target="#details-422" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">query</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-422">
<div class="comment"><p>Query is the <code>query</code> part of <code>http://www.example.com/some/path?query#fragment</code>.</p>
</div>
</div>



<a name="Uri.scheme"></a><span class="ts" id=419 data-target="#details-419" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">scheme</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-419">
<div class="comment"><p>Scheme is the <code>http</code> part of <code>http://www.example.com/some/path?query#fragment</code>.
The part before the first colon.</p>
</div>
</div>

#### Methods



<a name="Uri.toJSON"></a><span class="ts" id=438 data-target="#details-438" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">toJSON</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">any</span></span>
<div class="details collapse" id="details-438">
<div class="comment"><p>Returns a JSON representation of this Uri.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">any</span></td><td><div class="comment"><p>An object.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Uri.toString"></a><span class="ts" id=435 data-target="#details-435" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">toString</span><span>(</span><span class="ident">skipEncoding</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-435">
<div class="comment"><p>Returns a string representation of this Uri. The representation and normalization
of a URI depends on the scheme.</p>
<ul>
<li>The resulting string can be safely used with <a href="#Uri.parse">Uri.parse</a>.</li>
<li>The resulting string shall <em>not</em> be used for display purposes.</li>
</ul>
<p><em>Note</em> that the implementation will encode <em>aggressive</em> which often leads to unexpected,
but not incorrect, results. For instance, colons are encoded to <code>%3A</code> which might be unexpected
in file-uri. Also <code>&amp;</code> and <code>=</code> will be encoded which might be unexpected for http-uris. For stability
reasons this cannot be changed anymore. If you suffer from too aggressive encoding you should use
the <code>skipEncoding</code>-argument: <code>uri.toString(true)</code>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">skipEncoding</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Do not percentage-encode the result, defaults to <code>false</code>. Note that
    the <code>#</code> and <code>?</code> characters occurring in the path will always be encoded.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string representation of this Uri.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="Uri.with"></a><span class="ts" id=426 data-target="#details-426" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">with</span><span>(</span><span class="ident">change</span><span>: </span>{authority: <span class="type-intrinsic">string</span>, fragment: <span class="type-intrinsic">string</span>, path: <span class="type-intrinsic">string</span>, query: <span class="type-intrinsic">string</span>, scheme: <span class="type-intrinsic">string</span>}<span>)</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-426">
<div class="comment"><p>Derive a new Uri from this Uri.</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">let</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> file</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">Uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">parse</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'before:some/file/path'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">let</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> other</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">file</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">with</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">scheme:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'after'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">assert</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">ok</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">other</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">toString</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">() === </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'after:some/file/path'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">change</span><span>: </span>{authority: <span class="type-intrinsic">string</span>, fragment: <span class="type-intrinsic">string</span>, path: <span class="type-intrinsic">string</span>, query: <span class="type-intrinsic">string</span>, scheme: <span class="type-intrinsic">string</span>}</td><td><div class="comment"><p>An object that describes a change to this Uri. To unset components use <code>null</code> or
 the empty string.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A new Uri that reflects the given change. Will return <code>this</code> Uri if the change
 is not changing anything.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="UriHandler"></a><span class="code-item" id=2641>UriHandler</span>



<div class="comment"><p>A uri handler is responsible for handling system-wide <a href="#Uri">uris</a>.</p>
<p><em>See also</em>
<a href="#window.registerUriHandler">window.registerUriHandler</a>.</p>
</div>

#### Methods



<a name="UriHandler.handleUri"></a><span class="ts" id=2643 data-target="#details-2643" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">handleUri</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2643">
<div class="comment"><p>Handle the provided system-wide <a href="#Uri">Uri</a>.</p>
<p><em>See also</em>
<a href="#window.registerUriHandler">window.registerUriHandler</a>.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="ViewBadge"></a><span class="code-item" id=2961>ViewBadge</span>



<div class="comment"><p>A badge presenting a value for a view</p>
</div>

#### Properties



<a name="ViewBadge.tooltip"></a><span class="ts" id=2962 data-target="#details-2962" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">tooltip</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2962">
<div class="comment"><p>A label to present in tooltip for the badge.</p>
</div>
</div>



<a name="ViewBadge.value"></a><span class="ts" id=2963 data-target="#details-2963" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">value</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-2963">
<div class="comment"><p>The value to present in the badge.</p>
</div>
</div>

### <a name="ViewColumn"></a><span class="code-item" id=1827>ViewColumn</span>



<div class="comment"><p>Denotes a location of an editor in the window. Editors can be arranged in a grid
and each column represents one editor location in that grid by counting the editors
in order of their appearance.</p>
</div>

#### Enumeration Members



<a name="ViewColumn.Beside"></a><span class="ts" id=1829 data-target="#details-1829" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Beside</span><span>: </span><span class="type-literal">-2</span></span>
<div class="details collapse" id="details-1829">
<div class="comment"><p>A <em>symbolic</em> editor column representing the column to the side of the active one. This value
can be used when opening editors, but the <em>resolved</em> <a href="#TextEditor.viewColumn">viewColumn</a>-value
of editors will always be <code>One</code>, <code>Two</code>, <code>Three</code>,... or <code>undefined</code> but never <code>Beside</code>.</p>
</div>
</div>



<a name="ViewColumn.Active"></a><span class="ts" id=1828 data-target="#details-1828" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Active</span><span>: </span><span class="type-literal">-1</span></span>
<div class="details collapse" id="details-1828">
<div class="comment"><p>A <em>symbolic</em> editor column representing the currently active column. This value
can be used when opening editors, but the <em>resolved</em> <a href="#TextEditor.viewColumn">viewColumn</a>-value
of editors will always be <code>One</code>, <code>Two</code>, <code>Three</code>,... or <code>undefined</code> but never <code>Active</code>.</p>
</div>
</div>



<a name="ViewColumn.One"></a><span class="ts" id=1830 data-target="#details-1830" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">One</span><span>: </span><span class="type-literal">1</span></span>
<div class="details collapse" id="details-1830">
<div class="comment"><p>The first editor column.</p>
</div>
</div>



<a name="ViewColumn.Two"></a><span class="ts" id=1831 data-target="#details-1831" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Two</span><span>: </span><span class="type-literal">2</span></span>
<div class="details collapse" id="details-1831">
<div class="comment"><p>The second editor column.</p>
</div>
</div>



<a name="ViewColumn.Three"></a><span class="ts" id=1832 data-target="#details-1832" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Three</span><span>: </span><span class="type-literal">3</span></span>
<div class="details collapse" id="details-1832">
<div class="comment"><p>The third editor column.</p>
</div>
</div>



<a name="ViewColumn.Four"></a><span class="ts" id=1833 data-target="#details-1833" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Four</span><span>: </span><span class="type-literal">4</span></span>
<div class="details collapse" id="details-1833">
<div class="comment"><p>The fourth editor column.</p>
</div>
</div>



<a name="ViewColumn.Five"></a><span class="ts" id=1834 data-target="#details-1834" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Five</span><span>: </span><span class="type-literal">5</span></span>
<div class="details collapse" id="details-1834">
<div class="comment"><p>The fifth editor column.</p>
</div>
</div>



<a name="ViewColumn.Six"></a><span class="ts" id=1835 data-target="#details-1835" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Six</span><span>: </span><span class="type-literal">6</span></span>
<div class="details collapse" id="details-1835">
<div class="comment"><p>The sixth editor column.</p>
</div>
</div>



<a name="ViewColumn.Seven"></a><span class="ts" id=1836 data-target="#details-1836" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Seven</span><span>: </span><span class="type-literal">7</span></span>
<div class="details collapse" id="details-1836">
<div class="comment"><p>The seventh editor column.</p>
</div>
</div>



<a name="ViewColumn.Eight"></a><span class="ts" id=1837 data-target="#details-1837" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Eight</span><span>: </span><span class="type-literal">8</span></span>
<div class="details collapse" id="details-1837">
<div class="comment"><p>The eighth editor column.</p>
</div>
</div>



<a name="ViewColumn.Nine"></a><span class="ts" id=1838 data-target="#details-1838" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">Nine</span><span>: </span><span class="type-literal">9</span></span>
<div class="details collapse" id="details-1838">
<div class="comment"><p>The ninth editor column.</p>
</div>
</div>

### <a name="Webview"></a><span class="code-item" id=2433>Webview</span>



<div class="comment"><p>Displays html content, similarly to an iframe.</p>
</div>

#### Events



<a name="Webview.onDidReceiveMessage"></a><span class="ts" id=2436 data-target="#details-2436" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidReceiveMessage</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">any</span>&gt;</span>
<div class="details collapse" id="details-2436">
<div class="comment"><p>Fired when the webview content posts a message.</p>
<p>Webview content can post strings or json serializable objects back to an extension. They cannot
post <code>Blob</code>, <code>File</code>, <code>ImageData</code> and other DOM specific objects since the extension that receives the
message does not run in a browser environment.</p>
</div>
</div>

#### Properties



<a name="Webview.cspSource"></a><span class="ts" id=2443 data-target="#details-2443" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">cspSource</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2443">
<div class="comment"><p>Content security policy source for webview resources.</p>
<p>This is the origin that should be used in a content security policy rule:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`img-src https: </span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">${</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">webview</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">cspSource</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">}</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> ...;`</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"></span></code></pre>
</div>
</div>



<a name="Webview.html"></a><span class="ts" id=2435 data-target="#details-2435" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">html</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2435">
<div class="comment"><p>HTML contents of the webview.</p>
<p>This should be a complete, valid html document. Changing this property causes the webview to be reloaded.</p>
<p>Webviews are sandboxed from normal extension process, so all communication with the webview must use
message passing. To send a message from the extension to the webview, use <a href="#Webview.postMessage">postMessage</a>.
To send message from the webview back to an extension, use the <code>acquireVsCodeApi</code> function inside the webview
to get a handle to the editor&#39;s api and then call <code>.postMessage()</code>:</p>
<pre class="shiki" data-lang="html" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#808080;--shiki-light:#800000">&#x3C;</span><span style="--shiki-dark:#569CD6;--shiki-light:#800000">script</span><span style="--shiki-dark:#808080;--shiki-light:#800000">></span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">    const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> =</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26"> acquireVsCodeApi</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">(); </span><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// acquireVsCodeApi can only be invoked once</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">    vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">postMessage</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">message:</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515"> 'hello!'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF"> });</span></span>
<span class="line"><span style="--shiki-dark:#808080;--shiki-light:#800000">&#x3C;/</span><span style="--shiki-dark:#569CD6;--shiki-light:#800000">script</span><span style="--shiki-dark:#808080;--shiki-light:#800000">></span></span></code></pre>
<p>To load a resources from the workspace inside a webview, use the <a href="#Webview.asWebviewUri">asWebviewUri</a> method
and ensure the resource&#39;s directory is listed in <a href="#WebviewOptions.localResourceRoots">WebviewOptions.localResourceRoots</a>.</p>
<p>Keep in mind that even though webviews are sandboxed, they still allow running scripts and loading arbitrary content,
so extensions must follow all standard web security best practices when working with webviews. This includes
properly sanitizing all untrusted input (including content from the workspace) and
setting a <a href="https://aka.ms/vscode-api-webview-csp">content security policy</a>.</p>
</div>
</div>



<a name="Webview.options"></a><span class="ts" id=2434 data-target="#details-2434" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">options</span><span>: </span><a class="type-ref" href="#WebviewOptions">WebviewOptions</a></span>
<div class="details collapse" id="details-2434">
<div class="comment"><p>Content settings for the webview.</p>
</div>
</div>

#### Methods



<a name="Webview.asWebviewUri"></a><span class="ts" id=2441 data-target="#details-2441" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">asWebviewUri</span><span>(</span><span class="ident">localResource</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-2441">
<div class="comment"><p>Convert a uri for the local file system to one that can be used inside webviews.</p>
<p>Webviews cannot directly load resources from the workspace or local file system using <code>file:</code> uris. The
<code>asWebviewUri</code> function takes a local <code>file:</code> uri and converts it into a uri that can be used inside of
a webview to load the same resource:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">webview</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">html</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">`&#x3C;img src="</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">${</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">webview</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">asWebviewUri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">(</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">Uri</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">file</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'/Users/codey/workspace/cat.gif'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">)</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000FF">)</span><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">}</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">">`</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"></span></code></pre>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">localResource</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"></div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="Webview.postMessage"></a><span class="ts" id=2438 data-target="#details-2438" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">postMessage</span><span>(</span><span class="ident">message</span><span>: </span><span class="type-intrinsic">any</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</span>
<div class="details collapse" id="details-2438">
<div class="comment"><p>Post a message to the webview content.</p>
<p>Messages are only delivered if the webview is live (either visible or in the
background with <code>retainContextWhenHidden</code>).</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">message</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>Body of the message. This must be a string or other json serializable object.</p>
<p>  For older versions of vscode, if an <code>ArrayBuffer</code> is included in <code>message</code>,
  it will not be serialized properly and will not be received by the webview.
  Similarly any TypedArrays, such as a <code>Uint8Array</code>, will be very inefficiently
  serialized and will also not be recreated as a typed array inside the webview.</p>
<p>  However if your extension targets vscode 1.57+ in the <code>engines</code> field of its
  <code>package.json</code>, any <code>ArrayBuffer</code> values that appear in <code>message</code> will be more
  efficiently transferred to the webview and will also be correctly recreated inside
  of the webview.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">boolean</span>&gt;</td><td><div class="comment"><p>A promise that resolves when the message is posted to a webview or when it is
dropped because the message was not deliverable.</p>
<p>  Returns <code>true</code> if the message was posted to the webview. Messages can only be posted to
live webviews (i.e. either visible webviews or hidden webviews that set <code>retainContextWhenHidden</code>).</p>
<p>  A response of <code>true</code> does not mean that the message was actually received by the webview.
  For example, no message listeners may be have been hooked up inside the webview or the webview may
  have been destroyed after the message was posted but before it was received.</p>
<p>  If you want confirm that a message as actually received, you can try having your webview posting a
  confirmation message back to your extension.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="WebviewOptions"></a><span class="code-item" id=2427>WebviewOptions</span>



<div class="comment"><p>Content settings for a webview.</p>
</div>

#### Properties



<a name="WebviewOptions.enableCommandUris"></a><span class="ts" id=2430 data-target="#details-2430" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">enableCommandUris</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span> &#124; readonly <span class="type-intrinsic">string</span>[]</span>
<div class="details collapse" id="details-2430">
<div class="comment"><p>Controls whether command uris are enabled in webview content or not.</p>
<p>Defaults to <code>false</code> (command uris are disabled).</p>
<p>If you pass in an array, only the commands in the array are allowed.</p>
</div>
</div>



<a name="WebviewOptions.enableForms"></a><span class="ts" id=2429 data-target="#details-2429" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">enableForms</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2429">
<div class="comment"><p>Controls whether forms are enabled in the webview content or not.</p>
<p>Defaults to true if <a href="#WebviewOptions.enableScripts">scripts are enabled</a>. Otherwise defaults to false.
Explicitly setting this property to either true or false overrides the default.</p>
</div>
</div>



<a name="WebviewOptions.enableScripts"></a><span class="ts" id=2428 data-target="#details-2428" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">enableScripts</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2428">
<div class="comment"><p>Controls whether scripts are enabled in the webview content or not.</p>
<p>Defaults to false (scripts-disabled).</p>
</div>
</div>



<a name="WebviewOptions.localResourceRoots"></a><span class="ts" id=2431 data-target="#details-2431" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">localResourceRoots</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#Uri">Uri</a>[]</span>
<div class="details collapse" id="details-2431">
<div class="comment"><p>Root paths from which the webview can load local (filesystem) resources using uris from <code>asWebviewUri</code></p>
<p>Default to the root folders of the current workspace plus the extension&#39;s install directory.</p>
<p>Pass in an empty array to disallow access to any local resources.</p>
</div>
</div>



<a name="WebviewOptions.portMapping"></a><span class="ts" id=2432 data-target="#details-2432" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">portMapping</span><span>?</span><span>: </span>readonly <a class="type-ref" href="#WebviewPortMapping">WebviewPortMapping</a>[]</span>
<div class="details collapse" id="details-2432">
<div class="comment"><p>Mappings of localhost ports used inside the webview.</p>
<p>Port mapping allow webviews to transparently define how localhost ports are resolved. This can be used
to allow using a static localhost port inside the webview that is resolved to random port that a service is
running on.</p>
<p>If a webview accesses localhost content, we recommend that you specify port mappings even if
the <code>webviewPort</code> and <code>extensionHostPort</code> ports are the same.</p>
<p><em>Note</em> that port mappings only work for <code>http</code> or <code>https</code> urls. Websocket urls (e.g. <code>ws://localhost:3000</code>)
cannot be mapped to another port.</p>
</div>
</div>

### <a name="WebviewPanel"></a><span class="code-item" id=2447>WebviewPanel</span>



<div class="comment"><p>A panel that contains a <a href="#Webview">Webview</a>.</p>
</div>

#### Events



<a name="WebviewPanel.onDidChangeViewState"></a><span class="ts" id=2456 data-target="#details-2456" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeViewState</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<a class="type-ref" href="#WebviewPanelOnDidChangeViewStateEvent">WebviewPanelOnDidChangeViewStateEvent</a>&gt;</span>
<div class="details collapse" id="details-2456">
<div class="comment"><p>Fired when the panel&#39;s view state changes.</p>
</div>
</div>



<a name="WebviewPanel.onDidDispose"></a><span class="ts" id=2457 data-target="#details-2457" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidDispose</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2457">
<div class="comment"><p>Fired when the panel is disposed.</p>
<p>This may be because the user closed the panel or because <a href="#WebviewPanel.dispose">dispose</a> was
called on it.</p>
<p>Trying to use the panel after it has been disposed throws an exception.</p>
</div>
</div>

#### Properties



<a name="WebviewPanel.active"></a><span class="ts" id=2454 data-target="#details-2454" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">active</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2454">
<div class="comment"><p>Whether the panel is active (focused by the user).</p>
</div>
</div>



<a name="WebviewPanel.iconPath"></a><span class="ts" id=2450 data-target="#details-2450" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">iconPath</span><span>?</span><span>: </span><a class="type-ref" href="#IconPath">IconPath</a></span>
<div class="details collapse" id="details-2450">
<div class="comment"><p>Icon for the panel shown in UI.</p>
</div>
</div>



<a name="WebviewPanel.options"></a><span class="ts" id=2452 data-target="#details-2452" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">options</span><span>: </span><a class="type-ref" href="#WebviewPanelOptions">WebviewPanelOptions</a></span>
<div class="details collapse" id="details-2452">
<div class="comment"><p>Content settings for the webview panel.</p>
</div>
</div>



<a name="WebviewPanel.title"></a><span class="ts" id=2449 data-target="#details-2449" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2449">
<div class="comment"><p>Title of the panel shown in UI.</p>
</div>
</div>



<a name="WebviewPanel.viewColumn"></a><span class="ts" id=2453 data-target="#details-2453" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">viewColumn</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a></span>
<div class="details collapse" id="details-2453">
<div class="comment"><p>Editor position of the panel. This property is only set if the webview is in
one of the editor view columns.</p>
</div>
</div>



<a name="WebviewPanel.viewType"></a><span class="ts" id=2448 data-target="#details-2448" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2448">
<div class="comment"><p>Identifies the type of the webview panel, such as <code>&#39;markdown.preview&#39;</code>.</p>
</div>
</div>



<a name="WebviewPanel.visible"></a><span class="ts" id=2455 data-target="#details-2455" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">visible</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2455">
<div class="comment"><p>Whether the panel is visible.</p>
</div>
</div>



<a name="WebviewPanel.webview"></a><span class="ts" id=2451 data-target="#details-2451" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">webview</span><span>: </span><a class="type-ref" href="#Webview">Webview</a></span>
<div class="details collapse" id="details-2451">
<div class="comment"><p><a href="#Webview">Webview</a> belonging to the panel.</p>
</div>
</div>

#### Methods



<a name="WebviewPanel.dispose"></a><span class="ts" id=2463 data-target="#details-2463" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">dispose</span><span>(</span><span>)</span><span>: </span><span class="type-intrinsic">any</span></span>
<div class="details collapse" id="details-2463">
<div class="comment"><p>Dispose of the webview panel.</p>
<p>This closes the panel if it showing and disposes of the resources owned by the webview.
Webview panels are also disposed when the user closes the webview panel. Both cases
fire the <a href="#WebviewPanel.onDidDispose">onDidDispose</a> event.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">any</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="WebviewPanel.reveal"></a><span class="ts" id=2459 data-target="#details-2459" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">reveal</span><span>(</span><span class="ident">viewColumn</span><span>?</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a>, <span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-2459">
<div class="comment"><p>Show the webview panel in a given column.</p>
<p>A webview panel may only show in a single column at a time. If it is already showing, this
method moves it to a new column.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">viewColumn</span><span>?</span><span>: </span><a class="type-ref" href="#ViewColumn">ViewColumn</a></td><td><div class="comment"><p>View column to show the panel in. Shows in the current <a href="#WebviewPanel.viewColumn">WebviewPanel.viewColumn</a> if undefined.</p>
</div></td></tr>
<tr><td><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>When <code>true</code>, the webview will not take focus.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="WebviewPanelOnDidChangeViewStateEvent"></a><span class="code-item" id=2464>WebviewPanelOnDidChangeViewStateEvent</span>



<div class="comment"><p>Event fired when a <a href="#WebviewPanel">webview panel&#39;s</a> view state changes.</p>
</div>

#### Properties



<a name="WebviewPanelOnDidChangeViewStateEvent.webviewPanel"></a><span class="ts" id=2465 data-target="#details-2465" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">webviewPanel</span><span>: </span><a class="type-ref" href="#WebviewPanel">WebviewPanel</a></span>
<div class="details collapse" id="details-2465">
<div class="comment"><p><a href="#WebviewPanel">WebviewPanel</a> whose view state changed.</p>
</div>
</div>

### <a name="WebviewPanelOptions"></a><span class="code-item" id=2444>WebviewPanelOptions</span>



<div class="comment"><p>Content settings for a webview panel.</p>
</div>

#### Properties



<a name="WebviewPanelOptions.enableFindWidget"></a><span class="ts" id=2445 data-target="#details-2445" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">enableFindWidget</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2445">
<div class="comment"><p>Controls if the find widget is enabled in the panel.</p>
<p>Defaults to <code>false</code>.</p>
</div>
</div>



<a name="WebviewPanelOptions.retainContextWhenHidden"></a><span class="ts" id=2446 data-target="#details-2446" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">retainContextWhenHidden</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2446">
<div class="comment"><p>Controls if the webview panel&#39;s content (iframe) is kept around even when the panel
is no longer visible.</p>
<p>Normally the webview panel&#39;s html context is created when the panel becomes visible
and destroyed when it is hidden. Extensions that have complex state
or UI can set the <code>retainContextWhenHidden</code> to make the editor keep the webview
context around, even when the webview moves to a background tab. When a webview using
<code>retainContextWhenHidden</code> becomes hidden, its scripts and other dynamic content are suspended.
When the panel becomes visible again, the context is automatically restored
in the exact same state it was in originally. You cannot send messages to a
hidden webview, even with <code>retainContextWhenHidden</code> enabled.</p>
<p><code>retainContextWhenHidden</code> has a high memory overhead and should only be used if
your panel&#39;s context cannot be quickly saved and restored.</p>
</div>
</div>

### <a name="WebviewPanelSerializer"></a><span class="code-item" id=2466>WebviewPanelSerializer&lt;T&gt;</span>



<div class="comment"><p>Restore webview panels that have been persisted when vscode shuts down.</p>
<p>There are two types of webview persistence:</p>
<ul>
<li>Persistence within a session.</li>
<li>Persistence across sessions (across restarts of the editor).</li>
</ul>
<p>A <code>WebviewPanelSerializer</code> is only required for the second case: persisting a webview across sessions.</p>
<p>Persistence within a session allows a webview to save its state when it becomes hidden
and restore its content from this state when it becomes visible again. It is powered entirely
by the webview content itself. To save off a persisted state, call <code>acquireVsCodeApi().setState()</code> with
any json serializable object. To restore the state again, call <code>getState()</code></p>
<pre class="shiki" data-lang="js" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Within the webview</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">acquireVsCodeApi</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">();</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Get existing state</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> oldState</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">getState</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">() || { </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">value:</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658"> 0</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> };</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Update state</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">setState</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">value:</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> oldState</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">value</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> + </span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">1</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span>
<span class="line"></span></code></pre>
<p>A <code>WebviewPanelSerializer</code> extends this persistence across restarts of the editor. When the editor is shutdown,
it will save off the state from <code>setState</code> of all webviews that have a serializer. When the
webview first becomes visible after the restart, this state is passed to <code>deserializeWebviewPanel</code>.
The extension can then restore the old <code>WebviewPanel</code> from this state.</p>
</div>

#### Methods



<a name="WebviewPanelSerializer.deserializeWebviewPanel"></a><span class="ts" id=2469 data-target="#details-2469" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">deserializeWebviewPanel</span><span>(</span><span class="ident">webviewPanel</span><span>: </span><a class="type-ref" href="#WebviewPanel">WebviewPanel</a>, <span class="ident">state</span><span>: </span><span class="type-ref">T</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2469">
<div class="comment"><p>Restore a webview panel from its serialized <code>state</code>.</p>
<p>Called when a serialized webview first becomes visible.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">webviewPanel</span><span>: </span><a class="type-ref" href="#WebviewPanel">WebviewPanel</a></td><td><div class="comment"><p>Webview panel to restore. The serializer should take ownership of this panel. The
serializer must restore the webview&#39;s <code>.html</code> and hook up all webview events.</p>
</div></td></tr>
<tr><td><span class="ident">state</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>Persisted state from the webview content.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>Thenable indicating that the webview has been fully restored.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="WebviewPortMapping"></a><span class="code-item" id=2424>WebviewPortMapping</span>



<div class="comment"><p>Defines a port mapping used for localhost inside the webview.</p>
</div>

#### Properties



<a name="WebviewPortMapping.extensionHostPort"></a><span class="ts" id=2426 data-target="#details-2426" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">extensionHostPort</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-2426">
<div class="comment"><p>Destination port. The <code>webviewPort</code> is resolved to this port.</p>
</div>
</div>



<a name="WebviewPortMapping.webviewPort"></a><span class="ts" id=2425 data-target="#details-2425" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">webviewPort</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-2425">
<div class="comment"><p>Localhost port to remap inside the webview.</p>
</div>
</div>

### <a name="WebviewView"></a><span class="code-item" id=2472>WebviewView</span>



<div class="comment"><p>A webview based view.</p>
</div>

#### Events



<a name="WebviewView.onDidChangeVisibility"></a><span class="ts" id=2480 data-target="#details-2480" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidChangeVisibility</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2480">
<div class="comment"><p>Event fired when the visibility of the view changes.</p>
<p>Actions that trigger a visibility change:</p>
<ul>
<li>The view is collapsed or expanded.</li>
<li>The user switches to a different view group in the sidebar or panel.</li>
</ul>
<p>Note that hiding a view using the context menu instead disposes of the view and fires <code>onDidDispose</code>.</p>
</div>
</div>



<a name="WebviewView.onDidDispose"></a><span class="ts" id=2478 data-target="#details-2478" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">onDidDispose</span><span>: </span><a class="type-ref" href="#Event&amp;lt;T&amp;gt;">Event</a>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2478">
<div class="comment"><p>Event fired when the view is disposed.</p>
<p>Views are disposed when they are explicitly hidden by a user (this happens when a user
right clicks in a view and unchecks the webview view).</p>
<p>Trying to use the view after it has been disposed throws an exception.</p>
</div>
</div>

#### Properties



<a name="WebviewView.badge"></a><span class="ts" id=2477 data-target="#details-2477" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">badge</span><span>?</span><span>: </span><a class="type-ref" href="#ViewBadge">ViewBadge</a></span>
<div class="details collapse" id="details-2477">
<div class="comment"><p>The badge to display for this webview view.
To remove the badge, set to undefined.</p>
</div>
</div>



<a name="WebviewView.description"></a><span class="ts" id=2476 data-target="#details-2476" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">description</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2476">
<div class="comment"><p>Human-readable string which is rendered less prominently in the title.</p>
</div>
</div>



<a name="WebviewView.title"></a><span class="ts" id=2475 data-target="#details-2475" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">title</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2475">
<div class="comment"><p>View title displayed in the UI.</p>
<p>The view title is initially taken from the extension <code>package.json</code> contribution.</p>
</div>
</div>



<a name="WebviewView.viewType"></a><span class="ts" id=2473 data-target="#details-2473" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">viewType</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-2473">
<div class="comment"><p>Identifies the type of the webview view, such as <code>&#39;hexEditor.dataView&#39;</code>.</p>
</div>
</div>



<a name="WebviewView.visible"></a><span class="ts" id=2479 data-target="#details-2479" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">visible</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2479">
<div class="comment"><p>Tracks if the webview is currently visible.</p>
<p>Views are visible when they are on the screen and expanded.</p>
</div>
</div>



<a name="WebviewView.webview"></a><span class="ts" id=2474 data-target="#details-2474" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">webview</span><span>: </span><a class="type-ref" href="#Webview">Webview</a></span>
<div class="details collapse" id="details-2474">
<div class="comment"><p>The underlying webview for the view.</p>
</div>
</div>

#### Methods



<a name="WebviewView.show"></a><span class="ts" id=2482 data-target="#details-2482" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">show</span><span>(</span><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-2482">
<div class="comment"><p>Reveal the view in the UI.</p>
<p>If the view is collapsed, this will expand it.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">preserveFocus</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>When <code>true</code> the view will not take focus.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="WebviewViewProvider"></a><span class="code-item" id=2487>WebviewViewProvider</span>



<div class="comment"><p>Provider for creating <a href="#WebviewView">WebviewView</a> elements.</p>
</div>

#### Methods



<a name="WebviewViewProvider.resolveWebviewView"></a><span class="ts" id=2489 data-target="#details-2489" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveWebviewView</span><span>(</span><span class="ident">webviewView</span><span>: </span><a class="type-ref" href="#WebviewView">WebviewView</a>, <span class="ident">context</span><span>: </span><a class="type-ref" href="#WebviewViewResolveContext&amp;lt;T&amp;gt;">WebviewViewResolveContext</a>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-2489">
<div class="comment"><p>Resolves a webview view.</p>
<p><code>resolveWebviewView</code> is called when a view first becomes visible. This may happen when the view is
first loaded or when the user hides and then shows a view again.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">webviewView</span><span>: </span><a class="type-ref" href="#WebviewView">WebviewView</a></td><td><div class="comment"><p>Webview view to restore. The provider should take ownership of this view. The
   provider must set the webview&#39;s <code>.html</code> and hook up all webview events it is interested in.</p>
</div></td></tr>
<tr><td><span class="ident">context</span><span>: </span><a class="type-ref" href="#WebviewViewResolveContext&amp;lt;T&amp;gt;">WebviewViewResolveContext</a></td><td><div class="comment"><p>Additional metadata about the view being resolved.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>Cancellation token indicating that the view being provided is no longer needed.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span> &#124; <span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"><p>Optional thenable indicating that the view has been fully resolved.</p>
</div></td></tr>
</table>
</div>
</div>

### <a name="WebviewViewResolveContext"></a><span class="code-item" id=2484>WebviewViewResolveContext&lt;T&gt;</span>



<div class="comment"><p>Additional information the webview view being resolved.</p>
</div>

#### Properties



<a name="WebviewViewResolveContext.state"></a><span class="ts" id=2486 data-target="#details-2486" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">state</span><span>: </span><span class="type-ref">T</span></span>
<div class="details collapse" id="details-2486">
<div class="comment"><p>Persisted state from the webview content.</p>
<p>To save resources, the editor normally deallocates webview documents (the iframe content) that are not visible.
For example, when the user collapse a view or switches to another top level activity in the sidebar, the
<a href="#WebviewView">WebviewView</a> itself is kept alive but the webview&#39;s underlying document is deallocated. It is recreated when
the view becomes visible again.</p>
<p>You can prevent this behavior by setting [WebviewOptions.retainContextWhenHidden retainContextWhenHidden](#WebviewOptions.retainContextWhenHidden retainContextWhenHidden) in the <a href="#WebviewOptions">WebviewOptions</a>.
However this increases resource usage and should be avoided wherever possible. Instead, you can use
persisted state to save off a webview&#39;s state so that it can be quickly recreated as needed.</p>
<p>To save off a persisted state, inside the webview call <code>acquireVsCodeApi().setState()</code> with
any json serializable object. To restore the state again, call <code>getState()</code>. For example:</p>
<pre class="shiki" data-lang="js" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Within the webview</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">acquireVsCodeApi</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">();</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Get existing state</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> oldState</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">getState</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">() || { </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">value:</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658"> 0</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> };</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// Update state</span></span>
<span class="line"><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">setState</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">({ </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">value:</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080"> oldState</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">value</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> + </span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">1</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> });</span></span>
<span class="line"></span></code></pre>
<p>The editor ensures that the persisted state is saved correctly when a webview is hidden and across
editor restarts.</p>
</div>
</div>

### <a name="WindowState"></a><span class="code-item" id=2638>WindowState</span>



<div class="comment"><p>Represents the state of a window.</p>
</div>

#### Properties



<a name="WindowState.active"></a><span class="ts" id=2640 data-target="#details-2640" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">active</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2640">
<div class="comment"><p>Whether the window has been interacted with recently. This will change
immediately on activity, or after a short time of user inactivity.</p>
</div>
</div>



<a name="WindowState.focused"></a><span class="ts" id=2639 data-target="#details-2639" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">focused</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-2639">
<div class="comment"><p>Whether the current window is focused.</p>
</div>
</div>

### <a name="WorkspaceConfiguration"></a><span class="code-item" id=1701>WorkspaceConfiguration</span>



<div class="comment"><p>Represents the configuration. It is a merged view of</p>
<ul>
<li><em>Default Settings</em></li>
<li><em>Global (User) Settings</em></li>
<li><em>Workspace settings</em></li>
<li><em>Workspace Folder settings</em> - From one of the <a href="#workspace.workspaceFolders">Workspace Folders</a> under which requested resource belongs to.</li>
<li><em>Language settings</em> - Settings defined under requested language.</li>
</ul>
<p>The <em>effective</em> value (returned by <a href="#WorkspaceConfiguration.get">get</a>) is computed by overriding or merging the values in the following order:</p>
<ol>
<li><code>defaultValue</code> (if defined in <code>package.json</code> otherwise derived from the value&#39;s type)</li>
<li><code>globalValue</code> (if defined)</li>
<li><code>workspaceValue</code> (if defined)</li>
<li><code>workspaceFolderValue</code> (if defined)</li>
<li><code>defaultLanguageValue</code> (if defined)</li>
<li><code>globalLanguageValue</code> (if defined)</li>
<li><code>workspaceLanguageValue</code> (if defined)</li>
<li><code>workspaceFolderLanguageValue</code> (if defined)</li>
</ol>
<p><strong>Note:</strong> Only <code>object</code> value types are merged and all other value types are overridden.</p>
<p>Example 1: Overriding</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">defaultValue</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'on'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">globalValue</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'relative'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspaceFolderValue</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'off'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">value</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'off'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"></span></code></pre>
<p>Example 2: Language Values</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">defaultValue</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'on'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">globalValue</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'relative'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspaceFolderValue</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'off'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">globalLanguageValue</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'on'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">value</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'on'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">;</span></span>
<span class="line"></span></code></pre>
<p>Example 3: Object Values</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">defaultValue</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = { </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">a:</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658"> 1</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">b:</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658"> 2</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> };</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">globalValue</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = { </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">b:</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658"> 3</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">c:</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658"> 4</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> };</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">value</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = { </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">a:</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658"> 1</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">b:</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658"> 3</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">, </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">c:</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658"> 4</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> };</span></span>
<span class="line"></span></code></pre>
<p><em>Note:</em> Workspace and Workspace Folder configurations contains <code>launch</code> and <code>tasks</code> settings. Their basename will be
part of the section identifier. The following snippets shows how to retrieve all configurations
from <code>launch.json</code>:</p>
<pre class="shiki" data-lang="ts" shiki-themes dark-plus light-plus" style="--shiki-dark:#D4D4D4;--shiki-light:#000000;--shiki-dark-bg:#1E1E1E;--shiki-light-bg:#FFFFFF" tabindex="0"><code><span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// launch.json configuration</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> config</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">getConfiguration</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span></span>
<span class="line"><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">  'launch'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">,</span></span>
<span class="line"><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">  vscode</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspace</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">workspaceFolders</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">[</span><span style="--shiki-dark:#B5CEA8;--shiki-light:#098658">0</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">].</span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">uri</span></span>
<span class="line"><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-dark:#6A9955;--shiki-light:#008000">// retrieve values</span></span>
<span class="line"><span style="--shiki-dark:#569CD6;--shiki-light:#0000FF">const</span><span style="--shiki-dark:#4FC1FF;--shiki-light:#0070C1"> values</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000"> = </span><span style="--shiki-dark:#9CDCFE;--shiki-light:#001080">config</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">.</span><span style="--shiki-dark:#DCDCAA;--shiki-light:#795E26">get</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">(</span><span style="--shiki-dark:#CE9178;--shiki-light:#A31515">'configurations'</span><span style="--shiki-dark:#D4D4D4;--shiki-light:#000000">);</span></span>
<span class="line"></span></code></pre>
<p>Refer to <a href="https://code.visualstudio.com/docs/getstarted/settings">Settings</a> for more information.</p>
</div>

#### Methods



<a name="WorkspaceConfiguration.get"></a><span class="ts" id=1703 data-target="#details-1703" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">get</span><span>&lt;</span>T<span>&gt;</span><span>(</span><span class="ident">section</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-ref">T</span></span>
<div class="details collapse" id="details-1703">
<div class="comment"><p>Return a value from this configuration.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">section</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Configuration name, supports <em>dotted</em> names.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">T</span></td><td><div class="comment"><p>The value <code>section</code> denotes or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceConfiguration.get"></a><span class="ts" id=1706 data-target="#details-1706" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">get</span><span>&lt;</span>T<span>&gt;</span><span>(</span><span class="ident">section</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">defaultValue</span><span>: </span><span class="type-ref">T</span><span>)</span><span>: </span><span class="type-ref">T</span></span>
<div class="details collapse" id="details-1706">
<div class="comment"><p>Return a value from this configuration.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">section</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Configuration name, supports <em>dotted</em> names.</p>
</div></td></tr>
<tr><td><span class="ident">defaultValue</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>A value should be returned when no value could be found, is <code>undefined</code>.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">T</span></td><td><div class="comment"><p>The value <code>section</code> denotes or the default.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceConfiguration.has"></a><span class="ts" id=1711 data-target="#details-1711" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">has</span><span>(</span><span class="ident">section</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-1711">
<div class="comment"><p>Check if this configuration has a certain value.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">section</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Configuration name, supports <em>dotted</em> names.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> if the section doesn&#39;t resolve to <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceConfiguration.inspect"></a><span class="ts" id=1714 data-target="#details-1714" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">inspect</span><span>&lt;</span>T<span>&gt;</span><span>(</span><span class="ident">section</span><span>: </span><span class="type-intrinsic">string</span><span>)</span><span>: </span>{defaultLanguageValue: <span class="type-ref">T</span>, defaultValue: <span class="type-ref">T</span>, globalLanguageValue: <span class="type-ref">T</span>, globalValue: <span class="type-ref">T</span>, key: <span class="type-intrinsic">string</span>, languageIds: <span class="type-intrinsic">string</span>[], workspaceFolderLanguageValue: <span class="type-ref">T</span>, workspaceFolderValue: <span class="type-ref">T</span>, workspaceLanguageValue: <span class="type-ref">T</span>, workspaceValue: <span class="type-ref">T</span>}</span>
<div class="details collapse" id="details-1714">
<div class="comment"><p>Retrieve all information about a configuration setting. A configuration value
often consists of a <em>default</em> value, a global or installation-wide value,
a workspace-specific value, folder-specific value
and language-specific values (if <a href="#WorkspaceConfiguration">WorkspaceConfiguration</a> is scoped to a language).</p>
<p>Also provides all language ids under which the given configuration setting is defined.</p>
<p><em>Note:</em> The configuration name must denote a leaf in the configuration tree
(<code>editor.fontSize</code> vs <code>editor</code>) otherwise no result is returned.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">section</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Configuration name, supports <em>dotted</em> names.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td>{defaultLanguageValue: <span class="type-ref">T</span>, defaultValue: <span class="type-ref">T</span>, globalLanguageValue: <span class="type-ref">T</span>, globalValue: <span class="type-ref">T</span>, key: <span class="type-intrinsic">string</span>, languageIds: <span class="type-intrinsic">string</span>[], workspaceFolderLanguageValue: <span class="type-ref">T</span>, workspaceFolderValue: <span class="type-ref">T</span>, workspaceLanguageValue: <span class="type-ref">T</span>, workspaceValue: <span class="type-ref">T</span>}</td><td><div class="comment"><p>Information about a configuration setting or <code>undefined</code>.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceConfiguration.update"></a><span class="ts" id=1729 data-target="#details-1729" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">update</span><span>(</span><span class="ident">section</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">value</span><span>: </span><span class="type-intrinsic">any</span>, <span class="ident">configurationTarget</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span> &#124; <a class="type-ref" href="#ConfigurationTarget">ConfigurationTarget</a>, <span class="ident">overrideInLanguage</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span><span>)</span><span>: </span><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</span>
<div class="details collapse" id="details-1729">
<div class="comment"><p>Update a configuration value. The updated configuration values are persisted.</p>
<p>A value can be changed in</p>
<ul>
<li><a href="#ConfigurationTarget.Global">Global settings</a>: Changes the value for all instances of the editor.</li>
<li><a href="#ConfigurationTarget.Workspace">Workspace settings</a>: Changes the value for current workspace, if available.</li>
<li><a href="#ConfigurationTarget.WorkspaceFolder">Workspace folder settings</a>: Changes the value for settings from one of the <a href="#workspace.workspaceFolders">Workspace Folders</a> under which the requested resource belongs to.</li>
<li>Language settings: Changes the value for the requested languageId.</li>
</ul>
<p><em>Note:</em> To remove a configuration value use <code>undefined</code>, like so: <code>config.update(&#39;somekey&#39;, undefined)</code></p>
<ul>
<li><em>throws</em> - error while updating<ul>
<li>configuration which is not registered.</li>
<li>window configuration to workspace folder</li>
<li>configuration to workspace or workspace folder when no workspace is opened.</li>
<li>configuration to workspace folder when there is no workspace folder settings.</li>
<li>configuration to workspace folder when <a href="#WorkspaceConfiguration">WorkspaceConfiguration</a> is not scoped to a resource.</li>
</ul>
</li>
</ul>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">section</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>Configuration name, supports <em>dotted</em> names.</p>
</div></td></tr>
<tr><td><span class="ident">value</span><span>: </span><span class="type-intrinsic">any</span></td><td><div class="comment"><p>The new value.</p>
</div></td></tr>
<tr><td><span class="ident">configurationTarget</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span> &#124; <a class="type-ref" href="#ConfigurationTarget">ConfigurationTarget</a></td><td><div class="comment"><p>The <a href="#ConfigurationTarget">configuration target</a> or a boolean value.
    - If <code>true</code> updates <a href="#ConfigurationTarget.Global">Global settings</a>.
    - If <code>false</code> updates <a href="#ConfigurationTarget.Workspace">Workspace settings</a>.
    - If <code>undefined</code> or <code>null</code> updates to <a href="#ConfigurationTarget.WorkspaceFolder">Workspace folder settings</a> if configuration is resource specific,
    otherwise to <a href="#ConfigurationTarget.Workspace">Workspace settings</a>.</p>
</div></td></tr>
<tr><td><span class="ident">overrideInLanguage</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p>Whether to update the value in the scope of requested languageId or not.
    - If <code>true</code> updates the value under the requested languageId.
    - If <code>undefined</code> updates the value under the requested languageId only if the configuration is defined for the language.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-ref">Thenable</span>&lt;<span class="type-intrinsic">void</span>&gt;</td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="WorkspaceEdit"></a><span class="code-item" id=976>WorkspaceEdit</span>



<div class="comment"><p>A workspace edit is a collection of textual and files changes for
multiple resources and documents.</p>
<p>Use the <a href="#workspace.applyEdit">applyEdit</a>-function to apply a workspace edit.</p>
</div>

#### Constructors



<a name="WorkspaceEdit.WorkspaceEdit"></a><span class="ts" id=978 data-target="#details-978" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">WorkspaceEdit</span><span>(</span><span>)</span><span>: </span><a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a></span>
<div class="details collapse" id="details-978">
<div class="comment"></div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#WorkspaceEdit">WorkspaceEdit</a></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

#### Properties



<a name="WorkspaceEdit.size"></a><span class="ts" id=979 data-target="#details-979" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">size</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-979">
<div class="comment"><p>The number of affected resources of textual or resource changes.</p>
</div>
</div>

#### Methods



<a name="WorkspaceEdit.createFile"></a><span class="ts" id=1017 data-target="#details-1017" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">createFile</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">options</span><span>?</span><span>: </span>{contents: <span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt; &#124; <a class="type-ref" href="#DataTransferFile">DataTransferFile</a>, ignoreIfExists: <span class="type-intrinsic">boolean</span>, overwrite: <span class="type-intrinsic">boolean</span>}, <span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1017">
<div class="comment"><p>Create a regular file.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>Uri of the new file.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{contents: <span class="type-ref-ts">Uint8Array</span>&lt;<span class="type-ref-ts">ArrayBufferLike</span>&gt; &#124; <a class="type-ref" href="#DataTransferFile">DataTransferFile</a>, ignoreIfExists: <span class="type-intrinsic">boolean</span>, overwrite: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"><p>Defines if an existing file should be overwritten or be
ignored. When <code>overwrite</code> and <code>ignoreIfExists</code> are both set <code>overwrite</code> wins.
When both are unset and when the file already exists then the edit cannot
be applied successfully. The <code>content</code>-property allows to set the initial contents
the file is being created with.</p>
</div></td></tr>
<tr><td><span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a></td><td><div class="comment"><p>Optional metadata for the entry.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceEdit.delete"></a><span class="ts" id=993 data-target="#details-993" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">delete</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-993">
<div class="comment"><p>Delete the text at the given range.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><td><span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a></td><td><div class="comment"><p>Optional metadata for the entry.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceEdit.deleteFile"></a><span class="ts" id=1026 data-target="#details-1026" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">deleteFile</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">options</span><span>?</span><span>: </span>{ignoreIfNotExists: <span class="type-intrinsic">boolean</span>, recursive: <span class="type-intrinsic">boolean</span>}, <span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1026">
<div class="comment"><p>Delete a file or folder.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The uri of the file that is to be deleted.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{ignoreIfNotExists: <span class="type-intrinsic">boolean</span>, recursive: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"></div></td></tr>
<tr><td><span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a></td><td><div class="comment"><p>Optional metadata for the entry.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceEdit.entries"></a><span class="ts" id=1043 data-target="#details-1043" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">entries</span><span>(</span><span>)</span><span>: </span>Array&lt;[<a class="type-ref" href="#Uri">Uri</a>, <a class="type-ref" href="#TextEdit">TextEdit</a>[]]&gt;</span>
<div class="details collapse" id="details-1043">
<div class="comment"><p>Get all text edits grouped by resource.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td>Array&lt;[<a class="type-ref" href="#Uri">Uri</a>, <a class="type-ref" href="#TextEdit">TextEdit</a>[]]&gt;</td><td><div class="comment"><p>A shallow copy of <code>[Uri, TextEdit[]]</code>-tuples.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceEdit.get"></a><span class="ts" id=1014 data-target="#details-1014" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">get</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><a class="type-ref" href="#TextEdit">TextEdit</a>[]</span>
<div class="details collapse" id="details-1014">
<div class="comment"><p>Get the text edits for a resource.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#TextEdit">TextEdit</a>[]</td><td><div class="comment"><p>An array of text edits.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceEdit.has"></a><span class="ts" id=998 data-target="#details-998" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">has</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a><span>)</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-998">
<div class="comment"><p>Check if a text edit for a resource exists.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">boolean</span></td><td><div class="comment"><p><code>true</code> if the given resource will be touched by this edit.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceEdit.insert"></a><span class="ts" id=987 data-target="#details-987" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">insert</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a>, <span class="ident">newText</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-987">
<div class="comment"><p>Insert the given text at the given position.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><td><span class="ident">position</span><span>: </span><a class="type-ref" href="#Position">Position</a></td><td><div class="comment"><p>A position.</p>
</div></td></tr>
<tr><td><span class="ident">newText</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string.</p>
</div></td></tr>
<tr><td><span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a></td><td><div class="comment"><p>Optional metadata for the entry.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceEdit.renameFile"></a><span class="ts" id=1034 data-target="#details-1034" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">renameFile</span><span>(</span><span class="ident">oldUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">newUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">options</span><span>?</span><span>: </span>{ignoreIfExists: <span class="type-intrinsic">boolean</span>, overwrite: <span class="type-intrinsic">boolean</span>}, <span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1034">
<div class="comment"><p>Rename a file or folder.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">oldUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The existing file.</p>
</div></td></tr>
<tr><td><span class="ident">newUri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>The new location.</p>
</div></td></tr>
<tr><td><span class="ident">options</span><span>?</span><span>: </span>{ignoreIfExists: <span class="type-intrinsic">boolean</span>, overwrite: <span class="type-intrinsic">boolean</span>}</td><td><div class="comment"><p>Defines if existing files should be overwritten or be
ignored. When overwrite and ignoreIfExists are both set overwrite wins.</p>
</div></td></tr>
<tr><td><span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a></td><td><div class="comment"><p>Optional metadata for the entry.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceEdit.replace"></a><span class="ts" id=981 data-target="#details-981" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">replace</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a>, <span class="ident">newText</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a><span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-981">
<div class="comment"><p>Replace the given range with given text for the given resource.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><td><span class="ident">range</span><span>: </span><a class="type-ref" href="#Range">Range</a></td><td><div class="comment"><p>A range.</p>
</div></td></tr>
<tr><td><span class="ident">newText</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A string.</p>
</div></td></tr>
<tr><td><span class="ident">metadata</span><span>?</span><span>: </span><a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a></td><td><div class="comment"><p>Optional metadata for the entry.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceEdit.set"></a><span class="ts" id=1001 data-target="#details-1001" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">set</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">edits</span><span>: </span>ReadonlyArray&lt;<a class="type-ref" href="#TextEdit">TextEdit</a> &#124; <a class="type-ref" href="#SnippetTextEdit">SnippetTextEdit</a>&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1001">
<div class="comment"><p>Set (and replace) text edits or snippet edits for a resource.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><td><span class="ident">edits</span><span>: </span>ReadonlyArray&lt;<a class="type-ref" href="#TextEdit">TextEdit</a> &#124; <a class="type-ref" href="#SnippetTextEdit">SnippetTextEdit</a>&gt;</td><td><div class="comment"><p>An array of edits.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceEdit.set"></a><span class="ts" id=1004 data-target="#details-1004" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">set</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">edits</span><span>: </span>ReadonlyArray&lt;[<a class="type-ref" href="#TextEdit">TextEdit</a> &#124; <a class="type-ref" href="#SnippetTextEdit">SnippetTextEdit</a>, <a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a>]&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1004">
<div class="comment"><p>Set (and replace) text edits or snippet edits with metadata for a resource.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><td><span class="ident">edits</span><span>: </span>ReadonlyArray&lt;[<a class="type-ref" href="#TextEdit">TextEdit</a> &#124; <a class="type-ref" href="#SnippetTextEdit">SnippetTextEdit</a>, <a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a>]&gt;</td><td><div class="comment"><p>An array of edits.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceEdit.set"></a><span class="ts" id=1007 data-target="#details-1007" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">set</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">edits</span><span>: </span>readonly <a class="type-ref" href="#NotebookEdit">NotebookEdit</a>[]<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1007">
<div class="comment"><p>Set (and replace) notebook edits for a resource.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><td><span class="ident">edits</span><span>: </span>readonly <a class="type-ref" href="#NotebookEdit">NotebookEdit</a>[]</td><td><div class="comment"><p>An array of edits.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceEdit.set"></a><span class="ts" id=1010 data-target="#details-1010" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">set</span><span>(</span><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a>, <span class="ident">edits</span><span>: </span>ReadonlyArray&lt;[<a class="type-ref" href="#NotebookEdit">NotebookEdit</a>, <a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a>]&gt;<span>)</span><span>: </span><span class="type-intrinsic">void</span></span>
<div class="details collapse" id="details-1010">
<div class="comment"><p>Set (and replace) notebook edits with metadata for a resource.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></td><td><div class="comment"><p>A resource identifier.</p>
</div></td></tr>
<tr><td><span class="ident">edits</span><span>: </span>ReadonlyArray&lt;[<a class="type-ref" href="#NotebookEdit">NotebookEdit</a>, <a class="type-ref" href="#WorkspaceEditEntryMetadata">WorkspaceEditEntryMetadata</a>]&gt;</td><td><div class="comment"><p>An array of edits.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><span class="type-intrinsic">void</span></td><td><div class="comment"></div></td></tr>
</table>
</div>
</div>

### <a name="WorkspaceEditEntryMetadata"></a><span class="code-item" id=969>WorkspaceEditEntryMetadata</span>



<div class="comment"><p>Additional data for entries of a workspace edit. Supports to label entries and marks entries
as needing confirmation by the user. The editor groups edits with equal labels into tree nodes,
for instance all edits labelled with &quot;Changes in Strings&quot; would be a tree node.</p>
</div>

#### Properties



<a name="WorkspaceEditEntryMetadata.description"></a><span class="ts" id=972 data-target="#details-972" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">description</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-972">
<div class="comment"><p>A human-readable string which is rendered less prominent on the same line.</p>
</div>
</div>



<a name="WorkspaceEditEntryMetadata.iconPath"></a><span class="ts" id=973 data-target="#details-973" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">iconPath</span><span>?</span><span>: </span><a class="type-ref" href="#IconPath">IconPath</a></span>
<div class="details collapse" id="details-973">
<div class="comment"><p>The icon path or <a href="#ThemeIcon">ThemeIcon</a> for the edit.</p>
</div>
</div>



<a name="WorkspaceEditEntryMetadata.label"></a><span class="ts" id=971 data-target="#details-971" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">label</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-971">
<div class="comment"><p>A human-readable string which is rendered prominent.</p>
</div>
</div>



<a name="WorkspaceEditEntryMetadata.needsConfirmation"></a><span class="ts" id=970 data-target="#details-970" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">needsConfirmation</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-970">
<div class="comment"><p>A flag which indicates that user confirmation is needed.</p>
</div>
</div>

### <a name="WorkspaceEditMetadata"></a><span class="code-item" id=974>WorkspaceEditMetadata</span>



<div class="comment"><p>Additional data about a workspace edit.</p>
</div>

#### Properties



<a name="WorkspaceEditMetadata.isRefactoring"></a><span class="ts" id=975 data-target="#details-975" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">isRefactoring</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-975">
<div class="comment"><p>Signal to the editor that this edit is a refactoring.</p>
</div>
</div>

### <a name="WorkspaceFolder"></a><span class="code-item" id=3341>WorkspaceFolder</span>



<div class="comment"><p>A workspace folder is one of potentially many roots opened by the editor. All workspace folders
are equal which means there is no notion of an active or primary workspace folder.</p>
</div>

#### Properties



<a name="WorkspaceFolder.index"></a><span class="ts" id=3344 data-target="#details-3344" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">index</span><span>: </span><span class="type-intrinsic">number</span></span>
<div class="details collapse" id="details-3344">
<div class="comment"><p>The ordinal number of this workspace folder.</p>
</div>
</div>



<a name="WorkspaceFolder.name"></a><span class="ts" id=3343 data-target="#details-3343" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">name</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-3343">
<div class="comment"><p>The name of this workspace folder. Defaults to
the basename of its <a href="#Uri.path">uri-path</a></p>
</div>
</div>



<a name="WorkspaceFolder.uri"></a><span class="ts" id=3342 data-target="#details-3342" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">uri</span><span>: </span><a class="type-ref" href="#Uri">Uri</a></span>
<div class="details collapse" id="details-3342">
<div class="comment"><p>The associated uri for this workspace folder.</p>
<p><em>Note:</em> The <a href="#Uri">Uri</a>-type was intentionally chosen such that future releases of the editor can support
workspace folders that are not stored on the local disk, e.g. <code>ftp://server/workspaces/foo</code>.</p>
</div>
</div>

### <a name="WorkspaceFolderPickOptions"></a><span class="code-item" id=527>WorkspaceFolderPickOptions</span>



<div class="comment"><p>Options to configure the behavior of the <a href="#WorkspaceFolder">workspace folder</a> pick UI.</p>
</div>

#### Properties



<a name="WorkspaceFolderPickOptions.ignoreFocusOut"></a><span class="ts" id=529 data-target="#details-529" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">ignoreFocusOut</span><span>?</span><span>: </span><span class="type-intrinsic">boolean</span></span>
<div class="details collapse" id="details-529">
<div class="comment"><p>Set to <code>true</code> to keep the picker open when focus moves to another part of the editor or to another window.
This setting is ignored on iPad and is always <code>false</code>.</p>
</div>
</div>



<a name="WorkspaceFolderPickOptions.placeHolder"></a><span class="ts" id=528 data-target="#details-528" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">placeHolder</span><span>?</span><span>: </span><span class="type-intrinsic">string</span></span>
<div class="details collapse" id="details-528">
<div class="comment"><p>An optional string to show as placeholder in the input box to guide the user.</p>
</div>
</div>

### <a name="WorkspaceFoldersChangeEvent"></a><span class="code-item" id=3338>WorkspaceFoldersChangeEvent</span>



<div class="comment"><p>An event describing a change to the set of <a href="#workspace.workspaceFolders">workspace folders</a>.</p>
</div>

#### Properties



<a name="WorkspaceFoldersChangeEvent.added"></a><span class="ts" id=3339 data-target="#details-3339" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">added</span><span>: </span>readonly <a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a>[]</span>
<div class="details collapse" id="details-3339">
<div class="comment"><p>Added workspace folders.</p>
</div>
</div>



<a name="WorkspaceFoldersChangeEvent.removed"></a><span class="ts" id=3340 data-target="#details-3340" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">removed</span><span>: </span>readonly <a class="type-ref" href="#WorkspaceFolder">WorkspaceFolder</a>[]</span>
<div class="details collapse" id="details-3340">
<div class="comment"><p>Removed workspace folders.</p>
</div>
</div>

### <a name="WorkspaceSymbolProvider"></a><span class="code-item" id=873>WorkspaceSymbolProvider&lt;T&gt;</span>



<div class="comment"><p>The workspace symbol provider interface defines the contract between extensions and
the <a href="https://code.visualstudio.com/docs/editor/editingevolved#_open-symbol-by-name">symbol search</a>-feature.</p>
</div>

#### Methods



<a name="WorkspaceSymbolProvider.provideWorkspaceSymbols"></a><span class="ts" id=876 data-target="#details-876" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">provideWorkspaceSymbols</span><span>(</span><span class="ident">query</span><span>: </span><span class="type-intrinsic">string</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</span>
<div class="details collapse" id="details-876">
<div class="comment"><p>Project-wide search for a symbol matching the given query string.</p>
<p>The <code>query</code>-parameter should be interpreted in a <em>relaxed way</em> as the editor will apply its own highlighting
and scoring on the results. A good rule of thumb is to match case-insensitive and to simply check that the
characters of <em>query</em> appear in their order in a candidate symbol. Don&#39;t use prefix, substring, or similar
strict matching.</p>
<p>To improve performance implementors can implement <code>resolveWorkspaceSymbol</code> and then provide symbols with partial
<a href="#SymbolInformation.location">location</a>-objects, without a <code>range</code> defined. The editor will then call
<code>resolveWorkspaceSymbol</code> for selected symbols only, e.g. when opening a workspace symbol.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">query</span><span>: </span><span class="type-intrinsic">string</span></td><td><div class="comment"><p>A query string, can be the empty string in which case all symbols should be returned.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>[]&gt;</td><td><div class="comment"><p>An array of document highlights or a thenable that resolves to such. The lack of a result can be
signaled by returning <code>undefined</code>, <code>null</code>, or an empty array.</p>
</div></td></tr>
</table>
</div>
</div>



<a name="WorkspaceSymbolProvider.resolveWorkspaceSymbol"></a><span class="ts" id=880 data-target="#details-880" data-toggle="collapse" role="button" tabIndex="0" aria-expanded="false"><span class="ident">resolveWorkspaceSymbol</span><span>(</span><span class="ident">symbol</span><span>: </span><span class="type-ref">T</span>, <span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a><span>)</span><span>: </span><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</span>
<div class="details collapse" id="details-880">
<div class="comment"><p>Given a symbol fill in its <a href="#SymbolInformation.location">location</a>. This method is called whenever a symbol
is selected in the UI. Providers can implement this method and return incomplete symbols from
<a href="#WorkspaceSymbolProvider.provideWorkspaceSymbols">provideWorkspaceSymbols</a> which often helps to improve
performance.</p>
</div>
<div class="signature callable-signature">
<table class="table table-bordered">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td><span class="ident">symbol</span><span>: </span><span class="type-ref">T</span></td><td><div class="comment"><p>The symbol that is to be resolved. Guaranteed to be an instance of an object returned from an
earlier call to <code>provideWorkspaceSymbols</code>.</p>
</div></td></tr>
<tr><td><span class="ident">token</span><span>: </span><a class="type-ref" href="#CancellationToken">CancellationToken</a></td><td><div class="comment"><p>A cancellation token.</p>
</div></td></tr>
<tr><th>Returns</th><th>Description</th></tr>
<tr><td><a class="type-ref" href="#ProviderResult&amp;lt;T&amp;gt;">ProviderResult</a>&lt;<span class="type-ref">T</span>&gt;</td><td><div class="comment"><p>The resolved symbol or a thenable that resolves to that. When no result is returned,
the given <code>symbol</code> is used.</p>
</div></td></tr>
</table>
</div>
</div>



## API Patterns

These are some of the common patterns we use in the VS Code API.

### Promises

The VS Code API represents asynchronous operations with [promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise). From extensions, __any__ type of promise can be returned, like ES6, WinJS, A+, etc.

Being independent of a specific promise library is expressed in the API by the `Thenable`-type. `Thenable` represents the common denominator which is the [then](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) method.

In most cases the use of promises is optional and when VS Code calls into an extension, it can handle the _result type_ as well as a `Thenable` of the _result type_. When the use of a promise is optional, the API indicates this by returning `or`-types.

```typescript
provideNumber(): number | Thenable<number>
```

### Cancellation Tokens

Often operations are started on volatile state which changes before operations can finish. For instance, computing IntelliSense starts and the user continues to type making the result of that operation obsolete.

APIs that are exposed to such behavior will get passed a `CancellationToken` on which you can check for cancellation (`isCancellationRequested`) or get notified when cancellation occurs (`onCancellationRequested`). The cancellation token is usually the last parameter of a function call and optional.

### Disposables

The VS Code API uses the [dispose pattern](https://en.wikipedia.org/wiki/Dispose_pattern) for resources that are obtained from VS Code. This applies to event listening, commands, interacting with the UI, and various language contributions.

For instance, the `setStatusBarMessage(value: string)` function returns a `Disposable` which upon calling `dispose` removes the message again.

### Events

Events in the VS Code API are exposed as functions which you call with a listener-function to subscribe. Calls to subscribe return a `Disposable` which removes the event listener upon dispose.

```javascript
var listener = function(event) {
    console.log("It happened", event);
};

// start listening
var subscription = fsWatcher.onDidDelete(listener);

// do more stuff

subscription.dispose(); // stop listening
```

Names of events follow the `on[Will|Did]VerbNoun?` pattern. The name signals if the event is going to happen *(onWill)* or already happened *(onDid)*, what happened *(verb)*, and the context *(noun)* unless obvious from the context.

An example from the VS Code API is `window.onDidChangeActiveTextEditor` which is an event fired when the active text editor *(noun)* has been (*onDid*) changed (*verb*).

### Strict null

The VS Code API uses the `undefined` and `null` TypeScript types where appropriate to support [strict null checking](https://github.com/microsoft/TypeScript/pull/7140).