clojure-lsp / clojure-lsp

Clojure & ClojureScript Language Server (LSP) implementation
https://clojure-lsp.io
MIT License
1.15k stars 152 forks source link

Support to add project dependencies #461

Open wandersoncferreira opened 3 years ago

wandersoncferreira commented 3 years ago

Is your feature request related to a problem? Please describe. While working with clojure projects is common to include new libraries as dependencies. Right now, I am using clj-refactor to provide this functionality (https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-project-dependency) but would be nice to have this in clojure-lsp also.

Describe the solution you'd like Same behavior as clj-refactor https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-project-dependency but without hot-reload.

Additional context Something that clj-refactor does not take into account is to verify if a library already exists in your project. Therefore, if you try to include the same dependency more than one time, you will succeed. This could be a stretch goal to be fixed in this new version.

ericdallo commented 3 years ago

Thank you for the report!

It's a nice custom addition to clojure-lsp IMO, not so easy though. We'd need to create a custom LSP method for that that would request clojars/maven about the available artifacts and return to client so the client could ask for user which one use, after selected the client send again to server asking the available versions, which server requests again and return to client, then user selects the version, send to server and server make the proper changes on files.

ericdallo commented 3 years ago

I still need to check how clj-refactor requests clojars/maven and if that can cause any "too many requests" error.