Skip to content

Commit

Permalink
Fix strictFunctionTypes errors in terminalService
Browse files Browse the repository at this point in the history
Part of #81574
  • Loading branch information
Tyriar committed Oct 4, 2019
1 parent b0ebe32 commit abbf6a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
public constructor(
private readonly _terminalFocusContextKey: IContextKey<boolean>,
private readonly _configHelper: TerminalConfigHelper,
private _container: HTMLElement,
private _container: HTMLElement | undefined,
private _shellLaunchConfig: IShellLaunchConfig,
@ITerminalInstanceService private readonly _terminalInstanceService: ITerminalInstanceService,
@IContextKeyService private readonly _contextKeyService: IContextKeyService,
Expand Down Expand Up @@ -548,7 +548,9 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
}

// The container changed, reattach
this._container.removeChild(this._wrapperElement);
if (this._container) {
this._container.removeChild(this._wrapperElement);
}
this._container = container;
this._container.appendChild(this._wrapperElement);
}
Expand Down Expand Up @@ -801,7 +803,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
if (this._wrapperElement.xterm) {
this._wrapperElement.xterm = undefined;
}
if (this._wrapperElement.parentElement) {
if (this._wrapperElement.parentElement && this._container) {
this._container.removeChild(this._wrapperElement);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/terminal/browser/terminalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { IFileService } from 'vs/platform/files/common/files';
import { TerminalInstance } from 'vs/workbench/contrib/terminal/browser/terminalInstance';
import { IBrowserTerminalConfigHelper, ITerminalService, ITerminalInstance, ITerminalTab } from 'vs/workbench/contrib/terminal/browser/terminal';
import { ITerminalService, ITerminalInstance, ITerminalTab } from 'vs/workbench/contrib/terminal/browser/terminal';
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/terminalConfigHelper';
import { IQuickInputService, IQuickPickItem, IPickOptions } from 'vs/platform/quickinput/common/quickInput';
Expand Down Expand Up @@ -54,7 +54,7 @@ export class TerminalService implements ITerminalService {
public get terminalInstances(): ITerminalInstance[] { return this._terminalInstances; }
public get terminalTabs(): ITerminalTab[] { return this._terminalTabs; }

private _configHelper: IBrowserTerminalConfigHelper;
private _configHelper: TerminalConfigHelper;
private _terminalContainer: HTMLElement | undefined;

public get configHelper(): ITerminalConfigHelper { return this._configHelper; }
Expand Down

0 comments on commit abbf6a1

Please sign in to comment.