提交 effb1787 编写于 作者: I isidor

debug: a simplification with logDebugSessionStart

上级 d2d69a5b
......@@ -33,7 +33,7 @@ import { IAction } from 'vs/base/common/actions';
import { deepClone, equals } from 'vs/base/common/objects';
import { DebugSession } from 'vs/workbench/contrib/debug/browser/debugSession';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { IDebugService, State, IDebugSession, CONTEXT_DEBUG_TYPE, CONTEXT_DEBUG_STATE, CONTEXT_IN_DEBUG_MODE, IThread, IDebugConfiguration, VIEWLET_ID, DEBUG_PANEL_ID, IConfig, ILaunch, IViewModel, IConfigurationManager, IDebugModel, IEnablement, IBreakpoint, IBreakpointData, ICompound, IStackFrame, getStateLabel, IDebugSessionOptions, CONTEXT_DEBUG_UX, REPL_VIEW_ID, CONTEXT_BREAKPOINTS_EXIST } from 'vs/workbench/contrib/debug/common/debug';
import { IDebugService, State, IDebugSession, CONTEXT_DEBUG_TYPE, CONTEXT_DEBUG_STATE, CONTEXT_IN_DEBUG_MODE, IThread, IDebugConfiguration, VIEWLET_ID, DEBUG_PANEL_ID, IConfig, ILaunch, IViewModel, IConfigurationManager, IDebugModel, IEnablement, IBreakpoint, IBreakpointData, ICompound, IStackFrame, getStateLabel, IDebugSessionOptions, CONTEXT_DEBUG_UX, REPL_VIEW_ID, CONTEXT_BREAKPOINTS_EXIST, IGlobalConfig } from 'vs/workbench/contrib/debug/common/debug';
import { getExtensionHostDebugSession } from 'vs/workbench/contrib/debug/common/debugUtils';
import { isErrorWithActions } from 'vs/base/common/errorsWithActions';
import { RunOnceScheduler } from 'vs/base/common/async';
......@@ -521,7 +521,8 @@ export class DebugService implements IDebugService {
try {
await session.initialize(dbgr!);
await session.launchOrAttach(session.configuration);
await this.telemetry.logDebugSessionStart(dbgr!, session.root);
const launchJsonExists = !!session.root && !!this.configurationService.getValue<IGlobalConfig>('launch', { resource: session.root.uri });
await this.telemetry.logDebugSessionStart(dbgr!, launchJsonExists);
if (forceFocus || !this.viewModel.focusedSession || session.parentSession === this.viewModel.focusedSession) {
await this.focusStackFrame(undefined, undefined, session);
......
......@@ -3,10 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IDebugModel, IDebugSession, AdapterEndEvent, IBreakpoint, IGlobalConfig } from 'vs/workbench/contrib/debug/common/debug';
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { IDebugModel, IDebugSession, AdapterEndEvent, IBreakpoint } from 'vs/workbench/contrib/debug/common/debug';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { Debugger } from 'vs/workbench/contrib/debug/common/debugger';
export class DebugTelemetry {
......@@ -14,10 +12,9 @@ export class DebugTelemetry {
constructor(
private readonly model: IDebugModel,
@ITelemetryService private readonly telemetryService: ITelemetryService,
@IConfigurationService private readonly configurationService: IConfigurationService
) { }
logDebugSessionStart(dbgr: Debugger, root: IWorkspaceFolder | undefined): Promise<void> {
logDebugSessionStart(dbgr: Debugger, launchJsonExists: boolean): Promise<void> {
const extension = dbgr.getMainExtensionDescriptor();
/* __GDPR__
"debugSessionStart" : {
......@@ -37,7 +34,7 @@ export class DebugTelemetry {
watchExpressionsCount: this.model.getWatchExpressions().length,
extensionName: extension.identifier.value,
isBuiltin: extension.isBuiltin,
launchJsonExists: root && !!this.configurationService.getValue<IGlobalConfig>('launch', { resource: root.uri })
launchJsonExists
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册