@@ -25,17 +25,19 @@ let defaultClient: LanguageClient;
2525let clients : Map < string , LanguageClient > = new Map ( ) ;
2626
2727function registerCustomCommands ( context : ExtensionContext ) {
28- context . subscriptions . push ( Commands . registerCommand ( 'lua.config' , ( data ) => {
29- let config = Workspace . getConfiguration ( undefined , Uri . parse ( data . uri ) ) ;
30- if ( data . action == 'add' ) {
31- let value : any [ ] = config . get ( data . key ) ;
32- value . push ( data . value ) ;
33- config . update ( data . key , value , data . global ) ;
34- return ;
35- }
36- if ( data . action == 'set' ) {
37- config . update ( data . key , data . value , data . global ) ;
38- return ;
28+ context . subscriptions . push ( Commands . registerCommand ( 'lua.config' , ( changes ) => {
29+ for ( const data of changes ) {
30+ let config = Workspace . getConfiguration ( undefined , Uri . parse ( data . uri ) ) ;
31+ if ( data . action == 'add' ) {
32+ let value : any [ ] = config . get ( data . key ) ;
33+ value . push ( data . value ) ;
34+ config . update ( data . key , value , data . global ) ;
35+ continue ;
36+ }
37+ if ( data . action == 'set' ) {
38+ config . update ( data . key , data . value , data . global ) ;
39+ continue ;
40+ }
3941 }
4042 } ) )
4143}
0 commit comments