@@ -32,14 +32,10 @@ export class Messages {
3232 }
3333
3434 static async showKeyBindingsInfoMessage ( ) : Promise < MessageItem | undefined > {
35- const section = configuration . name ( 'advanced' ) ( 'messages' ) . value ;
36- const messages : { [ key : string ] : boolean } = configuration . get < { } > ( section ) ;
37-
38- if ( messages [ SuppressedMessages . ShowKeyBindingsNotice ] ) return undefined ;
35+ if ( Container . config . advanced . messages . suppressShowKeyBindingsNotice ) return undefined ;
3936
4037 if ( Container . config . keymap !== KeyMap . Alternate ) {
41- messages [ SuppressedMessages . ShowKeyBindingsNotice ] = true ;
42- await configuration . update ( section , messages , ConfigurationTarget . Global ) ;
38+ await this . suppressedMessage ( SuppressedMessages . ShowKeyBindingsNotice ) ;
4339
4440 return undefined ;
4541 }
@@ -115,16 +111,27 @@ export class Messages {
115111
116112 if ( dontShowAgain === null || result === dontShowAgain ) {
117113 Logger . log ( `ShowMessage(${ type } , '${ message } ', ${ suppressionKey } , ${ dontShowAgain } ) don't show again requested` ) ;
118-
119- const section = configuration . name ( 'advanced' ) ( 'messages' ) . value ;
120- const messages : { [ key : string ] : boolean } = configuration . get < { } > ( section ) ;
121- messages [ suppressionKey ] = true ;
122- await configuration . update ( section , messages , ConfigurationTarget . Global ) ;
114+ await this . suppressedMessage ( suppressionKey ) ;
123115
124116 if ( result === dontShowAgain ) return undefined ;
125117 }
126118
127119 Logger . log ( `ShowMessage(${ type } , '${ message } ', ${ suppressionKey } , ${ dontShowAgain } ) returned ${ result ? result . title : result } ` ) ;
128120 return result ;
129121 }
122+
123+ private static suppressedMessage ( suppressionKey : SuppressedMessages ) {
124+ const section = configuration . name ( 'advanced' ) ( 'messages' ) . value ;
125+ const messages : { [ key : string ] : boolean | undefined } = configuration . get < { } > ( section ) ;
126+
127+ messages [ suppressionKey ] = true ;
128+
129+ for ( const [ key , value ] of Object . entries ( messages ) ) {
130+ if ( value !== true ) {
131+ messages [ key ] = undefined ;
132+ }
133+ }
134+
135+ return configuration . update ( section , messages , ConfigurationTarget . Global ) ;
136+ }
130137}
0 commit comments