diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c936575b..587a0558f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - clojure-cli: `clojure -X:deps pom` - install: debian packages approach for OpenJDK rather than a specific Ubuntu tab - install: recommended OpenJDK versions of 17 and 21 as hint +- editor: refactor Clojure LSP page and format for Material for MkDocs ## Added - button link to Clojure CLI releases changelog to view available versions diff --git a/docs/clojure-editors/clojure-lsp/index.md b/docs/clojure-editors/clojure-lsp/index.md index 36463339f..89df98776 100644 --- a/docs/clojure-editors/clojure-lsp/index.md +++ b/docs/clojure-editors/clojure-lsp/index.md @@ -1,26 +1,68 @@ -# Clojure LSP +# Language Server Protocol -The Language Server Protocol provides a standard set of tools that are used to developer any programming language. These tools are typically provides with a language specific server. +[:globe_with_meridians: Language Server Protocol](https://microsoft.github.io/language-server-protocol/) provides a standard to provide a common set of development tools, e.g. code completion, syntax highlighting, refactor and language diagnostics. -clojure-lsp is an implementation of an LSP server, for Clojure and ClojureScript languages. +Each language requires a specific LSP server implementation. + +An editor or plugin provides an LSP client that uses data from language servers, providing information about source code and enabling development tools to understand the code structure. + + +## Clojure LSP + +[:globe_with_meridians: clojure-lsp](https://clojure-lsp.io/) is an implementation of an LSP server for Clojure and ClojureScript languages. Clojure LSP is built on top of [clj-kondo]() which provides the static analysis of Clojure and ClojureScript code. + +Most Clojure aware editors provide an LSP client. ![Clojure LSP example screenshot](https://emacs-lsp.github.io/lsp-mode/tutorials/images/clojure-call-hierarchy.png) ## Install -Follow your preferred option on the [Clojure LSP installation guide](https://clojure-lsp.io/installation/) +[Clojure LSP installation guide](https://clojure-lsp.io/installation/) covers multiple operating systems. + +=== "Linux" + + Practicalli recommends downloading the `clojure-lsp-native-linux-amd64` from [GitHub release page](https://github.com/clojure-lsp/clojure-lsp/releases) + + Extracts the `clojure-lsp` binary to `~/.local/bin/clojure-lsp` + +=== "Homebrew" + Clojure LSP project provides a custom tap for installing the latest version. + + !!! NOTE "" + ```shell + brew install clojure-lsp/brew/clojure-lsp-native + ``` -Practicalli downloads the clojure-lsp-native-linux-amd64.zip file from [GitHub release page](https://github.com/clojure-lsp/clojure-lsp/releases)and extracts the `clojure-lsp` binary to `~/.local/bin/clojure-lsp`. + ??? WARNING "Homebrew default package deprecated" + The `clojure-lsp` formula is deprecated and should not be used. -`clojure-lsp -v` in a terminal will test if the the install is working. + `brew remove clojure-lsp` if the default clojure-lsp was installed -??? HINT "Editors may install Clojure LSP for you" +Check Clojure LSP server is working via the command line + +!!! NOTE "" + ```shell + clojure-lsp --version + ``` + + +??? HINT "Editors may install Clojure LSP" Spacemacs LSP layer will prompt to install a language server when first opening a file of a major mode where LSP is enabled. E.g. when a Clojure related file is opened, the Clojure LSP server is downloaded if not installed (or not found on the Emacs path). + Neovim package called mason manages the install of lint & format tools as well as LSP servers. + VSCode Calva plugin includes the clojure-lsp server, although an external server can be configured. +## Configure + + + +??? "Practicalli Clojure LSP Configuration" + + + ## References * [LSP mode - A guide on disabling / enabling features](https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/) - if the Emacs UI is too cluttered or missing visual features