diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 7ee3ee574cd..cf327e2eb9e 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -599,7 +599,14 @@ export class DebugService implements debug.IDebugService { this.inDebugMode.set(true); this.lazyTransitionToRunningState(); - this.telemetryService.publicLog('debugSessionStart', { type: configuration.type, breakpointCount: this.model.getBreakpoints().length, exceptionBreakpoints: this.model.getExceptionBreakpoints(), watchExpressionsCount: this.model.getWatchExpressions().length }); + this.telemetryService.publicLog('debugSessionStart', { + type: configuration.type, + breakpointCount: this.model.getBreakpoints().length, + exceptionBreakpoints: this.model.getExceptionBreakpoints(), + watchExpressionsCount: this.model.getWatchExpressions().length, + extensionName: `${ this.configurationManager.adapter.extensionDescription.publisher }.${ this.configurationManager.adapter.extensionDescription.name }`, + isBuiltin: this.configurationManager.adapter.extensionDescription.isBuiltin + }); }).then(undefined, (error: any) => { this.telemetryService.publicLog('debugMisconfiguration', { type: configuration ? configuration.type : undefined }); this.setStateAndEmit(debug.State.Inactive); diff --git a/src/vs/workbench/parts/debug/node/debugAdapter.ts b/src/vs/workbench/parts/debug/node/debugAdapter.ts index 66f4bb2d739..7d159bb8096 100644 --- a/src/vs/workbench/parts/debug/node/debugAdapter.ts +++ b/src/vs/workbench/parts/debug/node/debugAdapter.ts @@ -8,6 +8,7 @@ import paths = require('vs/base/common/paths'); import platform = require('vs/base/common/platform'); import debug = require('vs/workbench/parts/debug/common/debug'); import { SystemVariables } from 'vs/workbench/parts/lib/node/systemVariables'; +import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; export class Adapter { @@ -22,7 +23,7 @@ export class Adapter { public enableBreakpointsFor: { languageIds: string[] }; public aiKey: string; - constructor(rawAdapter: debug.IRawAdapter, systemVariables: SystemVariables, extensionFolderPath: string) { + constructor(rawAdapter: debug.IRawAdapter, systemVariables: SystemVariables, public extensionDescription: IExtensionDescription) { if (rawAdapter.windows) { rawAdapter.win = rawAdapter.windows; } @@ -56,11 +57,11 @@ export class Adapter { if (this.program) { this.program = systemVariables ? systemVariables.resolve(this.program) : this.program; - this.program = paths.join(extensionFolderPath, this.program); + this.program = paths.join(extensionDescription.extensionFolderPath, this.program); } if (this.runtime && this.runtime.indexOf('./') === 0) { this.runtime = systemVariables ? systemVariables.resolve(this.runtime) : this.runtime; - this.runtime = paths.join(extensionFolderPath, this.runtime); + this.runtime = paths.join(extensionDescription.extensionFolderPath, this.runtime); } this.type = rawAdapter.type; diff --git a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts b/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts index ebf0ebb4b30..77b709e9286 100644 --- a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts +++ b/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts @@ -173,7 +173,7 @@ export class ConfigurationManager implements debug.IConfigurationManager { extensions.forEach(extension => { extension.value.forEach(rawAdapter => { - const adapter = new Adapter(rawAdapter, this.systemVariables, extension.description.extensionFolderPath); + const adapter = new Adapter(rawAdapter, this.systemVariables, extension.description); const duplicate = this.adapters.filter(a => a.type === adapter.type)[0]; if (!rawAdapter.type || (typeof rawAdapter.type !== 'string')) { extension.collector.error(nls.localize('debugNoType', "Debug adapter 'type' can not be omitted and must be of type 'string'.")); @@ -184,7 +184,7 @@ export class ConfigurationManager implements debug.IConfigurationManager { if (adapter[attribute]) { if (attribute === 'enableBreakpointsFor') { Object.keys(adapter.enableBreakpointsFor).forEach(languageId => duplicate.enableBreakpointsFor[languageId] = true); - } else if (duplicate[attribute] && attribute !== 'type') { + } else if (duplicate[attribute] && attribute !== 'type' && attribute !== 'extensionDescription') { // give priority to the later registered extension. duplicate[attribute] = adapter[attribute]; extension.collector.error(nls.localize('duplicateDebuggerType', "Debug type '{0}' is already registered and has attribute '{1}', ignoring attribute '{1}'.", adapter.type, attribute)); diff --git a/src/vs/workbench/parts/debug/test/node/debugAdapter.test.ts b/src/vs/workbench/parts/debug/test/node/debugAdapter.test.ts index ef80386e627..19a04396fe2 100644 --- a/src/vs/workbench/parts/debug/test/node/debugAdapter.test.ts +++ b/src/vs/workbench/parts/debug/test/node/debugAdapter.test.ts @@ -49,7 +49,7 @@ suite('Debug - Adapter', () => { } setup(() => { - adapter = new Adapter(rawAdapter, null, extensionFolderPath); + adapter = new Adapter(rawAdapter, null, { extensionFolderPath, id: 'adapter', name: 'myAdapter', version: '1.0.0', publisher: 'vscode', isBuiltin: false, engines: null }); }); teardown(() => {