CommentAuthorInformation · code.visualstudio.com

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 file from the VS Code repository.

authentication

Events

onDidChangeSessions: Event<AuthenticationSessionsChangeEvent>

Functions

getAccounts(providerId: string): Thenable<readonly AuthenticationSessionAccountInformation[]>

ParameterDescription
providerId: string

The id of the provider to use

ReturnsDescription
Thenable<readonly AuthenticationSessionAccountInformation[]>

A thenable that resolves to a readonly array of authentication accounts.

getSession(providerId: string, scopeListOrRequest: readonly string[] | AuthenticationWwwAuthenticateRequest, options: AuthenticationGetSessionOptions & {createIfNone: true | AuthenticationGetSessionPresentationOptions}): Thenable<AuthenticationSession>

ParameterDescription
providerId: string

The id of the provider to use

scopeListOrRequest: readonly string[] | AuthenticationWwwAuthenticateRequest

A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider.

options: AuthenticationGetSessionOptions & {createIfNone: true | AuthenticationGetSessionPresentationOptions}

The AuthenticationGetSessionOptions to use

ReturnsDescription
Thenable<AuthenticationSession>

A thenable that resolves to an authentication session

getSession(providerId: string, scopeListOrRequest: readonly string[] | AuthenticationWwwAuthenticateRequest, options: AuthenticationGetSessionOptions & {forceNewSession: true | AuthenticationGetSessionPresentationOptions}): Thenable<AuthenticationSession>

ParameterDescription
providerId: string

The id of the provider to use

scopeListOrRequest: readonly string[] | AuthenticationWwwAuthenticateRequest

A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider.

options: AuthenticationGetSessionOptions & {forceNewSession: true | AuthenticationGetSessionPresentationOptions}

The AuthenticationGetSessionOptions to use

ReturnsDescription
Thenable<AuthenticationSession>

A thenable that resolves to an authentication session

getSession(providerId: string, scopeListOrRequest: readonly string[] | AuthenticationWwwAuthenticateRequest, options?: AuthenticationGetSessionOptions): Thenable<AuthenticationSession | undefined>

ParameterDescription
providerId: string

The id of the provider to use

scopeListOrRequest: readonly string[] | AuthenticationWwwAuthenticateRequest

A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider.

options?: AuthenticationGetSessionOptions

The AuthenticationGetSessionOptions to use

ReturnsDescription
Thenable<AuthenticationSession | undefined>

A thenable that resolves to an authentication session or undefined if a silent flow was used and no session was found

registerAuthenticationProvider(id: string, label: string, provider: AuthenticationProvider, options?: AuthenticationProviderOptions): Disposable

ParameterDescription
id: string

The unique identifier of the provider.

label: string

The human-readable name of the provider.

provider: AuthenticationProvider

The authentication provider provider.

options?: AuthenticationProviderOptions

Additional options for the provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

chat

Functions

createChatParticipant(id: string, handler: ChatRequestHandler): ChatParticipant

ParameterDescription
id: string

A unique identifier for the participant.

handler: ChatRequestHandler

A request handler for the participant.

ReturnsDescription
ChatParticipant

A new chat participant

commands

Functions

executeCommand<T>(command: string, ...rest: any[]): Thenable<T>

ParameterDescription
command: string

Identifier of the command to execute.

...rest: any[]

Parameters passed to the command function.

ReturnsDescription
Thenable<T>

A thenable that resolves to the returned value of the given command. Returns undefined when the command handler function doesn't return anything.

getCommands(filterInternal?: boolean): Thenable<string[]>

ParameterDescription
filterInternal?: boolean

Set true to not see internal commands (starting with an underscore)

ReturnsDescription
Thenable<string[]>

Thenable that resolves to a list of command ids.

registerCommand(command: string, callback: (args: any[]) => any, thisArg?: any): Disposable

ParameterDescription
command: string

A unique identifier for the command.

callback: (args: any[]) => any

A command handler function.

thisArg?: any

The this context used when invoking the handler function.

ReturnsDescription
Disposable

Disposable which unregisters this command on disposal.

registerTextEditorCommand(command: string, callback: (textEditor: TextEditor, edit: TextEditorEdit, args: any[]) => void, thisArg?: any): Disposable

ParameterDescription
command: string

A unique identifier for the command.

callback: (textEditor: TextEditor, edit: TextEditorEdit, args: any[]) => void

A command handler function with access to an editor and an edit.

thisArg?: any

The this context used when invoking the handler function.

ReturnsDescription
Disposable

Disposable which unregisters this command on disposal.

Functions

createCommentController(id: string, label: string): CommentController

ParameterDescription
id: string

An id for the comment controller.

label: string

A human-readable string for the comment controller.

ReturnsDescription
CommentController

An instance of comment controller.

debug

Variables

activeDebugConsole: DebugConsole

activeDebugSession: DebugSession | undefined

activeStackItem: DebugThread | DebugStackFrame | undefined

breakpoints: readonly Breakpoint[]

Events

onDidChangeActiveDebugSession: Event<DebugSession | undefined>

onDidChangeActiveStackItem: Event<DebugThread | DebugStackFrame | undefined>

onDidChangeBreakpoints: Event<BreakpointsChangeEvent>

onDidReceiveDebugSessionCustomEvent: Event<DebugSessionCustomEvent>

onDidStartDebugSession: Event<DebugSession>

onDidTerminateDebugSession: Event<DebugSession>

Functions

addBreakpoints(breakpoints: readonly Breakpoint[]): void

ParameterDescription
breakpoints: readonly Breakpoint[]

The breakpoints to add.

ReturnsDescription
void

asDebugSourceUri(source: DebugProtocolSource, session?: DebugSession): Uri

ParameterDescription
source: DebugProtocolSource

An object conforming to the Source type defined in the Debug Adapter Protocol.

session?: DebugSession

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.

ReturnsDescription
Uri

A uri that can be used to load the contents of the source.

registerDebugAdapterDescriptorFactory(debugType: string, factory: DebugAdapterDescriptorFactory): Disposable

ParameterDescription
debugType: string

The debug type for which the factory is registered.

factory: DebugAdapterDescriptorFactory

The debug adapter descriptor factory to register.

ReturnsDescription
Disposable

A Disposable that unregisters this factory when being disposed.

registerDebugAdapterTrackerFactory(debugType: string, factory: DebugAdapterTrackerFactory): Disposable

ParameterDescription
debugType: string

The debug type for which the factory is registered or '*' for matching all debug types.

factory: DebugAdapterTrackerFactory

The debug adapter tracker factory to register.

ReturnsDescription
Disposable

A Disposable that unregisters this factory when being disposed.

registerDebugConfigurationProvider(debugType: string, provider: DebugConfigurationProvider, triggerKind?: DebugConfigurationProviderTriggerKind): Disposable

ParameterDescription
debugType: string

The debug type for which the provider is registered.

provider: DebugConfigurationProvider

The debug configuration provider to register.

triggerKind?: DebugConfigurationProviderTriggerKind

The trigger for which the 'provideDebugConfiguration' method of the provider is registered. If triggerKind is missing, the value DebugConfigurationProviderTriggerKind.Initial is assumed.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

removeBreakpoints(breakpoints: readonly Breakpoint[]): void

ParameterDescription
breakpoints: readonly Breakpoint[]

The breakpoints to remove.

ReturnsDescription
void

startDebugging(folder: WorkspaceFolder, nameOrConfiguration: string | DebugConfiguration, parentSessionOrOptions?: DebugSession | DebugSessionOptions): Thenable<boolean>

ParameterDescription
folder: WorkspaceFolder

The workspace folder for looking up named configurations and resolving variables or undefined for a non-folder setup.

nameOrConfiguration: string | DebugConfiguration

Either the name of a debug or compound configuration or a DebugConfiguration object.

parentSessionOrOptions?: DebugSession | DebugSessionOptions

Debug session options. When passed a parent debug session, assumes options with just this parent session.

ReturnsDescription
Thenable<boolean>

A thenable that resolves when debugging could be successfully started.

stopDebugging(session?: DebugSession): Thenable<void>

ParameterDescription
session?: DebugSession

The debug session to stop; if omitted all sessions are stopped.

ReturnsDescription
Thenable<void>

A thenable that resolves when the session(s) have been stopped.

env

Variables

appHost: string

appName: string

appRoot: string

clipboard: Clipboard

isAppPortable: boolean

isNewAppInstall: boolean

isTelemetryEnabled: boolean

language: string

logLevel: LogLevel

machineId: string

remoteName: string | undefined

sessionId: string

shell: string

uiKind: UIKind

uriScheme: string

Events

onDidChangeLogLevel: Event<LogLevel>

onDidChangeShell: Event<string>

onDidChangeTelemetryEnabled: Event<boolean>

Functions

asExternalUri(target: Uri): Thenable<Uri>

ParameterDescription
target: Uri
ReturnsDescription
Thenable<Uri>

A uri that can be used on the client machine.

createTelemetryLogger(sender: TelemetrySender, options?: TelemetryLoggerOptions): TelemetryLogger

ParameterDescription
sender: TelemetrySender

The telemetry sender that is used by the telemetry logger.

options?: TelemetryLoggerOptions

Options for the telemetry logger.

ReturnsDescription
TelemetryLogger

A new telemetry logger

openExternal(target: Uri): Thenable<boolean>

