Skip to content

Commit

Permalink
Fix codeq lookup of qualified symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoduncan committed Nov 30, 2012
1 parent eb61172 commit e18a25a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nrepl-codeq/src/ritz/nrepl/middleware/codeq.clj
Expand Up @@ -44,7 +44,7 @@
"Reply to codeq-def message" "Reply to codeq-def message"
[{:keys [project symbol ns datomic-url transport] :as msg}] [{:keys [project symbol ns datomic-url transport] :as msg}]
(try (try
(let [symbol (if (and symbol ns (.contains symbol "/")) (let [symbol (if (or (and symbol (.contains symbol "/")) (not ns))
symbol symbol
(str ns "/" symbol)) (str ns "/" symbol))
res (query-definitions symbol datomic-url)] res (query-definitions symbol datomic-url)]
Expand Down
10 changes: 10 additions & 0 deletions nrepl-codeq/test/ritz/nrepl/middleware/codeq_test.clj
Expand Up @@ -137,6 +137,16 @@ on the given transport with the handler, until the atom is set to false."
:id 0} :id 0}
(.take out))) (.take out)))


(is (= #{:done} (:status (.take out))))

(.offer in {:op "codeq-def" :symbol "trace" :ns "ritz.logging"
:datomic-url (datomic-url) :id 0})
(is (= {:value
[["(defmacro trace\n [fmt-str & args]\n `(log :trace ~fmt-str ~@args))"
"Sun Jul 03 02:08:35 UTC 2011"]]
:id 0}
(.take out)))

;; shut down the handle loop ;; shut down the handle loop
(reset! a false) (reset! a false)
(.offer in {:op "something to stop the handle loop"})))) (.offer in {:op "something to stop the handle loop"}))))

0 comments on commit e18a25a

Please sign in to comment.