From 3e0b867773c797bf0ca8a8f60a126c78583b566c Mon Sep 17 00:00:00 2001 From: Abhishar Sinha Date: Thu, 9 Dec 2021 22:29:21 +0530 Subject: [PATCH] Removed deprecated activateTerminal #10521 --- CHANGELOG.md | 1 + packages/task/src/browser/task-service.ts | 2 +- packages/terminal/src/browser/base/terminal-service.ts | 7 ------- .../terminal/src/browser/terminal-frontend-contribution.ts | 6 +----- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db45ccf102be6..e0c8e08038900 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - add `isSafeToShutDown()` - replaces `canUnload()`. - add `setSafeToShutDown()` - ensures that next close event will not be prevented. - add `reload()` - to allow different handling in Electron and browser. +- [terminal] removed deprecated `activateTerminal` method in favor of `open`. [#10529](https://github.com/eclipse-theia/theia/pull/10529) ## v1.20.0 - 11/25/2021 diff --git a/packages/task/src/browser/task-service.ts b/packages/task/src/browser/task-service.ts index 4336a15e10ac2..ef7b3a42618f2 100644 --- a/packages/task/src/browser/task-service.ts +++ b/packages/task/src/browser/task-service.ts @@ -1056,7 +1056,7 @@ export class TaskService implements TaskConfigurationClient { if (!terminal || terminal.kind !== 'user' || (await terminal.hasChildProcesses())) { terminal = await this.terminalService.newTerminal({ created: new Date().toString() }); await terminal.start(); - this.terminalService.activateTerminal(terminal); + this.terminalService.open(terminal); } terminal.sendText(selectedText); } diff --git a/packages/terminal/src/browser/base/terminal-service.ts b/packages/terminal/src/browser/base/terminal-service.ts index 0570cf80b74c5..049a3d80a5956 100644 --- a/packages/terminal/src/browser/base/terminal-service.ts +++ b/packages/terminal/src/browser/base/terminal-service.ts @@ -29,13 +29,6 @@ export interface TerminalService { */ newTerminal(options: TerminalWidgetOptions): Promise; - /** - * Display new terminal widget. - * @param terminal - widget to attach. - * @deprecated use #open - */ - activateTerminal(terminal: TerminalWidget): void; - open(terminal: TerminalWidget, options?: WidgetOpenerOptions): void; readonly all: TerminalWidget[]; diff --git a/packages/terminal/src/browser/terminal-frontend-contribution.ts b/packages/terminal/src/browser/terminal-frontend-contribution.ts index 044ea2ca50dad..ff67a1b20719c 100644 --- a/packages/terminal/src/browser/terminal-frontend-contribution.ts +++ b/packages/terminal/src/browser/terminal-frontend-contribution.ts @@ -427,7 +427,7 @@ export class TerminalFrontendContribution implements FrontendApplicationContribu // Open terminal const termWidget = await this.newTerminal({ cwd }); termWidget.start(); - this.activateTerminal(termWidget); + this.open(termWidget); } registerMenus(menus: MenuModelRegistry): void { @@ -602,10 +602,6 @@ export class TerminalFrontendContribution implements FrontendApplicationContribu return widget; } - activateTerminal(widget: TerminalWidget, widgetOptions?: ApplicationShell.WidgetOptions): void { - this.open(widget, { widgetOptions }); - } - // TODO: reuse WidgetOpenHandler.open open(widget: TerminalWidget, options?: WidgetOpenerOptions): void { const op: WidgetOpenerOptions = {