@@ -171,13 +171,46 @@ export function registerCommands(
171
171
registerCommandWithTreeNodeUnwrapping ( 'azureFunctions.stopFunctionApp' , stopFunctionApp ) ;
172
172
registerCommandWithTreeNodeUnwrapping ( 'azureFunctions.stopStreamingLogs' , stopStreamingLogs ) ;
173
173
registerCommandWithTreeNodeUnwrapping ( 'azureFunctions.swapSlot' , swapSlot ) ;
174
+ // Monkey-patch AppSettingTreeItem to include visibility state in contextValue
175
+ const originalContextValueGetter = Object . getOwnPropertyDescriptor ( AppSettingTreeItem . prototype , 'contextValue' ) ?. get ;
176
+ if ( originalContextValueGetter ) {
177
+ Object . defineProperty ( AppSettingTreeItem . prototype , 'contextValue' , {
178
+ get : function ( ) {
179
+ const originalValue = originalContextValueGetter . call ( this ) ;
180
+ const isHidden = this . label . includes ( 'Hidden value' ) ;
181
+ return isHidden ? `${ originalValue } ;hidden` : `${ originalValue } ;visible` ;
182
+ } ,
183
+ configurable : true
184
+ } ) ;
185
+ }
186
+
174
187
registerCommandWithTreeNodeUnwrapping (
175
188
'azureFunctions.toggleAppSettingVisibility' ,
176
189
async ( context : IActionContext , node : AppSettingTreeItem ) => {
177
190
await node . toggleValueVisibility ( context ) ;
178
191
} ,
179
192
250 ,
180
193
) ;
194
+ registerCommandWithTreeNodeUnwrapping (
195
+ 'azureFunctions.showAppSettingValue' ,
196
+ async ( context : IActionContext , node : AppSettingTreeItem ) => {
197
+ // Only show if currently hidden
198
+ if ( node . label . includes ( 'Hidden value' ) ) {
199
+ await node . toggleValueVisibility ( context ) ;
200
+ }
201
+ } ,
202
+ 250 ,
203
+ ) ;
204
+ registerCommandWithTreeNodeUnwrapping (
205
+ 'azureFunctions.hideAppSettingValue' ,
206
+ async ( context : IActionContext , node : AppSettingTreeItem ) => {
207
+ // Only hide if currently shown
208
+ if ( ! node . label . includes ( 'Hidden value' ) ) {
209
+ await node . toggleValueVisibility ( context ) ;
210
+ }
211
+ } ,
212
+ 250 ,
213
+ ) ;
181
214
registerCommandWithTreeNodeUnwrapping ( 'azureFunctions.uninstallFuncCoreTools' , uninstallFuncCoreTools ) ;
182
215
registerCommandWithTreeNodeUnwrapping ( 'azureFunctions.viewCommitInGitHub' , viewCommitInGitHub ) ;
183
216
registerSiteCommand ( 'azureFunctions.viewDeploymentLogs' , unwrapTreeNodeCommandCallback ( viewDeploymentLogs ) ) ;
0 commit comments