Skip to content

Commit

Permalink
Make cljr-add-stubs play better with :imported symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
vemv committed Feb 19, 2021
1 parent d5f3b1a commit ba996bc
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions clj-refactor.el
Original file line number Diff line number Diff line change
Expand Up @@ -3074,18 +3074,12 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-extract-function
See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-stubs"
(interactive)
(cljr--ensure-op-supported "stubs-for-interface")
(let* ((interface (cider-symbol-at-point))
(prefix? (cljr--symbol-prefix interface))
(alias? (cljr--resolve-alias prefix?))
(interface (if (not (string-blank-p prefix?))
(if alias?
(format "%s/%s" alias? (cljr--symbol-suffix interface))
interface)
(format "%s/%s" (cider-current-ns) interface)))
;; https://github.com/clojure-emacs/clj-refactor.el/issues/479
(let* ((interface (vemv.clojure-interaction/sync-eval-to-string (cider-symbol-at-point)))
(functions (parseedn-read-str (cljr--call-middleware-sync
(cljr--create-msg "stubs-for-interface"
"interface" interface)
"functions"))))
(cljr--create-msg "stubs-for-interface"
"interface" interface)
"functions"))))
(cljr--insert-function-stubs functions)))

(defun cljr--delete-definition (definition)
Expand Down

0 comments on commit ba996bc

Please sign in to comment.