Skip to content

Commit

Permalink
editor: refactor clojure lsp page and format for Material for MkDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalli-johnny committed Feb 6, 2024
1 parent 4e547cf commit bd115f1
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
56 changes: 49 additions & 7 deletions docs/clojure-editors/clojure-lsp/index.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit bd115f1

Please sign in to comment.