File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
packages/jupyterlab-lsp/src/features/completion Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 6
6
7
7
- custom cell syntax highlighting is now properly removed when no longer needed ([ #387 ] )
8
8
- the completer in continuous hinting now works well with the pasted text ([ #389 ] )
9
+ - continuous hinting suggestions will no longer show up if the only hint is the same as the current token ([ #391 ] )
9
10
10
11
[ #387 ] : https://github.com/krassowski/jupyterlab-lsp/issues/387
11
12
[ #389 ] : https://github.com/krassowski/jupyterlab-lsp/issues/389
13
+ [ #391 ] : https://github.com/krassowski/jupyterlab-lsp/issues/391
12
14
13
15
### ` @krassowski/jupyterlab-lsp 2.0.7 ` (2020-09-18)
14
16
Original file line number Diff line number Diff line change @@ -47,6 +47,14 @@ Works In File Editor
47
47
Completer Should Suggest add
48
48
[Teardown] Clean Up After Working With File completion.py
49
49
50
+ Continious Hinting Works
51
+ Configure JupyterLab Plugin {"continuousHinting": true} plugin id=${COMPLETION PLUGIN ID }
52
+ Prepare File for Editing Python completion completion.py
53
+ Place Cursor In File Editor At 9 2
54
+ Capture Page Screenshot 01-editor-ready.png
55
+ Press Keys None d
56
+ Completer Should Suggest addition
57
+
50
58
Autocompletes If Only One Option
51
59
Enter Cell Editor 3 line=1
52
60
Press Keys None cle
Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ export class LSPConnector
205
205
}
206
206
207
207
return promise . then ( reply => {
208
- reply = this . suppress_if_needed ( reply ) ;
208
+ reply = this . suppress_if_needed ( reply , token ) ;
209
209
this . trigger_kind = CompletionTriggerKind . Invoked ;
210
210
return reply ;
211
211
} ) ;
@@ -413,9 +413,17 @@ export class LSPConnector
413
413
return Promise . resolve ( undefined ) ;
414
414
}
415
415
416
- private suppress_if_needed ( reply : CompletionHandler . ICompletionItemsReply ) {
416
+ private suppress_if_needed (
417
+ reply : CompletionHandler . ICompletionItemsReply ,
418
+ token : CodeEditor . IToken
419
+ ) {
417
420
if ( this . trigger_kind == AdditionalCompletionTriggerKinds . AutoInvoked ) {
418
- if ( reply . start == reply . end ) {
421
+ if (
422
+ // do not auto-invoke if no match found
423
+ reply . start == reply . end ||
424
+ // do not auto-invoke if only one match found and this match is exactly the same as the current token
425
+ ( reply . items . length === 1 && reply . items [ 0 ] . insertText === token . value )
426
+ ) {
419
427
return {
420
428
start : reply . start ,
421
429
end : reply . end ,
You can’t perform that action at this time.
0 commit comments