Visual Studio Code API Reference

あまり更新できないコンテンツ

vscode namespace API


翻訳途中でも掲載されています


commands

Namespace for dealing with commands. In short, a command is a function with a
unique identifier. The function is sometimes also called command handler.


Commands can be added to the editor using the registerCommand
and registerTextEditorCommand functions. Commands
can be executed manually or from a UI gesture. Those are:



  • palette - Use the commands-section in package.json to make a command show in
    the command palette.

  • keybinding - Use the keybindings-section in package.json to enable
    keybindings
    for your extension.


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.


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 extension.sayHello.



commands.registerCommand(‘extension.sayHello’, () => {
window.showInformationMessage(‘Hello World!’);
});

Second, bind the command identifier to a title under which it will show in the palette (package.json).



{
“contributes”: {
“commands”: [{
“command”: “extension.sayHello”,
“title”: “Hello World”
}]
}
}

Functions

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


Executes the command denoted by the given command identifier.


When executing an editor command not all types are allowed to
be passed as arguments. Allowed are the primitive types string, boolean,
number, undefined, and null, as well as classes defined in this API.
There are no restrictions when executing commands that have been contributed
by extensions.










ParameterDescription
command: string

Identifier of the command to execute.


rest: any[]

Parameters passed to the command function.


ReturnsDescription
Thenable<T | undefined>

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




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


Retrieve the list of all available commands. Commands starting an underscore are
treated as internal commands.









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


Registers a command that can be invoked via a keyboard shortcut,
a menu item, an action, or directly.


Registering a command with an existing command identifier twice
will cause an error.











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


Registers a text editor command that can be invoked via a keyboard shortcut,
a menu item, an action, or directly.


Text editor commands are different from ordinary commands 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
edit-builder.











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.




debug

Namespace for dealing with debug sessions.


Variables

activeDebugSession: DebugSession | undefined


The currently active debug session or undefined. 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 undefined.



Events

onDidChangeActiveDebugSession: Event<DebugSession | undefined>


An event which fires when the active debug session
has changed. Note that the event also fires when the active debug session changes
to undefined.



onDidReceiveDebugSessionCustomEvent: Event<DebugSessionCustomEvent>


An event which fires when a custom DAP event is received from the debug session.



onDidStartDebugSession: Event<DebugSession>


An event which fires when a new debug session has been started.



onDidTerminateDebugSession: Event<DebugSession>


An event which fires when a debug session has terminated.



Functions

startDebugging(folder: WorkspaceFolder | undefined, nameOrConfiguration: string | DebugConfiguration): Thenable<boolean>


Start debugging by using either a named launch or named compound configuration,
or by directly passing a DebugConfiguration.
The named configurations are looked up in '.vscode/launch.json' 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. '${workspaceRoot}') are resolved against the given folder.










ParameterDescription
folder: WorkspaceFolder | undefined

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.


ReturnsDescription
Thenable<boolean>

A thenable that resolves when debugging could be successfully started.




env

エディターが実行される環境を説明する名前空間


Variables

appName: string


'VS Code' のようなエディターのアプリケーション名



  • readonly



language: string


de-CH, fr, en-US のようなユーザーが設定したユーザーの言語を表します



  • readonly



machineId: string


そのコンピューターを示すユニークな識別子



  • readonly



sessionId: string


現在のセッションを示すユニークな識別子


エディターが起動されるたびに変更されます



  • readonly



extensions

インストールされた拡張機能を扱うための名前空間


拡張機能は、それらを反映することができる extension インターフェイスに表示します。


拡張機能の作成者は API の public surface を activate-call (アクティ化呼び出し) から返すことによって他の拡張機能に API を提供することができます。(?)



export function activate(context: vscode.ExtensionContext) {
let api = {
sum(a, b) {
return a + b;
},
mul(a, b) {
return a * b;
}
};
// ‘export’ public api-surface
return api;
}

別の拡張機能の API に依存するときは、extensionDependency エントリを package.json に追加し、 getExtension-関数と getExtension-関数を以下のように使用します:



let mathExt = extensions.getExtension(‘genius.math’);
let importedApi = mathExt.exports;

console.log(importedApi.mul(42, 1));

Variables

all: Extension<any>[]


現在システムに登録されているすべての拡張機能



Functions

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


拡張機能を publisher.name の形で完全な識別子を取得します









ParameterDescription
extensionId: string

An extension identifier.


ReturnsDescription
Extension<any> | undefined

拡張機能または undefined




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


拡張機能を publisher.name の形で識別子を取得します









ParameterDescription
extensionId: string

An extension identifier.


ReturnsDescription
Extension<T> | undefined

拡張機能または undefined




languages

Namespace for participating in language-specific editor features,
like IntelliSense, code actions, diagnostics etc.


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.


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 TextDocument and a Position returning hover info. The rest, like tracking the
mouse, positioning the hover, keeping the hover stable etc. is taken care of by the editor.



languages.registerHoverProvider(‘javascript’, {
provideHover(document, position, token) {
return new Hover(‘I am a hover!’);
}
});

Registration is done using a document selector which is either a language id, like javascript or
a more complex filter like { language: 'typescript', scheme: 'file' }. Matching a document against such
a selector will result in a score 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 hover,
the score is only checked to be >0, for other features, like IntelliSense the
score is used for determining the order in which providers are asked to participate.


Functions

createDiagnosticCollection(name?: string): DiagnosticCollection


Create a diagnostics collection.









ParameterDescription
name?: string

The name of the collection.


ReturnsDescription
DiagnosticCollection

A new diagnostic collection.




getLanguages(): Thenable<string[]>


Return the identifiers of all known languages.







ReturnsDescription
Thenable<string[]>

Promise resolving to an array of identifier strings.




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


Compute the match between a document selector and a document. Values
greater than zero mean the selector matches the document.


A match is computed according to these rules:



  1. When DocumentSelector is an array, compute the match for each contained DocumentFilter or language identifier and take the maximum value.

  2. A string will be desugared to become the language-part of a DocumentFilter, so "fooLang" is like { language: "fooLang" }.

  3. A DocumentFilter will be matched against the document by comparing its parts with the document. The following rules apply:

    1. When the DocumentFilter is empty ({}) the result is 0

    2. When scheme, language, or pattern are defined but one doesn’t match, the result is 0

    3. Matching against gives a score of 5, matching via equality or via a glob-pattern gives a score of 10

    4. The result is the maximun value of each match




Samples:



// default document from disk (file-scheme)
doc.uri; //‘file:///my/file.js’
doc.languageId; // ‘javascript’
match(‘javascript’, doc); // 10;
match({language: ‘javascript’}, doc); // 10;
match({language: ‘javascript’, scheme: ‘file’}, doc); // 10;
match(‘‘, doc); // 5
match(‘fooLang’, doc); // 0
match([‘fooLang’, ], doc); // 5

// virtual document, e.g. from git-index
doc.uri; // ‘git:/my/file.js’
doc.languageId; // ‘javascript’
match(‘javascript’, doc); // 10;
match({language: ‘javascript’, scheme: ‘git’}, doc); // 10;
match(‘‘, doc); // 5









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.




registerCodeActionsProvider(selector: DocumentSelector, provider: CodeActionProvider): Disposable


Register a code action provider.


Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.










ParameterDescription
selector: DocumentSelector

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


provider: CodeActionProvider

A code action provider.


ReturnsDescription
Disposable

A disposable that unregisters this provider when being disposed.




registerCodeLensProvider(selector: DocumentSelector, provider: CodeLensProvider): Disposable


Register a code lens provider.


Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.










ParameterDescription
selector: DocumentSelector

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


provider: CodeLensProvider

A code lens provider.


ReturnsDescription
Disposable

A disposable that unregisters this provider when being disposed.




registerCompletionItemProvider(selector: DocumentSelector, provider: CompletionItemProvider, triggerCharacters: string[]): Disposable


Register a completion provider.


Multiple providers can be registered for a language. In that case providers are sorted
by their score 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.











ParameterDescription
selector: DocumentSelector

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


provider: CompletionItemProvider

A completion provider.


triggerCharacters: string[]

Trigger completion when the user types one of the characters, like . or :.


ReturnsDescription
Disposable

A disposable that unregisters this provider when being disposed.




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


Register a definition provider.


Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.










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.




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


Register a formatting provider for a document.


Multiple providers can be registered for a language. In that case providers are sorted
by their score and the best-matching provider is used. Failure
of the selected provider will cause a failure of the whole operation.










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


Register a document highlight provider.


Multiple providers can be registered for a language. In that case providers are sorted
by their score and groups sequentially asked for document highlights.
The process stops when a provider returns a non-falsy or non-failure result.










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): Disposable


Register a document link provider.


Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.










ParameterDescription
selector: DocumentSelector

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


provider: DocumentLinkProvider

A document link provider.


ReturnsDescription
Disposable

A disposable that unregisters this provider when being disposed.




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


Register a formatting provider for a document range.


Note: A document range provider is also a document formatter
which means there is no need to register a document
formatter when also registering a range provider.


Multiple providers can be registered for a language. In that case providers are sorted
by their score and the best-matching provider is used. Failure
of the selected provider will cause a failure of the whole operation.










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.




registerDocumentSymbolProvider(selector: DocumentSelector, provider: DocumentSymbolProvider): Disposable


Register a document symbol provider.


Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.










ParameterDescription
selector: DocumentSelector

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


provider: DocumentSymbolProvider

A document symbol provider.


ReturnsDescription
Disposable

A disposable that unregisters this provider when being disposed.




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


Register a hover provider.


Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.










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


Register an implementation provider.


Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.










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.




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


Register a formatting provider that works on type. The provider is active when the user enables the setting editor.formatOnType.


Multiple providers can be registered for a language. In that case providers are sorted
by their score and the best-matching provider is used. Failure
of the selected provider will cause a failure of the whole operation.












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


Register a reference provider.


Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.










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


Register a reference provider.


Multiple providers can be registered for a language. In that case providers are sorted
by their score and the best-matching provider is used. Failure
of the selected provider will cause a failure of the whole operation.










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.




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


Register a signature help provider.


Multiple providers can be registered for a language. In that case providers are sorted
by their score and called sequentially until a provider returns a
valid result.











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.




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


Register a type definition provider.


Multiple providers can be registered for a language. In that case providers are asked in
parallel and the results are merged. A failing provider (rejected promise or exception) will
not cause a failure of the whole operation.










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.




registerWorkspaceSymbolProvider(provider: WorkspaceSymbolProvider): Disposable


Register a workspace symbol provider.


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.









ParameterDescription
provider: WorkspaceSymbolProvider

A workspace symbol provider.


ReturnsDescription
Disposable

A disposable that unregisters this provider when being disposed.




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


Set a language configuration for a language.










ParameterDescription
language: string

A language identifier like typescript.


configuration: LanguageConfiguration

Language configuration.


ReturnsDescription
Disposable

A disposable that unsets this configuration.




scm

Variables

inputBox: SourceControlInputBox


The input box in the Source Control viewlet.



Functions

createSourceControl(id: string, label: string): SourceControl


Creates a new source control instance.










ParameterDescription
id: string

A unique id for the source control. Something short, eg: git.


label: string

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


ReturnsDescription
SourceControl

An instance of source control.




window

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.


Variables

activeTextEditor: TextEditor | undefined


The currently active editor or undefined. The active editor is the one
that currently has focus or, when none has focus, the one that has changed
input most recently.



visibleTextEditors: TextEditor[]


The currently visible editors or an empty array.



Events

onDidChangeActiveTextEditor: Event<TextEditor>


An event which fires when the active editor
has changed. Note that the event also fires when the active editor changes
to undefined.



onDidChangeTextEditorOptions: Event<TextEditorOptionsChangeEvent>


An event which fires when the options of an editor have changed.



onDidChangeTextEditorSelection: Event<TextEditorSelectionChangeEvent>


An event which fires when the selection in an editor has changed.



onDidChangeTextEditorViewColumn: Event<TextEditorViewColumnChangeEvent>


An event which fires when the view column of an editor has changed.



onDidChangeVisibleTextEditors: Event<TextEditor[]>


An event which fires when the array of visible editors
has changed.



onDidCloseTerminal: Event<Terminal>


An event which fires when a terminal is disposed.



Functions

createOutputChannel(name: string): OutputChannel


Create a new output channel with the given name.









ParameterDescription
name: string

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


ReturnsDescription
OutputChannel


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


Creates a status bar item.










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[]): Terminal


Creates a Terminal. The cwd of the terminal will be the workspace directory
if it exists, regardless of whether an explicit customStartPath setting exists.











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[]

