88 commands as Commands ,
99 TextDocument ,
1010 WorkspaceFolder ,
11- Uri
11+ Uri ,
1212} from 'vscode' ;
1313import {
1414 LanguageClient ,
@@ -24,7 +24,7 @@ let clients: Map<string, LanguageClient> = new Map();
2424
2525function registerCustomCommands ( context : ExtensionContext ) {
2626 context . subscriptions . push ( Commands . registerCommand ( 'lua.config' , ( data ) => {
27- let config = Workspace . getConfiguration ( )
27+ let config = Workspace . getConfiguration ( undefined , Uri . parse ( data . uri ) )
2828 if ( data . action == 'add' ) {
2929 let value : any [ ] = config . get ( data . key ) ;
3030 value . push ( data . value ) ;
@@ -143,16 +143,14 @@ function start(context: ExtensionContext, documentSelector: DocumentSelector, fo
143143 ) ;
144144
145145 client . registerProposedFeatures ( ) ;
146-
147- patch . patch ( client ) ;
148-
149146 client . start ( ) ;
150147
151148 return client ;
152149}
153150
154151export function activate ( context : ExtensionContext ) {
155152 registerCustomCommands ( context ) ;
153+ patch . patch ( ) ;
156154 function didOpenTextDocument ( document : TextDocument ) : void {
157155 // We are only interested in language mode text
158156 if ( document . languageId !== 'lua' || ( document . uri . scheme !== 'file' && document . uri . scheme !== 'untitled' ) ) {
@@ -188,7 +186,7 @@ export function activate(context: ExtensionContext) {
188186 Workspace . onDidOpenTextDocument ( didOpenTextDocument ) ;
189187 Workspace . textDocuments . forEach ( didOpenTextDocument ) ;
190188 Workspace . onDidChangeWorkspaceFolders ( ( event ) => {
191- for ( let folder of event . removed ) {
189+ for ( let folder of event . removed ) {
192190 let client = clients . get ( folder . uri . toString ( ) ) ;
193191 if ( client ) {
194192 clients . delete ( folder . uri . toString ( ) ) ;
0 commit comments