File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
packages/jupyterlab-lsp/src Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ import { ILoggerRegistry } from '@jupyterlab/logconsole';
20
20
import {
21
21
ILSPDocumentConnectionManager ,
22
22
DocumentConnectionManager ,
23
- ILanguageServerManager
23
+ ILanguageServerManager ,
24
+ TLanguageServerId
24
25
} from '@jupyterlab/lsp' ;
25
26
import { ISettingRegistry } from '@jupyterlab/settingregistry' ;
26
27
import { IStatusBar } from '@jupyterlab/statusbar' ;
@@ -175,7 +176,22 @@ export class LSPExtension {
175
176
176
177
const previousInitialConfig = this . _connectionManager . initialConfigurations ;
177
178
this . _connectionManager . initialConfigurations = languageServerSettings ;
178
- // TODO: if priorities changed reset connections
179
+
180
+ const prioritiesChanged = Object . keys ( languageServerSettings ) . some (
181
+ ( key : TLanguageServerId ) => {
182
+ const prevConfig = previousInitialConfig ?. [ key ] ;
183
+ const newConfig = languageServerSettings [ key ] ;
184
+ return prevConfig && newConfig && prevConfig . rank !== newConfig . rank ;
185
+ }
186
+ ) ;
187
+
188
+ if ( prioritiesChanged ) {
189
+ this . connectionManager . adapters . forEach ( adapter => {
190
+ if ( adapter . virtualDocument ) {
191
+ adapter [ 'reloadConnection' ] ( ) ;
192
+ }
193
+ } ) ;
194
+ }
179
195
180
196
// update the server-independent part of configuration immediately
181
197
this . connectionManager . updateConfiguration ( languageServerSettings ) ;
You can’t perform that action at this time.
0 commit comments