Skip to content

Commit

Permalink
[Fix #1540] Fix cider-complete-at-point
Browse files Browse the repository at this point in the history
  • Loading branch information
Malabarba committed Feb 7, 2016
1 parent 3aa5a35 commit 9a23cc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ and try to associate the created connection with this project automatically.

### Bugs fixed

* [#1540](https://github.com/clojure-emacs/cider/issues/1540): Fix cider-complete-at-point.
* [cider-nrepl#294](https://github.com/clojure-emacs/cider-nrepl/issues/294): Handle errors in the `complete-doc` nREPL op.
* [#1493](https://github.com/clojure-emacs/cider/issues/1493): Support special forms in eldoc.
* [#1529](https://github.com/clojure-emacs/cider/issues/1529): Close nREPL message buffer when you quit its matching connection.
Expand Down
15 changes: 7 additions & 8 deletions cider-interaction.el
Original file line number Diff line number Diff line change
Expand Up @@ -541,16 +541,15 @@ The formatting is performed by `cider-annotate-completion-function'."

(defun cider-complete-at-point ()
"Complete the symbol at point."
(when-let ((sap (cider-symbol-at-point)))
(when-let ((bounds (bounds-of-thing-at-point 'symbol)))
(when (and (cider-connected-p)
(not (or (cider-in-string-p) (cider-in-comment-p))))
(let ((bounds (bounds-of-thing-at-point 'symbol)))
(list (car bounds) (cdr bounds)
(completion-table-dynamic #'cider-complete)
:annotation-function #'cider-annotate-symbol
:company-doc-buffer #'cider-create-doc-buffer
:company-location #'cider-company-location
:company-docsig #'cider-company-docsig)))))
(list (car bounds) (cdr bounds)
(completion-table-dynamic #'cider-complete)
:annotation-function #'cider-annotate-symbol
:company-doc-buffer #'cider-create-doc-buffer
:company-location #'cider-company-location
:company-docsig #'cider-company-docsig))))

(defun cider-company-location (var)
"Open VAR's definition in a buffer.
Expand Down

0 comments on commit 9a23cc3

Please sign in to comment.