clojure-lsp is commonly used in a text editor, but it has its own API featuring the main features that can be used as a library or via CLI. This is a new feature and it's experimental, so things can break at any moment, so please open an issue if you find anything wrong.
clojure-lsp --help
should show all available commands and options.
The namespace clojure-lsp.api should be used as the entrypoint for all available features of the CLI and some specific for library only usage, feel free to open a issue for missing features.
Below is an example using the clean-ns feature on a deps.edn
project:
{:aliases
{:lint-ns {:replace-deps {com.github.clojure-lsp/clojure-lsp {:mvn/version "..."}}
:exec-fn clojure-lsp.api/clean-ns!
:exec-args {:dry? true}}}}
You can use setup-clojure-lsp GitHub action to install clojure-lsp in a CI.
Remember to install your build tool, like clojure
or leiningen
as well in your CI according to your project to clojure-lsp be able to scan the classpath correctly.
To run clojure-lsp from Leiningen easily, check lein-clojure-lsp plugin.
clojure-lsp will check for .lsp/config.edn
in the project or home dir, but it's possible to force override the settings via the :settings
option of the API or --settings
option of the CLI.
For all available settings, check the settings section documentation.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close