mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 15:41:37 -05:00
jupyter-completion-prefix (julia): Allow symbol key completion in dictionaries
This commit is contained in:
parent
67befbc10c
commit
6c7ceb4ae2
1 changed files with 12 additions and 6 deletions
|
@ -53,13 +53,19 @@
|
||||||
(jupyter-completion-symbol-beginning (1- (point)))
|
(jupyter-completion-symbol-beginning (1- (point)))
|
||||||
(point)))
|
(point)))
|
||||||
(t
|
(t
|
||||||
(let ((prefix (cl-call-next-method "\\\\\\|\\.\\|::" 2)))
|
(let ((prefix (cl-call-next-method "\\\\\\|\\.\\|::?" 2)))
|
||||||
(prog1 prefix
|
(prog1 prefix
|
||||||
(when (and (consp prefix)
|
(when (consp prefix)
|
||||||
(eq (char-before (- (point) (length (car prefix)))) ?\\))
|
(let ((beg (- (point) (length (car prefix)))))
|
||||||
;; Include the \ in the prefix so it gets replaced if a canidate is
|
(cond
|
||||||
;; selected.
|
;; Include the \ in the prefix so it gets replaced if a canidate is
|
||||||
(setcar prefix (concat "\\" (car prefix)))))))))
|
;; selected.
|
||||||
|
((eq (char-before beg) ?\\)
|
||||||
|
(setcar prefix (concat "\\" (car prefix))))
|
||||||
|
;; Also include : to complete symbols when used as dictionary keys
|
||||||
|
((and (eq (char-before beg) ?:)
|
||||||
|
(not (eq (char-before (1- beg)) ?:)))
|
||||||
|
(setcar prefix (concat ":" (car prefix))))))))))))
|
||||||
|
|
||||||
(cl-defmethod jupyter-completion-post-completion (candidate
|
(cl-defmethod jupyter-completion-post-completion (candidate
|
||||||
&context (jupyter-lang julia))
|
&context (jupyter-lang julia))
|
||||||
|
|
Loading…
Add table
Reference in a new issue