Better name for temporary DebugUIService

This commit is contained in:
Andre Weinand
2019-06-17 16:25:31 +02:00
parent e20b2637d9
commit e12dff9fe5
10 changed files with 51 additions and 64 deletions
@@ -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<IJSONContributionRegistry>(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;
}
@@ -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<IDebugUIService>;
_serviceBrand: ServiceIdentifier<IDebugHelperService>;
createTerminalLauncher(instantiationService: IInstantiationService): ITerminalLauncher {
throw new Error('Method createTerminalLauncher not implemented.');
@@ -27,4 +26,4 @@ export class BrowserDebugUIService implements IDebugUIService {
}
}
registerSingleton(IDebugUIService, BrowserDebugUIService);
registerSingleton(IDebugHelperService, BrowserDebugHelperService);
@@ -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);
@@ -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);
+32 -1
View File
@@ -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<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer(VIEWLET_ID);
@@ -835,3 +836,33 @@ export interface IDebugEditorContribution extends IEditorContribution {
closeBreakpointWidget(): void;
addLaunchConfiguration(): Promise<any>;
}
// temporary debug helper service
export const DEBUG_HELPER_SERVICE_ID = 'debugHelperService';
export const IDebugHelperService = createDecorator<IDebugHelperService>(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<number>;
createTelemetryService(configurationService: IConfigurationService, args: string[]): TelemetryService | undefined;
}
@@ -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<IDebugUIService>(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<number>;
createTelemetryService(configurationService: IConfigurationService, args: string[]): TelemetryService | undefined;
}
@@ -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);
});
}
@@ -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);
registerSingleton(IDebugHelperService, NodeDebugHelperService);
+1 -1
View File
@@ -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';
+1 -1
View File
@@ -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