Commit 309cb85
committed
Fix: REPL completion adds trailing backslash after keyword completion.
The REPL completer implemented by `rlcompleter.py` adds a trailing whitespace to keywords (except `finally` and `try`).
This makes sense as nothing else can follow those keywords, however, the current GraalPython completer implementation
via `JLineConsoleHandler` uses a DefaultParser for parsing completion candidates which escapes whitespace characters.
Therefore a trailing whitespace got replaced by '\ ' leading to a wrong completion. As a fix we overwrite the
`isDelimiterChar` method from the DefaultParser to never count the last character of a character sequence as a delimiter.
This works because we otherwise only use this check to split a line into it's words and in this case the last
character of the line also cannot be a delimiter.1 parent 88384a4 commit 309cb85
File tree
1 file changed
+16
-1
lines changed- graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell
1 file changed
+16
-1
lines changedLines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
116 | 131 | | |
117 | 132 | | |
118 | 133 | | |
| |||
0 commit comments