Skip to content

Commit 1648dec

Browse files
committed
diag - set crash options for extension host if crash reporter directory is provided
1 parent 3fab5de commit 1648dec

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/vs/workbench/services/extensions/electron-browser/extensionHost.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import * as nls from 'vs/nls';
77
import { ChildProcess, fork } from 'child_process';
88
import { Server, Socket, createServer } from 'net';
9+
import { CrashReporterStartOptions } from 'electron';
910
import { getPathFromAmdModule } from 'vs/base/common/amd';
1011
import { timeout } from 'vs/base/common/async';
1112
import { toErrorMessage } from 'vs/base/common/errorMessage';
@@ -170,8 +171,17 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter {
170171
opts.execArgv = ['--inspect-port=0'];
171172
}
172173

173-
const crashReporterOptions = undefined; // TODO@electron pass this in as options to the extension host after verifying this actually works
174-
if (crashReporterOptions) {
174+
// Enable the crash reporter depending on environment for local reporting
175+
const crashesDirectory = this._environmentService.crashReporterDirectory;
176+
if (crashesDirectory) {
177+
const crashReporterOptions: CrashReporterStartOptions = {
178+
companyName: product.crashReporter?.companyName || 'Microsoft',
179+
productName: product.crashReporter?.productName || product.nameShort,
180+
submitURL: '',
181+
uploadToServer: false,
182+
crashesDirectory
183+
};
184+
175185
opts.env.CRASH_REPORTER_START_OPTIONS = JSON.stringify(crashReporterOptions);
176186
}
177187

0 commit comments

Comments
 (0)