From e12dff9fe5dda1ef36c2edfd353974ee5cb55aeb Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Mon, 17 Jun 2019 16:25:31 +0200 Subject: [PATCH] Better name for temporary DebugUIService --- .../browser/debugConfigurationManager.ts | 7 ++-- ...ebugUIService.ts => debugHelperService.ts} | 9 ++--- .../contrib/debug/browser/debugSession.ts | 5 +-- .../contrib/debug/browser/rawDebugSession.ts | 6 +-- .../workbench/contrib/debug/common/debug.ts | 33 ++++++++++++++++- .../workbench/contrib/debug/common/debugUI.ts | 37 ------------------- .../contrib/debug/common/debugger.ts | 7 ++-- ...ebugUIService.ts => debugHelperService.ts} | 7 ++-- src/vs/workbench/workbench.main.ts | 2 +- src/vs/workbench/workbench.web.main.ts | 2 +- 10 files changed, 51 insertions(+), 64 deletions(-) rename src/vs/workbench/contrib/debug/browser/{debugUIService.ts => debugHelperService.ts} (76%) delete mode 100644 src/vs/workbench/contrib/debug/common/debugUI.ts rename src/vs/workbench/contrib/debug/node/{debugUIService.ts => debugHelperService.ts} (93%) diff --git a/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts b/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts index 28eae251da8..af9817c9807 100644 --- a/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts +++ b/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts @@ -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 } from 'vs/workbench/contrib/debug/common/debug'; +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 { 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'; @@ -34,7 +34,6 @@ import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { onUnexpectedError } from 'vs/base/common/errors'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { IDebugUIService } from 'vs/workbench/contrib/debug/common/debugUI'; const jsonRegistry = Registry.as(JSONExtensions.JSONContribution); jsonRegistry.registerSchema(launchSchemaId, launchSchema); @@ -68,7 +67,7 @@ export class ConfigurationManager implements IConfigurationManager { @ILifecycleService lifecycleService: ILifecycleService, @IExtensionService private readonly extensionService: IExtensionService, @IContextKeyService contextKeyService: IContextKeyService, - @IDebugUIService private readonly debugUIService: IDebugUIService + @IDebugHelperService private readonly debugHelperService: IDebugHelperService ) { this.configProviders = []; this.adapterDescriptorFactories = []; @@ -115,7 +114,7 @@ export class ConfigurationManager implements IConfigurationManager { let tl: ITerminalLauncher | undefined = this.debugAdapterFactories.get(debugType); if (!tl) { if (!this.terminalLauncher) { - this.terminalLauncher = this.debugUIService.createTerminalLauncher(this.instantiationService); + this.terminalLauncher = this.debugHelperService.createTerminalLauncher(this.instantiationService); } tl = this.terminalLauncher; } diff --git a/src/vs/workbench/contrib/debug/browser/debugUIService.ts b/src/vs/workbench/contrib/debug/browser/debugHelperService.ts similarity index 76% rename from src/vs/workbench/contrib/debug/browser/debugUIService.ts rename to src/vs/workbench/contrib/debug/browser/debugHelperService.ts index a2a939c03f7..c7fa5b96cd1 100644 --- a/src/vs/workbench/contrib/debug/browser/debugUIService.ts +++ b/src/vs/workbench/contrib/debug/browser/debugHelperService.ts @@ -4,15 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import { ServiceIdentifier, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ITerminalLauncher } from 'vs/workbench/contrib/debug/common/debug'; +import { ITerminalLauncher, IDebugHelperService, ILaunchVSCodeArguments } from 'vs/workbench/contrib/debug/common/debug'; import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IDebugUIService, ILaunchVSCodeArguments } from 'vs/workbench/contrib/debug/common/debugUI'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -export class BrowserDebugUIService implements IDebugUIService { +export class BrowserDebugHelperService implements IDebugHelperService { - _serviceBrand: ServiceIdentifier; + _serviceBrand: ServiceIdentifier; createTerminalLauncher(instantiationService: IInstantiationService): ITerminalLauncher { throw new Error('Method createTerminalLauncher not implemented.'); @@ -27,4 +26,4 @@ export class BrowserDebugUIService implements IDebugUIService { } } -registerSingleton(IDebugUIService, BrowserDebugUIService); \ No newline at end of file +registerSingleton(IDebugHelperService, BrowserDebugHelperService); \ No newline at end of file diff --git a/src/vs/workbench/contrib/debug/browser/debugSession.ts b/src/vs/workbench/contrib/debug/browser/debugSession.ts index 259dd7a13a0..da945a8ee9f 100644 --- a/src/vs/workbench/contrib/debug/browser/debugSession.ts +++ b/src/vs/workbench/contrib/debug/browser/debugSession.ts @@ -12,7 +12,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import { CompletionItem, completionKindFromString } from 'vs/editor/common/modes'; import { Position } from 'vs/editor/common/core/position'; import * as aria from 'vs/base/browser/ui/aria/aria'; -import { IDebugSession, IConfig, IThread, IRawModelUpdate, IDebugService, IRawStoppedDetails, State, LoadedSourceEvent, IFunctionBreakpoint, IExceptionBreakpoint, IBreakpoint, IExceptionInfo, AdapterEndEvent, IDebugger, VIEWLET_ID, IDebugConfiguration, IReplElement, IStackFrame, IExpression, IReplElementSource } from 'vs/workbench/contrib/debug/common/debug'; +import { IDebugSession, IConfig, IThread, IRawModelUpdate, IDebugService, IRawStoppedDetails, State, LoadedSourceEvent, IFunctionBreakpoint, IExceptionBreakpoint, IBreakpoint, IExceptionInfo, AdapterEndEvent, IDebugger, VIEWLET_ID, IDebugConfiguration, IReplElement, IStackFrame, IExpression, IReplElementSource, IDebugHelperService } from 'vs/workbench/contrib/debug/common/debug'; import { Source } from 'vs/workbench/contrib/debug/common/debugSource'; import { mixin } from 'vs/base/common/objects'; import { Thread, ExpressionContainer, DebugModel } from 'vs/workbench/contrib/debug/common/debugModel'; @@ -32,7 +32,6 @@ import { ReplModel } from 'vs/workbench/contrib/debug/common/replModel'; import { onUnexpectedError } from 'vs/base/common/errors'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { ISignService } from 'vs/platform/sign/common/sign'; -import { IDebugUIService } from 'vs/workbench/contrib/debug/common/debugUI'; export class DebugSession implements IDebugSession { @@ -69,7 +68,7 @@ export class DebugSession implements IDebugSession { @INotificationService private readonly notificationService: INotificationService, @ISignService private readonly signService: ISignService, @IProductService private readonly productService: IProductService, - @IDebugUIService private readonly debugUIService: IDebugUIService + @IDebugHelperService private readonly debugUIService: IDebugHelperService ) { this.id = generateUuid(); this.repl = new ReplModel(this); diff --git a/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts b/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts index 53b3dab14ba..3eb52275d43 100644 --- a/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts +++ b/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts @@ -10,11 +10,9 @@ import { Action } from 'vs/base/common/actions'; import * as errors from 'vs/base/common/errors'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { formatPII } from 'vs/workbench/contrib/debug/common/debugUtils'; -import { IDebugAdapter, IConfig, AdapterEndEvent, IDebugger } from 'vs/workbench/contrib/debug/common/debug'; +import { IDebugAdapter, IConfig, AdapterEndEvent, IDebugger, IDebugHelperService, ILaunchVSCodeArguments } from 'vs/workbench/contrib/debug/common/debug'; import { createErrorWithActions } from 'vs/base/common/errorsWithActions'; import { ISignService } from 'vs/platform/sign/common/sign'; -import { IDebugUIService, ILaunchVSCodeArguments } from 'vs/workbench/contrib/debug/common/debugUI'; - /** * Encapsulates the DebugAdapter lifecycle and some idiosyncrasies of the Debug Adapter Protocol. @@ -58,7 +56,7 @@ export class RawDebugSession { private readonly telemetryService: ITelemetryService, public readonly customTelemetryService: ITelemetryService | undefined, private readonly signService: ISignService, - private readonly debugUIService: IDebugUIService + private readonly debugUIService: IDebugHelperService ) { this.debugAdapter = debugAdapter; this._capabilities = Object.create(null); diff --git a/src/vs/workbench/contrib/debug/common/debug.ts b/src/vs/workbench/contrib/debug/common/debug.ts index ff5f06503ee..de7ba55bf0f 100644 --- a/src/vs/workbench/contrib/debug/common/debug.ts +++ b/src/vs/workbench/contrib/debug/common/debug.ts @@ -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 } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator, IInstantiationService } 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'; @@ -25,6 +25,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { TaskIdentifier } from 'vs/workbench/contrib/tasks/common/tasks'; import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService'; import { ITerminalConfiguration } from 'vs/workbench/contrib/terminal/common/terminal'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; export const VIEWLET_ID = 'workbench.view.debug'; export const VIEW_CONTAINER: ViewContainer = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer(VIEWLET_ID); @@ -835,3 +836,33 @@ export interface IDebugEditorContribution extends IEditorContribution { closeBreakpointWidget(): void; addLaunchConfiguration(): Promise; } + +// temporary debug helper service + +export const DEBUG_HELPER_SERVICE_ID = 'debugHelperService'; +export const IDebugHelperService = createDecorator(DEBUG_HELPER_SERVICE_ID); + +/** + * This interface represents a single command line argument split into a "prefix" and a "path" half. + * The optional "prefix" contains arbitrary text and the optional "path" contains a file system path. + * Concatenating both results in the original command line argument. + */ +export interface ILaunchVSCodeArgument { + prefix?: string; + path?: string; +} + +export interface ILaunchVSCodeArguments { + args: ILaunchVSCodeArgument[]; + env?: { [key: string]: string | null; }; +} + +export interface IDebugHelperService { + _serviceBrand: any; + + createTerminalLauncher(instantiationService: IInstantiationService): ITerminalLauncher; + + launchVsCode(vscodeArgs: ILaunchVSCodeArguments): Promise; + + createTelemetryService(configurationService: IConfigurationService, args: string[]): TelemetryService | undefined; +} diff --git a/src/vs/workbench/contrib/debug/common/debugUI.ts b/src/vs/workbench/contrib/debug/common/debugUI.ts deleted file mode 100644 index 775b0dee09c..00000000000 --- a/src/vs/workbench/contrib/debug/common/debugUI.ts +++ /dev/null @@ -1,37 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ITerminalLauncher } from 'vs/workbench/contrib/debug/common/debug'; -import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; - -export const DEBUGUI_SERVICE_ID = 'debugUIService'; -export const IDebugUIService = createDecorator(DEBUGUI_SERVICE_ID); - -/** - * This interface represents a single command line argument split into a "prefix" and a "path" half. - * The optional "prefix" contains arbitrary text and the optional "path" contains a file system path. - * Concatenating both results in the original command line argument. - */ -export interface ILaunchVSCodeArgument { - prefix?: string; - path?: string; -} - -export interface ILaunchVSCodeArguments { - args: ILaunchVSCodeArgument[]; - env?: { [key: string]: string | null; }; -} - -export interface IDebugUIService { - _serviceBrand: any; - - createTerminalLauncher(instantiationService: IInstantiationService): ITerminalLauncher; - - launchVsCode(vscodeArgs: ILaunchVSCodeArguments): Promise; - - createTelemetryService(configurationService: IConfigurationService, args: string[]): TelemetryService | undefined; -} diff --git a/src/vs/workbench/contrib/debug/common/debugger.ts b/src/vs/workbench/contrib/debug/common/debugger.ts index 0d2f50c79e5..4034a6c9596 100644 --- a/src/vs/workbench/contrib/debug/common/debugger.ts +++ b/src/vs/workbench/contrib/debug/common/debugger.ts @@ -9,7 +9,7 @@ import * as objects from 'vs/base/common/objects'; import { isObject } from 'vs/base/common/types'; import { IJSONSchema, IJSONSchemaSnippet } from 'vs/base/common/jsonSchema'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { IConfig, IDebuggerContribution, INTERNAL_CONSOLE_OPTIONS_SCHEMA, IConfigurationManager, IDebugAdapter, ITerminalSettings, IDebugger, IDebugSession } from 'vs/workbench/contrib/debug/common/debug'; +import { IConfig, IDebuggerContribution, INTERNAL_CONSOLE_OPTIONS_SCHEMA, IConfigurationManager, IDebugAdapter, ITerminalSettings, IDebugger, IDebugSession, IDebugHelperService } from 'vs/workbench/contrib/debug/common/debug'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import * as ConfigurationResolverUtils from 'vs/workbench/services/configurationResolver/common/configurationResolverUtils'; @@ -22,7 +22,6 @@ import { URI } from 'vs/base/common/uri'; import { Schemas } from 'vs/base/common/network'; import { isDebuggerMainContribution } from 'vs/workbench/contrib/debug/common/debugUtils'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { IDebugUIService } from 'vs/workbench/contrib/debug/common/debugUI'; export class Debugger implements IDebugger { @@ -35,7 +34,7 @@ export class Debugger implements IDebugger { @ITextResourcePropertiesService private readonly resourcePropertiesService: ITextResourcePropertiesService, @IConfigurationResolverService private readonly configurationResolverService: IConfigurationResolverService, @ITelemetryService private readonly telemetryService: ITelemetryService, - @IDebugUIService private readonly debugUIService: IDebugUIService + @IDebugHelperService private readonly debugHelperService: IDebugHelperService ) { this.debuggerContribution = { type: dbgContribution.type }; this.merge(dbgContribution, extensionDescription); @@ -193,7 +192,7 @@ export class Debugger implements IDebugger { return telemetryInfo; }).then(data => { const args = [`${this.getMainExtensionDescriptor().publisher}.${this.type}`, JSON.stringify(data), aiKey]; - return this.debugUIService.createTelemetryService(this.configurationService, args); + return this.debugHelperService.createTelemetryService(this.configurationService, args); }); } diff --git a/src/vs/workbench/contrib/debug/node/debugUIService.ts b/src/vs/workbench/contrib/debug/node/debugHelperService.ts similarity index 93% rename from src/vs/workbench/contrib/debug/node/debugUIService.ts rename to src/vs/workbench/contrib/debug/node/debugHelperService.ts index 7fad721771c..cfbc3539189 100644 --- a/src/vs/workbench/contrib/debug/node/debugUIService.ts +++ b/src/vs/workbench/contrib/debug/node/debugHelperService.ts @@ -9,16 +9,15 @@ import * as cp from 'child_process'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { TerminalLauncher } from 'vs/workbench/contrib/debug/node/terminalSupport'; -import { ITerminalLauncher } from 'vs/workbench/contrib/debug/common/debug'; +import { ITerminalLauncher, IDebugHelperService, ILaunchVSCodeArguments } 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'; import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IDebugUIService, ILaunchVSCodeArguments } from 'vs/workbench/contrib/debug/common/debugUI'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -export class NodeDebugUIService implements IDebugUIService { +export class NodeDebugHelperService implements IDebugHelperService { _serviceBrand: any; constructor( @@ -129,4 +128,4 @@ export class NodeDebugUIService implements IDebugUIService { } } -registerSingleton(IDebugUIService, NodeDebugUIService); \ No newline at end of file +registerSingleton(IDebugHelperService, NodeDebugHelperService); \ No newline at end of file diff --git a/src/vs/workbench/workbench.main.ts b/src/vs/workbench/workbench.main.ts index 7d36f913001..412d58fbb2e 100644 --- a/src/vs/workbench/workbench.main.ts +++ b/src/vs/workbench/workbench.main.ts @@ -235,7 +235,7 @@ import 'vs/workbench/contrib/debug/browser/debugQuickOpen'; import 'vs/workbench/contrib/debug/browser/debugEditorContribution'; import 'vs/workbench/contrib/debug/browser/repl'; import 'vs/workbench/contrib/debug/browser/debugViewlet'; -import 'vs/workbench/contrib/debug/node/debugUIService'; +import 'vs/workbench/contrib/debug/node/debugHelperService'; // Markers import 'vs/workbench/contrib/markers/browser/markers.contribution'; diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts index e89d766d149..09dc32edf03 100644 --- a/src/vs/workbench/workbench.web.main.ts +++ b/src/vs/workbench/workbench.web.main.ts @@ -239,7 +239,7 @@ import 'vs/workbench/contrib/debug/browser/debugQuickOpen'; import 'vs/workbench/contrib/debug/browser/debugEditorContribution'; import 'vs/workbench/contrib/debug/browser/repl'; import 'vs/workbench/contrib/debug/browser/debugViewlet'; -import 'vs/workbench/contrib/debug/browser/debugUIService'; +import 'vs/workbench/contrib/debug/browser/debugHelperService'; // Markers