Fork me on GitHub
#lsp
<
2021-11-18
>
murtaza10:11:56

how is the root directory of a project figured out in clojure-lsp?

ericdallo13:11:10

it's the client (editor) that sends the project-root

ericdallo13:11:19

when initializing the server

Drew Verlee21:11:36

does the language server have to be updated manually? or will just updating my client (spacemacs) package do that?

ericdallo21:11:32

It needs to be updated manually

ericdallo21:11:47

Via emacs there is a command for that lsp-update-server

Drew Verlee21:11:00

well that might be the source of my woes. here is the output i get while running that:

LSP :: Server clojure-lsp install process failed with the following error message: (error Attempt to accept output from process  locked to thread #<thread 0x55b1c30a4c20>).
Check `*lsp-install*' and `*lsp-log*' buffer.

ericdallo21:11:08

yeah, lsp-mode has some timeout issues

dpsutton21:11:13

#!/usr/bin/env bb

(require '[babashka.fs :as fs]
         '[babashka.curl :as curl]
         '[ :as io])

(def latest-url "")
(def release-name "clojure-lsp-native-macos-amd64.zip")

(def release-location (-> (curl/get latest-url)
                          :headers
                          (get "location")
                          (str "/" release-name)))

(println "  Downloading " release-location)

(def zip-download (io/file (.toFile (fs/temp-dir)) "clojure-lsp.zip"))

(io/copy
    (:body (curl/get release-location {:as :stream}))
    zip-download)

(println "  Extracting to /Users/dan/bin/clojure-lsp")

(fs/unzip zip-download "/Users/dan/bin/" {:replace-existing true})

(println "-- Done")
you can just update the install location "/Users/dan/bin/" for wherever you need it

🆒 1
dpsutton21:11:46

this is saved as upgrade-lsp on my path

👍 1
ericdallo21:11:17

My personal recomendation is:

sudo bash < <(curl -s )

Drew Verlee21:11:47

thanks dpsutton. @UKFSJSM38 where should i install it to though? I didn't see that in the docs either, where the client expects it to be.

Drew Verlee21:11:09

i guess that script answer the question.

ericdallo21:11:11

the client, in this case emacs, tries to find a clojure-lsp in your PATH

ericdallo21:11:26

it doesn´t search in a specific directory or path

practicalli-johnny12:11:09

For Linux, I just download the latest release of clojure-lsp from GitHob and put it on the $PATH. Emacs will find it. Specifically I place clojure-lsp into $HOME/.local/bin/ directory, no need for any additional scripts or another package manager

👍 1