Commit 88384a4
committed
REPL: Use tab instead of completion at beginning of line, complete on each word.
This commit enables tab usage in the graalpython REPL. For now in an otherwise empty line hitting the `key` inserts a tab
instead of activating completion. This aligns with the behaviour of the CPython REPL and also makes writing Python code
that needs indentation in the REPL more enjoyable.
Additionally, completion now happens on a word / token basis, which allows to get completion on more than the first word in a line.
E.g. completion on "for i in ra" will now offer completions for "ra" e.g. "range(".
This also aligns with the CPython REPL behaviour.
The implementation doesn't algin with CPython e.g. in not being able to add additional tabs after already written words in a line.
This is due to the implementation with `JLine` functionality. To reach full compatability it might be interesting to investigate why the
autocompletion with the completer from `rlcompleter.py` currently doesn't work completely e.g. for tab insertion.1 parent 10b3cde commit 88384a4
File tree
1 file changed
+4
-3
lines changed- graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell
1 file changed
+4
-3
lines changedLines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
0 commit comments