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 66
77 - custom cell syntax highlighting is now properly removed when no longer needed ([ #387 ] )
88 - 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 ] )
910
1011[ #387 ] : https://github.com/krassowski/jupyterlab-lsp/issues/387
1112[ #389 ] : https://github.com/krassowski/jupyterlab-lsp/issues/389
13+ [ #391 ] : https://github.com/krassowski/jupyterlab-lsp/issues/391
1214
1315### ` @krassowski/jupyterlab-lsp 2.0.7 ` (2020-09-18)
1416
Original file line number Diff line number Diff line change @@ -47,6 +47,14 @@ Works In File Editor
4747 Completer Should Suggest add
4848 [Teardown] Clean Up After Working With File completion.py
4949
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+
5058Autocompletes If Only One Option
5159 Enter Cell Editor 3 line=1
5260 Press Keys None cle
Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ export class LSPConnector
205205 }
206206
207207 return promise . then ( reply => {
208- reply = this . suppress_if_needed ( reply ) ;
208+ reply = this . suppress_if_needed ( reply , token ) ;
209209 this . trigger_kind = CompletionTriggerKind . Invoked ;
210210 return reply ;
211211 } ) ;
@@ -413,9 +413,17 @@ export class LSPConnector
413413 return Promise . resolve ( undefined ) ;
414414 }
415415
416- private suppress_if_needed ( reply : CompletionHandler . ICompletionItemsReply ) {
416+ private suppress_if_needed (
417+ reply : CompletionHandler . ICompletionItemsReply ,
418+ token : CodeEditor . IToken
419+ ) {
417420 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+ ) {
419427 return {
420428 start : reply . start ,
421429 end : reply . end ,
You can’t perform that action at this time.
0 commit comments