@@ -41,6 +41,7 @@ export type DevFunction =
4141 | 'deleteSsoConnections'
4242 | 'expireSsoConnections'
4343 | 'editAuthConnections'
44+ | 'forceIdeCrash'
4445
4546export type DevOptions = {
4647 context : vscode . ExtensionContext
@@ -105,6 +106,11 @@ const menuOptions: Record<DevFunction, MenuOption> = {
105106 detail : 'Opens editor to all Auth Connections the extension is using.' ,
106107 executor : editSsoConnections ,
107108 } ,
109+ forceIdeCrash : {
110+ label : 'Crash: Force IDE ExtHost Crash' ,
111+ detail : `Will SIGKILL ExtHost with pid, ${ process . pid } , but IDE will not crash itself.` ,
112+ executor : forceQuitIde ,
113+ } ,
108114}
109115
110116/**
@@ -435,6 +441,15 @@ async function expireSsoConnections() {
435441 )
436442}
437443
444+ export function forceQuitIde ( ) {
445+ // This current process is the ExtHost. Killing it will cause all the extensions to crash
446+ // for the specific IDE instance.
447+ // The PPID does not seem to be the IDE instance but the root VS Code process, killing
448+ // this crashes all VS Code instances.
449+ const vsCodePid = process . pid
450+ process . kill ( vsCodePid , 'SIGKILL' ) // SIGTERM would be the graceful shutdown
451+ }
452+
438453async function showState ( path : string ) {
439454 const uri = vscode . Uri . parse ( `aws-dev2://state/${ path } -${ targetContext . extension . id } ` )
440455 const doc = await vscode . workspace . openTextDocument ( uri )
0 commit comments