Skip to content
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

clojure-sort-ns does not handle forms like :gen-class #527

Open
xiongtx opened this issue May 28, 2019 · 2 comments
Open

clojure-sort-ns does not handle forms like :gen-class #527

xiongtx opened this issue May 28, 2019 · 2 comments
Labels

Comments

@xiongtx
Copy link
Member

xiongtx commented May 28, 2019

Expected behavior

clojure-sort-ns should handle the whole ns form, including :gen-class.

Actual behavior

clojure-sort-ns chokes on forms like :gen-class.

Steps to reproduce the problem

Create a .clj file w/ the following ns form:

(ns foo
  (:gen-class
   :methods [[methodOne [] String]
             [methodTwo [] String]]
   :init init))

Run clojure-sort-ns and see that the form is mangled:

(ns foo
  (:gen-class
   :methods [[methodOne [] String]
             :init init
             [methodTwo [] String]]))

Environment & Version information

clojure-mode version information

20190105.1043

Emacs version

26.1

Operating system

Fedora 28

@bbatsov
Copy link
Member

bbatsov commented Mar 21, 2020

I wonder if we would be able to persuade @yuhan0 to take a stab at this one. 😉

@bbatsov bbatsov added the bug label Mar 21, 2020
@yuhan0
Copy link
Contributor

yuhan0 commented Mar 21, 2020

I tried running clojure-sort-ns on the above form and it produced

(ns foo
  (:gen-class
   :init init
             :methods [[methodOne [] String]
   [methodTwo [] String]]))

which after manual indentation becomes

(ns foo
  (:gen-class
   :init init
   :methods [[methodOne [] String]
             [methodTwo [] String]]))

Maybe this already got fixed in the meantime?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants