]> git.eshelyaron.com Git - emacs.git/commit
Respect the delimiter of completer in Python shell completion
authorLiu Hui <liuhui1610@gmail.com>
Thu, 18 Jan 2024 04:00:00 +0000 (12:00 +0800)
committerEshel Yaron <me@eshelyaron.com>
Fri, 9 Feb 2024 10:44:45 +0000 (11:44 +0100)
commit575a7662d5342b1d85025e50acb738beea5090f6
treea0978daa7d2d3514f4bd6ec345fb24ce6e5d8cef
parentdf01b4208ac2793b8680e499793be0da5db03c21
Respect the delimiter of completer in Python shell completion

* lisp/progmodes/python.el: (python-shell-completion-setup-code): Fix
the completion code of IPython.  Change the return value to JSON string
and ...
(python-shell-completion-get-completions): ... simplify parsing.
(inferior-python-mode): Update docstring.
(python-shell-readline-completer-delims): New variable indicating the
word delimiters of readline completer.
(python-shell-completion-native-setup): Set the completer delimiter.
(python-shell-completion-native-get-completions): Convert output string
to completions properly.
(python-shell--get-multiline-input)
(python-shell--extra-completion-context)
(python-shell-completion-extra-context): New functions.
(python-shell-completion-at-point): Send text beginning from the line
start if the completion backend does not need word splitting.  Remove
the detection of import statement because it is not needed anymore.
Create proper completion table based on completions returned from
different backends.

* test/lisp/progmodes/python-tests.el (python-tests--completion-module)
(python-tests--completion-parameters)
(python-tests--completion-extra-context): New helper functions.
(python-shell-completion-at-point-jedi-completer)
(python-shell-completion-at-point-ipython): New tests.  (bug#68559)

(cherry picked from commit 0b9c7148fd681c8ad63fd0eb3895db44403e9f8c)
lisp/progmodes/python.el
test/lisp/progmodes/python-tests.el