提交 096d627d 编写于 作者: D Daniel Imms

Make terminal access APIs stable

Fixes #52574
上级 acc5bf3a
......@@ -5784,6 +5784,17 @@ declare module 'vscode' {
*/
export const onDidChangeTextEditorViewColumn: Event<TextEditorViewColumnChangeEvent>;
/**
* The currently opened terminals or an empty array.
*/
export const terminals: ReadonlyArray<Terminal>;
/**
* An [event](#Event) which fires when a terminal has been created, either through the
* [createTerminal](#window.createTerminal) API or commands.
*/
export const onDidOpenTerminal: Event<Terminal>;
/**
* An [event](#Event) which fires when a terminal is disposed.
*/
......
......@@ -615,11 +615,6 @@ declare module 'vscode' {
}
export namespace window {
/**
* The currently opened terminals or an empty array.
*/
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.
......@@ -633,12 +628,6 @@ declare module 'vscode' {
*/
export const onDidChangeActiveTerminal: Event<Terminal | undefined>;
/**
* An [event](#Event) which fires when a terminal has been created, either through the
* [createTerminal](#window.createTerminal) API or commands.
*/
export const onDidOpenTerminal: Event<Terminal>;
/**
* Create a [TerminalRenderer](#TerminalRenderer).
*
......
......@@ -335,7 +335,7 @@ export function createApiFactory(
return proposedApiFunction(extension, extHostTerminalService.activeTerminal);
},
get terminals() {
return proposedApiFunction(extension, extHostTerminalService.terminals);
return extHostTerminalService.terminals;
},
showTextDocument(documentOrUri: vscode.TextDocument | vscode.Uri, columnOrOptions?: vscode.ViewColumn | vscode.TextDocumentShowOptions, preserveFocus?: boolean): TPromise<vscode.TextEditor> {
let documentPromise: TPromise<vscode.TextDocument>;
......@@ -372,9 +372,9 @@ export function createApiFactory(
onDidCloseTerminal(listener, thisArg?, disposables?) {
return extHostTerminalService.onDidCloseTerminal(listener, thisArg, disposables);
},
onDidOpenTerminal: proposedApiFunction(extension, (listener, thisArg?, disposables?) => {
onDidOpenTerminal(listener, thisArg?, disposables?) {
return extHostTerminalService.onDidOpenTerminal(listener, thisArg, disposables);
}),
},
onDidChangeActiveTerminal: proposedApiFunction(extension, (listener, thisArg?, disposables?) => {
return extHostTerminalService.onDidChangeActiveTerminal(listener, thisArg, disposables);
}),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册