File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed
packages/jupyterlab-lsp/src/features/completion Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ Continious Hinting Works
5454 Capture Page Screenshot 01-editor-ready.png
5555 Press Keys None d
5656 Completer Should Suggest addition
57+ # gh430 - auto invoke after dot should work too
58+ Press Keys None .
59+ Completer Should Suggest __doc__
5760
5861Autocompletes If Only One Option
5962 Enter Cell Editor 3 line=1
Original file line number Diff line number Diff line change @@ -44,17 +44,10 @@ export class CompletionCM extends CodeMirrorIntegration {
4444 afterChange ( change : CodeMirror . EditorChange ) : void {
4545 // TODO: maybe the completer could be kicked off in the handleChange() method directly; signature help still
4646 // requires an up-to-date virtual document on the LSP side, so we need to wait for sync.
47- if (
48- change . text &&
49- change . text [ 0 ] . length == 1 &&
50- this . settings . composite . continuousHinting
51- ) {
52- ( this . feature . labIntegration as CompletionLabIntegration )
53- . invoke_completer ( AdditionalCompletionTriggerKinds . AutoInvoked )
54- . catch ( console . warn ) ;
55- return ;
56- }
5747
48+ // note: trigger character completion need to be have a higher priority than auto-invoked completion
49+ // because the latter does not work for on-dot completion due to suppression of trivial suggestions
50+ // see gh430
5851 let last_character = this . extract_last_character ( change ) ;
5952 if ( this . completionCharacters . indexOf ( last_character ) > - 1 ) {
6053 this . virtual_editor . console . log (
@@ -64,6 +57,17 @@ export class CompletionCM extends CodeMirrorIntegration {
6457 ( this . feature . labIntegration as CompletionLabIntegration )
6558 . invoke_completer ( CompletionTriggerKind . TriggerCharacter )
6659 . catch ( console . warn ) ;
60+ return ;
61+ }
62+
63+ if (
64+ change . text &&
65+ change . text [ 0 ] . length == 1 &&
66+ this . settings . composite . continuousHinting
67+ ) {
68+ ( this . feature . labIntegration as CompletionLabIntegration )
69+ . invoke_completer ( AdditionalCompletionTriggerKinds . AutoInvoked )
70+ . catch ( console . warn ) ;
6771 }
6872 }
6973}
You can’t perform that action at this time.
0 commit comments