File tree Expand file tree Collapse file tree 5 files changed +21
-8
lines changed
packages/jupyterlab-lsp/src Expand file tree Collapse file tree 5 files changed +21
-8
lines changed Original file line number Diff line number Diff line change 1
1
## Changelog
2
2
3
- ### (unreleased)
3
+ ### ` @krassowski/jupyterlab-lsp 3.7.0 ` (unreleased)
4
4
5
- - Add ability to deactivate Kernel completions or LSP completion through the settings.
5
+ - features:
6
+
7
+ - add ability to deactivate Kernel completions or LSP completion through the settings ([ #586 ] , thanks @Carreau )
8
+ - allow to set a priority for LSP server, allowing to choose which server to use when multiple servers are installed ([ #588 ] )
9
+
10
+ [ #586 ] : https://github.com/krassowski/jupyterlab-lsp/pull/586
11
+ [ #588 ] : https://github.com/krassowski/jupyterlab-lsp/pull/588
6
12
7
13
### ` jupyter-lsp 1.2.0 ` (2021-04-26)
8
14
Original file line number Diff line number Diff line change @@ -493,7 +493,7 @@ export namespace LSPStatus {
493
493
} ) ;
494
494
// TODO server.status === "started" ?
495
495
// TODO update once multiple servers are allowed
496
- if ( matchedServers [ 0 ] === id ) {
496
+ if ( matchedServers . length && matchedServers [ 0 ] === id ) {
497
497
return true ;
498
498
}
499
499
}
@@ -590,10 +590,11 @@ export namespace LSPStatus {
590
590
591
591
detected_documents . forEach ( ( document , uri ) => {
592
592
let connection = this . _connection_manager . connections . get ( uri ) ;
593
- let server_id = this . _connection_manager . language_server_manager . getMatchingServers (
593
+ let server_ids = this . _connection_manager . language_server_manager . getMatchingServers (
594
594
{ language : document . language }
595
595
) ;
596
- if ( server_id !== null ) {
596
+
597
+ if ( server_ids . length !== 0 ) {
597
598
documents_with_known_servers . add ( document ) ;
598
599
}
599
600
if ( ! connection ) {
Original file line number Diff line number Diff line change @@ -12,13 +12,17 @@ import * as lsProtocol from 'vscode-languageserver-protocol';
12
12
13
13
import { until_ready } from './utils' ;
14
14
15
- interface ILSPOptions extends ILspOptions { }
15
+ interface ILSPOptions extends ILspOptions {
16
+ serverIdentifier ?: string ;
17
+ }
16
18
17
19
export class LSPConnection extends LspWsConnection {
18
20
protected documentsToOpen : IDocumentInfo [ ] ;
21
+ public serverIdentifier : string ;
19
22
20
23
constructor ( options : ILSPOptions ) {
21
24
super ( options ) ;
25
+ this . serverIdentifier = options ?. serverIdentifier ;
22
26
this . documentsToOpen = [ ] ;
23
27
}
24
28
Original file line number Diff line number Diff line change @@ -444,7 +444,8 @@ namespace Private {
444
444
const connection = new LSPConnection ( {
445
445
languageId : language ,
446
446
serverUri : uris . server ,
447
- rootUri : uris . base
447
+ rootUri : uris . base ,
448
+ serverIdentifier : language_server_id
448
449
} ) ;
449
450
// TODO: remove remaining unbounded users of connection.on
450
451
connection . setMaxListeners ( 999 ) ;
Original file line number Diff line number Diff line change @@ -242,7 +242,8 @@ function FeatureSupport<TBase extends TestEnvironmentConstructor>(Base: TBase) {
242
242
return new LSPConnection ( {
243
243
languageId : this . document_options . language ,
244
244
serverUri : 'ws://localhost:8080' ,
245
- rootUri : 'file:///unit-test'
245
+ rootUri : 'file:///unit-test' ,
246
+ serverIdentifier : 'pylsp'
246
247
} ) ;
247
248
}
248
249
You can’t perform that action at this time.
0 commit comments