ParameterDescription
target: Uri

The uri that should be opened.

ReturnsDescription
Thenable<boolean>

A promise indicating if open was successful.

extensions

Variables

all: readonly Extension<any>[]

Events

onDidChange: Event<void>

Functions

getExtension<T>(extensionId: string): Extension<T> | undefined

ParameterDescription
extensionId: string

An extension identifier.

ReturnsDescription
Extension<T> | undefined

An extension or undefined.

l10n

Variables

bundle: | undefined

uri: Uri | undefined

Functions

t(message: string, ...args: Array<string | number | boolean>): string

ParameterDescription
message: string

The message to localize. Supports index templating where strings like {0} and {1} are replaced by the item at that index in the args array.

...args: Array<string | number | boolean>

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.

ReturnsDescription
string

localized string with injected arguments.

t(message: string, args: Record<string, string | number | boolean>): string

ParameterDescription
message: string

The message to localize. Supports named templating where strings like {foo} and {bar} are replaced by the value in the Record for that key (foo, bar, etc).

args: Record<string, string | number | boolean>

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.

ReturnsDescription
string

localized string with injected arguments.

t(options: {args: Array<string | number | boolean> | Record<string, string | number | boolean>, comment: string | string[], message: string}): string

ParameterDescription
options: {args: Array<string | number | boolean> | Record<string, string | number | boolean>, comment: string | string[], message: string}

The options to use when localizing the message.

ReturnsDescription
string

localized string with injected arguments.

languages

Events

onDidChangeDiagnostics: Event<DiagnosticChangeEvent>

Functions

createDiagnosticCollection(name?: string): DiagnosticCollection

ParameterDescription
name?: string

The name of the collection.

ReturnsDescription
DiagnosticCollection

A new diagnostic collection.

createLanguageStatusItem(id: string, selector: DocumentSelector): LanguageStatusItem

ParameterDescription
id: string

The identifier of the item.

selector: DocumentSelector

The document selector that defines for what editors the item shows.

ReturnsDescription
LanguageStatusItem

A new language status item.

getDiagnostics(resource: Uri): Diagnostic[]

ParameterDescription
resource: Uri

A resource

ReturnsDescription
Diagnostic[]

An array of diagnostics objects or an empty array.

getDiagnostics(): Array<[Uri, Diagnostic[]]>

ParameterDescription
ReturnsDescription
Array<[Uri, Diagnostic[]]>

An array of uri-diagnostics tuples or an empty array.

getLanguages(): Thenable<string[]>

ParameterDescription
ReturnsDescription
Thenable<string[]>

Promise resolving to an array of identifier strings.

match(selector: DocumentSelector, document: TextDocument): number

ParameterDescription
selector: DocumentSelector

A document selector.

document: TextDocument

A text document.

ReturnsDescription
number

A number >0 when the selector matches and 0 when the selector does not match.

