-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"cljr clean ns" should keep namespace meta information #223
Comments
I can't reproduce, but I know this was a problem in the past. What's the output of If it's anything other than
I'd appreciate if you upgraded, tried again, and posted a minimal example exhibiting the problem if it still persists. |
Yes, I have the latest versions as shown above. The bug can be reproduced when there is a comment before the name space declaration. A minimal example follows: ;; ===========================================================================
;;
;; Copyright (c) Example Inc. All rights reserved.
;;
;; ===========================================================================
(ns ^{:doc "Important documentation"}
example.core
(:import java.io.ByteArrayInputStream)
(:require [clj-time.core :as t]
[clojure.string :as s]
[clojure.java.io :as io]
[taoensso.timbre :as timbre]))
(timbre/refer-timbre)
(defn foo
"I don't do a whole lot."
[x]
(let [t (t/now)
ss (ByteArrayInputStream. (io/file "afile.txt"))]
(println (s/trim x) "Hello, World!"))) The presence of the copyright notice will trigger the bug. Removing it removes the bug, but it is common for copyright notice to appear at that position. |
If the file started with a comment, clean-ns, would fail to retrieve the metadata. Fixes clojure-emacs/clj-refactor.el#223
If the file started with a comment, clean-ns, would fail to retrieve the metadata. Fixes clojure-emacs/clj-refactor.el#223
I've deployed a new snapshot containing this fix. Thanks for the bug report @huahaiy! |
Thanks for the quick fix. |
Such as :doc and :author, etc, instead of removing them.
The text was updated successfully, but these errors were encountered: