[WIP] Back to the old prefix behavior in company-jupyter-repl

This needs to be changed. `company-grab-symbol` will only grab 'bar' when
cursor is at | in the following:

    foo.bar|

We would like it to grab the whole 'foo.bar' and let the kernel figure out what
to do. Similarly for other operators like '->'. The problem that needs to be
fixed is to properly replace just the 'bar' part if 'foo.bar' is the prefix. I
believe the `match` command of a company backend will be of use.
This commit is contained in:
Nathaniel Nicandro 2018-01-07 14:10:52 -06:00
parent 8431e6834b
commit 9e2db2146b

View file

@ -707,11 +707,13 @@ The first character of the cell code corresponds to position 1."
(prefix (and (eq major-mode 'jupyter-repl-mode) (prefix (and (eq major-mode 'jupyter-repl-mode)
(not (get-text-property (point) 'read-only)) (not (get-text-property (point) 'read-only))
;; Just grab a symbol, we will just send the whole code cell ;; Just grab a symbol, we will just send the whole code cell
(buffer-substring (or (save-excursion (company-grab-symbol)
(when (re-search-backward "[ \t]" (point-at-bol) 'noerror) ;; (buffer-substring (or (save-excursion
(1+ (point)))) ;; (when (re-search-backward "[ \t]" (point-at-bol) 'noerror)
(point-at-bol)) ;; (1+ (point))))
(point)))) ;; (point-at-bol))
;; (point))
))
(candidates (candidates
(cons (cons
:async :async