Optional args for the custom shell executable, this does not work on Windows (see #8429)


ReturnsDescription
Terminal

A new Terminal.




createTerminal(options: TerminalOptions): Terminal


Creates a Terminal. The cwd of the terminal will be the workspace directory
if it exists, regardless of whether an explicit customStartPath setting exists.









ParameterDescription
options: TerminalOptions

A TerminalOptions object describing the characteristics of the new terminal.


ReturnsDescription
Terminal

A new Terminal.




createTextEditorDecorationType(options: DecorationRenderOptions): TextEditorDecorationType


Create a TextEditorDecorationType that can be used to add decorations to text editors.









ParameterDescription
options: DecorationRenderOptions

Rendering options for the decoration type.


ReturnsDescription
TextEditorDecorationType

A new decoration type instance.




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


Register a TreeDataProvider for the view contributed using the extension point views.










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


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


Set a message to the status bar. This is a short hand for the more powerful
status bar items.










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


Set a message to the status bar. This is a short hand for the more powerful
status bar items.










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


Set a message to the status bar. This is a short hand for the more powerful
status bar items.


Note that status bar messages stack and that they must be disposed when no
longer used.









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(message: string, items: string[]): Thenable<string | undefined>


Show an error message.











ParameterDescription
message: string

The message to show.


items: string[]

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


ReturnsDescription
Thenable<string | undefined>

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




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


Show an error message.












ParameterDescription
message: string

The message to show.


options: MessageOptions

Configures the behaviour of the message.


items: string[]

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


ReturnsDescription
Thenable<string | 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>


Show an error message.











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>


Show an error message.












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(message: string, items: string[]): Thenable<string | undefined>


Show an information message to users. Optionally provide an array of items which will be presented as
clickable buttons.










ParameterDescription
message: string

The message to show.


items: string[]

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


ReturnsDescription
Thenable<string | undefined>

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




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


Show an information message to users. Optionally provide an array of items which will be presented as
clickable buttons.











ParameterDescription
message: string

The message to show.


options: MessageOptions

Configures the behaviour of the message.


items: string[]

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


ReturnsDescription
Thenable<string | 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>


Show an information message.











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>


Show an information message.












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>


Opens an input box to ask the user for input.


The returned value will be undefined 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.










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 promise that resolves to a string the user provided or to undefined in case of dismissal.




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


Shows a selection list.











ParameterDescription
items: string[] | Thenable<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 promise that resolves to the selection or undefined.




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


Shows a selection list.











ParameterDescription
items: T[] | Thenable<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 promise that resolves to the selected item or undefined.




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


Show the given document in a text editor. A column can be provided
to control where the editor is being shown. Might change the active editor.











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 one, other values
are adjusted to be Min(column, columnCount + 1).


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>


Show the given document in a text editor. Options can be provided
to control options of the editor is being shown. Might change the active editor.










ParameterDescription
document: TextDocument

A text document to be shown.


options?: TextDocumentShowOptions

(#ShowTextDocumentOptions) 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>


A short-hand for openTextDocument(uri).then(document => showTextDocument(document, options)).











ParameterDescription
uri: Uri

A resource identifier.


options?: TextDocumentShowOptions

(#ShowTextDocumentOptions) to configure the behavior of showing the editor.


ReturnsDescription
Thenable<TextEditor>

A promise that resolves to an editor.




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


Show a warning message.











ParameterDescription
message: string

The message to show.


items: string[]

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


ReturnsDescription
Thenable<string | undefined>

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




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


Show a warning message.












ParameterDescription
message: string

The message to show.


options: MessageOptions

Configures the behaviour of the message.


items: string[]

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


ReturnsDescription
Thenable<string | 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>


Show a warning message.











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>


Show a warning message.












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.




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


Show progress in the editor. Progress is shown while running the given callback
and while the promise it returned isn't resolved nor rejected. The location at which
progress should show (and other details) is defined via the passed ProgressOptions.










ParameterDescription
options: ProgressOptions
task: (progress: Progress<{message: string}>) => Thenable<R>

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


ReturnsDescription
Thenable<R>

The thenable the task-callback returned.




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


Show progress in the Source Control viewlet while running the given callback and while
its returned promise isn't resolve or rejected.



  • deprecated - Use withProgress instead.









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




workspace

Namespace for dealing with the current workspace. A workspace is the representation
of the folder that has been opened. There is no workspace when just a file but not a
folder has been opened.


The workspace offers support for listening to fs
events and for finding files. Both perform well and run outside
the editor-process so that they should be always used instead of nodejs-equivalents.


Variables

rootPath: string | undefined


The folder that is open in the editor. undefined when no folder
has been opened.




  • readonly



textDocuments: TextDocument[]


All text documents currently known to the system.



  • readonly



workspaceFolders: WorkspaceFolder[] | undefined


List of workspace folders or undefined when no folder is open.
Note that the first entry corresponds to the value of rootPath.



  • readonly



Events

onDidChangeConfiguration: Event<void>


An event that is emitted when the configuration changed.



onDidChangeTextDocument: Event<TextDocumentChangeEvent>


An event that is emitted when a text document is changed. This usually happens
when the contents changes but also when other things like the
dirty-state changes.



onDidChangeWorkspaceFolders: Event<WorkspaceFoldersChangeEvent>


An event that is emitted when a workspace folder is added or removed.



onDidCloseTextDocument: Event<TextDocument>


An event that is emitted when a text document is disposed.



onDidOpenTextDocument: Event<TextDocument>


An event that is emitted when a text document is opened.



onDidSaveTextDocument: Event<TextDocument>


An event that is emitted when a text document is saved to disk.



onWillSaveTextDocument: Event<TextDocumentWillSaveEvent>


An event that is emitted when a text document will be saved to disk.


Note 1: 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.


Note 2: Subscribers are called sequentially and they can delay saving
by registering asynchronous work. Protection against misbehaving listeners is implemented as such:



  • there is an overall time budget that all listeners share and if that is exhausted no further listener is called

  • listeners that take a long time or produce errors frequently will not be called anymore


The current thresholds are 1.5 seconds as overall time budget and a listener can misbehave 3 times before being ignored.



Functions

applyEdit(edit: WorkspaceEdit): Thenable<boolean>


Make changes to one or many resources as defined by the given
workspace edit.


When applying a workspace edit, the editor implements an 'all-or-nothing'-strategy,
that means failure to load one document or make changes to one document will cause
the edit to be rejected.









ParameterDescription
edit: WorkspaceEdit

A workspace edit.


ReturnsDescription
Thenable<boolean>

A thenable that resolves when the edit could be applied.




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


Returns a path that is relative to the workspace folder or folders.


When there are no workspace folders or when the path
is not contained in them, the input is returned.










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: string, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean): FileSystemWatcher


Creates a file system watcher.


A glob pattern that filters the file events must be provided. Optionally, flags to ignore certain
kinds of events can be provided. To stop listening to events the watcher must be disposed.


Note that only files within the current workspace folders can be watched.












ParameterDescription
globPattern: string

A glob pattern that is applied to the names of created, changed, and deleted files.


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.




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


Find files in the workspace.



  • sample - findFiles('∕*.js', '∕node_modules∕**', 10)












ParameterDescription
include: string

A glob pattern that defines the files to search for.


exclude?: string

A glob pattern that defines files and folders to exclude.


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.




getConfiguration(section?: string, resource?: Uri): WorkspaceConfiguration


Get a workspace configuration object.


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 { myExt: { setting: { doIt: true }}} and getConfiguration('myExt.setting').get('doIt') === true.


When a resource is provided, configuration scoped to that resource is returned.










ParameterDescription
section?: string

A dot-separated identifier.


resource?: Uri

A resource for which the configuration is asked for


ReturnsDescription
WorkspaceConfiguration

The full configuration or a subset.




getWorkspaceFolder(uri: Uri): WorkspaceFolder | undefined


Returns a workspace folder for the provided resource. When the resource
is a workspace folder itself, its parent workspace folder or undefined is returned.









ParameterDescription
uri: Uri

An uri.


ReturnsDescription
WorkspaceFolder | undefined

A workspace folder or undefined




openTextDocument(uri: Uri): Thenable<TextDocument>


Opens a document. Will return early if this document is already open. Otherwise
the document is loaded and the didOpen-event fires.


The document is denoted by an uri. Depending on the scheme the
following rules apply:



  • file-scheme: Open a file on disk, will be rejected if the file does not exist or cannot be loaded.

  • untitled-scheme: A new file that should be saved on disk, e.g. untitled:c:\frodo\new.js. The language
    will be derived from the file name.

  • For all other schemes the registered text document content providers are consulted.


Note that the lifecycle of the returned document is owned by the editor and not by the extension. That means an
onDidClose-event can occur at any time after opening it.









ParameterDescription
uri: Uri

Identifies the resource to open.


ReturnsDescription
Thenable<TextDocument>

A promise that resolves to a document.




openTextDocument(fileName: string): Thenable<TextDocument>


A short-hand for openTextDocument(Uri.file(fileName)).










ParameterDescription
fileName: string

A name of a file on disk.


ReturnsDescription
Thenable<TextDocument>

A promise that resolves to a document.




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


Opens an untitled text document. The editor will prompt the user for a file
path when the document is to be saved. The options parameter allows to
specify the language and/or the content of the document.









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

Options to control how the document will be created.


ReturnsDescription
Thenable<TextDocument>

A promise that resolves to a document.




registerTaskProvider(type: string, provider: TaskProvider): Disposable


Register a task provider.










ParameterDescription
type: string

The task kind type this provider is registered for.


provider: TaskProvider

A task provider.


ReturnsDescription
Disposable

A disposable that unregisters this provider when being disposed.




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


Register a text document content provider.


Only one provider can be registered per scheme.










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.




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


Save all dirty files.









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.




CancellationToken

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.


To get an instance of a CancellationToken use a
CancellationTokenSource.


Properties

isCancellationRequested: boolean


Is true when the token has been cancelled, false otherwise.



onCancellationRequested: Event<any>


An event which fires upon cancellation.



CancellationTokenSource

A cancellation source creates and controls a cancellation token.


Properties

token: CancellationToken


The cancellation token of this source.



Methods

cancel(): void


Signal cancellation on the token.







ReturnsDescription
void


dispose(): void


Dispose object and free resources. Will call cancel.







ReturnsDescription
void


CharacterPair

A tuple of two characters, like a pair of
opening and closing brackets.


CharacterPair: [string, string]

CodeActionContext

Contains additional diagnostic information about the context in which
a code action is run.


Properties

diagnostics: Diagnostic[]


An array of diagnostics.



CodeActionProvider

The code action interface defines the contract between extensions and
the light bulb feature.


A code action can be any command that is known to the system.


Methods

provideCodeActions(document: TextDocument, range: Range, context: CodeActionContext, token: CancellationToken): ProviderResult


Provide commands for the given document and range.












ParameterDescription
document: TextDocument

The document in which the command was invoked.


range: Range

The range for which the command was invoked.


context: CodeActionContext

Context carrying additional information.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

An array of commands or a thenable of such. The lack of a result can be
signaled by returning undefined, null, or an empty array.




CodeLens

CodeLens は参照の数、テストを実行する方法など、ソース テキストともに表示される command を表します


CodeLens はコマンドが関連付けされていないときは unresolved です。
パフォーマンス上の理由から、CodeLensの作成と解決は 2 つの段階に分かれていなければなりません。




Constructors

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


新しい 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


このCodeLens が示すコマンド



isResolved: boolean


関連するコマンドがあるとき true です



range: Range


このCodeLens が有効な範囲。1 行のみ span します。



CodeLensProvider

CodeLens プロバイダーはソース テキストに commands を追加します


コマンドはソース テキストの間に専用の水平な行で表示されます。


Events

onDidChangeCodeLenses?: Event<void>


このプロバイダーが変更されたことを通知するオプションのイベント



Methods

provideCodeLenses(document: TextDocument, token: CancellationToken): ProviderResult


lenses のリストを計算します。
この呼び出しはできるだけ速く返す必要があります。もしコマンドの計算が複雑な実装の場合は範囲を指定する CodeLens オブジェクトを返すだけで resolve するよう実装しなければなりません。










ParameterDescription
document: TextDocument

The document in which the command was invoked.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

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: CodeLens, token: CancellationToken): ProviderResult


この関数は CodeLens が表示されるたびに呼び出されます。通常はスクロール後とcompute-lenses を呼び出したあとです。










ParameterDescription
codeLens: CodeLens

code lens that must be resolved.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

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




Command

コマンドへの参照を表示します


UI でコマンドを表すために使用されます。オプションで呼び出されたとき、コマンド ハンドラに渡される引数の配列を提供します。


Properties

arguments?: any[]


コマンドハンドラが呼び出されるべき引数



command: string


実際のコマンドハンドラの識別子




title: string


saveのようなコマンドのタイトル



tooltip?: string


UI で表示されたときのコマンド用ツールチップ



CommentRule

Describes how comments for a language work.


Properties

blockComment?: CharacterPair


The block comment character pair, like / block comment &#47;



lineComment?: string


The line comment token, like // this is a comment



CompletionItem

A completion item represents a text snippet that is proposed to complete text that is being typed.


It is suffient to create a completion item from just a label. In that
case the completion item will replace the word
until the cursor with the given label or insertText. Otherwise the
the given edit is used.


When selecting a completion item in the editor its defined or synthesized text edit will be applied
to all cursors/selections whereas additionalTextEdits will be
applied as provided.




Constructors

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


Creates a new completion item.


Completion items must have at least a label which then
will be used as insert text as well as for sorting and filtering.










ParameterDescription
label: string

The label of the completion.


kind?: CompletionItemKind

The kind of the completion.


ReturnsDescription
CompletionItem


Properties

additionalTextEdits?: TextEdit[]


An optional array of additional text edits that are applied when
selecting this completion. Edits must not overlap with the main edit
nor with themselves.



command?: Command


An optional command that is executed after inserting this completion. Note that
additional modifications to the current document should be described with the
additionalTextEdits-property.



commitCharacters?: string[]


An optional set of characters that when pressed while this completion is active will accept it first and
then type that character. Note that all commit characters should have length=1 and that superfluous
characters will be ignored.



detail?: string


A human-readable string with additional information
about this item, like type or symbol information.



documentation?: string


A human-readable string that represents a doc-comment.



filterText?: string


A string that should be used when filtering a set of
completion items. When falsy the label
is used.



insertText?: string | SnippetString


A string or snippet that should be inserted in a document when selecting
this completion. When falsy the label
is used.



kind?: CompletionItemKind


The kind of this completion item. Based on the kind
an icon is chosen by the editor.



label: string


The label of this completion item. By default
this is also the text that is inserted when selecting
this completion.



range?: Range


A range of text that should be replaced by this completion item.


Defaults to a range from the start of the current word to the
current position.


Note: The range must be a single line and it must
contain the position at which completion has been requested.



sortText?: string


A string that should be used when comparing this item
with other items. When falsy the label
is used.



textEdit?: TextEdit



  • deprecated - Use CompletionItem.insertText and CompletionItem.range instead.


An edit which is applied to a document when selecting
this completion. When an edit is provided the value of
insertText is ignored.


The range of the edit must be single-line and on the same
line completions were requested at.



CompletionItemKind

Completion の種類


Enumeration members

Class


6

Color


15

Constant


20

Constructor


3

Enum


12

EnumMember


19

Event


22

Field


4

File


16

Folder


18

Function


2

Interface


7

Keyword


13

Method


1

Module


8

Operator


23

Property


9

Reference


17

Snippet


14

Struct


21

Text


0

TypeParameter


24

Unit


10

Value


11

Variable


5

CompletionItemProvider

The completion item provider interface defines the contract between extensions and
IntelliSense.


When computing complete completion items is expensive, providers can optionally implement
the resolveCompletionItem-function. In that case it is enough to return completion
items with a label from the
provideCompletionItems-function. Subsequently,
when a completion item is shown in the UI and gains focus this provider is asked to resolve
the item, like adding doc-comment or details.


Providers are asked for completions either explicitly by a user gesture or -depending on the configuration-
implicitly when typing words or trigger characters.


Methods

provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken): ProviderResult


Provide completion items for the given position and document.











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

