Today I learned, with a bunch of digging, how to make clojure-lsp work on my computer. Since I have clojure installed in a "weird" place for linux, zed couldn't find it. And the editor's documentation doesn't talk about how to fix that anywhere. Figured I'd document my findings here for posterity.

Today I learned, with a bunch of digging, how to make clojure-lsp work on my computer. Since I have clojure installed in a "weird" place for linux, zed couldn't find it. And the editor's documentation doesn't talk about how to fix that anywhere. Figured I'd document my findings here for posterity.

First I checked out the documentation for the language server that the plugin was using. Bounced from https://zed.dev/docs/languages/clojure to https://github.com/zed-extensions/clojure/blob/main/src/clojure.rs and poked around. Learned that the plugin "somehow" finds out where to find the app.

Finally, after some digging, I found https://github.com/zed-industries/zed/issues/6767

That told me I should be able to do something like this in the settings:

  "lsp": {
    "clojure-lsp": {
      "binary": {
        "path": "/usr/local/bin/clojure-lsp-wrapper"
      }
    }
  }

Maybe some day I'll contribute an update to their documentation, but I don't have the energy at the moment.

Which is exactly what worked. The final piece, then, was writing the wrapper. I found a hint about why the wrapper was needed here: https://clojure-lsp.io/clients/

This is the code:

#!/usr/bin/env bash

export PATH="$PATH:/opt/infrastructure/clojure/bin"

exec /usr/local/bin/clojure-lsp
tags: coding