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
54
54
Capture Page Screenshot 01-editor-ready.png
55
55
Press Keys None d
56
56
Completer Should Suggest addition
57
+ # gh430 - auto invoke after dot should work too
58
+ Press Keys None .
59
+ Completer Should Suggest __doc__
57
60
58
61
Autocompletes If Only One Option
59
62
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 {
44
44
afterChange ( change : CodeMirror . EditorChange ) : void {
45
45
// TODO: maybe the completer could be kicked off in the handleChange() method directly; signature help still
46
46
// 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
- }
57
47
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
58
51
let last_character = this . extract_last_character ( change ) ;
59
52
if ( this . completionCharacters . indexOf ( last_character ) > - 1 ) {
60
53
this . virtual_editor . console . log (
@@ -64,6 +57,17 @@ export class CompletionCM extends CodeMirrorIntegration {
64
57
( this . feature . labIntegration as CompletionLabIntegration )
65
58
. invoke_completer ( CompletionTriggerKind . TriggerCharacter )
66
59
. 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 ) ;
67
71
}
68
72
}
69
73
}
You can’t perform that action at this time.
0 commit comments