registerCallHierarchyProvider(selector: DocumentSelector, provider: CallHierarchyProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: CallHierarchyProvider

A call hierarchy provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerCodeActionsProvider(selector: DocumentSelector, provider: CodeActionProvider<CodeAction>, metadata?: CodeActionProviderMetadata): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: CodeActionProvider<CodeAction>

A code action provider.

metadata?: CodeActionProviderMetadata

Metadata about the kind of code actions the provider provides.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerCodeLensProvider(selector: DocumentSelector, provider: CodeLensProvider<CodeLens>): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: CodeLensProvider<CodeLens>

A code lens provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerColorProvider(selector: DocumentSelector, provider: DocumentColorProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: DocumentColorProvider

A color provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerCompletionItemProvider(selector: DocumentSelector, provider: CompletionItemProvider<CompletionItem>, ...triggerCharacters: string[]): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: CompletionItemProvider<CompletionItem>

A completion provider.

...triggerCharacters: string[]

Trigger completion when the user types one of the characters.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerDeclarationProvider(selector: DocumentSelector, provider: DeclarationProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: DeclarationProvider

A declaration provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerDefinitionProvider(selector: DocumentSelector, provider: DefinitionProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: DefinitionProvider

A definition provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerDocumentDropEditProvider(selector: DocumentSelector, provider: DocumentDropEditProvider<DocumentDropEdit>, metadata?: DocumentDropEditProviderMetadata): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider applies to.

provider: DocumentDropEditProvider<DocumentDropEdit>

A drop provider.

metadata?: DocumentDropEditProviderMetadata

Additional metadata about the provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when disposed of.

registerDocumentFormattingEditProvider(selector: DocumentSelector, provider: DocumentFormattingEditProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: DocumentFormattingEditProvider

A document formatting edit provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerDocumentHighlightProvider(selector: DocumentSelector, provider: DocumentHighlightProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: DocumentHighlightProvider

A document highlight provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerDocumentLinkProvider(selector: DocumentSelector, provider: DocumentLinkProvider<DocumentLink>): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: DocumentLinkProvider<DocumentLink>

A document link provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerDocumentPasteEditProvider(selector: DocumentSelector, provider: DocumentPasteEditProvider<DocumentPasteEdit>, metadata: DocumentPasteProviderMetadata): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider applies to.

provider: DocumentPasteEditProvider<DocumentPasteEdit>

A paste editor provider.

metadata: DocumentPasteProviderMetadata

Additional metadata about the provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when disposed of.

registerDocumentRangeFormattingEditProvider(selector: DocumentSelector, provider: DocumentRangeFormattingEditProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: DocumentRangeFormattingEditProvider

A document range formatting edit provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerDocumentRangeSemanticTokensProvider(selector: DocumentSelector, provider: DocumentRangeSemanticTokensProvider, legend: SemanticTokensLegend): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: DocumentRangeSemanticTokensProvider

A document range semantic tokens provider.

legend: SemanticTokensLegend
ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerDocumentSemanticTokensProvider(selector: DocumentSelector, provider: DocumentSemanticTokensProvider, legend: SemanticTokensLegend): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: DocumentSemanticTokensProvider

A document semantic tokens provider.

legend: SemanticTokensLegend
ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerDocumentSymbolProvider(selector: DocumentSelector, provider: DocumentSymbolProvider, metaData?: DocumentSymbolProviderMetadata): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: DocumentSymbolProvider

A document symbol provider.

metaData?: DocumentSymbolProviderMetadata

metadata about the provider

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerEvaluatableExpressionProvider(selector: DocumentSelector, provider: EvaluatableExpressionProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: EvaluatableExpressionProvider

An evaluatable expression provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerFoldingRangeProvider(selector: DocumentSelector, provider: FoldingRangeProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: FoldingRangeProvider

A folding range provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerHoverProvider(selector: DocumentSelector, provider: HoverProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: HoverProvider

A hover provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerImplementationProvider(selector: DocumentSelector, provider: ImplementationProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: ImplementationProvider

An implementation provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerInlayHintsProvider(selector: DocumentSelector, provider: InlayHintsProvider<InlayHint>): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: InlayHintsProvider<InlayHint>

An inlay hints provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerInlineCompletionItemProvider(selector: DocumentSelector, provider: InlineCompletionItemProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: InlineCompletionItemProvider

An inline completion provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerInlineValuesProvider(selector: DocumentSelector, provider: InlineValuesProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: InlineValuesProvider

An inline values provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerLinkedEditingRangeProvider(selector: DocumentSelector, provider: LinkedEditingRangeProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: LinkedEditingRangeProvider

A linked editing range provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerOnTypeFormattingEditProvider(selector: DocumentSelector, provider: OnTypeFormattingEditProvider, firstTriggerCharacter: string, ...moreTriggerCharacter: string[]): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: OnTypeFormattingEditProvider

An on type formatting edit provider.

firstTriggerCharacter: string

A character on which formatting should be triggered, like }.

...moreTriggerCharacter: string[]

More trigger characters.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerReferenceProvider(selector: DocumentSelector, provider: ReferenceProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: ReferenceProvider

A reference provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerRenameProvider(selector: DocumentSelector, provider: RenameProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: RenameProvider

A rename provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerSelectionRangeProvider(selector: DocumentSelector, provider: SelectionRangeProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: SelectionRangeProvider

A selection range provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerSignatureHelpProvider(selector: DocumentSelector, provider: SignatureHelpProvider, ...triggerCharacters: string[]): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: SignatureHelpProvider

A signature help provider.

...triggerCharacters: string[]

Trigger signature help when the user types one of the characters, like , or (.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerSignatureHelpProvider(selector: DocumentSelector, provider: SignatureHelpProvider, metadata: SignatureHelpProviderMetadata): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: SignatureHelpProvider

A signature help provider.

metadata: SignatureHelpProviderMetadata

Information about the provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerTypeDefinitionProvider(selector: DocumentSelector, provider: TypeDefinitionProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: TypeDefinitionProvider

A type definition provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerTypeHierarchyProvider(selector: DocumentSelector, provider: TypeHierarchyProvider): Disposable

ParameterDescription
selector: DocumentSelector

A selector that defines the documents this provider is applicable to.

provider: TypeHierarchyProvider

A type hierarchy provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerWorkspaceSymbolProvider(provider: WorkspaceSymbolProvider<SymbolInformation>): Disposable

ParameterDescription
provider: WorkspaceSymbolProvider<SymbolInformation>

A workspace symbol provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

setLanguageConfiguration(language: string, configuration: LanguageConfiguration): Disposable

ParameterDescription
language: string

A language identifier like typescript.

configuration: LanguageConfiguration

Language configuration.

ReturnsDescription
Disposable

A Disposable that unsets this configuration.

setTextDocumentLanguage(document: TextDocument, languageId: string): Thenable<TextDocument>

ParameterDescription
document: TextDocument

The document which language is to be changed

languageId: string

The new language identifier.

ReturnsDescription
Thenable<TextDocument>

A thenable that resolves with the updated document.

lm

Variables

tools: readonly LanguageModelToolInformation[]

Events

onDidChangeChatModels: Event<void>

Functions

invokeTool(name: string, options: LanguageModelToolInvocationOptions<object>, token?: CancellationToken): Thenable<LanguageModelToolResult>

ParameterDescription
name: string

The name of the tool to call.

options: LanguageModelToolInvocationOptions<object>

The options to use when invoking the tool.

token?: CancellationToken

A cancellation token. See CancellationTokenSource for how to create one.

ReturnsDescription
Thenable<LanguageModelToolResult>

The result of the tool invocation.

registerLanguageModelChatProvider(vendor: string, provider: LanguageModelChatProvider<LanguageModelChatInformation>): Disposable

ParameterDescription
vendor: string

The vendor for this provider. Must be globally unique. An example is copilot or openai.

provider: LanguageModelChatProvider<LanguageModelChatInformation>

The provider to register

ReturnsDescription
Disposable

A disposable that unregisters the provider when disposed

registerMcpServerDefinitionProvider(id: string, provider: McpServerDefinitionProvider<McpServerDefinition>): Disposable

ParameterDescription
id: string

The ID of the provider, which is unique to the extension.

provider: McpServerDefinitionProvider<McpServerDefinition>

The provider to register

ReturnsDescription
Disposable

A disposable that unregisters the provider when disposed.

registerTool<T>(name: string, tool: LanguageModelTool<T>): Disposable

ParameterDescription
name: string
tool: LanguageModelTool<T>
ReturnsDescription
Disposable

A Disposable that unregisters the tool when disposed.

selectChatModels(selector?: LanguageModelChatSelector): Thenable<LanguageModelChat[]>

ParameterDescription
selector?: LanguageModelChatSelector

A chat model selector. When omitted all chat models are returned.

ReturnsDescription
Thenable<LanguageModelChat[]>

An array of chat models, can be empty!

notebooks

Functions

createNotebookController(id: string, notebookType: string, label: string, handler?: (cells: NotebookCell[], notebook: NotebookDocument, controller: NotebookController) => void | Thenable<void>): NotebookController

ParameterDescription
id: string

Identifier of the controller. Must be unique per extension.

notebookType: string

A notebook type for which this controller is for.

label: string

The label of the controller.

handler?: (cells: NotebookCell[], notebook: NotebookDocument, controller: NotebookController) => void | Thenable<void>

The execute-handler of the controller.

ReturnsDescription
NotebookController

A new notebook controller.

createRendererMessaging(rendererId: string): NotebookRendererMessaging

ParameterDescription
rendererId: string

The renderer ID to communicate with

ReturnsDescription
NotebookRendererMessaging

A new notebook renderer messaging object.

registerNotebookCellStatusBarItemProvider(notebookType: string, provider: NotebookCellStatusBarItemProvider): Disposable

ParameterDescription
notebookType: string

The notebook type to register for.

provider: NotebookCellStatusBarItemProvider

A cell status bar provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

scm

Variables

inputBox: SourceControlInputBox

Functions

createSourceControl(id: string, label: string, rootUri?: Uri): SourceControl

ParameterDescription
id: string

An id for the source control. Something short, e.g.: git.

label: string

A human-readable string for the source control. E.g.: Git.

rootUri?: Uri

An optional Uri of the root of the source control. E.g.: Uri.parse(workspaceRoot).

ReturnsDescription
SourceControl

An instance of source control.

tasks

Variables

taskExecutions: readonly TaskExecution[]

Events

onDidEndTask: Event<TaskEndEvent>

onDidEndTaskProcess: Event<TaskProcessEndEvent>

onDidStartTask: Event<TaskStartEvent>

onDidStartTaskProcess: Event<TaskProcessStartEvent>

Functions

executeTask(task: Task): Thenable<TaskExecution>

ParameterDescription
task: Task

the task to execute

ReturnsDescription
Thenable<TaskExecution>

A thenable that resolves to a task execution.

fetchTasks(filter?: TaskFilter): Thenable<Task[]>

ParameterDescription
filter?: TaskFilter

Optional filter to select tasks of a certain type or version.

ReturnsDescription
Thenable<Task[]>

A thenable that resolves to an array of tasks.

registerTaskProvider(type: string, provider: TaskProvider<Task>): Disposable

ParameterDescription
type: string

The task kind type this provider is registered for.

provider: TaskProvider<Task>

A task provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

tests

Functions

createTestController(id: string, label: string): TestController

ParameterDescription
id: string

Identifier for the controller, must be globally unique.

label: string

A human-readable label for the controller.

ReturnsDescription
TestController

An instance of the TestController.

window

Variables

activeColorTheme: ColorTheme

activeNotebookEditor: NotebookEditor | undefined

activeTerminal: Terminal | undefined

activeTextEditor: TextEditor | undefined

state: WindowState

tabGroups: TabGroups

terminals: readonly Terminal[]

visibleNotebookEditors: readonly NotebookEditor[]

visibleTextEditors: readonly TextEditor[]

Events

onDidChangeActiveColorTheme: Event<ColorTheme>

onDidChangeActiveNotebookEditor: Event<NotebookEditor | undefined>

onDidChangeActiveTerminal: Event<Terminal | undefined>

onDidChangeActiveTextEditor: Event<TextEditor | undefined>

onDidChangeNotebookEditorSelection: Event<NotebookEditorSelectionChangeEvent>

onDidChangeNotebookEditorVisibleRanges: Event<NotebookEditorVisibleRangesChangeEvent>

onDidChangeTerminalShellIntegration: Event<TerminalShellIntegrationChangeEvent>

onDidChangeTerminalState: Event<Terminal>

onDidChangeTextEditorOptions: Event<TextEditorOptionsChangeEvent>

onDidChangeTextEditorSelection: Event<TextEditorSelectionChangeEvent>

onDidChangeTextEditorViewColumn: Event<TextEditorViewColumnChangeEvent>

onDidChangeTextEditorVisibleRanges: Event<TextEditorVisibleRangesChangeEvent>

onDidChangeVisibleNotebookEditors: Event<readonly NotebookEditor[]>

onDidChangeVisibleTextEditors: Event<readonly TextEditor[]>

onDidChangeWindowState: Event<WindowState>

onDidCloseTerminal: Event<Terminal>

onDidEndTerminalShellExecution: Event<TerminalShellExecutionEndEvent>

onDidOpenTerminal: Event<Terminal>

onDidStartTerminalShellExecution: Event<TerminalShellExecutionStartEvent>

Functions

createInputBox(): InputBox

ParameterDescription
ReturnsDescription
InputBox

A new InputBox.

createOutputChannel(name: string, languageId?: string): OutputChannel

ParameterDescription
name: string

Human-readable string which will be used to represent the channel in the UI.

languageId?: string

The identifier of the language associated with the channel.

ReturnsDescription
OutputChannel

A new output channel.

createOutputChannel(name: string, options: {log: true}): LogOutputChannel

ParameterDescription
name: string

Human-readable string which will be used to represent the channel in the UI.

options: {log: true}

Options for the log output channel.

ReturnsDescription
LogOutputChannel

A new log output channel.

createQuickPick<T extends QuickPickItem>(): QuickPick<T>

ParameterDescription
ReturnsDescription
QuickPick<T>

A new QuickPick.

createStatusBarItem(id: string, alignment?: StatusBarAlignment, priority?: number): StatusBarItem

ParameterDescription
id: string

The identifier of the item. Must be unique within the extension.

alignment?: StatusBarAlignment

The alignment of the item.

priority?: number

The priority of the item. Higher values mean the item should be shown more to the left.

ReturnsDescription
StatusBarItem

A new status bar item.

createStatusBarItem(alignment?: StatusBarAlignment, priority?: number): StatusBarItem

ParameterDescription
alignment?: StatusBarAlignment

The alignment of the item.

priority?: number

The priority of the item. Higher values mean the item should be shown more to the left.

ReturnsDescription
StatusBarItem

A new status bar item.

createTerminal(name?: string, shellPath?: string, shellArgs?: string | readonly string[]): Terminal

ParameterDescription
name?: string

Optional human-readable string which will be used to represent the terminal in the UI.

shellPath?: string

Optional path to a custom shell executable to be used in the terminal.

shellArgs?: string | readonly string[]

Optional args for the custom shell executable. A string can be used on Windows only which allows specifying shell args in command-line format.

ReturnsDescription
Terminal

A new Terminal.

createTerminal(options: TerminalOptions): Terminal

ParameterDescription
options: TerminalOptions

A TerminalOptions object describing the characteristics of the new terminal.

ReturnsDescription
Terminal

A new Terminal.

createTerminal(options: ExtensionTerminalOptions): Terminal

ParameterDescription
options: ExtensionTerminalOptions

An ExtensionTerminalOptions object describing the characteristics of the new terminal.

ReturnsDescription
Terminal

A new Terminal.

createTextEditorDecorationType(options: DecorationRenderOptions): TextEditorDecorationType

ParameterDescription
options: DecorationRenderOptions

Rendering options for the decoration type.

ReturnsDescription
TextEditorDecorationType

A new decoration type instance.

createTreeView<T>(viewId: string, options: TreeViewOptions<T>): TreeView<T>

ParameterDescription
viewId: string

Id of the view contributed using the extension point views.

options: TreeViewOptions<T>

Options for creating the TreeView

ReturnsDescription
TreeView<T>

a TreeView.

createWebviewPanel(viewType: string, title: string, showOptions: ViewColumn | {preserveFocus: boolean, viewColumn: ViewColumn}, options?: WebviewPanelOptions & WebviewOptions): WebviewPanel

ParameterDescription
viewType: string

Identifies the type of the webview panel.

title: string

Title of the panel.

showOptions: ViewColumn | {preserveFocus: boolean, viewColumn: ViewColumn}

Where to show the webview in the editor. If preserveFocus is set, the new webview will not take focus.

options?: WebviewPanelOptions & WebviewOptions

Settings for the new panel.

ReturnsDescription
WebviewPanel

New webview panel.

registerCustomEditorProvider(viewType: string, provider: CustomTextEditorProvider | CustomReadonlyEditorProvider<CustomDocument> | CustomEditorProvider<CustomDocument>, options?: {supportsMultipleEditorsPerDocument: boolean, webviewOptions: WebviewPanelOptions}): Disposable

ParameterDescription
viewType: string

Unique identifier for the custom editor provider. This should match the viewType from the customEditors contribution point.

provider: CustomTextEditorProvider | CustomReadonlyEditorProvider<CustomDocument> | CustomEditorProvider<CustomDocument>

Provider that resolves custom editors.

options?: {supportsMultipleEditorsPerDocument: boolean, webviewOptions: WebviewPanelOptions}

Options for the provider.

ReturnsDescription
Disposable

Disposable that unregisters the provider.

registerFileDecorationProvider(provider: FileDecorationProvider): Disposable

ParameterDescription
provider: FileDecorationProvider
ReturnsDescription
Disposable

A Disposable that unregisters the provider.

registerTerminalLinkProvider(provider: TerminalLinkProvider<TerminalLink>): Disposable

ParameterDescription
provider: TerminalLinkProvider<TerminalLink>

The provider that provides the terminal links.

ReturnsDescription
Disposable

Disposable that unregisters the provider.

registerTerminalProfileProvider(id: string, provider: TerminalProfileProvider): Disposable

ParameterDescription
id: string

The ID of the contributed terminal profile.

provider: TerminalProfileProvider

The terminal profile provider.

ReturnsDescription
Disposable

A disposable that unregisters the provider.

registerTreeDataProvider<T>(viewId: string, treeDataProvider: TreeDataProvider<T>): Disposable

ParameterDescription
viewId: string

Id of the view contributed using the extension point views.

treeDataProvider: TreeDataProvider<T>

A TreeDataProvider that provides tree data for the view

ReturnsDescription
Disposable

A disposable that unregisters the TreeDataProvider.

registerUriHandler(handler: UriHandler): Disposable

ParameterDescription
handler: UriHandler

The uri handler to register for this extension.

ReturnsDescription
Disposable

A disposable that unregisters the handler.

registerWebviewPanelSerializer(viewType: string, serializer: WebviewPanelSerializer<unknown>): Disposable

ParameterDescription
viewType: string

Type of the webview panel that can be serialized.

serializer: WebviewPanelSerializer<unknown>

Webview serializer.

ReturnsDescription
Disposable

A disposable that unregisters the serializer.

registerWebviewViewProvider(viewId: string, provider: WebviewViewProvider, options?: {webviewOptions: {retainContextWhenHidden: boolean}}): Disposable

ParameterDescription
viewId: string

Unique id of the view. This should match the id from the views contribution in the package.json.

provider: WebviewViewProvider

Provider for the webview views.

options?: {webviewOptions: {retainContextWhenHidden: boolean}}
ReturnsDescription
Disposable

Disposable that unregisters the provider.

setStatusBarMessage(text: string, hideAfterTimeout: number): Disposable

ParameterDescription
text: string

The message to show, supports icon substitution as in status bar items.

hideAfterTimeout: number

Timeout in milliseconds after which the message will be disposed.

ReturnsDescription
Disposable

A disposable which hides the status bar message.

setStatusBarMessage(text: string, hideWhenDone: Thenable<any>): Disposable

ParameterDescription
text: string

The message to show, supports icon substitution as in status bar items.

hideWhenDone: Thenable<any>

Thenable on which completion (resolve or reject) the message will be disposed.

ReturnsDescription
Disposable

A disposable which hides the status bar message.

setStatusBarMessage(text: string): Disposable

ParameterDescription
text: string

The message to show, supports icon substitution as in status bar items.

ReturnsDescription
Disposable

A disposable which hides the status bar message.

showErrorMessage<T extends string>(message: string, ...items: T[]): Thenable<T | undefined>

ParameterDescription
message: string

The message to show.

...items: T[]

A set of items that will be rendered as actions in the message.

ReturnsDescription
Thenable<T | undefined>

A thenable that resolves to the selected item or undefined when being dismissed.

showErrorMessage<T extends string>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>

ParameterDescription
message: string

The message to show.

options: MessageOptions

Configures the behaviour of the message.

...items: T[]

A set of items that will be rendered as actions in the message.

ReturnsDescription
Thenable<T | undefined>

A thenable that resolves to the selected item or undefined when being dismissed.

showErrorMessage<T extends MessageItem>(message: string, ...items: T[]): Thenable<T | undefined>

ParameterDescription
message: string

The message to show.

...items: T[]

A set of items that will be rendered as actions in the message.

ReturnsDescription
Thenable<T | undefined>

A thenable that resolves to the selected item or undefined when being dismissed.

showErrorMessage<T extends MessageItem>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>

ParameterDescription
message: string

The message to show.

options: MessageOptions

Configures the behaviour of the message.

...items: T[]

A set of items that will be rendered as actions in the message.

ReturnsDescription
Thenable<T | undefined>

A thenable that resolves to the selected item or undefined when being dismissed.

showInformationMessage<T extends string>(message: string, ...items: T[]): Thenable<T | undefined>

ParameterDescription
message: string

The message to show.

...items: T[]

A set of items that will be rendered as actions in the message.

ReturnsDescription
Thenable<T | undefined>

A thenable that resolves to the selected item or undefined when being dismissed.

showInformationMessage<T extends string>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>

ParameterDescription
message: string

The message to show.

options: MessageOptions

Configures the behaviour of the message.

...items: T[]

A set of items that will be rendered as actions in the message.

ReturnsDescription
Thenable<T | undefined>

A thenable that resolves to the selected item or undefined when being dismissed.

showInformationMessage<T extends MessageItem>(message: string, ...items: T[]): Thenable<T | undefined>

ParameterDescription
message: string

The message to show.

...items: T[]

A set of items that will be rendered as actions in the message.

ReturnsDescription
Thenable<T | undefined>

A thenable that resolves to the selected item or undefined when being dismissed.

showInformationMessage<T extends MessageItem>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>

ParameterDescription
message: string

The message to show.

options: MessageOptions

Configures the behaviour of the message.

...items: T[]

A set of items that will be rendered as actions in the message.

ReturnsDescription
Thenable<T | undefined>

A thenable that resolves to the selected item or undefined when being dismissed.

showInputBox(options?: InputBoxOptions, token?: CancellationToken): Thenable<string | undefined>

ParameterDescription
options?: InputBoxOptions

Configures the behavior of the input box.

token?: CancellationToken

A token that can be used to signal cancellation.

ReturnsDescription
Thenable<string | undefined>

A thenable that resolves to a string the user provided or to undefined in case of dismissal.

showNotebookDocument(document: NotebookDocument, options?: NotebookDocumentShowOptions): Thenable<NotebookEditor>

ParameterDescription
document: NotebookDocument

A text document to be shown.

options?: NotebookDocumentShowOptions

Editor options to configure the behavior of showing the notebook editor.

ReturnsDescription
Thenable<NotebookEditor>

A promise that resolves to an notebook editor.

showOpenDialog(options?: OpenDialogOptions): Thenable<Uri[] | undefined>

ParameterDescription
options?: OpenDialogOptions

Options that control the dialog.

ReturnsDescription
Thenable<Uri[] | undefined>

A promise that resolves to the selected resources or undefined.

showQuickPick(items: readonly string[] | Thenable<readonly string[]>, options: QuickPickOptions & {canPickMany: true}, token?: CancellationToken): Thenable<string[] | undefined>

ParameterDescription
items: readonly string[] | Thenable<readonly string[]>

An array of strings, or a promise that resolves to an array of strings.

options: QuickPickOptions & {canPickMany: true}

Configures the behavior of the selection list.

token?: CancellationToken

A token that can be used to signal cancellation.

ReturnsDescription
Thenable<string[] | undefined>

A thenable that resolves to the selected items or undefined.

showQuickPick(items: readonly string[] | Thenable<readonly string[]>, options?: QuickPickOptions, token?: CancellationToken): Thenable<string | undefined>

ParameterDescription
items: readonly string[] | Thenable<readonly string[]>

An array of strings, or a promise that resolves to an array of strings.

options?: QuickPickOptions

Configures the behavior of the selection list.

token?: CancellationToken

A token that can be used to signal cancellation.

ReturnsDescription
Thenable<string | undefined>

A thenable that resolves to the selected string or undefined.

showQuickPick<T extends QuickPickItem>(items: readonly T[] | Thenable<readonly T[]>, options: QuickPickOptions & {canPickMany: true}, token?: CancellationToken): Thenable<T[] | undefined>

ParameterDescription
items: readonly T[] | Thenable<readonly T[]>

An array of items, or a promise that resolves to an array of items.

options: QuickPickOptions & {canPickMany: true}

Configures the behavior of the selection list.

token?: CancellationToken

A token that can be used to signal cancellation.

ReturnsDescription
Thenable<T[] | undefined>

A thenable that resolves to the selected items or undefined.

showQuickPick<T extends QuickPickItem>(items: readonly T[] | Thenable<readonly T[]>, options?: QuickPickOptions, token?: CancellationToken): Thenable<T | undefined>

ParameterDescription
items: readonly T[] | Thenable<readonly T[]>

An array of items, or a promise that resolves to an array of items.

options?: QuickPickOptions

Configures the behavior of the selection list.

token?: CancellationToken

A token that can be used to signal cancellation.

ReturnsDescription
Thenable<T | undefined>

A thenable that resolves to the selected item or undefined.

showSaveDialog(options?: SaveDialogOptions): Thenable<Uri | undefined>

ParameterDescription
options?: SaveDialogOptions

Options that control the dialog.

ReturnsDescription
Thenable<Uri | undefined>

A promise that resolves to the selected resource or undefined.

showTextDocument(document: TextDocument, column?: ViewColumn, preserveFocus?: boolean): Thenable<TextEditor>

ParameterDescription
document: TextDocument

A text document to be shown.

column?: ViewColumn

A view column in which the editor should be shown. The default is the active. Columns that do not exist will be created as needed up to the maximum of ViewColumn.Nine. Use ViewColumn.Beside to open the editor to the side of the currently active one.

preserveFocus?: boolean

When true the editor will not take focus.

ReturnsDescription
Thenable<TextEditor>

A promise that resolves to an editor.

showTextDocument(document: TextDocument, options?: TextDocumentShowOptions): Thenable<TextEditor>

ParameterDescription
document: TextDocument

A text document to be shown.

options?: TextDocumentShowOptions

Editor options to configure the behavior of showing the editor.

ReturnsDescription
Thenable<TextEditor>

A promise that resolves to an editor.

showTextDocument(uri: Uri, options?: TextDocumentShowOptions): Thenable<TextEditor>

ParameterDescription
uri: Uri

A resource identifier.

options?: TextDocumentShowOptions

Editor options to configure the behavior of showing the editor.

ReturnsDescription
Thenable<TextEditor>

A promise that resolves to an editor.

showWarningMessage<T extends string>(message: string, ...items: T[]): Thenable<T | undefined>

ParameterDescription
message: string

The message to show.

...items: T[]

A set of items that will be rendered as actions in the message.

ReturnsDescription
Thenable<T | undefined>

A thenable that resolves to the selected item or undefined when being dismissed.

showWarningMessage<T extends string>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>

ParameterDescription
message: string

The message to show.

options: MessageOptions

Configures the behaviour of the message.

...items: T[]

A set of items that will be rendered as actions in the message.

ReturnsDescription
Thenable<T | undefined>

A thenable that resolves to the selected item or undefined when being dismissed.

showWarningMessage<T extends MessageItem>(message: string, ...items: T[]): Thenable<T | undefined>

ParameterDescription
message: string

The message to show.

...items: T[]

A set of items that will be rendered as actions in the message.

ReturnsDescription
Thenable<T | undefined>

A thenable that resolves to the selected item or undefined when being dismissed.

showWarningMessage<T extends MessageItem>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>

ParameterDescription
message: string

The message to show.

options: MessageOptions

Configures the behaviour of the message.

...items: T[]

A set of items that will be rendered as actions in the message.

ReturnsDescription
Thenable<T | undefined>

A thenable that resolves to the selected item or undefined when being dismissed.

showWorkspaceFolderPick(options?: WorkspaceFolderPickOptions): Thenable<WorkspaceFolder | undefined>

ParameterDescription
options?: WorkspaceFolderPickOptions

Configures the behavior of the workspace folder list.

ReturnsDescription
Thenable<WorkspaceFolder | undefined>

A promise that resolves to the workspace folder or undefined.

withProgress<R>(options: ProgressOptions, task: (progress: Progress<{increment: number, message: string}>, token: CancellationToken) => Thenable<R>): Thenable<R>

ParameterDescription
options: ProgressOptions

A ProgressOptions-object describing the options to use for showing progress, like its location

task: (progress: Progress<{increment: number, message: string}>, token: CancellationToken) => Thenable<R>

A callback returning a promise. Progress state can be reported with the provided Progress-object.

To report discrete progress, use increment to indicate how much work has been completed. Each call with a increment value will be summed up and reflected as overall progress until 100% is reached (a value of e.g. 10 accounts for 10% of work done). Note that currently only ProgressLocation.Notification is capable of showing discrete progress.

To monitor if the operation has been cancelled by the user, use the provided CancellationToken. Note that currently only ProgressLocation.Notification is supporting to show a cancel button to cancel the long running operation.

ReturnsDescription
Thenable<R>

The thenable the task-callback returned.

withScmProgress<R>(task: (progress: Progress<number>) => Thenable<R>): Thenable<R>

ParameterDescription
task: (progress: Progress<number>) => Thenable<R>

A callback returning a promise. Progress increments can be reported with the provided Progress-object.

ReturnsDescription
Thenable<R>

The thenable the task did return.

workspace

Variables

fs: FileSystem

isTrusted: boolean

name: string | undefined

notebookDocuments: readonly NotebookDocument[]

rootPath: string | undefined

textDocuments: readonly TextDocument[]

workspaceFile: Uri | undefined

workspaceFolders: readonly WorkspaceFolder[] | undefined

Events

onDidChangeConfiguration: Event<ConfigurationChangeEvent>

onDidChangeNotebookDocument: Event<NotebookDocumentChangeEvent>

onDidChangeTextDocument: Event<TextDocumentChangeEvent>

onDidChangeWorkspaceFolders: Event<WorkspaceFoldersChangeEvent>

onDidCloseNotebookDocument: Event<NotebookDocument>

onDidCloseTextDocument: Event<TextDocument>

onDidCreateFiles: Event<FileCreateEvent>

onDidDeleteFiles: Event<FileDeleteEvent>

onDidGrantWorkspaceTrust: Event<void>

onDidOpenNotebookDocument: Event<NotebookDocument>

onDidOpenTextDocument: Event<TextDocument>

onDidRenameFiles: Event<FileRenameEvent>

onDidSaveNotebookDocument: Event<NotebookDocument>

onDidSaveTextDocument: Event<TextDocument>

onWillCreateFiles: Event<FileWillCreateEvent>

onWillDeleteFiles: Event<FileWillDeleteEvent>

onWillRenameFiles: Event<FileWillRenameEvent>

onWillSaveNotebookDocument: Event<NotebookDocumentWillSaveEvent>

onWillSaveTextDocument: Event<TextDocumentWillSaveEvent>

Functions

applyEdit(edit: WorkspaceEdit, metadata?: WorkspaceEditMetadata): Thenable<boolean>

ParameterDescription
edit: WorkspaceEdit

A workspace edit.

metadata?: WorkspaceEditMetadata

Optional metadata for the edit.

ReturnsDescription
Thenable<boolean>

A thenable that resolves when the edit could be applied.

asRelativePath(pathOrUri: string | Uri, includeWorkspaceFolder?: boolean): string

ParameterDescription
pathOrUri: string | Uri

A path or uri. When a uri is given its fsPath is used.

includeWorkspaceFolder?: boolean

When true and when the given path is contained inside a workspace folder the name of the workspace is prepended. Defaults to true when there are multiple workspace folders and false otherwise.

ReturnsDescription
string

A path relative to the root or the input.

createFileSystemWatcher(globPattern: GlobPattern, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean): FileSystemWatcher

ParameterDescription
globPattern: GlobPattern

A glob pattern that controls which file events the watcher should report.

ignoreCreateEvents?: boolean

Ignore when files have been created.

ignoreChangeEvents?: boolean

Ignore when files have been changed.

ignoreDeleteEvents?: boolean

Ignore when files have been deleted.

ReturnsDescription
FileSystemWatcher

A new file system watcher instance. Must be disposed when no longer needed.

decode(content: Uint8Array): Thenable<string>

ParameterDescription
content: Uint8Array

The text content to decode as a Uint8Array.

ReturnsDescription
Thenable<string>

A thenable that resolves to the decoded string.

decode(content: Uint8Array, options: {encoding: string}): Thenable<string>

ParameterDescription
content: Uint8Array

The text content to decode as a Uint8Array.

options: {encoding: string}

Additional context for picking the encoding.

ReturnsDescription
Thenable<string>

A thenable that resolves to the decoded string.

decode(content: Uint8Array, options: {uri: Uri}): Thenable<string>

ParameterDescription
content: Uint8Array

The content to decode as a Uint8Array.

options: {uri: Uri}

Additional context for picking the encoding.

ReturnsDescription
Thenable<string>

A thenable that resolves to the decoded string.

encode(content: string): Thenable<Uint8Array>

ParameterDescription
content: string

The content to decode as a string.

ReturnsDescription
Thenable<Uint8Array>

A thenable that resolves to the encoded Uint8Array.

encode(content: string, options: {encoding: string}): Thenable<Uint8Array>

ParameterDescription
content: string

The content to decode as a string.

options: {encoding: string}

Additional context for picking the encoding.

ReturnsDescription
Thenable<Uint8Array>

A thenable that resolves to the encoded Uint8Array.

encode(content: string, options: {uri: Uri}): Thenable<Uint8Array>

ParameterDescription
content: string

The content to decode as a string.

options: {uri: Uri}

Additional context for picking the encoding.

ReturnsDescription
Thenable<Uint8Array>

A thenable that resolves to the encoded Uint8Array.

findFiles(include: GlobPattern, exclude?: GlobPattern, maxResults?: number, token?: CancellationToken): Thenable<Uri[]>

ParameterDescription
include: GlobPattern

A glob pattern 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 relative pattern to restrict the search results to a workspace folder.

exclude?: GlobPattern

A glob pattern 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 undefined, default file-excludes (e.g. the files.exclude-setting but not search.exclude) will apply. When null, no excludes will apply.

maxResults?: number

An upper-bound for the result.

token?: CancellationToken

A token that can be used to signal cancellation to the underlying search engine.

ReturnsDescription
Thenable<Uri[]>

A thenable that resolves to an array of resource identifiers. Will return no results if no workspace folders are opened.

getConfiguration(section?: string, scope?: ConfigurationScope): WorkspaceConfiguration

ParameterDescription
section?: string

A dot-separated identifier.

scope?: ConfigurationScope

A scope for which the configuration is asked for.

ReturnsDescription
WorkspaceConfiguration

The full configuration or a subset.

getWorkspaceFolder(uri: Uri): WorkspaceFolder | undefined

ParameterDescription
uri: Uri

An uri.

ReturnsDescription
WorkspaceFolder | undefined

A workspace folder or undefined

openNotebookDocument(uri: Uri): Thenable<NotebookDocument>

ParameterDescription
uri: Uri

The resource to open.

ReturnsDescription
Thenable<NotebookDocument>

A promise that resolves to a notebook

openNotebookDocument(notebookType: string, content?: NotebookData): Thenable<NotebookDocument>

ParameterDescription
notebookType: string

The notebook type that should be used.

content?: NotebookData

The initial contents of the notebook.

ReturnsDescription
Thenable<NotebookDocument>

A promise that resolves to a notebook.

openTextDocument(uri: Uri, options?: {encoding: string}): Thenable<TextDocument>

ParameterDescription
uri: Uri

Identifies the resource to open.

options?: {encoding: string}
ReturnsDescription
Thenable<TextDocument>

A promise that resolves to a document.

openTextDocument(path: string, options?: {encoding: string}): Thenable<TextDocument>

ParameterDescription
path: string

A path of a file on disk.

options?: {encoding: string}
ReturnsDescription
Thenable<TextDocument>

A promise that resolves to a document.

openTextDocument(options?: {content: string, encoding: string, language: string}): Thenable<TextDocument>

ParameterDescription
options?: {content: string, encoding: string, language: string}

Options to control how the document will be created.

ReturnsDescription
Thenable<TextDocument>

A promise that resolves to a document.

registerFileSystemProvider(scheme: string, provider: FileSystemProvider, options?: {isCaseSensitive: boolean, isReadonly: boolean | MarkdownString}): Disposable

ParameterDescription
scheme: string

The uri-scheme the provider registers for.

provider: FileSystemProvider

The filesystem provider.

options?: {isCaseSensitive: boolean, isReadonly: boolean | MarkdownString}

Immutable metadata about the provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerNotebookSerializer(notebookType: string, serializer: NotebookSerializer, options?: NotebookDocumentContentOptions): Disposable

ParameterDescription
notebookType: string

A notebook.

serializer: NotebookSerializer

A notebook serializer.

options?: NotebookDocumentContentOptions

Optional context options that define what parts of a notebook should be persisted

ReturnsDescription
Disposable

A Disposable that unregisters this serializer when being disposed.

registerTaskProvider(type: string, provider: TaskProvider<Task>): Disposable

ParameterDescription
type: string

The task kind type this provider is registered for.

provider: TaskProvider<Task>

A task provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

registerTextDocumentContentProvider(scheme: string, provider: TextDocumentContentProvider): Disposable

ParameterDescription
scheme: string

The uri-scheme to register for.

provider: TextDocumentContentProvider

A content provider.

ReturnsDescription
Disposable

A Disposable that unregisters this provider when being disposed.

save(uri: Uri): Thenable<Uri | undefined>

ParameterDescription
uri: Uri

the associated uri for the opened editor to save.

ReturnsDescription
Thenable<Uri | undefined>

A thenable that resolves when the save operation has finished.

saveAll(includeUntitled?: boolean): Thenable<boolean>

ParameterDescription
includeUntitled?: boolean

Also save files that have been created during this session.

ReturnsDescription
Thenable<boolean>

A thenable that resolves when the files have been saved. Will return false for any file that failed to save.

saveAs(uri: Uri): Thenable<Uri | undefined>

ParameterDescription
uri: Uri

the associated uri for the opened editor to save as.

ReturnsDescription
Thenable<Uri | undefined>

A thenable that resolves when the save-as operation has finished.

updateWorkspaceFolders(start: number, deleteCount: number, ...workspaceFoldersToAdd: Array<{name: string, uri: Uri}>): boolean

ParameterDescription
start: number

the zero-based location in the list of currently opened workspace folders from which to start deleting workspace folders.

deleteCount: number

the optional number of workspace folders to remove.

...workspaceFoldersToAdd: Array<{name: string, uri: Uri}>

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.

ReturnsDescription
boolean

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).

AccessibilityInformation

Properties

label: string

role?: string

AuthenticationForceNewSessionOptions

AuthenticationForceNewSessionOptions: AuthenticationGetSessionPresentationOptions

AuthenticationGetSessionOptions

Properties

account?: AuthenticationSessionAccountInformation

clearSessionPreference?: boolean

createIfNone?: boolean | AuthenticationGetSessionPresentationOptions

forceNewSession?: boolean | AuthenticationGetSessionPresentationOptions

silent?: boolean

AuthenticationGetSessionPresentationOptions

Properties

detail?: string

AuthenticationProvider

Events

onDidChangeSessions: Event<AuthenticationProviderAuthenticationSessionsChangeEvent>

Methods

createSession(scopes: readonly string[], options: AuthenticationProviderSessionOptions): Thenable<AuthenticationSession>

ParameterDescription
scopes: readonly string[]

A list of scopes, permissions, that the new session should be created with.

options: AuthenticationProviderSessionOptions

Additional options for creating a session.

ReturnsDescription
Thenable<AuthenticationSession>

A promise that resolves to an authentication session.

getSessions(scopes: readonly string[], options: AuthenticationProviderSessionOptions): Thenable<AuthenticationSession[]>

ParameterDescription
scopes: readonly string[]

An optional list of scopes. If provided, the sessions returned should match these permissions, otherwise all sessions should be returned.

options: AuthenticationProviderSessionOptions

Additional options for getting sessions.

ReturnsDescription
Thenable<AuthenticationSession[]>

A promise that resolves to an array of authentication sessions.

removeSession(sessionId: string): Thenable<void>

ParameterDescription
sessionId: string

The id of the session to remove.

ReturnsDescription
Thenable<void>

AuthenticationProviderAuthenticationSessionsChangeEvent

Properties

added: readonly AuthenticationSession[]

changed: readonly AuthenticationSession[]

removed: readonly AuthenticationSession[]

AuthenticationProviderInformation

Properties

id: string

label: string

AuthenticationProviderOptions

Properties

supportsMultipleAccounts?: boolean

AuthenticationProviderSessionOptions

Properties

account?: AuthenticationSessionAccountInformation

AuthenticationSession

Properties

accessToken: string

account: AuthenticationSessionAccountInformation

id: string

idToken?: string

scopes: readonly string[]

AuthenticationSessionAccountInformation

Properties

id: string

label: string

AuthenticationSessionsChangeEvent

Properties

provider: AuthenticationProviderInformation

AuthenticationWwwAuthenticateRequest

Properties

fallbackScopes?: readonly string[]

wwwAuthenticate: string

AutoClosingPair

Properties

close: string

notIn?: SyntaxTokenType[]

open: string

BranchCoverage

Constructors

new BranchCoverage(executed: number | boolean, location?: Range | Position, label?: string): BranchCoverage

ParameterDescription
executed: number | boolean

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.

location?: Range | Position

The branch position.

label?: string
ReturnsDescription
BranchCoverage

Properties

executed: number | boolean

label?: string

location?: Range | Position

Breakpoint

Constructors

new Breakpoint(enabled?: boolean, condition?: string, hitCondition?: string, logMessage?: string): Breakpoint

ParameterDescription
enabled?: boolean

Is breakpoint enabled.

condition?: string

Expression for conditional breakpoints

hitCondition?: string

Expression that controls how many hits of the breakpoint are ignored

logMessage?: string

Log message to display when breakpoint is hit

ReturnsDescription
Breakpoint

Properties

condition?: string

enabled: boolean

hitCondition?: string

id: string

logMessage?: string

BreakpointsChangeEvent

Properties

added: readonly Breakpoint[]

changed: readonly Breakpoint[]

removed: readonly Breakpoint[]

CallHierarchyIncomingCall

Constructors

new CallHierarchyIncomingCall(item: CallHierarchyItem, fromRanges: Range[]): CallHierarchyIncomingCall

ParameterDescription
item: CallHierarchyItem

The item making the call.

fromRanges: Range[]

The ranges at which the calls appear.

ReturnsDescription
CallHierarchyIncomingCall

Properties

from: CallHierarchyItem

fromRanges: Range[]

CallHierarchyItem

Constructors

new CallHierarchyItem(kind: SymbolKind, name: string, detail: string, uri: Uri, range: Range, selectionRange: Range): CallHierarchyItem

ParameterDescription
kind: SymbolKind
name: string
detail: string
uri: Uri
range: Range
selectionRange: Range
ReturnsDescription
CallHierarchyItem

Properties

detail?: string

kind: SymbolKind

name: string

range: Range

selectionRange: Range

tags?: readonly SymbolTag[]

uri: Uri

CallHierarchyOutgoingCall

Constructors

new CallHierarchyOutgoingCall(item: CallHierarchyItem, fromRanges: Range[]): CallHierarchyOutgoingCall

ParameterDescription
item: CallHierarchyItem

The item being called

fromRanges: Range[]

The ranges at which the calls appear.

ReturnsDescription
CallHierarchyOutgoingCall

Properties

fromRanges: Range[]

to: CallHierarchyItem

CallHierarchyProvider

Methods

prepareCallHierarchy(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<CallHierarchyItem | CallHierarchyItem[]>

ParameterDescription
document: TextDocument

The document in which the command was invoked.

position: Position

The position at which the command was invoked.

token: CancellationToken

A cancellation token.

ReturnsDescription
ProviderResult<CallHierarchyItem | CallHierarchyItem[]>

One or multiple call hierarchy items or a thenable that resolves to such. The lack of a result can be signaled by returning undefined, null, or an empty array.

provideCallHierarchyIncomingCalls(item: CallHierarchyItem, token: CancellationToken): ProviderResult<CallHierarchyIncomingCall[]>

ParameterDescription
item: CallHierarchyItem

The hierarchy item for which incoming calls should be computed.

token: CancellationToken

A cancellation token.

ReturnsDescription
ProviderResult<CallHierarchyIncomingCall[]>

A set of incoming calls or a thenable that resolves to such. The lack of a result can be signaled by returning undefined or null.

provideCallHierarchyOutgoingCalls(item: CallHierarchyItem, token: CancellationToken): ProviderResult<CallHierarchyOutgoingCall[]>

ParameterDescription
item: CallHierarchyItem

The hierarchy item for which outgoing calls should be computed.

token: CancellationToken

A cancellation token.

ReturnsDescription
ProviderResult<CallHierarchyOutgoingCall[]>

A set of outgoing calls or a thenable that resolves to such. The lack of a result can be signaled by returning undefined or null.

CancellationError

Constructors

new CancellationError(): CancellationError

ParameterDescription
ReturnsDescription
CancellationError

CancellationToken

Properties

isCancellationRequested: boolean

onCancellationRequested: Event<any>

CancellationTokenSource

Constructors

new CancellationTokenSource(): CancellationTokenSource

ParameterDescription
ReturnsDescription
CancellationTokenSource

Properties

token: CancellationToken

Methods

cancel(): void

ParameterDescription
ReturnsDescription
void

dispose(): void

ParameterDescription
ReturnsDescription
void

CharacterPair

CharacterPair: [string, string]

ChatContext

Properties

history: ReadonlyArray<ChatRequestTurn | ChatResponseTurn>

ChatErrorDetails

Properties

message: string

responseIsFiltered?: boolean

ChatFollowup

Properties

command?: string

label?: string

participant?: string

prompt: string

ChatFollowupProvider

Methods

provideFollowups(result: ChatResult, context: ChatContext, token: CancellationToken): ProviderResult<ChatFollowup[]>

ParameterDescription
result: ChatResult

This object has the same properties as the result returned from the participant callback, including metadata, but is not the same instance.

context: ChatContext

Extra context passed to a participant.

token: CancellationToken

A cancellation token.

ReturnsDescription
ProviderResult<ChatFollowup[]>

ChatLanguageModelToolReference

Properties

name: string

range?: [start: number, end: number]

ChatParticipant

Events

onDidReceiveFeedback: Event<ChatResultFeedback>

Properties

followupProvider?: ChatFollowupProvider

iconPath?: IconPath

id: string

requestHandler: ChatRequestHandler

Methods

dispose(): void

ParameterDescription
ReturnsDescription
void

ChatParticipantToolToken

ChatParticipantToolToken: never

ChatPromptReference

Properties

id: string

modelDescription?: string

range?: [start: number, end: number]

value: unknown

ChatRequest

Properties

command: string

model: LanguageModelChat

prompt: string

references: readonly ChatPromptReference[]

toolInvocationToken: never

toolReferences: readonly ChatLanguageModelToolReference[]

ChatRequestHandler

ChatRequestHandler: (request: ChatRequest, context: ChatContext, response: ChatResponseStream, token: CancellationToken) => ProviderResult<ChatResult | void>

ChatRequestTurn

Properties

command?: string

participant: string

prompt: string

references: ChatPromptReference[]

toolReferences: readonly ChatLanguageModelToolReference[]

ChatResponseAnchorPart

Constructors

new ChatResponseAnchorPart(value: Uri | Location, title?: string): ChatResponseAnchorPart

ParameterDescription
value: Uri | Location

A uri or location.

title?: string

An optional title that is rendered with value.

ReturnsDescription
ChatResponseAnchorPart

Properties

title?: string

value: Uri | Location

ChatResponseCommandButtonPart

Constructors

new ChatResponseCommandButtonPart(value: Command): ChatResponseCommandButtonPart

ParameterDescription
value: Command

A Command that will be executed when the button is clicked.

ReturnsDescription
ChatResponseCommandButtonPart

Properties

value: Command

ChatResponseFileTree

Properties

children?: ChatResponseFileTree[]

name: string

ChatResponseFileTreePart

Constructors

new ChatResponseFileTreePart(value: ChatResponseFileTree[], baseUri: Uri): ChatResponseFileTreePart

ParameterDescription
value: ChatResponseFileTree[]

File tree data.

baseUri: Uri

The base uri to which this file tree is relative.

ReturnsDescription
ChatResponseFileTreePart

Properties

baseUri: Uri

value: ChatResponseFileTree[]

ChatResponseMarkdownPart

Constructors

new ChatResponseMarkdownPart(value: string | MarkdownString): ChatResponseMarkdownPart

ParameterDescription
value: string | MarkdownString

A markdown string or a string that should be interpreted as markdown. The boolean form of MarkdownString.isTrusted is NOT supported.

ReturnsDescription
ChatResponseMarkdownPart

Properties

value: MarkdownString

ChatResponsePart

ChatResponsePart: ChatResponseMarkdownPart | ChatResponseFileTreePart | ChatResponseAnchorPart | ChatResponseProgressPart | ChatResponseReferencePart | ChatResponseCommandButtonPart

ChatResponseProgressPart

Constructors

new ChatResponseProgressPart(value: string): ChatResponseProgressPart

ParameterDescription
value: string

A progress message

ReturnsDescription
ChatResponseProgressPart

Properties

value: string

ChatResponseReferencePart

Constructors

new ChatResponseReferencePart(value: Uri | Location, iconPath?: IconPath): ChatResponseReferencePart

ParameterDescription
value: Uri | Location

A uri or location

iconPath?: IconPath

Icon for the reference shown in UI

ReturnsDescription
ChatResponseReferencePart

Properties

iconPath?: IconPath

value: Uri | Location

ChatResponseStream

Methods

anchor(value: Uri | Location, title?: string): void

ParameterDescription
value: Uri | Location

A uri or location.

title?: string

An optional title that is rendered with value.

ReturnsDescription
void

button(command: Command): void

ParameterDescription
command: Command

A Command that will be executed when the button is clicked.

ReturnsDescription
void

filetree(value: ChatResponseFileTree[], baseUri: Uri): void

ParameterDescription
value: ChatResponseFileTree[]

File tree data.

baseUri: Uri

The base uri to which this file tree is relative.

ReturnsDescription
void

markdown(value: string | MarkdownString): void

ParameterDescription
value: string | MarkdownString

A markdown string or a string that should be interpreted as markdown. The boolean form of MarkdownString.isTrusted is NOT supported.

ReturnsDescription
void

progress(value: string): void

ParameterDescription
value: string

A progress message

ReturnsDescription
void

push(part: ChatResponsePart): void

ParameterDescription
part: ChatResponsePart

A response part, rendered or metadata

ReturnsDescription
void

reference(value: Uri | Location, iconPath?: IconPath): void

ParameterDescription
value: Uri | Location

A uri or location

iconPath?: IconPath

Icon for the reference shown in UI

ReturnsDescription
void

ChatResponseTurn

Properties

command?: string

participant: string

response: ReadonlyArray<ChatResponseMarkdownPart | ChatResponseFileTreePart | ChatResponseAnchorPart | ChatResponseCommandButtonPart>

result: ChatResult

ChatResult

Properties

errorDetails?: ChatErrorDetails

metadata?:

ChatResultFeedback

Properties

kind: ChatResultFeedbackKind

result: ChatResult

ChatResultFeedbackKind

Enumeration Members

Unhelpful: 0

Helpful: 1

Clipboard

Methods

readText(): Thenable<string>

ParameterDescription
ReturnsDescription
Thenable<string>

A thenable that resolves to a string.

writeText(value: string): Thenable<void>

ParameterDescription
value: string
ReturnsDescription
Thenable<void>

A thenable that resolves when writing happened.

CodeAction

Constructors

new CodeAction(title: string, kind?: CodeActionKind): CodeAction

ParameterDescription
title: string

The title of the code action.

kind?: CodeActionKind

The kind of the code action.

ReturnsDescription
CodeAction

Properties

command?: Command

diagnostics?: Diagnostic[]

disabled?: {reason: string}

ParameterDescription
reason: string

Human readable description of why the code action is currently disabled.

This is displayed in the code actions UI.

edit?: WorkspaceEdit

isPreferred?: boolean

kind?: CodeActionKind

title: string

CodeActionContext

Properties

diagnostics: readonly Diagnostic[]

only: CodeActionKind

triggerKind: CodeActionTriggerKind

CodeActionKind

Static

Empty: CodeActionKind

Notebook: CodeActionKind

QuickFix: CodeActionKind

Refactor: CodeActionKind

RefactorExtract: CodeActionKind

RefactorInline: CodeActionKind

RefactorMove: CodeActionKind

RefactorRewrite: CodeActionKind

Source: CodeActionKind

SourceFixAll: CodeActionKind

SourceOrganizeImports: CodeActionKind

Constructors

new CodeActionKind(value: string): CodeActionKind

ParameterDescription
value: string

The value of the kind, such as refactor.extract.function.

ReturnsDescription
CodeActionKind

Properties

value: string

Methods

append(parts: string): CodeActionKind

ParameterDescription
parts: string
ReturnsDescription
CodeActionKind

contains(other: CodeActionKind): boolean

ParameterDescription
other: CodeActionKind

Kind to check.

ReturnsDescription
boolean

intersects(other: CodeActionKind): boolean

ParameterDescription
other: CodeActionKind

Kind to check.

ReturnsDescription
boolean

CodeActionProvider<T>

Methods

provideCodeActions(document: TextDocument, range: Range | Selection, context: CodeActionContext, token: CancellationToken): ProviderResult<Array<Command | T>>

ParameterDescription
document: TextDocument

The document in which the command was invoked.

range: Range | Selection

The selector or range for which the command was invoked. This will always be a selection if the actions are being requested in the currently active editor.

context: CodeActionContext

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.

token: CancellationToken

A cancellation token.

ReturnsDescription
ProviderResult<Array<Command | T>>

An array of code actions, such as quick fixes or refactorings. The lack of a result can be signaled by returning undefined, null, or an empty array.

We also support returning Command for legacy reasons, however all new extensions should return CodeAction object instead.

resolveCodeAction(codeAction: T, token: CancellationToken): ProviderResult<T>

ParameterDescription
codeAction: T

A code action.

token: CancellationToken

A cancellation token.

ReturnsDescription
ProviderResult<T>

The resolved code action or a thenable that resolves to such. It is OK to return the given item. When no result is returned, the given item will be used.

CodeActionProviderMetadata

Properties

documentation?: ReadonlyArray<{command: Command, kind: CodeActionKind}>

providedCodeActionKinds?: readonly CodeActionKind[]

CodeActionTriggerKind

Enumeration Members

Invoke: 1

Automatic: 2

CodeLens

Constructors

new CodeLens(range: Range, command?: Command): CodeLens

ParameterDescription
range: Range

The range to which this code lens applies.

command?: Command

The command associated to this code lens.

ReturnsDescription
CodeLens

Properties

command?: Command

isResolved: boolean

range: Range

CodeLensProvider<T>

Events

onDidChangeCodeLenses?: Event<void>

Methods

provideCodeLenses(document: TextDocument, token: CancellationToken): ProviderResult<T[]>

ParameterDescription
document: TextDocument

The document in which the command was invoked.

token: CancellationToken

A cancellation token.

ReturnsDescription
ProviderResult<T[]>

An array of code lenses or a thenable that resolves to such. The lack of a result can be signaled by returning undefined, null, or an empty array.

resolveCodeLens(codeLens: T, token: CancellationToken): ProviderResult<T>

ParameterDescription
codeLens: T

Code lens that must be resolved.

token: CancellationToken

A cancellation token.

ReturnsDescription
ProviderResult<T>

The given, resolved code lens or thenable that resolves to such.

Color

Constructors

new Color(red: number, green: number, blue: number, alpha: number): Color

ParameterDescription
red: number

The red component.

green: number

The green component.

blue: number

The blue component.

alpha: number

The alpha component.

ReturnsDescription
Color

Properties

alpha: number

blue: number

green: number

red: number

ColorInformation

Constructors

new ColorInformation(range: Range, color: Color): ColorInformation

ParameterDescription
range: Range

The range the color appears in. Must not be empty.

color: Color

The value of the color.

ReturnsDescription
ColorInformation

Properties

color: Color

range: Range

ColorPresentation

Constructors

new ColorPresentation(label: string): ColorPresentation

ParameterDescription
label: string

The label of this color presentation.

ReturnsDescription
ColorPresentation

Properties

additionalTextEdits?: TextEdit[]

label: string

textEdit?: TextEdit

ColorTheme

Properties

kind: ColorThemeKind

ColorThemeKind

Enumeration Members

Light: 1

Dark: 2

HighContrast: 3

HighContrastLight: 4

Command

Properties

arguments?: any[]

command: string

title: string

tooltip?: string

Properties

author: CommentAuthorInformation

body: string | MarkdownString

contextValue?: string

label?: string

mode: CommentMode

reactions?: CommentReaction[]

timestamp?: Date

Properties

iconPath?: Uri

name: string

Properties

commentingRangeProvider?: CommentingRangeProvider

id: string

label: string

options?: CommentOptions

reactionHandler?: (comment: Comment, reaction: CommentReaction) => Thenable<void>

ParameterDescription
comment: Comment
reaction: CommentReaction
ReturnsDescription
Thenable<void>

Methods

createCommentThread(uri: Uri, range: Range, comments: readonly Comment[]): CommentThread

ParameterDescription
uri: Uri

The uri of the document the thread has been created on.

range: Range

The range the comment thread is located within the document.

comments: readonly Comment[]

The ordered comments of the thread.

ReturnsDescription
CommentThread

dispose(): void

ParameterDescription
ReturnsDescription
void

Methods

provideCommentingRanges(document: TextDocument, token: CancellationToken): ProviderResult<Range[] | CommentingRanges>

ParameterDescription
document: TextDocument
token: CancellationToken
ReturnsDescription
ProviderResult<Range[] | CommentingRanges>

Properties

enableFileComments: boolean

ranges?: Range[]

Enumeration Members

Editing: 0

Preview: 1

Properties

placeHolder?: string

prompt?: string

Properties

authorHasReacted: boolean

count: number

iconPath: string | Uri

label: string

Properties

text: string

thread: CommentThread

Properties

blockComment?: CharacterPair

lineComment?: string | LineCommentRule

Properties

canReply: boolean | CommentAuthorInformation

collapsibleState: CommentThreadCollapsibleState

comments: readonly Comment[]

contextValue?: string

label?: string

range: Range

state?: CommentThreadState

uri: Uri

Methods

dispose(): void

ParameterDescription
ReturnsDescription
void

Enumeration Members

Collapsed: 0

Expanded: 1

Enumeration Members

Unresolved: 0

Resolved: 1

CompletionContext

Properties

triggerCharacter: string

triggerKind: CompletionTriggerKind

CompletionItem

Constructors

new CompletionItem(label: string | CompletionItemLabel, kind?: CompletionItemKind): CompletionItem

ParameterDescription
label: string | CompletionItemLabel

The label of the completion.

kind?: CompletionItemKind

The kind of the completion.

ReturnsDescription
CompletionItem

Properties

additionalTextEdits?: TextEdit[]

command?: Command

commitCharacters?: string[]

detail?: string

documentation?: string | MarkdownString

filterText?: string

insertText?: string | SnippetString

keepWhitespace?: boolean

kind?: CompletionItemKind

label: string | CompletionItemLabel

preselect?: boolean

range?: Range | {inserting: Range, replacing: Range}

sortText?: string

tags?: readonly CompletionItemTag[]

textEdit?: TextEdit

CompletionItemKind

Enumeration Members

Text: 0

Method: 1

Function: 2

Constructor: 3

Field: 4

Variable: 5

Class: 6

Interface: 7

Module: 8

Property: 9

Unit: 10

Value: 11

Enum: 12

Keyword: 13

Snippet: 14

Color: 15

File: 16

Reference: 17

Folder: 18

EnumMember: 19

Constant: 20

Struct: 21

Event: 22

Operator: 23

Read the original on code.visualstudio.com ↗