Open dgr opened 2 years ago
Sounds like a resaonsable request.
The code that does the insertion in question is https://github.com/clojure-emacs/clj-refactor.el/blob/542225248e8d27111d6164292b37058ad5194984/clj-refactor.el#L2288-L2296
Doing an artifact
search between the beginning and the end of the :deps "block" doesn't seem too hard. You can use Paredit commands for determining these boundaries.
PR welcome otherwise this might linger for quite a while.
Cheers - V
I added a dependency to a project but forgot to
:require
it in the namespace form. A few days later, thinking that I needed it again, I re-added it viaap
. Later, when looking at thedips.edn
file, I noticed that it was added twice.Expected behavior
It should just add it to the project file (
deps.edn
,project.clj
, etc.) once. If a duplicate is detected, do not add it to the project file, and possibly inform the user so that she doesn't think that she needs to restart the REPL to include the "new" dependency.Actual behavior
Adds the dependency to the project file more than once. I have not checked whether this happens to all types of project files (e.g.,
deps.edn
andproject.clj
) or justdeps.edn
.Steps to reproduce the problem
Add a project to the project file twice using
ap
.Environment & Version information
clj-refactor.el version information
cli-refactor 3.3.2 (package 20220213.1906), refactor-nrepl 3.3.2
CIDER version information
Leiningen or Boot version
Emacs version
Emacs 28.0.91
Operating system
MacOS 12.2.1