There is already the clojure-lsp-intellij dedicated plugin that fully integrates with lsp4ij and Clojure LSP providing more features, make sure to check it out first.
In case you want to integrate manually, follow these steps:
-
Download the appropriate release for your operating system from the Clojure LSP releases page.
-
Extract the downloaded asset. For example, on Windows, the extracted files will include
clojure-lsp.exe
. -
Open the New Language Server Dialog. This can usually be found under the IDE settings related to Language Server Protocol (LSP). For more information, refer to the New Language Server Dialog documentation.
-
Select Clojure LSP as the template from the available options. This will populate the command field with a default command. You need to adjust this command to point to the location of the extracted Clojure LSP asset.
-
Adjust the command in the template to reference the location of the extracted Clojure LSP executable.
-
Optional: You may also customize the mappings section according to your preferences.
-
Click OK to apply the changes. You should now have Clojure language support enabled in your IDE, with the Clojure LSP integrated.