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
65
65
66
66
context . subscriptions . push (
67
67
vscode . workspace . onDidChangeConfiguration ( async ( event ) => {
68
+ const affectedFolders = new Set < vscode . Uri > ( ) ;
69
+
68
70
for ( const s of [
69
71
"robotcode.python" ,
70
72
"robotcode.languageServer" ,
71
73
"robotcode.robot" ,
72
74
"robotcode.robocop" ,
73
75
"robotcode.robotidy" ,
74
76
] ) {
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
+ }
77
82
}
78
83
}
84
+
85
+ for ( const uri of affectedFolders ) {
86
+ await languageClientManger . restart ( uri ) ;
87
+ }
79
88
} )
80
89
) ;
81
90
}
Original file line number Diff line number Diff line change @@ -438,9 +438,9 @@ export class LanguageClientsManager {
438
438
} ) ;
439
439
}
440
440
441
- public async restart ( ) : Promise < void > {
441
+ public async restart ( uri ?: vscode . Uri ) : Promise < void > {
442
442
this . _pythonValidPythonAndRobotEnv = new WeakMap < vscode . WorkspaceFolder , boolean > ( ) ;
443
- await this . refresh ( ) ;
443
+ await this . refresh ( uri , true ) ;
444
444
}
445
445
446
446
public async refresh ( uri ?: vscode . Uri , restart ?: boolean ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments