Skip to content

Commit

Permalink
le-python.el: Turn e.g. "foo(" into "foo" for Python completion
Browse files Browse the repository at this point in the history
* le-python.el (lispy-python-completion-at-point): Update.
  • Loading branch information
abo-abo committed Jan 25, 2017
1 parent 6e64df1 commit f302c97
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion le-python.el
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,18 @@ Stripping them will produce code that's valid for an eval."
(end (if bnd (cdr bnd) (point))))
(list beg end cands)))
(t
(python-shell-completion-at-point (lispy--python-proc)))))
(let ((comp (python-shell-completion-at-point (lispy--python-proc))))
(list (nth 0 comp)
(nth 1 comp)
(mapcar (lambda (s)
(if (string-match "(\\'" s)
(substring s 0 (match-beginning 0))
s))
(all-completions
(buffer-substring-no-properties
(nth 0 comp)
(nth 1 comp))
(nth 2 comp))))))))

(defvar lispy--python-arg-key-re "\\`\\(\\(?:\\sw\\|\\s_\\)+\\) ?= ?\\(.*\\)\\'"
"Constant regexp for matching function keyword spec.")
Expand Down

0 comments on commit f302c97

Please sign in to comment.