@@ -61,57 +61,59 @@ let targetAuth: Auth
6161 * on selection. There is no support for name-spacing. Just add the relevant
6262 * feature/module as a description so it can be moved around easier.
6363 */
64- const menuOptions : Record < DevFunction , MenuOption > = {
65- installVsix : {
66- label : 'Install VSIX on Remote Environment' ,
67- description : 'CodeCatalyst' ,
68- detail : 'Automatically upload/install a VSIX to a remote host' ,
69- executor : installVsixCommand ,
70- } ,
71- openTerminal : {
72- label : 'Open Remote Terminal' ,
73- description : 'CodeCatalyst' ,
74- detail : 'Opens a new terminal connected to the remote environment' ,
75- executor : openTerminalCommand ,
76- } ,
77- deleteDevEnv : {
78- label : 'Delete Workspace' ,
79- description : 'CodeCatalyst' ,
80- detail : 'Deletes the selected Dev Environment' ,
81- executor : deleteDevEnvCommand ,
82- } ,
83- editStorage : {
84- label : 'Show or Edit globalState' ,
85- description : 'VS Code' ,
86- detail : 'Shows all globalState values, or edit a globalState/secret item' ,
87- executor : openStorageFromInput ,
88- } ,
89- showEnvVars : {
90- label : 'Show Environment Variables' ,
91- description : 'AWS Toolkit' ,
92- detail : 'Shows all environment variable values' ,
93- executor : ( ) => showState ( 'envvars' ) ,
94- } ,
95- deleteSsoConnections : {
96- label : 'Auth: Delete SSO Connections' ,
97- detail : 'Deletes all SSO Connections the extension is using.' ,
98- executor : deleteSsoConnections ,
99- } ,
100- expireSsoConnections : {
101- label : 'Auth: Expire SSO Connections' ,
102- detail : 'Force expires all SSO Connections, in to a "needs reauthentication" state.' ,
103- executor : expireSsoConnections ,
104- } ,
105- editAuthConnections : {
106- label : 'Auth: Edit Connections' ,
107- detail : 'Opens editor to all Auth Connections the extension is using.' ,
108- executor : editSsoConnections ,
109- } ,
110- forceIdeCrash : {
111- label : 'Crash: Force IDE ExtHost Crash' ,
112- detail : `Will SIGKILL ExtHost, { pid: ${ process . pid } , sessionId: '${ getSessionId ( ) . slice ( 0 , 8 ) } -...' }, but the IDE itself will not crash.` ,
113- executor : forceQuitIde ,
114- } ,
64+ const menuOptions : ( ) => Record < DevFunction , MenuOption > = ( ) => {
65+ return {
66+ installVsix : {
67+ label : 'Install VSIX on Remote Environment' ,
68+ description : 'CodeCatalyst' ,
69+ detail : 'Automatically upload/install a VSIX to a remote host' ,
70+ executor : installVsixCommand ,
71+ } ,
72+ openTerminal : {
73+ label : 'Open Remote Terminal' ,
74+ description : 'CodeCatalyst' ,
75+ detail : 'Opens a new terminal connected to the remote environment' ,
76+ executor : openTerminalCommand ,
77+ } ,
78+ deleteDevEnv : {
79+ label : 'Delete Workspace' ,
80+ description : 'CodeCatalyst' ,
81+ detail : 'Deletes the selected Dev Environment' ,
82+ executor : deleteDevEnvCommand ,
83+ } ,
84+ editStorage : {
85+ label : 'Show or Edit globalState' ,
86+ description : 'VS Code' ,
87+ detail : 'Shows all globalState values, or edit a globalState/secret item' ,
88+ executor : openStorageFromInput ,
89+ } ,
90+ showEnvVars : {
91+ label : 'Show Environment Variables' ,
92+ description : 'AWS Toolkit' ,
93+ detail : 'Shows all environment variable values' ,
94+ executor : ( ) => showState ( 'envvars' ) ,
95+ } ,
96+ deleteSsoConnections : {
97+ label : 'Auth: Delete SSO Connections' ,
98+ detail : 'Deletes all SSO Connections the extension is using.' ,
99+ executor : deleteSsoConnections ,
100+ } ,
101+ expireSsoConnections : {
102+ label : 'Auth: Expire SSO Connections' ,
103+ detail : 'Force expires all SSO Connections, in to a "needs reauthentication" state.' ,
104+ executor : expireSsoConnections ,
105+ } ,
106+ editAuthConnections : {
107+ label : 'Auth: Edit Connections' ,
108+ detail : 'Opens editor to all Auth Connections the extension is using.' ,
109+ executor : editSsoConnections ,
110+ } ,
111+ forceIdeCrash : {
112+ label : 'Crash: Force IDE ExtHost Crash' ,
113+ detail : `Will SIGKILL ExtHost, { pid: ${ process . pid } , sessionId: '${ getSessionId ( ) . slice ( 0 , 8 ) } -...' }, but the IDE itself will not crash.` ,
114+ executor : forceQuitIde ,
115+ } ,
116+ }
115117}
116118
117119/**
@@ -167,7 +169,7 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
167169 globalState = targetContext . globalState
168170 targetAuth = opts . auth
169171 void openMenu (
170- entries ( menuOptions )
172+ entries ( menuOptions ( ) )
171173 . filter ( ( e ) => ( opts . menuOptions ?? Object . keys ( menuOptions ) ) . includes ( e [ 0 ] ) )
172174 . map ( ( e ) => e [ 1 ] )
173175 )
0 commit comments