An array of completions, a completion list, or a thenable that resolves to either.
The lack of a result can be signaled by returning undefined, null, or an empty array.




resolveCompletionItem(item: CompletionItem, token: CancellationToken): ProviderResult


Given a completion item fill in more data, like doc-comment
or details.


The editor will only resolve a completion item once.










ParameterDescription
item: CompletionItem

A completion item currently active in the UI.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

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




CompletionList

Represents a collection of completion items to be presented
in the editor.


Constructors

new CompletionList(items?: CompletionItem[], isIncomplete?: boolean): CompletionList


Creates a new completion list.










ParameterDescription
items?: CompletionItem[]

The completion items.


isIncomplete?: boolean

The list is not complete.


ReturnsDescription
CompletionList


Properties

isIncomplete?: boolean


This list it not complete. Further typing should result in recomputing
this list.



items: CompletionItem[]


The completion items.



ConfigurationTarget

The configuration target


Enumeration members

Global


1

Workspace


2

WorkspaceFolder


3

DebugConfiguration

Configuration for a debug session.


Properties

name?: string


An optional name for the debug session.



request: string


The request type of the debug session.



type: string


The type for the debug session.



DebugSession

A debug session.


Properties

id: string


The unique ID of this debug session.



name: string


The debug session's name from the debug configuration.



type: string


The debug session's type from the debug configuration.



Methods

customRequest(command: string, args?: any): Thenable<any>


Send a custom request to the debug adapter.










ParameterDescription
command: string
args?: any
ReturnsDescription
Thenable<any>


DebugSessionCustomEvent

A custom Debug Adapter Protocol event received from a debug session.


Properties

body?: any


Event specific information.



event: string


Type of event.



session: DebugSession


The debug session for which the custom event was received.



DecorationInstanceRenderOptions

Properties

after?: ThemableDecorationAttachmentRenderOptions


デコレーションされたテキストの後ろに挿入される attachment の描画オプションを定義します



before?: ThemableDecorationAttachmentRenderOptions


デコレーションされたテキストの前に挿入される attachment の描画オプションを定義します



dark?: ThemableDecorationInstanceRenderOptions


dark theme 用の上書きオプション



light?: ThemableDecorationInstanceRenderOptions


light theme 用の上書きオプション



DecorationOptions

decoration set 内で特定のデコレーション用のオプションを表します


Properties

hoverMessage?: MarkedString | MarkedString[]


デコレーション上をホバーするとき、描画されるべきメッセージ



range: Range


このデコレーションができようされる範囲。範囲は空にできません。



renderOptions?: DecorationInstanceRenderOptions


現在のデコレーションに適用される描画オプション
パフォーマンスの理由から、デコレーション固有のオプションの数はできるだけ少なくし、可能な限りデコレーション タイプを使用してください



DecorationRangeBehavior

入力/編集するとき、エッジでのデコレーションの動作を説明します


Enumeration members

ClosedClosed


1

ClosedOpen


3

OpenClosed


2

OpenOpen


0

DecorationRenderOptions

text editor decoration 用の描画スタイルを表します


Properties

after?: ThemableDecorationAttachmentRenderOptions


デコレーションされたテキストの後ろに挿入される attachment の描画オプションを定義します



backgroundColor?: string | ThemeColor


デコレーションの背景色。rgba() を使用して透明な背景色を定義することで、他のデコレーションとうまく一緒になります。


あるいはカラー レジストリの配色が referenced されます



before?: ThemableDecorationAttachmentRenderOptions


デコレーションされたテキストの前に挿入される attachment の描画オプションを定義します



border?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ



borderColor?: string | ThemeColor


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のボーダー プロパティを設定する場合は 'border' を使用する方が効果的です。



borderRadius?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のボーダー プロパティを設定する場合は 'border' を使用する方が効果的です。



borderSpacing?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のボーダー プロパティを設定する場合は 'border' を使用する方が効果的です。



borderStyle?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のボーダー プロパティを設定する場合は 'border' を使用する方が効果的です。



borderWidth?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のボーダー プロパティを設定する場合は 'border' を使用する方が効果的です。



color?: string | ThemeColor


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ



cursor?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ



dark?: ThemableDecorationRenderOptions


dark theme 用の上書きオプション



gutterIconPath?: string | Uri


絶対パス または ガターに描画する画像への URI



gutterIconSize?: string


ガターアイコンのサイズを指定します


使用可能な値は 'auto', 'contain', 'cover', 任意のパーセント値です。


詳細: https://msdn.microsoft.com/en-us/library/jj127316(v=vs.85).aspx



isWholeLine?: boolean


デコレーションは行テキストの後ろの空白でも表示されるべきか


既定は false です



letterSpacing?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ



light?: ThemableDecorationRenderOptions


light theme 用の上書きオプション



outline?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ



outlineColor?: string | ThemeColor


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のアウトライン プロパティを設定する場合は 'outline' を使用する方が効果的です。



outlineStyle?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のアウトライン プロパティを設定する場合は 'outline' を使用する方が効果的です。



outlineWidth?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のアウトライン プロパティを設定する場合は 'outline' を使用する方が効果的です。



overviewRulerColor?: string | ThemeColor


概要ルーラーのデコレーション色
rgba() を使用して透明な色を定義することで、他のデコレーションとうまく一緒になります。



overviewRulerLane?: OverviewRulerLane


デコレーションを描画するべき概要ルーラーの位置



rangeBehavior?: DecorationRangeBehavior


デコレーションの範囲のエッジで編集が行われたとき、デコレーションのどうだが変化するようにカスタマイズします


既定は DecorationRangeBehavior.OpenOpen です。



textDecoration?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ



Definition

The definition of a symbol represented as one or many locations.
For most programming languages there is only one location at which a symbol is
defined.


Definition: Location | Location[]

DefinitionProvider

The definition provider interface defines the contract between extensions and
the go to definition
and peek definition features.


Methods

provideDefinition(document: TextDocument, position: Position, token: CancellationToken): ProviderResult


Provide the definition of the symbol at the given position and document.











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

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




Diagnostic

Represents a diagnostic, such as a compiler error or warning. Diagnostic objects
are only valid in the scope of a file.


Constructors

new Diagnostic(range: Range, message: string, severity?: DiagnosticSeverity): Diagnostic


Creates a new diagnostic object.











ParameterDescription
range: Range

The range to which this diagnostic applies.


message: string

The human-readable message.


severity?: DiagnosticSeverity

The severity, default is error.


ReturnsDescription
Diagnostic


Properties

code: string | number


A code or identifier for this diagnostics. Will not be surfaced
to the user, but should be used for later processing, e.g. when
providing code actions.



message: string


The human-readable message.



range: Range


The range to which this diagnostic applies.



severity: DiagnosticSeverity


The severity, default is error.



source: string


A human-readable string describing the source of this
diagnostic, e.g. 'typescript' or 'super lint'.



DiagnosticCollection

A diagnostics collection is a container that manages a set of
diagnostics. Diagnostics are always scopes to a
diagnostics collection and a resource.


To get an instance of a DiagnosticCollection use
createDiagnosticCollection.


Properties

name: string


The name of this diagnostic collection, for instance typescript. Every diagnostic
from this collection will be associated with this name. Also, the task framework uses this
name when defining problem matchers.



Methods

clear(): void


Remove all diagnostics from this collection. The same
as calling #set(undefined);







ReturnsDescription
void


delete(uri: Uri): void


Remove all diagnostics from this collection that belong
to the provided uri. The same as #set(uri, undefined).









ParameterDescription
uri: Uri

A resource identifier.


ReturnsDescription
void


dispose(): void


Dispose and free associated resources. Calls
clear.







ReturnsDescription
void


forEach(callback: (uri: Uri, diagnostics: Diagnostic[], collection: DiagnosticCollection) => any, thisArg?: any): void


Iterate over each entry in this collection.










ParameterDescription
callback: (uri: Uri, diagnostics: Diagnostic[], collection: DiagnosticCollection) => any

Function to execute for each entry.


thisArg?: any

The this context used when invoking the handler function.


ReturnsDescription
void


get(uri: Uri): Diagnostic[] | undefined


Get the diagnostics for a given resource. Note that you cannot
modify the diagnostics-array returned from this call.









ParameterDescription
uri: Uri

A resource identifier.


ReturnsDescription
Diagnostic[] | undefined

An immutable array of diagnostics or undefined.




has(uri: Uri): boolean


Check if this collection contains diagnostics for a
given resource.









ParameterDescription
uri: Uri

A resource identifier.


ReturnsDescription
boolean

true if this collection has diagnostic for the given resource.




set(uri: Uri, diagnostics: Diagnostic[] | undefined): void


Assign diagnostics for given resource. Will replace
existing diagnostics for that resource.










ParameterDescription
uri: Uri

A resource identifier.


diagnostics: Diagnostic[] | undefined

Array of diagnostics or undefined


ReturnsDescription
void


set(entries: [Uri, Diagnostic[] | undefined][]): void


Replace all entries in this collection.


Diagnostics of multiple tuples of the same uri will be merged, e.g
[[file1, [d1]], [file1, [d2]]] is equivalent to [[file1, [d1, d2]]].
If a diagnostics item is undefined as in [file1, undefined]
all previous but not subsequent diagnostics are removed.









ParameterDescription
entries: [Uri, Diagnostic[] | undefined][]

An array of tuples, like [[file1, [d1, d2]], [file2, [d3, d4, d5]]], or undefined.


ReturnsDescription
void


DiagnosticSeverity

Represents the severity of diagnostics.


Enumeration members

Error


0

Hint


3

Information


2

Warning


1

Disposable

Represents a type which can release resources, such
as event listening or a timer.


Static

from(disposableLikes: {dispose: () => any}[]): Disposable


Combine many disposable-likes into one. Use this method
when having objects with a dispose function which are not
instances of Disposable.









ParameterDescription
disposableLikes: {dispose: () => any}[]

Objects that have at least a dispose-function member.


ReturnsDescription
Disposable

Returns a new disposable which, upon dispose, will
dispose all provided disposables.




Constructors

new Disposable(callOnDispose: Function): Disposable


Creates a new Disposable calling the provided function
on dispose.









ParameterDescription
callOnDispose: Function

Function that disposes something.


ReturnsDescription
Disposable


Methods

dispose(): any


Dispose this object.







ReturnsDescription
any


DocumentFilter

A document filter denotes a document by different properties like
the language, the scheme of
its resource, or a glob-pattern that is applied to the path.



  • sample - A language filter that applies to typescript files on disk: { language: 'typescript', scheme: 'file' }



  • sample - A language filter that applies to all package.json paths: { language: 'json', pattern: '**∕package.json' }


Properties

language?: string


A language id, like typescript.



pattern?: string


A glob pattern, like *.{ts,js}.



scheme?: string


A Uri scheme, like file or untitled.



DocumentFormattingEditProvider

The document formatting provider interface defines the contract between extensions and
the formatting-feature.


Methods

provideDocumentFormattingEdits(document: TextDocument, options: FormattingOptions, token: CancellationToken): ProviderResult


Provide formatting edits for a whole document.











ParameterDescription
document: TextDocument

The document in which the command was invoked.


options: FormattingOptions

Options controlling formatting.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

A set of text edits or a thenable that resolves to such. The lack of a result can be
signaled by returning undefined, null, or an empty array.




DocumentHighlight

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.


Constructors

new DocumentHighlight(range: Range, kind?: DocumentHighlightKind): DocumentHighlight


Creates a new document highlight object.










ParameterDescription
range: Range

The range the highlight applies to.


kind?: DocumentHighlightKind

The highlight kind, default is text.


ReturnsDescription
DocumentHighlight


Properties

kind?: DocumentHighlightKind


The highlight kind, default is text.



range: Range


The range this highlight applies to.



DocumentHighlightKind

A document highlight kind.


Enumeration members

Read


1

Text


0

Write


2

DocumentHighlightProvider

document highlight provider interface は拡張機能と word-higliht-機能の間のコントラクトを定義します


Methods

provideDocumentHighlights(document: TextDocument, position: Position, token: CancellationToken): ProviderResult


変数のすべての出現箇所や、関数すべての exit-point のような一連のドキュメント ハイライトを提供します











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

ドキュメント ハイライトの配列またはそう解決される thenable。結果の欠落は undefined, null または空の配列を返すことによって伝えることができます。




DocumentLink

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.


Constructors

new DocumentLink(range: Range, target?: Uri): DocumentLink


Creates a new document link.










ParameterDescription
range: Range

The range the document link applies to. Must not be empty.


target?: Uri

The uri the document link points to.


ReturnsDescription
DocumentLink


Properties

range: Range


The range this link applies to.



target?: Uri


The uri this link points to.



DocumentLinkProvider

The document link provider defines the contract between extensions and feature of showing
links in the editor.


Methods

provideDocumentLinks(document: TextDocument, token: CancellationToken): ProviderResult


Provide links for the given document. Note that the editor ships with a default provider that detects
http(s) and file links.










ParameterDescription
document: TextDocument

The document in which the command was invoked.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

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




resolveDocumentLink(link: DocumentLink, token: CancellationToken): ProviderResult


Given a link fill in its target. This method is called when an incomplete
link is selected in the UI. Providers can implement this method and return incomple links
(without target) from the provideDocumentLinks method which
often helps to improve performance.










ParameterDescription
link: DocumentLink

The link that is to be resolved.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult


DocumentRangeFormattingEditProvider

The document formatting provider interface defines the contract between extensions and
the formatting-feature.


Methods

