提交 bb9d5dd3 编写于 作者: I isidor

debug: additional telemetry data on debug session start

fixes microsoft/vscode-distro#35
上级 0519a269
......@@ -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);
......
......@@ -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;
......
......@@ -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));
......
......@@ -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(() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册