未验证 提交 d166c0c8 编写于 作者: J Johannes Rieken 提交者: GitHub

Merge pull request #60167 from Microsoft/tyriar/58357

Stabilize active terminal APIs
...@@ -5920,6 +5920,19 @@ declare module 'vscode' { ...@@ -5920,6 +5920,19 @@ declare module 'vscode' {
*/ */
export const terminals: ReadonlyArray<Terminal>; export const terminals: ReadonlyArray<Terminal>;
/**
* The currently active terminal or `undefined`. The active terminal is the one that
* currently has focus or most recently had focus.
*/
export const activeTerminal: Terminal | undefined;
/**
* An [event](#Event) which fires when the [active terminal](#window.activeTerminal)
* has changed. *Note* that the event also fires when the active terminal changes
* to `undefined`.
*/
export const onDidChangeActiveTerminal: Event<Terminal | undefined>;
/** /**
* An [event](#Event) which fires when a terminal has been created, either through the * An [event](#Event) which fires when a terminal has been created, either through the
* [createTerminal](#window.createTerminal) API or commands. * [createTerminal](#window.createTerminal) API or commands.
......
...@@ -995,19 +995,6 @@ declare module 'vscode' { ...@@ -995,19 +995,6 @@ declare module 'vscode' {
} }
export namespace window { export namespace window {
/**
* The currently active terminal or `undefined`. The active terminal is the one that
* currently has focus or most recently had focus.
*/
export const activeTerminal: Terminal | undefined;
/**
* An [event](#Event) which fires when the [active terminal](#window.activeTerminal)
* has changed. *Note* that the event also fires when the active terminal changes
* to `undefined`.
*/
export const onDidChangeActiveTerminal: Event<Terminal | undefined>;
/** /**
* Create a [TerminalRenderer](#TerminalRenderer). * Create a [TerminalRenderer](#TerminalRenderer).
* *
......
...@@ -354,7 +354,7 @@ export function createApiFactory( ...@@ -354,7 +354,7 @@ export function createApiFactory(
return extHostEditors.getVisibleTextEditors(); return extHostEditors.getVisibleTextEditors();
}, },
get activeTerminal() { get activeTerminal() {
return proposedApiFunction(extension, extHostTerminalService.activeTerminal); return extHostTerminalService.activeTerminal;
}, },
get terminals() { get terminals() {
return extHostTerminalService.terminals; return extHostTerminalService.terminals;
...@@ -397,9 +397,9 @@ export function createApiFactory( ...@@ -397,9 +397,9 @@ export function createApiFactory(
onDidOpenTerminal(listener, thisArg?, disposables?) { onDidOpenTerminal(listener, thisArg?, disposables?) {
return extHostTerminalService.onDidOpenTerminal(listener, thisArg, disposables); return extHostTerminalService.onDidOpenTerminal(listener, thisArg, disposables);
}, },
onDidChangeActiveTerminal: proposedApiFunction(extension, (listener, thisArg?, disposables?) => { onDidChangeActiveTerminal(listener, thisArg?, disposables?) {
return extHostTerminalService.onDidChangeActiveTerminal(listener, thisArg, disposables); return extHostTerminalService.onDidChangeActiveTerminal(listener, thisArg, disposables);
}), },
get state() { get state() {
return extHostWindow.state; return extHostWindow.state;
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册