provideDocumentRangeFormattingEdits(document: TextDocument, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult


Provide formatting edits for a range in a document.


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.












ParameterDescription
document: TextDocument

The document in which the command was invoked.


range: Range

The range which should be formatted.


options: FormattingOptions

Options controlling formatting.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

A set of text edits or a thenable that resolves to such. The lack of a result can be
signaled by returning undefined, null, or an empty array.




DocumentSelector

A language selector is the combination of one or many language identifiers
and language filters.



  • sample - let sel:DocumentSelector = 'typescript';



  • sample - let sel:DocumentSelector = ['typescript', { language: 'json', pattern: '**∕tsconfig.json' }];


DocumentSelector: string | DocumentFilter | string | DocumentFilter[]

DocumentSymbolProvider

document symbol provider interface は拡張機能と go to symbol-機能 の間のコントラクトを定義します


Methods

provideDocumentSymbols(document: TextDocument, token: CancellationToken): ProviderResult


与えられたドキュメントのシンボル情報を提供する










ParameterDescription
document: TextDocument

The document in which the command was invoked.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

ドキュメント ハイライトの配列またはそう解決される thenable。結果の欠落は undefined, null または空の配列を返すことによって伝えることができます。




EndOfLine

document 内の行末文字列を表します


Enumeration members

CRLF


2

LF


1

EnterAction

Describes what to do when pressing Enter.


Properties

appendText?: string


Describes text to be appended after the new line and after the indentation.



indentAction: IndentAction


Describe what to do with the indentation.



removeText?: number


Describes the number of characters to remove from the new line's indentation.



Event<T>

Represents a typed event.


A function that represents an event to which you subscribe by calling it with
a listener function as argument.



  • sample - item.onDidChange(function(event) { console.log("Event happened: " + event); });


(listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable


A function that represents an event to which you subscribe by calling it with
a listener function as argument.


A function that represents an event to which you subscribe by calling it with
a listener function as argument.











ParameterDescription
listener: (e: T) => any

The listener function will be called when the event happens.


thisArgs?: any

The this-argument which will be used when calling the event listener.


disposables?: Disposable[]

An array to which a disposable will be added.


ReturnsDescription
Disposable

A disposable which unsubscribes the event listener.




EventEmitter<T>

An event emitter can be used to create and manage an event for others
to subscribe to. One emitter always owns one event.


Use this class if you want to provide event from within your extension, for instance
inside a TextDocumentContentProvider or when providing
API to other extensions.


Properties

event: Event<T>


The event listeners can subscribe to.



Methods

dispose(): void


Dispose this object and free resources.







ReturnsDescription
void


fire(data?: T): void


Notify all subscribers of the event. Failure
of one or more listener will not fail this function call.









ParameterDescription
data?: T

The event object.


ReturnsDescription
void


Extension<T>

Represents an extension.


To get an instance of an Extension use getExtension.


Properties

exports: T


The public API exported by this extension. It is an invalid action
to access this field before this extension has been activated.



extensionPath: string


The absolute file path of the directory containing this extension.



id: string


The canonical extension identifier in the form of: publisher.name.



isActive: boolean


true if the extension has been activated.



packageJSON: any


The parsed contents of the extension's package.json.



Methods

activate(): Thenable<T>


Activates this extension and returns its public API.







ReturnsDescription
Thenable<T>

A promise that will resolve when this extension has been activated.




ExtensionContext

An extension context is a collection of utilities private to an
extension.


An instance of an ExtensionContext is provided as the first
parameter to the activate-call of an extension.


Properties

extensionPath: string


The absolute file path of the directory containing the extension.



globalState: Memento


A memento object that stores state independent
of the current opened workspace.



storagePath: string | undefined


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.


Use workspaceState or
globalState to store key value data.



subscriptions: {dispose}[]


An array to which disposables can be added. When this
extension is deactivated the disposables will be disposed.



workspaceState: Memento


A memento object that stores state in the context
of the currently opened workspace.



Methods

asAbsolutePath(relativePath: string): string


Get the absolute path of a resource contained in the extension.









ParameterDescription
relativePath: string

A relative path to a resource contained in the extension.


ReturnsDescription
string

The absolute path of the resource.




FileSystemWatcher

A file system watcher notifies about changes to files and folders
on disk.


To get an instance of a FileSystemWatcher use
createFileSystemWatcher.


Events

onDidChange: Event<Uri>


An event which fires on file/folder change.



onDidCreate: Event<Uri>


An event which fires on file/folder creation.



onDidDelete: Event<Uri>


An event which fires on file/folder deletion.



Static

from(disposableLikes: {dispose: () => any}[]): Disposable


Combine many disposable-likes into one. Use this method
when having objects with a dispose function which are not
instances of Disposable.









ParameterDescription
disposableLikes: {dispose: () => any}[]

Objects that have at least a dispose-function member.


ReturnsDescription
Disposable

Returns a new disposable which, upon dispose, will
dispose all provided disposables.




Constructors

new FileSystemWatcher(callOnDispose: Function): FileSystemWatcher


Creates a new Disposable calling the provided function
on dispose.









ParameterDescription
callOnDispose: Function

Function that disposes something.


ReturnsDescription
FileSystemWatcher


Properties

ignoreChangeEvents: boolean


true if this file system watcher has been created such that
it ignores change file system events.



ignoreCreateEvents: boolean


true if this file system watcher has been created such that
it ignores creation file system events.



ignoreDeleteEvents: boolean


true if this file system watcher has been created such that
it ignores delete file system events.



Methods

dispose(): any


Dispose this object.







ReturnsDescription
any


FormattingOptions

Value-object describing what options formatting should use.


Properties

insertSpaces: boolean


Prefer spaces over tabs.



tabSize: number


Size of a tab in spaces.



Hover

A hover represents additional information for a symbol or word. Hovers are
rendered in a tooltip-like widget.


Constructors

new Hover(contents: MarkedString | MarkedString[], range?: Range): Hover


Creates a new hover object.










ParameterDescription
contents: MarkedString | MarkedString[]

The contents of the hover.


range?: Range

The range to which the hover applies.


ReturnsDescription
Hover


Properties

contents: MarkedString[]


The contents of this hover.



range?: Range


The range to which this hover applies. When missing, the
editor will use the range at the current position or the
current position itself.



HoverProvider

The hover provider interface defines the contract between extensions and
the hover-feature.


Methods

provideHover(document: TextDocument, position: Position, token: CancellationToken): ProviderResult


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.











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

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




ImplementationProvider

The implemenetation provider interface defines the contract between extensions and
the go to implementation feature.


Methods

provideImplementation(document: TextDocument, position: Position, token: CancellationToken): ProviderResult


Provide the implementations of the symbol at the given position and document.











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

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




IndentAction

Describes what to do with the indentation when pressing Enter.


Enumeration members

Indent


1

IndentOutdent


2

None


0

Outdent


3

IndentationRule

Describes indentation rules for a language.


Properties

decreaseIndentPattern: RegExp


If a line matches this pattern, then all the lines after it should be unindendented once (until another rule matches).



increaseIndentPattern: RegExp


If a line matches this pattern, then all the lines after it should be indented once (until another rule matches).



indentNextLinePattern?: RegExp


If a line matches this pattern, then only the next line after it should be indented once.



unIndentedLinePattern?: RegExp


If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules.



InputBoxOptions

Options to configure the behavior of the input box UI.


Properties

ignoreFocusOut?: boolean


Set to true to keep the input box open when focus moves to another part of the editor or to another window.



password?: boolean


Set to true to show a password prompt that will not show the typed value.



placeHolder?: string


An optional string to show as place holder in the input box to guide the user what to type.



prompt?: string


The text to display underneath the input box.



value?: string


The value to prefill in the input box.



valueSelection?: [number, number]


Selection of the prefilled value. Defined as tuple of two number where the
first is the inclusive start index and the second the exclusive end index. When undefined the whole
word will be selected, when empty (start equals end) only the cursor will be set,
otherwise the defined range will be selected.



Methods

validateInput(value: string): string | undefined | null


An optional function that will be called to validate input and to give a hint
to the user.









ParameterDescription
value: string

The current value of the input box.


ReturnsDescription
string | undefined | null

A human readable string which is presented as diagnostic message.
Return undefined, null, or the empty string when 'value' is valid.




LanguageConfiguration

The language configuration interfaces defines the contract between extensions
and various editor features, like automatic bracket insertion, automatic indentation etc.


Properties

___characterPairSupport?: {autoClosingPairs: {close: string, notIn: string[], open: string}[]}


Deprecated Do not use.



  • deprecated - * Use the the autoClosingPairs property in the language configuration file instead.



___electricCharacterSupport?: {brackets: any, docComment: {close: string, lineStart: string, open: string, scope: string}}


Deprecated Do not use.



  • deprecated - Will be replaced by a better API soon.



brackets?: CharacterPair[]


The language's brackets.
This configuration implicitly affects pressing Enter around these brackets.



comments?: CommentRule


The language's comment settings.



indentationRules?: IndentationRule


The language's indentation settings.



onEnterRules?: OnEnterRule[]


The language's rules to be evaluated when pressing Enter.



wordPattern?: RegExp


The language'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):
/(-?\d.\d\w)|([^`~!\@@#\%\^\&*()-\=+[{]}|\;\:\'\"\,.\<>\/\?\s]+)/g



Location

Represents a location inside a resource, such as a line
inside a text file.


Constructors

new Location(uri: Uri, rangeOrPosition: Range | Position): Location


Creates a new location object.










ParameterDescription
uri: Uri

The resource identifier.


rangeOrPosition: Range | Position

The range or position. Positions will be converted to an empty range.


ReturnsDescription
Location


Properties

range: Range


The document range of this locations.



uri: Uri


The resource identifier of this location.



MarkedString

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.


MarkedString: string | {language: string, value: string}

Memento

A memento represents a storage utility. It can store and retrieve
values.


Methods

get<T>(key: string): T | undefined


Return a value.









ParameterDescription
key: string

A string.


ReturnsDescription
T | undefined

The stored value or undefined.




get<T>(key: string, defaultValue: T): T


Return a value.










ParameterDescription
key: string

A string.


defaultValue: T

A value that should be returned when there is no
value (undefined) with the given key.


ReturnsDescription
T

The stored value or the defaultValue.




update(key: string, value: any): Thenable<void>


Store a value. The value must be JSON-stringifyable.










ParameterDescription
key: string

A string.


value: any

A value. MUST not contain cyclic references.


ReturnsDescription
Thenable<void>


MessageItem

Represents an action that is shown with an information, warning, or
error message.





Properties

isCloseAffordance?: boolean


Indicates that this item replaces the default
'Close' action.



title: string


A short title like 'Retry', 'Open Log' etc.



MessageOptions

Options to configure the behavior of the message.





Properties

modal?: boolean


Indicates that this message should be modal.



OnEnterRule

Describes a rule to be evaluated when pressing Enter.


Properties

action: EnterAction


The action to execute.



afterText?: RegExp


This rule will only execute if the text after the cursor matches this regular expression.



beforeText: RegExp


This rule will only execute if the text before the cursor matches this regular expression.



OnTypeFormattingEditProvider

The document formatting provider interface defines the contract between extensions and
the formatting-feature.


Methods

provideOnTypeFormattingEdits(document: TextDocument, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): ProviderResult


Provide formatting edits after a character has been typed.


The given position and character should hint to the provider
what range the position to expand to, like find the matching {
when } has been entered.













ParameterDescription
document: TextDocument

The document in which the command was invoked.


position: Position

The position at which the command was invoked.


ch: string

The character that has been typed.


options: FormattingOptions

Options controlling formatting.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

A set of text edits or a thenable that resolves to such. The lack of a result can be
signaled by returning undefined, null, or an empty array.




OutputChannel

An output channel is a container for readonly textual information.


To get an instance of an OutputChannel use
createOutputChannel.


Properties

name: string


The human-readable name of this output channel.



Methods

append(value: string): void


Append the given value to the channel.









ParameterDescription
value: string

A string, falsy values will not be printed.


ReturnsDescription
void


appendLine(value: string): void


Append the given value and a line feed character
to the channel.









ParameterDescription
value: string

A string, falsy values will be printed.


ReturnsDescription
void


clear(): void


Removes all output from the channel.







ReturnsDescription
void


dispose(): void


Dispose and free associated resources.







ReturnsDescription
void


hide(): void


Hide this channel from the UI.







ReturnsDescription
void


show(preserveFocus?: boolean): void


Reveal this channel in the UI.









ParameterDescription
preserveFocus?: boolean

When true the channel will not take focus.


ReturnsDescription
void


show(column?: ViewColumn, preserveFocus?: boolean): void


Reveal this channel in the UI.



  • deprecated - Use the overload with just one parameter (show(preserveFocus?: boolean): void).










ParameterDescription
column?: ViewColumn

This argument is deprecated and will be ignored.


preserveFocus?: boolean

When true the channel will not take focus.


ReturnsDescription
void


OverviewRulerLane

overview rulerでの装飾の描画用の異なる位置を表します


概要ルーラーは 3 つのレーンに対応しています。


Enumeration members

Center


2

Full


7

Left


1

Right


4

ParameterInformation

呼び出し可能な signature(以下署名) のパラメーターを表します


パラメーターはラベルと doc-comment を持ちます


Constructors

new ParameterInformation(label: string, documentation?: string): ParameterInformation


新しいパラメーター情報オブジェクトを作成します










ParameterDescription
label: string

A label string.


documentation?: string

A doc string.


ReturnsDescription
ParameterInformation


Properties

documentation?: string


この署名の human-readable な doc-comment


UI で表示されますが、省略できます



label: string


この署名のラベル


UI で表示されます



Position

カーソルの位置を行と文字の位置で表します


Position オブジェクトは immutable です。既存の位置から新しい位置を導出するには withtranslate メソッドを使用してください。


Constructors

new Position(line: number, character: number): Position










ParameterDescription
line: number

A zero-based line value.


character: number

A zero-based character value.


ReturnsDescription
Position


Properties

character: number


0 から始まる文字値



line: number


0 から始まる行の値



Methods

compareTo(other: Position): number


これを other と比較









ParameterDescription
other: Position

A position.


ReturnsDescription
number

この位置が指定された位置の前にある場合は 0 より小さい数値。この位置が指定された位置の後ろにある場合は 0 より大きい数値。これと指定した位置が等しい場合は 0 です。




isAfter(other: Position): boolean


この位置の後ろに other があるか確認します









ParameterDescription
other: Position

A position.


ReturnsDescription
boolean

位置が後ろにある場合、または後ろの文字で同じ行にある場合は true




isAfterOrEqual(other: Position): boolean


other がこの位置の後ろか等しいかどうかを確認します









ParameterDescription
other: Position

A position.


ReturnsDescription
boolean

位置が後ろにある場合、または後ろの文字または同じ文字の同じ行にある場合は true




isBefore(other: Position): boolean


この位置の前に other があるか確認します









ParameterDescription
other: Position

A position.


ReturnsDescription
boolean

位置が前にある場合、または前の文字で同じ行にある場合は true




isBeforeOrEqual(other: Position): boolean


other がこの位置の前か等しいかどうかを確認します









ParameterDescription
other: Position

A position.


ReturnsDescription
boolean

位置が前にある場合、または前の文字または同じ文字の同じ行にある場合は true




isEqual(other: Position): boolean


other がこの位置に等しいか確認します









ParameterDescription
other: Position

A position.


ReturnsDescription
boolean

指定された位置の行と文字がこの位置の行と文字と等しい場合は true




translate(lineDelta?: number, characterDelta?: number): Position


この位置に相対的な新しい位置を作成します










ParameterDescription
lineDelta?: number

Delta value for the line value, default is 0.


characterDelta?: number

Delta value for the character value, default is 0.


ReturnsDescription
Position

行と文字の位置は、現在の行と文字と対応するデルタの合計です




translate(change: {characterDelta: number, lineDelta: number}): Position


この位置と相対的な新しい位置を派生します









ParameterDescription
change: {characterDelta: number, lineDelta: number}

An object that describes a delta to this position.


ReturnsDescription
Position

指定されたデルタを反映する位置。その変更が何も変更しない場合 this(この) の位置に戻ります。




with(line?: number, character?: number): Position


このポジションから派生した新しいポジションを作成します










ParameterDescription
line?: number

Value that should be used as line value, default is the existing value


character?: number

Value that should be used as character value, default is the existing value


ReturnsDescription
Position

行と文字が指定された値で置き換えられた位置




with(change: {character: number, line: number}): Position


この位置から新しい位置を派生します









ParameterDescription
change: {character: number, line: number}

An object that describes a change to this position.


ReturnsDescription
Position

指定した変更を反映する位置。その変更が何も変更しない場合 this(この) の位置に戻ります。




ProcessExecution

The execution of a task happens as an external process
without shell interaction.


Constructors

new ProcessExecution(process: string, options?: ProcessExecutionOptions): ProcessExecution


Creates a process execution.










ParameterDescription
process: string

The process to start.


options?: ProcessExecutionOptions

Optional options for the started process.


ReturnsDescription
ProcessExecution


new ProcessExecution(process: string, args: string[], options?: ProcessExecutionOptions): ProcessExecution


Creates a process execution.











ParameterDescription
process: string

The process to start.


args: string[]

Arguments to be passed to the process.


options?: ProcessExecutionOptions

Optional options for the started process.


ReturnsDescription
ProcessExecution


Properties

args: string[]


The arguments passed to the process. Defaults to an empty array.



options?: ProcessExecutionOptions


The process options used when the process is executed.
Defaults to undefined.



process: string


The process to be executed.



ProcessExecutionOptions

Options for a process execution


Properties

cwd?: string


The current working directory of the executed program or shell.
If omitted the tools current workspace root is used.



env?:


The additional environment of the executed program or shell. If omitted
the parent process' environment is used. If provided it is merged with
the parent process' environment.



Progress<T>

Defines a generalized way of reporting progress updates.


Methods

report(value: T): void


Report a progress update.









ParameterDescription
value: T

A progress item, like a message or an updated percentage value


ReturnsDescription
void


ProgressLocation

A location in the editor at which progress information can be shown. It depends on the
location how progress is visually represented.


Enumeration members

SourceControl


1

Window


10

ProgressOptions

Value-object describing where and how progress should show.


Properties

location: ProgressLocation


The location at which progress should show.



title?: string


A human-readable string which will be used to describe the
operation.



ProviderResult

A provider result represents the values a provider, like the HoverProvider,
may return. For once this is the actual result type T, like Hover, or a thenable that resolves
to that type T. In addition, null and undefined can be returned - either directly or from a
thenable.


The snippets below are all valid implementions of the HoverProvider:



let a: HoverProvider = {
provideHover(doc, pos, token): ProviderResult<Hover> {
return new Hover(‘Hello World’);
}
}

let b: HoverProvider = {
provideHover(doc, pos, token): ProviderResult<Hover> {
return new Promise(resolve => {
resolve(new Hover(‘Hello World’));
});
}
}

let c: HoverProvider = {
provideHover(doc, pos, token): ProviderResult<Hover> {
return; // undefined
}
}

ProviderResult: T | undefined | null | Thenable<T | undefined | null>

QuickDiffProvider

Methods

provideOriginalResource(uri: Uri, token: CancellationToken): ProviderResult


Provide a uri to the original resource of any given resource uri.










ParameterDescription
uri: Uri

The uri of the resource open in a text editor.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

A thenable that resolves to uri of the matching original resource.




QuickPickItem

Represents an item that can be selected from
a list of items.


Properties

description: string


A human readable string which is rendered less prominent.



detail?: string


A human readable string which is rendered less prominent.



label: string


A human readable string which is rendered prominent.



QuickPickOptions

Options to configure the behavior of the quick pick UI.


Events

onDidSelectItem(item: QuickPickItem | string): any


An optional function that is invoked whenever an item is selected.









ParameterDescription
item: QuickPickItem | string
ReturnsDescription
any


Properties

ignoreFocusOut?: boolean


Set to true to keep the picker open when focus moves to another part of the editor or to another window.



matchOnDescription?: boolean


An optional flag to include the description when filtering the picks.



matchOnDetail?: boolean


An optional flag to include the detail when filtering the picks.



placeHolder?: string


An optional string to show as place holder in the input box to guide the user what to pick on.



Range

範囲は順序付けられた 2 つの位置のペアで表します


これは start.isBeforeOrEqual(end) が補償されるということです。


Range オブジェクトは immutable です。既存の範囲から新しい範囲を導出するには、withwithunion メソッドを使用してください。


Constructors

new Range(start: Position, end: Position): Range


2 つの位置から新しい範囲を作成します


startend の前になければ値は入れ替えられます。










ParameterDescription
start: Position

A position.


end: Position

A position.


ReturnsDescription
Range


new Range(startLine: number, startCharacter: number, endLine: number, endCharacter: number): Range


数値座標から新しい範囲を作成します


これは new Range(new Position(startLine, startCharacter), new Position(endLine, endCharacter)) を使用することと同じです。












ParameterDescription
startLine: number

A zero-based line value.


startCharacter: number

A zero-based character value.


endLine: number

A zero-based line value.


endCharacter: number

A zero-based character value.


ReturnsDescription
Range


Properties

end: Position


終了位置。これは start と同じかそれより後ろです。



isEmpty: boolean


startend が等しい場合は true を返します



isSingleLine: boolean


start.lineend.line が等しい場合は true を返します



start: Position


開始位置。これは end と同じかそれより前です。



Methods

contains(positionOrRange: Position | Range): boolean


この範囲に位置もしくは範囲が含まれているかどうかを確認します









ParameterDescription
positionOrRange: Position | Range

A position or a range.


ReturnsDescription
boolean

位置または範囲が指定した範囲の中またはそれに等しい場合は true を返します
to this range.




intersection(range: Range): Range | undefined


この範囲で range をインターセクトして、範囲に重複がない場合は、新しい範囲または undefined を返します









ParameterDescription
range: Range

A range.


ReturnsDescription
Range | undefined

その後ろの開始位置とその前の終了位置の範囲。
重複がない場合は未定義に戻ります。




isEqual(other: Range): boolean


other がこの範囲に等しいかどうかを確認します









ParameterDescription
other: Range

A range.


ReturnsDescription
boolean

指定した範囲の開始と終了には、開始と終了がequalとき true になります




union(other: Range): Range


この範囲で other のユニオンを計算します









ParameterDescription
other: Range

A range.


ReturnsDescription
Range

その前の開始位置とその後ろの終了位置の範囲。




with(start?: Position, end?: Position): Range


この範囲から新しい範囲を派生します










ParameterDescription
start?: Position

A position that should be used as start. The default value is the current start.


end?: Position

A position that should be used as end. The default value is the current end.


ReturnsDescription
Range

指定された開始位置と終了位置で範囲から派生した範囲。
開始と終了が一緒の場合は this (こ) の範囲が返されます。




with(change: {end: Position, start: Position}): Range


この範囲から新しい範囲を派生します









ParameterDescription
change: {end: Position, start: Position}

An object that describes a change to this range.


ReturnsDescription
Range

指定された変更を反映する範囲。その変更が何も変更しない場合 this(こ) の範囲に戻ります。




ReferenceContext

Value-object that contains additional information when
requesting references.


Properties

includeDeclaration: boolean


Include the declaration of the current symbol.



ReferenceProvider

The reference provider interface defines the contract between extensions and
the find references-feature.


Methods

provideReferences(document: TextDocument, position: Position, context: ReferenceContext, token: CancellationToken): ProviderResult


Provide a set of project-wide references for the given position and document.












ParameterDescription
document: TextDocument

The document in which the command was invoked.


position: Position

The position at which the command was invoked.


context: ReferenceContext
token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

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




RenameProvider

The rename provider interface defines the contract between extensions and
the rename-feature.


Methods

provideRenameEdits(document: TextDocument, position: Position, newName: string, token: CancellationToken): ProviderResult


Provide an edit that describes changes that have to be made to one
or many resources to rename a symbol to a different name.












ParameterDescription
document: TextDocument

The document in which the command was invoked.


position: Position

The position at which the command was invoked.


newName: string

The new name of the symbol. If the given name is not valid, the provider must return a rejected promise.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

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




Selection

エディター内のテキスト選択範囲を表します


Constructors

new Selection(anchor: Position, active: Position): Selection


2 つの位置から選択範囲を作成します










ParameterDescription
anchor: Position

A position.


active: Position

A position.


ReturnsDescription
Selection


new Selection(anchorLine: number, anchorCharacter: number, activeLine: number, activeCharacter: number): Selection


4 つの座標から選択範囲を作成します












ParameterDescription
anchorLine: number

A zero-based line value.


anchorCharacter: number

A zero-based character value.


activeLine: number

A zero-based line value.


activeCharacter: number

A zero-based character value.


ReturnsDescription
Selection


Properties

active: Position


カーソルの位置


この位置は anchor の前後にある必要があります。



anchor: Position


選択範囲が始まる範囲の位置


この位置は active の前後にある必要があります。



end: Position


終了位置。これは start と同じかそれより後ろです。



isEmpty: boolean


startend が等しい場合は true を返します



isReversed: boolean


active.isBefore(anchor) の場合選択範囲が逆になります



isSingleLine: boolean


start.lineend.line が等しい場合は true を返します



start: Position


開始位置。これは end と同じかそれより前です。



Methods

contains(positionOrRange: Position | Range): boolean


この範囲に位置もしくは範囲が含まれているかどうかを確認します









ParameterDescription
positionOrRange: Position | Range

A position or a range.


ReturnsDescription
boolean

位置または範囲が指定した範囲の中またはそれに等しい場合は true を返します
to this range.




intersection(range: Range): Range | undefined


この範囲で range をインターセクトして、範囲に重複がない場合は、新しい範囲または undefined を返します









ParameterDescription
range: Range

A range.


ReturnsDescription
Range | undefined

その後ろの開始位置とその前の終了位置の範囲。
重複がない場合は未定義に戻ります。




isEqual(other: Range): boolean


other がこの範囲に等しいかどうかを確認します









ParameterDescription
other: Range

A range.


ReturnsDescription
boolean

指定した範囲の開始と終了には、開始と終了がequalとき true になります




union(other: Range): Range


この範囲で other のユニオンを計算します









ParameterDescription
other: Range

A range.


ReturnsDescription
Range

その前の開始位置とその後ろの終了位置の範囲。




with(start?: Position, end?: Position): Range


この範囲から新しい範囲を派生します










ParameterDescription
start?: Position

A position that should be used as start. The default value is the current start.


end?: Position

A position that should be used as end. The default value is the current end.


ReturnsDescription
Range

指定された開始位置と終了位置で範囲から派生した範囲。
開始と終了が一緒の場合は this (こ) の範囲が返されます。




with(change: {end: Position, start: Position}): Range


この範囲から新しい範囲を派生します









ParameterDescription
change: {end: Position, start: Position}

An object that describes a change to this range.


ReturnsDescription
Range

指定された変更を反映する範囲。その変更が何も変更しない場合 this(こ) の範囲に戻ります。




ShellExecution

Constructors

new ShellExecution(commandLine: string, options?: ShellExecutionOptions): ShellExecution


Creates a process execution.










ParameterDescription
commandLine: string

The command line to execute.


options?: ShellExecutionOptions

Optional options for the started the shell.


ReturnsDescription
ShellExecution


Properties

commandLine: string


The shell command line



options?: ShellExecutionOptions


The shell options used when the command line is executed in a shell.
Defaults to undefined.



ShellExecutionOptions

Options for a shell execution


Properties

cwd?: string


The current working directory of the executed shell.
If omitted the tools current workspace root is used.



env?:


The additional environment of the executed shell. If omitted
the parent process' environment is used. If provided it is merged with
the parent process' environment.



executable?: string


The shell executable.



shellArgs?: string[]


The arguments to be passed to the shell executable used to run the task.



SignatureHelp

呼び出し可能な署名を表します


複数の署名にすることができますが、アクティブなものは一つでアクティブなパラメーターは一つです。


Properties

activeParameter: number


アクティな署名のアクティブ パラメーター



activeSignature: number


アクティブな署名



signatures: SignatureInformation[]


1 つ以上の署名



SignatureHelpProvider

signature help provider interface は拡張機能と parameter hints-機能の間のコントラクトを定義します


Methods

provideSignatureHelp(document: TextDocument, position: Position, token: CancellationToken): ProviderResult


指定する位置とドキュメントで署名のヘルプを提供します











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

Signature help or a thenable that resolves to such. The lack of a result can be
signaled by returning undefined or null.




SignatureInformation

呼び出し可能な署名を表します


署名は関数名、doc-comment及びパラメーターのようなラベルを付けることができます


Constructors

new SignatureInformation(label: string, documentation?: string): SignatureInformation


新しい署名情報オブジェクトを作成します










ParameterDescription
label: string

A label string.


documentation?: string

A doc string.


ReturnsDescription
SignatureInformation


Properties

documentation?: string


この署名の human-readable な doc-comment


UI で表示されますが、省略できます



label: string


この署名のラベル


UI で表示されます



parameters: ParameterInformation[]


この署名のパラメーター



SnippetString

A snippet string is a template which allows to insert text
and to control the editor cursor when insertion happens.


A snippet can define tab stops and placeholders with $1, $2
and ${3:foo}. $0 defines the final tab stop, it defaults to
the end of the snippet. Variables are defined with $name and
${name:default value}. The full snippet syntax is documented
here.


Constructors

new SnippetString(value?: string): SnippetString









ParameterDescription
value?: string
ReturnsDescription
SnippetString


Properties

value: string


The snippet string.



Methods

appendPlaceholder(value: string | (snippet: SnippetString) => any, number?: number): SnippetString


Builder-function that appends a placeholder (${1:value}) to
the value of this snippet string.










ParameterDescription
value: string | (snippet: SnippetString) => any

The value of this placeholder - either a string or a function
with which a nested snippet can be created.


number?: number

The number of this tabstop, defaults to an auto-incremet
value starting at 1.


ReturnsDescription
SnippetString

This snippet string.




appendTabstop(number?: number): SnippetString


Builder-function that appends a tabstop ($1, $2 etc) to
the value of this snippet string.









ParameterDescription
number?: number

The number of this tabstop, defaults to an auto-incremet
value starting at 1.


ReturnsDescription
SnippetString

This snippet string.




appendText(string: string): SnippetString


Builder-function that appends the given string to
the value of this snippet string.









ParameterDescription
string: string

A value to append 'as given'. The string will be escaped.


ReturnsDescription
SnippetString

This snippet string.




appendVariable(name: string, defaultValue: string | (snippet: SnippetString) => any): SnippetString


Builder-function that appends a variable (${VAR}) to
the value of this snippet string.










ParameterDescription
name: string

The name of the variable - excluding the $.


defaultValue: string | (snippet: SnippetString) => any

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.


ReturnsDescription
SnippetString

This snippet string.




SourceControl

An source control is able to provide resource states
to the editor and interact with the editor in several source control related ways.


Properties

acceptInputCommand?: Command


Optional accept input command.


This command will be invoked when the user accepts the value
in the Source Control input.



commitTemplate?: string


Optional commit template string.


The Source Control viewlet will populate the Source Control
input with this value when appropriate.



count?: number


The UI-visible count of resource states of
this source control.


Equals to the total number of resource state
of this source control, if undefined.



id: string


The id of this source control.



label: string


The human-readable label of this source control.



quickDiffProvider?: QuickDiffProvider


An optional quick diff provider.



statusBarCommands?: Command[]


Optional status bar commands.


These commands will be displayed in the editor's status bar.



Methods

createResourceGroup(id: string, label: string): SourceControlResourceGroup


Create a new resource group.










ParameterDescription
id: string
label: string
ReturnsDescription
SourceControlResourceGroup


dispose(): void


Dispose this source control.







ReturnsDescription
void


SourceControlInputBox

Represents the input box in the Source Control viewlet.


Properties

value: string


Setter and getter for the contents of the input box.



SourceControlResourceDecorations

The decorations for a source control resource state.
Can be independently specified for light and dark themes.


Properties

dark?: SourceControlResourceThemableDecorations


The dark theme decorations.



faded?: boolean


Whether the source control resource state should
be faded in the UI.



iconPath?: string | Uri


The icon path for a specific
source control resource state.



light?: SourceControlResourceThemableDecorations


The light theme decorations.



strikeThrough?: boolean


Whether the source control resource state should
be striked-through in the UI.



SourceControlResourceGroup

A source control resource group is a collection of
source control resource states.


Properties

hideWhenEmpty?: boolean


Whether this source control resource group is hidden when it contains
no source control resource states.



id: string


The id of this source control resource group.



label: string


The label of this source control resource group.



resourceStates: SourceControlResourceState[]


This group's collection of
source control resource states.



Methods

dispose(): void


Dispose this source control resource group.







ReturnsDescription
void


SourceControlResourceState

An source control resource state represents the state of an underlying workspace
resource within a certain source control group.


Properties

command?: Command


The command which should be run when the resource
state is open in the Source Control viewlet.



decorations?: SourceControlResourceDecorations


The decorations for this source control
resource state.



resourceUri: Uri


The uri of the underlying resource inside the workspace.



SourceControlResourceThemableDecorations

The theme-aware decorations for a
source control resource state.


Properties

iconPath?: string | Uri


The icon path for a specific
source control resource state.



StatusBarAlignment

Represents the alignment of status bar items.


Enumeration members

Left


1

Right


2

StatusBarItem

A status bar item is a status bar contribution that can
show text and icons and run a command on click.


Properties

alignment: StatusBarAlignment


The alignment of this item.



color: string | ThemeColor | undefined


The foreground color for this entry.



command: string | undefined


The identifier of a command to run on click. The command must be
known.



priority: number


The priority of this item. Higher value means the item should
be shown more to the left.



text: string


The text to show for the entry. You can embed icons in the text by leveraging the syntax:


My text $(icon-name) contains icons like $(icon'name) this one.


Where the icon-name is taken from the octicon icon set, e.g.
light-bulb, thumbsup, zap etc.



tooltip: string | undefined


The tooltip text when you hover over this entry.



Methods

dispose(): void


Dispose and free associated resources. Call
hide.







ReturnsDescription
void


hide(): void


Hide the entry in the status bar.







ReturnsDescription
void


show(): void


Shows the entry in the status bar.







ReturnsDescription
void


SymbolInformation

変数、クラス、interface などのプログラミング構造に関する情報を表します


Constructors

new SymbolInformation(name: string, kind: SymbolKind, containerName: string, location: Location): SymbolInformation


新しいシンボル情報のオブジェクトを作成します












ParameterDescription
name: string

The name of the symbol.


kind: SymbolKind

The kind of the symbol.


containerName: string

The name of the symbol containing the symbol.


location: Location

The the location of the symbol.


ReturnsDescription
SymbolInformation


new SymbolInformation(name: string, kind: SymbolKind, range: Range, uri?: Uri, containerName?: string): SymbolInformation


新しいシンボル情報のオブジェクトを作成します~~



  • deprecated - location オブジェクトを使用するコンストラクタを使用してください













ParameterDescription
name: string

The name of the symbol.


kind: SymbolKind

The kind of the symbol.


range: Range

The range of the location of the symbol.


uri?: Uri

The resource of the location of symbol, defaults to the current document.


containerName?: string

The name of the symbol containing the symbol.


ReturnsDescription
SymbolInformation


Properties

containerName: string


このシンボルを含むシンボルの名前



kind: SymbolKind


このシンボルの種類



location: Location


このシンボルの位置



name: string


このシンボルの名前



SymbolKind

シンボルの種類


Enumeration members

Array


17

Boolean


16

Class


4

Constant


13

Constructor


8

Enum


9

EnumMember


21

Event


23

Field


7

File


0

Function


11

Interface


10

Key


19

Method


5

Module


1

Namespace


2

Null


20

Number


15

Object


18

Operator


24

Package


3

Property


6

String


14

Struct


22

TypeParameter


25

Variable


12

Task

A task to execute


Constructors

new Task(taskDefinition: TaskDefinition, name: string, source: string, execution?: ProcessExecution | ShellExecution, problemMatchers?: string | string[]): Task


Creates a new task.













ParameterDescription
taskDefinition: TaskDefinition
name: string

The task's name. Is presented in the user interface.


source: string

The task's source (e.g. 'gulp', 'npm', …). Is presented in the user interface.


execution?: ProcessExecution | ShellExecution

The process or shell execution.


problemMatchers?: string | string[]

the names of problem matchers to use, like '$tsc'
or '$eslint'. Problem matchers can be contributed by an extension using
the problemMatchers extension point.


ReturnsDescription
Task


Properties

definition: TaskDefinition


The task's definition.



execution: ProcessExecution | ShellExecution


The task's execution engine



group?: TaskGroup


The task group this tasks belongs to. See TaskGroup
for a predefined set of available groups.
Defaults to undefined meaning that the task doesn't
belong to any special group.



isBackground: boolean


Whether the task is a background task or not.



name: string


The task's name



presentationOptions: TaskPresentationOptions


The presentation options. Defaults to an empty literal.



problemMatchers: string[]


The problem matchers attached to the task. Defaults to an empty
array.



source: string


A human-readable string describing the source of this
shell task, e.g. 'gulp' or 'npm'.



TaskDefinition

A structure that defines a task kind in the system.
The value must be JSON-stringifyable.


Properties

type: string


The task definition descibing 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 'taskDefinitions' extension point. The npm
task definition for example looks like this



interface NpmTaskDefinition extends TaskDefinition {
script: string;
}


TaskGroup

A grouping for tasks. The editor by default supports the
'Clean', 'Build', 'RebuildAll' and 'Test' group.


Static

Build: TaskGroup


The build task group;



Clean: TaskGroup


The clean task group;



Rebuild: TaskGroup


The rebuild all task group;



Test: TaskGroup


The test all task group;



Constructors

new TaskGroup(id: string, label: string): TaskGroup










ParameterDescription
id: string
label: string
ReturnsDescription
TaskGroup


TaskPanelKind

Controls how the task channel is used between tasks


Enumeration members

Dedicated


2

New


3

Shared


1

TaskPresentationOptions

Controls how the task is presented in the UI.


Properties

echo?: boolean


Controls whether the command associated with the task is echoed
in the user interface.



focus?: boolean


Controls whether the panel showing the task output is taking focus.



panel?: TaskPanelKind


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 TaskInstanceKind.Shared



reveal?: TaskRevealKind


Controls whether the task output is reveal in the user interface.
Defaults to RevealKind.Always.



TaskProvider

A task provider allows to add tasks to the task service.
A task provider is registerd via #workspace.registerTaskProvider.


Methods

provideTasks(token?: CancellationToken): ProviderResult


Provides tasks.









ParameterDescription
token?: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

an array of tasks




resolveTask(task: Task, token?: CancellationToken): ProviderResult


Resolves a task that has no execution set. Tasks are
often created from information found in the task.json-file. Such tasks miss
the information on how to execute them and a task provider must fill in
the missing information in the resolveTask-method.










ParameterDescription
task: Task

The task to resolve.


token?: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

The resolved task




TaskRevealKind

Controls the behaviour of the terminal's visibility.


Enumeration members

Always


1

Never


3

Silent


2

Terminal

An individual terminal instance within the integrated terminal.


Properties

name: string


The name of the terminal.



processId: Thenable<number>


The process ID of the shell process.



Methods

dispose(): void


Dispose and free associated resources.







ReturnsDescription
void


hide(): void


Hide the terminal panel if this terminal is currently showing.







ReturnsDescription
void


sendText(text: string, addNewLine?: boolean): void


Send text to the terminal. The text is written to the stdin of the underlying pty process
(shell) of the terminal.










ParameterDescription
text: string

The text to send.


addNewLine?: boolean

Whether to add a new line to the text being sent, this is normally
required to run a command in the terminal. The character(s) added are \n or \r\n
depending on the platform. This defaults to true.


ReturnsDescription
void


show(preserveFocus?: boolean): void


Show the terminal panel and reveal this terminal in the UI.









ParameterDescription
preserveFocus?: boolean

When true the terminal will not take focus.


ReturnsDescription
void


TerminalOptions

Value-object describing what options a terminal should use.


Properties

name?: string


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



shellArgs?: string[]


Args for the custom shell executable, this does not work on Windows (see #8429)



shellPath?: string


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



TextDocument

ソース ファイルなどのテキスト ドキュメントを表します


テキスト ドキュメントは lines とファイルのような元となるリソースに関する情報を持っています。


Properties

eol: EndOfLine


このドキュメントで主に使用されている end of line シークエンス



fileName: string


関連リソースのファイル システム パス


略記法 TextDocument.uri.fsPath。Uri のスキームとは独立しています。



isClosed: boolean


ドキュメントが閉じられている場合は true です


閉じたドキュメントは同期されず、同じリソースが再度開かれたとき再利用されません。



isDirty: boolean


無修正の変更がある場合は true です



isUntitled: boolean


このドキュメントが無題のファイルかどうか



languageId: string


このドキュメントに関連する言語の識別子



lineCount: number


このドキュメント内で行の番号



uri: Uri


このドキュメントに関連する URL


ほとんどのドキュメントは file スキームをもち、ディスク上のファイルを表します。


ただし、ドキュメントによってはディスク上で利用できないことを表すのスキームを持つことがあります。



version: number


このドキュメントのバージョン番号


取り消し/やり直しを含む各変更後に、厳密に増加します。



Methods

getText(range?: Range): string


このドキュメントのテキストを取得します


範囲を指定すると文字列の一部を取得できます。範囲は adjusted されます。









ParameterDescription
range?: Range

Include only the text included by the range.


ReturnsDescription
string

指定された範囲内のテキストまたはテキスト全体




getWordRangeAtPosition(position: Position, regex?: RegExp): Range | undefined


与えられた位置で単語の範囲を取得します


既定で単語は、 space, -, _, etc などのような区切り文字で定義されます。
さらに、言語ごとにカスタムな word definitions を定義できます。
これにはカスタムな正規表現を提供することも可能です。



  • Note 1: カスタム正規表現は、空の文字列と一致してはいけません。一致した場合は無視されます。



  • Note 2: カスタムの正規表現は複数行の文字列に一致せず、speed の名前で正規表現は単語をスペースに一致させるべきではありません。


より複雑で、単語性でない場合は TextLine.text を使用してください。


position は adjusted されます。










ParameterDescription
position: Position

A position.


regex?: RegExp

Optional regular expression that describes what a word is.


ReturnsDescription
Range | undefined

単語にまたがる範囲またはundefined




lineAt(line: number): TextLine


行番号を意味するテキスト行を返します


返されるオブジェクトは live ではありません、ドキュメントへの変更は反映されないことに注意してください。









ParameterDescription
line: number

A line number [0, lineCount]


ReturnsDescription
TextLine

(#TextLine)




lineAt(position: Position): TextLine


position を示すテキスト行を返します


返されるオブジェクトは live ではありません、ドキュメントへの変更は反映されないことに注意してください。


position は adjusted されます。










ParameterDescription
position: Position

A position.


ReturnsDescription
TextLine

(#TextLine)




offsetAt(position: Position): number


positionを zero-based offset に変換します


position は adjusted されます。









ParameterDescription
position: Position

A position.


ReturnsDescription
number

有効な zero-based offset




positionAt(offset: number): Position


zero-based offset を position に変換します









ParameterDescription
offset: number

A zero-based offset.


ReturnsDescription
Position

有効な position




save(): Thenable<boolean>


元となるファイルを保存します







ReturnsDescription
Thenable<boolean>

(promise)ファイルが保存されたとき true に解決されます。
ファイルがダーティーでないか保存に失敗したときは false が返ります。




validatePosition(position: Position): Position


このドキュメントの範囲内に、position が含まれていることを確認します









ParameterDescription
position: Position

A position.


ReturnsDescription
Position

指定された位置または新しい調整された位置




validateRange(range: Range): Range


このドキュメントに range が完全に含まれていることを確認します









ParameterDescription
range: Range

A range.


ReturnsDescription
Range

指定された範囲または新しい調整済み範囲




TextDocumentChangeEvent

An event describing a transactional document change.


Properties

contentChanges: TextDocumentContentChangeEvent[]


An array of content changes.



document: TextDocument


The affected document.



TextDocumentContentChangeEvent

An event describing an individual change in the text of a document.


Properties

range: Range


The range that got replaced.



rangeLength: number


The length of the range that got replaced.



text: string


The new text for the range.



TextDocumentContentProvider

A text document content provider allows to add readonly documents
to the editor, such as source from a dll or generated html from md.


Content providers are registered
for a uri-scheme. When a uri with that scheme is to
be loaded the content provider is
asked.


Events

onDidChange?: Event<Uri>


An event to signal a resource has changed.



Methods

provideTextDocumentContent(uri: Uri, token: CancellationToken): ProviderResult


Provide textual content for a given uri.


The editor will use the returned string-content to create a readonly
document. Resources allocated should be released when
the corresponding document has been closed.










ParameterDescription
uri: Uri

An uri which scheme matches the scheme this provider was registered for.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

A string or a thenable that resolves to such.




TextDocumentSaveReason

Represents reasons why a text document is saved.


Enumeration members

AfterDelay


2

FocusOut


3

Manual


1

TextDocumentShowOptions

documenteditor に表示する動作を構成するオプションを表します


Properties

preserveFocus?: boolean


オプション フラグ。 true を指定するとき、editor はフォーカスをとりません。



preview?: boolean


オプション フラグ。 editor-tab を次のエディターに置き換えるかどうかまたはそれを保持するかどうか。



selection?: Range


editor のドキュメントを適応するオプションの選択範囲。



viewColumn?: ViewColumn


オプションのビュー列で、editor を表示します


既定値は one で、他の値は Min(column, columnCount + 1) に調整されます。



TextDocumentWillSaveEvent

An event that is fired when a document will be saved.


To make modifications to the document before it is being saved, call the
waitUntil-function with a thenable
that resolves to an array of text edits.


Properties

document: TextDocument


The document that will be saved.



reason: TextDocumentSaveReason


The reason why save was triggered.



Methods

waitUntil(thenable: Thenable<TextEdit[]>): void


Allows to pause the event loop and to apply pre-save-edits.
Edits of subsequent calls to this function will be applied in order. The
edits will be ignored if concurrent modifications of the document happened.


Note: This function can only be called during event dispatch and not
in an asynchronous manner:



workspace.onWillSaveTextDocument(event => {
// async, will throw an error
setTimeout(() => event.waitUntil(promise));

// sync, OK
event.waitUntil(promise);
})








ParameterDescription
thenable: Thenable<TextEdit[]>

A thenable that resolves to pre-save-edits.


ReturnsDescription
void


waitUntil(thenable: Thenable<any>): void


Allows to pause the event loop until the provided thenable resolved.


Note: This function can only be called during event dispatch.









ParameterDescription
thenable: Thenable<any>

A thenable that delays saving.


ReturnsDescription
void


TextEdit

A text edit represents edits that should be applied
to a document.


Static

delete(range: Range): TextEdit


Utility to create a delete edit.









ParameterDescription
range: Range

A range.


ReturnsDescription
TextEdit

A new text edit object.




insert(position: Position, newText: string): TextEdit


Utility to create an insert edit.










ParameterDescription
position: Position

A position, will become an empty range.


newText: string

A string.


ReturnsDescription
TextEdit

A new text edit object.




replace(range: Range, newText: string): TextEdit


Utility to create a replace edit.










ParameterDescription
range: Range

A range.


newText: string

A string.


ReturnsDescription
TextEdit

A new text edit object.




setEndOfLine(eol: EndOfLine): TextEdit


Utility to create an eol-edit.









ParameterDescription
eol: EndOfLine

An eol-sequence


ReturnsDescription
TextEdit

A new text edit object.




Constructors

new TextEdit(range: Range, newText: string): TextEdit


Create a new TextEdit.










ParameterDescription
range: Range

A range.


newText: string

A string.


ReturnsDescription
TextEdit


Properties

newEol: EndOfLine


The eol-sequence used in the document.


Note that the eol-sequence will be applied to the
whole document.



newText: string


The string this edit will insert.



range: Range


The range this edit applies to.



TextEditor

Represents an editor that is attached to a document.


Properties

document: TextDocument


The document associated with this text editor. The document will be the same for the entire lifetime of this text editor.



options: TextEditorOptions


Text editor options.



selection: Selection


The primary selection on this text editor. Shorthand for TextEditor.selections[0].



selections: Selection[]


The selections in this text editor. The primary selection is always at index 0.



viewColumn?: ViewColumn


The column in which this editor shows. Will be undefined in case this
isn't one of the three main editors, e.g an embedded editor.



Methods

edit(callback: (editBuilder: TextEditorEdit) => void, options?: {undoStopAfter: boolean, undoStopBefore: boolean}): Thenable<boolean>


Perform an edit on the document associated with this text editor.


The given callback-function is invoked with an edit-builder which must
be used to make edits. Note that the edit-builder is only valid while the
callback executes.










ParameterDescription
callback: (editBuilder: TextEditorEdit) => void

A function which can create edits using an edit-builder.


options?: {undoStopAfter: boolean, undoStopBefore: boolean}

The undo/redo behavior around this edit. By default, undo stops will be created before and after this edit.


ReturnsDescription
Thenable<boolean>

A promise that resolves with a value indicating if the edits could be applied.




hide(): void


Hide the text editor.



  • deprecated - Use the command workbench.action.closeActiveEditor instead.
    This method shows unexpected behavior and will be removed in the next major update.







ReturnsDescription
void


insertSnippet(snippet: SnippetString, location?: Position | Range | Position[] | Range[], options?: {undoStopAfter: boolean, undoStopBefore: boolean}): Thenable<boolean>


Insert a snippet and put the editor into snippet mode. "Snippet mode"
means the editor adds placeholders and additionals cursors so that the user can complete
or accept the snippet.











ParameterDescription
snippet: SnippetString

The snippet to insert in this edit.


location?: Position | Range | Position[] | Range[]

Position or range at which to insert the snippet, defaults to the current editor selection or selections.


options?: {undoStopAfter: boolean, undoStopBefore: boolean}

The undo/redo behavior around this edit. By default, undo stops will be created before and after this edit.


ReturnsDescription
Thenable<boolean>

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.




revealRange(range: Range, revealType?: TextEditorRevealType): void


Scroll as indicated by revealType in order to reveal the given range.










ParameterDescription
range: Range

A range.


revealType?: TextEditorRevealType

The scrolling strategy for revealing range.


ReturnsDescription
void


setDecorations(decorationType: TextEditorDecorationType, rangesOrOptions: Range[] | DecorationOptions[]): void


Adds a set of decorations to the text editor. If a set of decorations already exists with
the given decoration type, they will be replaced.











ParameterDescription
decorationType: TextEditorDecorationType

A decoration type.


rangesOrOptions: Range[] | DecorationOptions[]

Either ranges or more detailed options.


ReturnsDescription
void


show(column?: ViewColumn): void


Show the text editor.










ParameterDescription
column?: ViewColumn

The column in which to show this editor.
instead. This method shows unexpected behavior and will be removed in the next major update.


ReturnsDescription
void


TextEditorCursorStyle

カーソルの描画スタイル


Enumeration members

Block


2

BlockOutline


5

Line


1

LineThin


4

Underline


3

UnderlineThin


6

TextEditorDecorationType

text editor で同じ styling options を共有する装飾のハンドルを表します


TextEditorDecorationType のインスタンスを取得するには createTextEditorDecorationType を使用してください。


Properties

key: string


ハンドルの内部表現



Methods

dispose(): void


この装飾タイプとそれを使用するテキスト エディターのすべての装飾を削除します。







ReturnsDescription
void


TextEditorEdit

TextEditor で 1 つのトランザクションに適用する複雑な編集


これは編集の内容を保持し、編集が有効な場合(領域が重複していない、文書が変更されていないなど)、これらは text editor に関連付けられた text editor に適応されます。


Methods

delete(location: Range | Selection): void


特定のテキスト範囲を削除します









ParameterDescription
location: Range | Selection

The range this operation should remove.


ReturnsDescription
void


insert(location: Position, value: string): void


指定する場所にテキストを挿入します
value には \r\n か \n を使用することができ、これらは現在の document に正規化されます。


insert はことなる選択範囲を作成します(移動させることができる)。同等のテキスト編集は replace で行うことができます。










ParameterDescription
location: Position

The position where the new text should be inserted.


value: string

The new text this operation should insert.


ReturnsDescription
void


replace(location: Position | Range | Selection, value: string): void


特定のテキスト領域を新しい値に置き換えます


value には \r\n か \n を使用することができ、これらは現在の document に正規化されます。










ParameterDescription
location: Position | Range | Selection

The range this operation should remove.


value: string

The new text this operation should insert after removing location.


ReturnsDescription
void


setEndOfLine(endOfLine: EndOfLine): void


EOF シーケンスを設定します









ParameterDescription
endOfLine: EndOfLine

The new end of line for the document.


ReturnsDescription
void


TextEditorLineNumbersStyle

行番号の描画スタイル


Enumeration members

Off


0

On


1

Relative


2

TextEditorOptions

text editoroptions を示します


Properties

cursorStyle?: TextEditorCursorStyle


このエディターでのカーソルの描画スタイル


テキスト エディターのオプションを取得するとき、このプロパティは常に存在します。


テキスト エディターのオプションを設定するとき、このプロパティはオプションです。



insertSpaces?: boolean | string


Tab を押したとき n 個のスペースを挿入します


テキスト エディターのオプションを取得するとき、このプロパティは常にブール値(解決済み)になります。


テキスト エディターのオプションを設定するとき、このプロパティはオプションであり数値または"auto"にすることができます。



lineNumbers?: TextEditorLineNumbersStyle


現在の行番号を相対的な行番号で描画します


テキスト エディターのオプションを取得するとき、このプロパティは常に存在します。


テキスト エディターのオプションを設定するとき、このプロパティはオプションです。



tabSize?: number | string


タブのスペース サイズ。これは 2 つの目的で使用されます:



  • タブ文字の描画幅;

  • insertSpaces が true の時に挿入するスペースの数


テキスト エディターのオプションを取得するき、このプロパティは常に数値(解決済み)になります。


テキスト エディターのオプションを設定するとき、このプロパティはオプションであり数値または "auto" にすることができます。



TextEditorOptionsChangeEvent

text editor's options での変更を説明するイベントを表します


Properties

options: TextEditorOptions


text editor's options の新しい値



textEditor: TextEditor


オプションが変更された text editor



TextEditorRevealType

テキスト エディターでの reveal strategies を表します


Enumeration members

AtTop


3

Default


0

InCenter


1

InCenterIfOutsideViewport


2

TextEditorSelectionChangeEvent

text editor's selectionsでの変更を説明するイベントを表します


Properties

kind?: TextEditorSelectionChangeKind


このイベントを発生させた change kind


undefined にすることができます。



selections: Selection[]


text editor's selections 用の新しい値



textEditor: TextEditor


選択が変更された text editor



TextEditorSelectionChangeKind

selection change events を引き起こす可能性があるソースを表します


Enumeration members

Command


3

Keyboard


1

Mouse


2

TextEditorViewColumnChangeEvent

text editor's view column の変更を説明するイベントを表します


Properties

textEditor: TextEditor


オプションが変更された text editor



viewColumn: ViewColumn

TextLine

ソース コードなどのテキスト行を表します


TextLine のオブジェクトは immutable です。ドキュメント が変更されるとき、以前に取得された行は最新の状態を表しません。


Properties

firstNonWhitespaceCharacterIndex: number


/\s/ によって定義された空白文字ではない最初の文字のオフセット


Note 行がすべて空白の場合行の長さが返されます。



isEmptyOrWhitespace: boolean


この行が空白のみであるかどうか


略語 : TextLine.firstNonWhitespaceCharacterIndex === TextLine.text.length



lineNumber: number


0 から始まる行番号 (0オリジン)



range: Range


行の区切り文字を含まない、この行の範囲



rangeIncludingLineBreak: Range


行の区切り文字を含む、この行の範囲



text: string


行の区切り文字を含まない、この行のテキスト



ThemableDecorationAttachmentRenderOptions

Properties

backgroundColor?: string | ThemeColor


デコレーション attachment に適応される CSS スタイル プロパティ



border?: string


デコレーション attachment に適応される CSS スタイル プロパティ



borderColor?: string | ThemeColor


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ



color?: string | ThemeColor


デコレーション attachment に適応される CSS スタイル プロパティ



contentIconPath?: string | Uri


絶対パス または attachment に描画する画像への URI。アイコンまたはテキストのいずれかを表示できますが、両方を表示することはできません。



contentText?: string


attachment に表示されるテキスト コンテンツを定義します。アイコンまたはテキストのいずれかを表示できますが、両方を表示することはできません。



height?: string


デコレーション attachment に適応される CSS スタイル プロパティ



margin?: string


デコレーション attachment に適応される CSS スタイル プロパティ



textDecoration?: string


デコレーション attachment に適応される CSS スタイル プロパティ



width?: string


デコレーション attachment に適応される CSS スタイル プロパティ



ThemableDecorationInstanceRenderOptions

Properties

after?: ThemableDecorationAttachmentRenderOptions


デコレーションされたテキストの後ろに挿入される attachment の描画オプションを定義します



before?: ThemableDecorationAttachmentRenderOptions


デコレーションされたテキストの前に挿入される attachment の描画オプションを定義します



ThemableDecorationRenderOptions

text editor decoration 用のテーマ固有の描画スタイルを表します


Properties

after?: ThemableDecorationAttachmentRenderOptions


デコレーションされたテキストの後ろに挿入される attachment の描画オプションを定義します



backgroundColor?: string | ThemeColor


デコレーションの背景色。rgba() を使用して透明な背景色を定義することで、他のデコレーションとうまく一緒になります。


あるいはカラー レジストリの配色が referenced されます



before?: ThemableDecorationAttachmentRenderOptions


デコレーションされたテキストの前に挿入される attachment の描画オプションを定義します



border?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ



borderColor?: string | ThemeColor


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のボーダー プロパティを設定する場合は 'border' を使用する方が効果的です。



borderRadius?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のボーダー プロパティを設定する場合は 'border' を使用する方が効果的です。



borderSpacing?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のボーダー プロパティを設定する場合は 'border' を使用する方が効果的です。



borderStyle?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のボーダー プロパティを設定する場合は 'border' を使用する方が効果的です。



borderWidth?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のボーダー プロパティを設定する場合は 'border' を使用する方が効果的です。



color?: string | ThemeColor


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ



cursor?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ



gutterIconPath?: string | Uri


絶対パス または ガターに描画する画像への URI



gutterIconSize?: string


ガターアイコンのサイズを指定します


使用可能な値は 'auto', 'contain', 'cover', 任意のパーセント値です。


詳細: https://msdn.microsoft.com/en-us/library/jj127316(v=vs.85).aspx



letterSpacing?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ



outline?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ



outlineColor?: string | ThemeColor


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のアウトライン プロパティを設定する場合は 'outline' を使用する方が効果的です。



outlineStyle?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のアウトライン プロパティを設定する場合は 'outline' を使用する方が効果的です。



outlineWidth?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ


1 つ以上のアウトライン プロパティを設定する場合は 'outline' を使用する方が効果的です。



overviewRulerColor?: string | ThemeColor


概要ルーラーのデコレーション色
rgba() を使用して透明な色を定義することで、他のデコレーションとうまく一緒になります。



textDecoration?: string


デコレーションで囲まれたテキストに適用される CSS スタイル プロパティ



ThemeColor

https://code.visualstudio.com/docs/getstarted/theme-color-reference で定義されるワークベンチ配色のいずれかへの参照


テーマの配色を使用するとき、テーマ作成者とユーザーが色を変更する可能性があるため、カスタム配色よりも優先されます。


Constructors

new ThemeColor(id: string): ThemeColor


テーマ配色への参照を作成します









ParameterDescription
id: string

of the color. The available colors are listed in https://code.visualstudio.com/docs/getstarted/theme-color-reference.


ReturnsDescription
ThemeColor


TreeDataProvider<T>

A data provider that provides tree data


Events

onDidChangeTreeData?: Event<T | undefined | null>


An optional event to signal that an element or root has changed.
To signal that root has changed, do not pass any argument or pass undefined or null.



Methods

getChildren(element?: T): ProviderResult


Get the children of element or root if no element is passed.









ParameterDescription
element?: T

The element from which the provider gets children. Can be undefined.


ReturnsDescription
ProviderResult

Children of element or root if no element is passed.




getTreeItem(element: T): TreeItem | Thenable<TreeItem>


Get TreeItem representation of the element









ParameterDescription
element: T

The element for which TreeItem representation is asked for.


ReturnsDescription
TreeItem | Thenable<TreeItem>

(#TreeItem) representation of the element




TreeItem

Constructors

new TreeItem(label: string, collapsibleState?: TreeItemCollapsibleState): TreeItem










ParameterDescription
label: string

A human-readable string describing this item


collapsibleState?: TreeItemCollapsibleState

(#TreeItemCollapsibleState) of the tree item. Default is TreeItemCollapsibleState.None


ReturnsDescription
TreeItem


Properties

collapsibleState?: TreeItemCollapsibleState


TreeItemCollapsibleState of the tree item.



command?: Command


The command which should be run when the tree item is selected.



contextValue?: string


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 folder. When contributing actions to view/item/context
using menus extension point, you can specify context value for key viewItem in when expression like viewItem == folder.



    “contributes”: {
“menus”: {
“view/item/context”: [
{
“command”: “extension.deleteFolder”,
“when”: “viewItem == folder”
}
]
}
}

This will show action extension.deleteFolder only for items with contextValue is folder.



iconPath?: string | Uri | {dark: string | Uri, light: string | Uri}


The icon path for the tree item



label: string


A human-readable string describing this item



TreeItemCollapsibleState

Collapsible state of the tree item


Enumeration members

Collapsed


1

Expanded


2

None


0

TypeDefinitionProvider

The type definition provider defines the contract between extensions and
the go to type definition feature.


Methods

provideTypeDefinition(document: TextDocument, position: Position, token: CancellationToken): ProviderResult


Provide the type definition of the symbol at the given position and document.











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

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




Uri

ディスク上のファイルまたは無題のリソースのような別のリソースを表すユニバーサル リソース識別子


Static

file(path: string): Uri


ファイル システム パスから URI を作成します


schemefile になります









ParameterDescription
path: string

A file system or UNC path.


ReturnsDescription
Uri

新しい Uri インスタンス




parse(value: string): Uri


文字列から URI を作成します


与えられた値が正しくない場合は throw します。









ParameterDescription
value: string

The string value of an Uri.


ReturnsDescription
Uri

新しい Uri インスタンス




Properties

authority: string


Authority は http://www.msft.com/some/path?query#fragmentwww.msft.com 部分です


最初の 2 重スラッシュから次のスラッシュまでの間の部分を指します。



fragment: string


Fragment は http://www.msft.com/some/path?query#fragmentfragment 部分です



fsPath: string


この Uri の 対応するファイル システム パスを表す文字列


UNC パスで処理し、Windows ドライブ文字を小文字に正規化します。また、プラットフォーム固有のパス区切り文字も使用されます。
無効な文字とセマンティックのパスを検証しません



path: string


Path は http://www.msft.com/some/path?query#fragment/some/path 部分です



query: string


Query は http://www.msft.com/some/path?query#fragmentquery 部分です



scheme: string


Scheme は http://www.msft.com/some/path?query#fragmenthttp 部分です


最初のコロンの前部分を指します。



Methods

toJSON(): any


この Uri を JSON 表記で返します







ReturnsDescription
any

オブジェクト




toString(skipEncoding?: boolean): string


この Uri を文字列表記で返します
URI の表現と正規化はスキームに依存します。結果の文字列は Uri.parse を使用して安全に使用できます。









ParameterDescription
skipEncoding?: boolean

Do not percentage-encode the result, defaults to false. Note that
the # and ? characters occuring in the path will always be encoded.


ReturnsDescription
string

この Uri の文字列表記




with(change: {authority: string, fragment: string, path: string, query: string, scheme: string}): Uri


この Uri から 新しい Uri を派生します



let file = Uri.parse(‘before:some/file/path’);
let other = file.with({ scheme: ‘after’ });
assert.ok(other.toString() === ‘after:some/file/path’);








ParameterDescription
change: {authority: string, fragment: string, path: string, query: string, scheme: string}

An object that describes a change to this Uri. To unset components use null or
the empty string.


ReturnsDescription
Uri

指定された変更を反映する新しい Uri。その変更が何も変更しない場合 this(こ) の Uri に戻ります。




ViewColumn

Denotes a column in the editor window. Columns are
used to show editors side by side.


Enumeration members

One


1

Three


3

Two


2

WorkspaceConfiguration

Represents the configuration. It is a merged view of



  • Default configuration

  • Global configuration

  • Workspace configuration (if available)

  • Workspace folder configuration of the requested resource (if available)


Global configuration comes from User Settings and shadows Defaults.


Workspace configuration comes from Workspace Settings and shadows Global configuration.


Workspace Folder configuration comes from .vscode folder under one of the workspace folders.


Note: Workspace and Workspace Folder configurations contains launch and tasks settings. Their basename will be
part of the section identifier. The following snippets shows how to retrieve all configurations
from launch.json:



// launch.json configuration
const config = workspace.getConfiguration(‘launch’, vscode.window.activeTextEditor.document.uri);

// retrieve values
const values = config.get(‘configurations’);

Refer to Settings for more information.


Methods

get<T>(section: string): T | undefined


Return a value from this configuration.









ParameterDescription
section: string

Configuration name, supports dotted names.


ReturnsDescription
T | undefined

The value section denotes or undefined.




get<T>(section: string, defaultValue: T): T


Return a value from this configuration.










ParameterDescription
section: string

Configuration name, supports dotted names.


defaultValue: T

A value should be returned when no value could be found, is undefined.


ReturnsDescription
T

The value section denotes or the default.




has(section: string): boolean


Check if this configuration has a certain value.









ParameterDescription
section: string

Configuration name, supports dotted names.


ReturnsDescription
boolean

true if the section doesn't resolve to undefined.




inspect<T>(section: string): {defaultValue: T, globalValue: T, key: string, workspaceFolderValue: T, workspaceValue: T} | undefined


Retrieve all information about a configuration setting. A configuration value
often consists of a default value, a global or installation-wide value,
a workspace-specific value and a folder-specific value.


The effective value (returned by get)
is computed like this: defaultValue overwritten by globalValue,
globalValue overwritten by workspaceValue. workspaceValue overwritten by workspaceFolderValue.
Refer to Settings Inheritence
for more information.


Note: The configuration name must denote a leaf in the configuration tree
(editor.fontSize vs editor) otherwise no result is returned.









ParameterDescription
section: string

Configuration name, supports dotted names.


ReturnsDescription
{defaultValue: T, globalValue: T, key: string, workspaceFolderValue: T, workspaceValue: T} | undefined

Information about a configuration setting or undefined.




update(section: string, value: any, configurationTarget?: ConfigurationTarget | boolean): Thenable<void>


Update a configuration value. The updated configuration values are persisted.


A value can be changed in



Note 1: Setting a global value in the presence of a more specific workspace value
has no observable effect in that workspace, but in others. Setting a workspace value
in the presence of a more specific folder value has no observable effect for the resources
under respective folder, but in others. Refer to
Settings Inheritence for more information.


Note 2: To remove a configuration value use undefined, like so: config.update('somekey', undefined)


Will throw error when



  • Writing a configuration which is not registered.

  • Writing a configuration to workspace or folder target when no workspace is opened

  • Writing a configuration to folder target when there is no folder settings

  • Writing to folder target without passing a resource when getting the configuration (workspace.getConfiguration(section, resource))

  • Writing a window configuration to folder target











ParameterDescription
section: string

Configuration name, supports dotted names.


value: any

The new value.


configurationTarget?: ConfigurationTarget | boolean

The configuration target or a boolean value.
If undefined or null or false configuration target is ConfigurationTarget.Workspace.
If true configuration target is ConfigurationTarget.Global.


ReturnsDescription
Thenable<void>


WorkspaceEdit

A workspace edit represents textual changes for many documents.


Properties

size: number


The number of affected resources.



Methods

delete(uri: Uri, range: Range): void


Delete the text at the given range.










ParameterDescription
uri: Uri

A resource identifier.


range: Range

A range.


ReturnsDescription
void


entries(): [Uri, TextEdit[]][]


Get all text edits grouped by resource.







ReturnsDescription
[Uri, TextEdit[]][]

An array of [Uri, TextEdit[]]-tuples.




get(uri: Uri): TextEdit[]


Get the text edits for a resource.









ParameterDescription
uri: Uri

A resource identifier.


ReturnsDescription
TextEdit[]

An array of text edits.




has(uri: Uri): boolean


Check if this edit affects the given resource.









ParameterDescription
uri: Uri

A resource identifier.


ReturnsDescription
boolean

true if the given resource will be touched by this edit.




insert(uri: Uri, position: Position, newText: string): void


Insert the given text at the given position.











ParameterDescription
uri: Uri

A resource identifier.


position: Position

A position.


newText: string

A string.


ReturnsDescription
void


replace(uri: Uri, range: Range, newText: string): void


Replace the given range with given text for the given resource.











ParameterDescription
uri: Uri

A resource identifier.


range: Range

A range.


newText: string

A string.


ReturnsDescription
void


set(uri: Uri, edits: TextEdit[]): void


Set (and replace) text edits for a resource.










ParameterDescription
uri: Uri

A resource identifier.


edits: TextEdit[]

An array of text edits.


ReturnsDescription
void


WorkspaceFolder

A workspace folder is one of potentially many roots opened by the editor. All workspace folders
are equal which means there is notion of an active or master workspace folder.


Properties

index: number


The ordinal number of this workspace folder.



name: string


The name of this workspace folder. Defaults to
the basename its uri-path



uri: Uri


The associated URI for this workspace folder.



WorkspaceFoldersChangeEvent

An event describing a change to the set of workspace folders.


Properties

added: WorkspaceFolder[]


Added workspace folders.



removed: WorkspaceFolder[]


Removed workspace folders.



WorkspaceSymbolProvider

workspace symbol provider interface は拡張機能と symbol search-機能の間のコントラクトを定義します
the symbol search-feature.


Methods

provideWorkspaceSymbols(query: string, token: CancellationToken): ProviderResult


Project-wide search for a symbol matching the given query string. It is up to the provider
how to search given the query string, like substring, indexOf etc. To improve performance implementors can
skip the location of symbols and implement resolveWorkspaceSymbol to do that
later.










ParameterDescription
query: string

A non-empty query string.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

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




resolveWorkspaceSymbol(symbol: SymbolInformation, token: CancellationToken): ProviderResult


Given a symbol fill in its location. This method is called whenever a symbol
is selected in the UI. Providers can implement this method and return incomplete symbols from
provideWorkspaceSymbols which often helps to improve
performance.










ParameterDescription
symbol: SymbolInformation

The symbol that is to be resolved. Guaranteed to be an instance of an object returned from an
earlier call to provideWorkspaceSymbols.


token: CancellationToken

A cancellation token.


ReturnsDescription
ProviderResult

The resolved symbol or a thenable that resolves to that. When no result is returned,
the given symbol is used.




Thenable<T>

Thenable は ES6 promises, Q, jquery.Deferred, WinJS.Promise, その他 の間で共通です。


この API は 特定の promise の実装に移行せずに、既存のコードを再利用することができる promise libary が使用されることについては想定しません。


それでも、このエディターで利用可能な native promises の使用を推奨します。


Methods

then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>


Promise の解決やリジェクトのコールバックをアタッチします。










ParameterDescription
onfulfilled?: (value: T) => TResult | Thenable<TResult>

The callback to execute when the Promise is resolved.


onrejected?: (reason: any) => TResult | Thenable<TResult>

The callback to execute when the Promise is rejected.


ReturnsDescription
Thenable<TResult>

A Promise for the completion of which ever callback is executed.




then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>










ParameterDescription
onfulfilled?: (value: T) => TResult | Thenable<TResult>
onrejected?: (reason: any) => void
ReturnsDescription
Thenable<TResult>