当前活动的编辑器或 undefined
。活动的编辑器是当前聚焦的编辑器,或者当没有聚焦时,是最近改变输入的编辑器。
当前可见的编辑器或者一个空数组。
The currently opened terminals or an empty array.
The currently active terminal or undefined
. The active terminal is the one that
currently has focus or most recently had focus.
Represents the current window's state.
The currently active color theme as configured in the settings. The active
theme can be changed via the workbench.colorTheme
setting.
An Event which fires when the array of visible editors has changed.
An Event which fires when the selection in an editor has changed.
An Event which fires when the visible ranges of an editor has changed.
An Event which fires when the options of an editor have changed.
An Event which fires when the view column of an editor has changed.
An Event which fires when the active terminal
has changed. Note that the event also fires when the active terminal changes
to undefined
.
An Event which fires when a terminal has been created, either through the createTerminal API or commands.
An Event which fires when a terminal is disposed.
An Event which fires when the focus state of the current window changes. The value of the event represents whether the window is focused.
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.
A text document to be shown.
A view column in which the editor should be shown. The default is the active, other values
are adjusted to be Min(column, columnCount + 1)
, the active-column is not adjusted. Use ViewColumn.Beside
to open the editor to the side of the currently active one.
When true
the editor will not take focus.
A promise that resolves to an editor.
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.
A text document to be shown.
Editor options to configure the behavior of showing the editor.
A promise that resolves to an editor.
A short-hand for openTextDocument(uri).then(document => showTextDocument(document, options))
.
A resource identifier.
Editor options to configure the behavior of showing the editor.
A promise that resolves to an editor.
Create a TextEditorDecorationType that can be used to add decorations to text editors.
Rendering options for the decoration type.
A new decoration type instance.
Show an information message to users. Optionally provide an array of items which will be presented as clickable buttons.
The message to show.
A set of items that will be rendered as actions in the message.
A thenable that resolves to the selected item or undefined
when being dismissed.
Show an information message to users. Optionally provide an array of items which will be presented as clickable buttons.
The message to show.
Configures the behaviour of the message.
A set of items that will be rendered as actions in the message.
A thenable that resolves to the selected item or undefined
when being dismissed.
Show an information message.
The message to show.
A set of items that will be rendered as actions in the message.
A thenable that resolves to the selected item or undefined
when being dismissed.
Show an information message.
The message to show.
Configures the behaviour of the message.
A set of items that will be rendered as actions in the message.
A thenable that resolves to the selected item or undefined
when being dismissed.
Show a warning message.
The message to show.
A set of items that will be rendered as actions in the message.
A thenable that resolves to the selected item or undefined
when being dismissed.
Show a warning message.
The message to show.
Configures the behaviour of the message.
A set of items that will be rendered as actions in the message.
A thenable that resolves to the selected item or undefined
when being dismissed.
Show a warning message.
The message to show.
A set of items that will be rendered as actions in the message.
A thenable that resolves to the selected item or undefined
when being dismissed.
Show a warning message.
The message to show.
Configures the behaviour of the message.
A set of items that will be rendered as actions in the message.
A thenable that resolves to the selected item or undefined
when being dismissed.
Show an error message.
The message to show.
A set of items that will be rendered as actions in the message.
A thenable that resolves to the selected item or undefined
when being dismissed.
Show an error message.
The message to show.
Configures the behaviour of the message.
A set of items that will be rendered as actions in the message.
A thenable that resolves to the selected item or undefined
when being dismissed.
Show an error message.
The message to show.
A set of items that will be rendered as actions in the message.
A thenable that resolves to the selected item or undefined
when being dismissed.
Show an error message.
The message to show.
Configures the behaviour of the message.
A set of items that will be rendered as actions in the message.
A thenable that resolves to the selected item or undefined
when being dismissed.
Shows a selection list allowing multiple selections.
An array of strings, or a promise that resolves to an array of strings.
Configures the behavior of the selection list.
A token that can be used to signal cancellation.
A promise that resolves to the selected items or undefined
.
Shows a selection list.
An array of strings, or a promise that resolves to an array of strings.
Configures the behavior of the selection list.
A token that can be used to signal cancellation.
A promise that resolves to the selection or undefined
.
Shows a selection list allowing multiple selections.
An array of items, or a promise that resolves to an array of items.
Configures the behavior of the selection list.
A token that can be used to signal cancellation.
A promise that resolves to the selected items or undefined
.
Shows a selection list.
An array of items, or a promise that resolves to an array of items.
Configures the behavior of the selection list.
A token that can be used to signal cancellation.
A promise that resolves to the selected item or undefined
.
Shows a selection list of workspace folders to pick from.
Returns undefined
if no folder is open.
Configures the behavior of the workspace folder list.
A promise that resolves to the workspace folder or undefined
.
Shows a file open dialog to the user which allows to select a file for opening-purposes.
Options that control the dialog.
A promise that resolves to the selected resources or undefined
.
Shows a file save dialog to the user which allows to select a file for saving-purposes.
Options that control the dialog.
A promise that resolves to the selected resource or 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.
Configures the behavior of the input box.
A token that can be used to signal cancellation.
A promise that resolves to a string the user provided or to undefined
in case of dismissal.
Creates a QuickPick to let the user pick an item from a list of items of type T.
Note that in many cases the more convenient window.showQuickPick is easier to use. window.createQuickPick should be used when window.showQuickPick does not offer the required flexibility.
A new QuickPick.
Creates a InputBox to let the user enter some text input.
Note that in many cases the more convenient window.showInputBox is easier to use. window.createInputBox should be used when window.showInputBox does not offer the required flexibility.
A new InputBox.
Creates a new output channel with the given name.
Human-readable string which will be used to represent the channel in the UI.
Create and show a new webview panel.
Identifies the type of the webview panel.
Title of the panel.
Where to show the webview in the editor. If preserveFocus is set, the new webview will not take focus.
Settings for the new panel.
New webview panel.
Set a message to the status bar. This is a short hand for the more powerful status bar items.
The message to show, supports icon substitution as in status bar items.
Timeout in milliseconds after which the message will be disposed.
A disposable which hides the status bar message.
Set a message to the status bar. This is a short hand for the more powerful status bar items.
The message to show, supports icon substitution as in status bar items.
Thenable on which completion (resolve or reject) the message will be disposed.
A disposable which hides the status bar message.
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.
The message to show, supports icon substitution as in status bar items.
A disposable which hides the status bar message.
Show progress in the Source Control viewlet while running the given callback and while its returned promise isn't resolve or rejected.
A callback returning a promise. Progress increments can be reported with the provided Progress-object.
The thenable the task did return.
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
.
A callback returning a promise. Progress state can be reported with the provided Progress-object.
To report discrete progress, use increment
to indicate how much work has been completed. Each call with
a increment
value will be summed up and reflected as overall progress until 100% is reached (a value of
e.g. 10
accounts for 10%
of work done).
Note that currently only ProgressLocation.Notification
is capable of showing discrete progress.
To monitor if the operation has been cancelled by the user, use the provided CancellationToken
.
Note that currently only ProgressLocation.Notification
is supporting to show a cancel button to cancel the
long running operation.
The thenable the task-callback returned.
Creates a status bar item.
The alignment of the item.
The priority of the item. Higher values mean the item should be shown more to the left.
A new status bar item.
Creates a status bar item.
The unique identifier of the item.
The alignment of the item.
The priority of the item. Higher values mean the item should be shown more to the left.
A new status bar item.
Creates a Terminal with a backing shell process. The cwd of the terminal will be the workspace directory if it exists.
Optional human-readable string which will be used to represent the terminal in the UI.
Optional path to a custom shell executable to be used in the terminal.
Optional args for the custom shell executable. A string can be used on Windows only which allows specifying shell args in command-line format.
A new Terminal.
Creates a Terminal with a backing shell process.
A TerminalOptions object describing the characteristics of the new terminal.
A new Terminal.
Creates a Terminal where an extension controls its input and output.
An ExtensionTerminalOptions object describing the characteristics of the new terminal.
A new Terminal.
Register a TreeDataProvider for the view contributed using the extension point views
.
This will allow you to contribute data to the TreeView and update if the data changes.
Note: To get access to the TreeView and perform operations on it, use createTreeView.
Id of the view contributed using the extension point views
.
A TreeDataProvider that provides tree data for the view
Create a TreeView for the view contributed using the extension point views
.
Id of the view contributed using the extension point views
.
Options for creating the TreeView
a TreeView.
Registers a uri handler capable of handling system-wide uris. In case there are multiple windows open, the topmost window will handle the uri. A uri handler is scoped to the extension it is contributed from; it will only be able to handle uris which are directed to the extension itself. A uri must respect the following rules:
vscode.env.uriScheme
;my.extension
);For example, if the my.extension
extension registers a uri handler, it will only
be allowed to handle uris with the prefix product-name://my.extension
.
An extension can only register a single uri handler in its entire activation lifetime.
onUri
that fires when a uri directed for
the current extension is about to be handled.The uri handler to register for this extension.
Registers a webview panel serializer.
Extensions that support reviving should have an "onWebviewPanel:viewType"
activation event and
make sure that registerWebviewPanelSerializer is called during activation.
Only a single serializer may be registered at a time for a given viewType
.
Type of the webview panel that can be serialized.
Webview serializer.
Register a new provider for webview views.
Unique id of the view. This should match the id
from the
views
contribution in the package.json.
Provider for the webview views.
Content settings for the webview created for this view.
Controls if the webview element itself (iframe) is kept around even when the view is no longer visible.
Normally the webview's html context is created when the view becomes visible
and destroyed when it is hidden. Extensions that have complex state
or UI can set the retainContextWhenHidden
to make the editor keep the webview
context around, even when the webview moves to a background tab. When a webview using
retainContextWhenHidden
becomes hidden, its scripts and other dynamic content are suspended.
When the view becomes visible again, the context is automatically restored
in the exact same state it was in originally. You cannot send messages to a
hidden webview, even with retainContextWhenHidden
enabled.
retainContextWhenHidden
has a high memory overhead and should only be used if
your view's context cannot be quickly saved and restored.
Disposable that unregisters the provider.
为 customEditors
扩展功能点贡献的 viewType
注册一个自定义编辑器的 Provider。
当打开一个自定义编辑器被时,会触发一个 onCustomEditor:viewType
活动事件。
你的扩展必须为 viewType
注册一个 CustomTextEditorProvider
、CustomReadonlyEditorProvider
或 CustomEditorProvider
作为激活的一部分。
自定义编辑器 provider 的唯一标识符。这应该与 contribution.customEditors
配置的 viewType
匹配。
解析自定义编辑器的 Provider。
的配置选项。
Content settings for the webview panels created for this custom editor.
Only applies to CustomReadonlyEditorProvider | CustomEditorProvider
.
Indicates that the provider allows multiple editor instances to be open at the same time for the same resource.
By default, the editor only allows one editor instance to be open at a time for each resource. If the user tries to open a second editor instance for the resource, the first one is instead moved to where the second one was to be opened.
When supportsMultipleEditorsPerDocument
is enabled, users can split and create copies of the custom
editor. In this case, the custom editor must make sure it can properly synchronize the states of all
editor instances for a resource so that they are consistent.
一次性的,取消注册的 provider
Register provider that enables the detection and handling of links within the terminal.
The provider that provides the terminal links.
Disposable that unregisters the provider.
Registers a provider for a contributed terminal profile.
The ID of the contributed terminal profile.
The terminal profile provider.
Register a file decoration provider.
A Disposable that unregisters the provider.
An Event which fires when the active color theme is changed or has changes.
友链:VS Code 中文文档 | VS Code 官网文档 | VS Code 扩展市场
用于处理编辑器当前窗口(window)的命名空间。就是可见和活动的编辑器以及显示信息、选择和要求用户输入的 UI 元素。
@youngjuning