File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
packages/jupyterlab-lsp/src/features/completion Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 11
11
12
12
- delayed completion suggestions will no longer show up if cursor moved to another line ([ #496 ] )
13
13
- changes in notebooks after kernel restart or file rename will now be recorded by the language server again ([ #496 ] )
14
+ - when either of kernel providers: kernel or LSP server fails, the completion from the other will still be shown ([ #496 ] )
14
15
15
16
[ #496 ] : https://github.com/krassowski/jupyterlab-lsp/pull/496
16
17
Original file line number Diff line number Diff line change @@ -374,11 +374,9 @@ export class LSPConnector
374
374
] ) ;
375
375
}
376
376
377
- // TODO: use allSettled if available; requires ES2020 or a polyfill
378
- // allSettled ensures that the result is not lost if one of the promises rejects
379
377
promise = Promise . all ( [
380
- kernel_promise ,
381
- lsp_promise
378
+ kernel_promise . catch ( p => p ) ,
379
+ lsp_promise . catch ( p => p )
382
380
] ) . then ( ( [ kernel , lsp ] ) =>
383
381
this . merge_replies ( this . transform_reply ( kernel ) , lsp , this . _editor )
384
382
) ;
@@ -544,10 +542,17 @@ export class LSPConnector
544
542
) : CompletionHandler . ICompletionItemsReply {
545
543
this . console . debug ( 'Merging completions:' , lsp , kernel ) ;
546
544
547
- if ( ! kernel . items . length ) {
545
+ if ( kernel instanceof Error ) {
546
+ this . console . warn ( 'Caught kernel completions error' , kernel ) ;
547
+ }
548
+ if ( lsp instanceof Error ) {
549
+ this . console . warn ( 'Caught LSP completions error' , lsp ) ;
550
+ }
551
+
552
+ if ( kernel instanceof Error || ! kernel . items . length ) {
548
553
return lsp ;
549
554
}
550
- if ( ! lsp . items . length ) {
555
+ if ( lsp instanceof Error || ! lsp . items . length ) {
551
556
return kernel ;
552
557
}
553
558
You can’t perform that action at this time.
0 commit comments