Skip to content

Commit

Permalink
consolidate externalTerminalService: dead wood removal
Browse files Browse the repository at this point in the history
  • Loading branch information
weinand committed Jul 3, 2019
1 parent c0a9bc3 commit 9f20ed4
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 391 deletions.
7 changes: 2 additions & 5 deletions src/vs/workbench/api/node/extHostDebugService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { IExtHostWorkspaceProvider } from 'vs/workbench/api/common/extHostWorksp
import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionService';
import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors';
import { ITerminalSettings, IDebuggerContribution, IConfig, IDebugAdapter, IDebugAdapterServer, IDebugAdapterExecutable, IAdapterDescriptor } from 'vs/workbench/contrib/debug/common/debug';
import { getTerminalLauncher, hasChildProcesses, prepareCommand } from 'vs/workbench/contrib/debug/node/terminals';
import { hasChildProcesses, prepareCommand, runInExternalTerminal } from 'vs/workbench/contrib/debug/node/terminals';
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { AbstractVariableResolverService } from 'vs/workbench/services/configurationResolver/common/variableResolver';
import { ExtHostConfiguration, ExtHostConfigProvider } from '../common/extHostConfiguration';
Expand Down Expand Up @@ -357,10 +357,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {

} else if (args.kind === 'external') {

const terminalLauncher = getTerminalLauncher();
if (terminalLauncher) {
return terminalLauncher.runInTerminal(args, config);
}
runInExternalTerminal(args, config);
}
return Promise.resolve(undefined);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { IFileService } from 'vs/platform/files/common/files';
import { IWorkspaceContextService, IWorkspaceFolder, WorkbenchState } from 'vs/platform/workspace/common/workspace';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { IDebugConfigurationProvider, ICompound, IDebugConfiguration, IConfig, IGlobalConfig, IConfigurationManager, ILaunch, IDebugAdapterDescriptorFactory, IDebugAdapter, ITerminalSettings, ITerminalLauncher, IDebugSession, IAdapterDescriptor, CONTEXT_DEBUG_CONFIGURATION_TYPE, IDebugAdapterFactory, IDebugService, IDebugHelperService } from 'vs/workbench/contrib/debug/common/debug';
import { IDebugConfigurationProvider, ICompound, IDebugConfiguration, IConfig, IGlobalConfig, IConfigurationManager, ILaunch, IDebugAdapterDescriptorFactory, IDebugAdapter, ITerminalSettings, IDebugSession, IAdapterDescriptor, CONTEXT_DEBUG_CONFIGURATION_TYPE, IDebugAdapterFactory, IDebugService } from 'vs/workbench/contrib/debug/common/debug';
import { Debugger } from 'vs/workbench/contrib/debug/common/debugger';
import { IEditorService, ACTIVE_GROUP, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
Expand Down Expand Up @@ -52,7 +52,6 @@ export class ConfigurationManager implements IConfigurationManager {
private configProviders: IDebugConfigurationProvider[];
private adapterDescriptorFactories: IDebugAdapterDescriptorFactory[];
private debugAdapterFactories = new Map<string, IDebugAdapterFactory>();
private terminalLauncher: ITerminalLauncher;
private debugConfigurationTypeContext: IContextKey<string>;

constructor(
Expand All @@ -66,8 +65,7 @@ export class ConfigurationManager implements IConfigurationManager {
@IStorageService private readonly storageService: IStorageService,
@ILifecycleService lifecycleService: ILifecycleService,
@IExtensionService private readonly extensionService: IExtensionService,
@IContextKeyService contextKeyService: IContextKeyService,
@IDebugHelperService private readonly debugHelperService: IDebugHelperService
@IContextKeyService contextKeyService: IContextKeyService
) {
this.configProviders = [];
this.adapterDescriptorFactories = [];
Expand Down Expand Up @@ -111,14 +109,11 @@ export class ConfigurationManager implements IConfigurationManager {
}

runInTerminal(debugType: string, args: DebugProtocol.RunInTerminalRequestArguments, config: ITerminalSettings): Promise<number | undefined> {
let tl: ITerminalLauncher | undefined = this.debugAdapterFactories.get(debugType);
if (!tl) {
if (!this.terminalLauncher) {
this.terminalLauncher = this.debugHelperService.createTerminalLauncher(this.instantiationService);
}
tl = this.terminalLauncher;
let tl = this.debugAdapterFactories.get(debugType);
if (tl) {
return tl.runInTerminal(args, config);
}
return tl.runInTerminal(args, config);
return Promise.resolve(void 0);
}

// debug adapter
Expand Down
8 changes: 2 additions & 6 deletions src/vs/workbench/contrib/debug/browser/debugHelperService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { ServiceIdentifier, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ITerminalLauncher, IDebugHelperService } from 'vs/workbench/contrib/debug/common/debug';
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
import { IDebugHelperService } from 'vs/workbench/contrib/debug/common/debug';
import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
Expand All @@ -13,10 +13,6 @@ export class BrowserDebugHelperService implements IDebugHelperService {

_serviceBrand: ServiceIdentifier<IDebugHelperService>;

createTerminalLauncher(instantiationService: IInstantiationService): ITerminalLauncher {
throw new Error('Method createTerminalLauncher not implemented.');
}

createTelemetryService(configurationService: IConfigurationService, args: string[]): TelemetryService | undefined {
return undefined;
}
Expand Down
4 changes: 1 addition & 3 deletions src/vs/workbench/contrib/debug/common/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { URI as uri } from 'vs/base/common/uri';
import severity from 'vs/base/common/severity';
import { Event } from 'vs/base/common/event';
import { IJSONSchemaSnippet } from 'vs/base/common/jsonSchema';
import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { IEditorContribution } from 'vs/editor/common/editorCommon';
import { ITextModel as EditorIModel } from 'vs/editor/common/model';
import { IEditor, ITextEditor } from 'vs/workbench/common/editor';
Expand Down Expand Up @@ -846,7 +846,5 @@ export const IDebugHelperService = createDecorator<IDebugHelperService>(DEBUG_HE
export interface IDebugHelperService {
_serviceBrand: any;

createTerminalLauncher(instantiationService: IInstantiationService): ITerminalLauncher;

createTelemetryService(configurationService: IConfigurationService, args: string[]): TelemetryService | undefined;
}
8 changes: 1 addition & 7 deletions src/vs/workbench/contrib/debug/node/debugHelperService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { TerminalLauncher } from 'vs/workbench/contrib/debug/node/terminalSupport';
import { ITerminalLauncher, IDebugHelperService } from 'vs/workbench/contrib/debug/common/debug';
import { IDebugHelperService } from 'vs/workbench/contrib/debug/common/debug';
import { Client as TelemetryClient } from 'vs/base/parts/ipc/node/ipc.cp';
import { TelemetryAppenderClient } from 'vs/platform/telemetry/node/telemetryIpc';
import { getPathFromAmdModule } from 'vs/base/common/amd';
Expand All @@ -20,10 +18,6 @@ export class NodeDebugHelperService implements IDebugHelperService {
) {
}

createTerminalLauncher(instantiationService: IInstantiationService): ITerminalLauncher {
return instantiationService.createInstance(TerminalLauncher);
}

createTelemetryService(configurationService: IConfigurationService, args: string[]): TelemetryService | undefined {

const client = new TelemetryClient(
Expand Down
73 changes: 0 additions & 73 deletions src/vs/workbench/contrib/debug/node/terminalSupport.ts

This file was deleted.

Loading

0 comments on commit 9f20ed4

Please sign in to comment.