File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -65,17 +65,26 @@ export async function activateAsync(context: vscode.ExtensionContext): Promise<v
6565
6666 context . subscriptions . push (
6767 vscode . workspace . onDidChangeConfiguration ( async ( event ) => {
68+ const affectedFolders = new Set < vscode . Uri > ( ) ;
69+
6870 for ( const s of [
6971 "robotcode.python" ,
7072 "robotcode.languageServer" ,
7173 "robotcode.robot" ,
7274 "robotcode.robocop" ,
7375 "robotcode.robotidy" ,
7476 ] ) {
75- if ( event . affectsConfiguration ( s ) ) {
76- await languageClientManger . restart ( ) ;
77+ for ( const ws of vscode . workspace . workspaceFolders ?? [ ] ) {
78+ if ( languageClientManger . clients . has ( ws . uri . toString ( ) ) )
79+ if ( event . affectsConfiguration ( s , ws ) ) {
80+ affectedFolders . add ( ws . uri ) ;
81+ }
7782 }
7883 }
84+
85+ for ( const uri of affectedFolders ) {
86+ await languageClientManger . restart ( uri ) ;
87+ }
7988 } )
8089 ) ;
8190}
Original file line number Diff line number Diff line change @@ -438,9 +438,9 @@ export class LanguageClientsManager {
438438 } ) ;
439439 }
440440
441- public async restart ( ) : Promise < void > {
441+ public async restart ( uri ?: vscode . Uri ) : Promise < void > {
442442 this . _pythonValidPythonAndRobotEnv = new WeakMap < vscode . WorkspaceFolder , boolean > ( ) ;
443- await this . refresh ( ) ;
443+ await this . refresh ( uri , true ) ;
444444 }
445445
446446 public async refresh ( uri ?: vscode . Uri , restart ?: boolean ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments