clojure-emacs / clojure-emacs/clj-refactor.el

move-form has the possibility of creating invalid namespaces

Open
#199 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Emacs Lisp
Stars
785
Forks
110
PR merge metrics
No merged PRs in 30d

Description

If you have the files

```
(ns website.views.analyse-repo
(:require [hiccup.core :as h]))

(defn index [name]
(h/h name))
```

and

```
(ns website.views.layout
(:require [hiccup.page :as h]))

(defn other-func []
(h/html5 "OK"))
```

and you use move-form to move `index` to `layout.clj`, then the resulting namespace in that file will be

```
(ns website.views.layout
(:require [hiccup.page :as h]
[hiccup.core :as h]))
```

Maybe clj-refactor should offer to fix that when it happens?

However, that sounds like it's probably very troublesome to implement. If that's the case, it would be nice to at least get a message about that before or after I make the move, instead of finding out with an evaluation error further down the line.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.