From 1362a5634d778a7aab4af399b324093cebf73b23 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 30 Jun 2023 06:14:18 -0700 Subject: [PATCH] Remove native private fields from terminal/ Part of #186737 --- .../common/embedderTerminalService.ts | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/vs/workbench/services/terminal/common/embedderTerminalService.ts b/src/vs/workbench/services/terminal/common/embedderTerminalService.ts index 52e52a85acd..61c4a433e09 100644 --- a/src/vs/workbench/services/terminal/common/embedderTerminalService.ts +++ b/src/vs/workbench/services/terminal/common/embedderTerminalService.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/* eslint-disable local/code-no-native-private */ - import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { Emitter, Event } from 'vs/base/common/event'; @@ -74,17 +72,17 @@ class EmbedderTerminalService implements IEmbedderTerminalService { class EmbedderTerminalProcess extends Disposable implements ITerminalChildProcess { - readonly #pty: IEmbedderTerminalPty; + private readonly _pty: IEmbedderTerminalPty; readonly shouldPersist = false; readonly onProcessData: Event; - readonly #onProcessReady = this._register(new Emitter()); - readonly onProcessReady = this.#onProcessReady.event; - readonly #onDidChangeProperty = this._register(new Emitter>()); - readonly onDidChangeProperty = this.#onDidChangeProperty.event; - readonly #onProcessExit = this._register(new Emitter()); - readonly onProcessExit = this.#onProcessExit.event; + private readonly _onProcessReady = this._register(new Emitter()); + readonly onProcessReady = this._onProcessReady.event; + private readonly _onDidChangeProperty = this._register(new Emitter>()); + readonly onDidChangeProperty = this._onDidChangeProperty.event; + private readonly _onProcessExit = this._register(new Emitter()); + readonly onProcessExit = this._onProcessExit.event; constructor( readonly id: number, @@ -92,13 +90,13 @@ class EmbedderTerminalProcess extends Disposable implements ITerminalChildProces ) { super(); - this.#pty = pty; - this.onProcessData = this.#pty.onDidWrite; - if (this.#pty.onDidClose) { - this._register(this.#pty.onDidClose(e => this.#onProcessExit.fire(e || undefined))); + this._pty = pty; + this.onProcessData = this._pty.onDidWrite; + if (this._pty.onDidClose) { + this._register(this._pty.onDidClose(e => this._onProcessExit.fire(e || undefined))); } - if (this.#pty.onDidChangeName) { - this._register(this.#pty.onDidChangeName(e => this.#onDidChangeProperty.fire({ + if (this._pty.onDidChangeName) { + this._register(this._pty.onDidChangeName(e => this._onDidChangeProperty.fire({ type: ProcessPropertyType.Title, value: e }))); @@ -106,12 +104,12 @@ class EmbedderTerminalProcess extends Disposable implements ITerminalChildProces } async start(): Promise { - this.#onProcessReady.fire({ pid: -1, cwd: '', windowsPty: undefined }); - this.#pty.open(); + this._onProcessReady.fire({ pid: -1, cwd: '', windowsPty: undefined }); + this._pty.open(); return undefined; } shutdown(): void { - this.#pty.close(); + this._pty.close(); } // TODO: A lot of these aren't useful for some implementations of ITerminalChildProcess, should