Fork me on GitHub

Is the placement of the clojure-lsp log predictable? It's in /tmp/clojure-lsp.out on my machine. I want to have a command in Calva to open this log even when the server has failed to start, and currently we rely on the server to do it.


not possible, if server not started porperly it's not possible to get the log-path


Meaning the log path is configurable?


this happens because: • we check log-path during initialization to then update the log-path • we use JVM safe temp path until we check user log-path, we do that because there are some machines like some macs that don't have write permission on /tmp/


the log-path is configurable via log-path setting, but it will be checked in a certain point during server initialization


It's this issue that I am looking at. I'm running out of ideas what to suggest the user to test.


Hum, what happens when user try to run clojure-lsp manually like ./clojure-lsp --version ?


Thanks. Let's see whet they answer.


but I agree we could use a more determinist log-path as the initial log-path, but I'm not aware of any folder that always has write permission, JDK is the most reliable way IMO but it's always a random folder hash

Lukas Domagala13:03:08

Maybe we should set .lsp/clojure-lsp.out as the default? Or at least as the default for calva?


not a good idea, one more thing to users need to add to gitignore


but .lsp/.cache/clojure-lsp.out sounds reasonable

👍 2

my concern was that this was a critical crash if user doesn't have write permissions, but I doubt one would not have write permission on the project its working

Lukas Domagala13:03:52

Could have a fallback to the current way if the write fails. In vscode it could actually happen on a remote git repo, so your fear is not unfounded


yeah, I think we could handle the critical failure, sounds a good idea, feel free to open a issue @U0ETXRFEW


Calva would not behave well if it can't write there.


yeah. I think clojure-lsp db as well, but we have db-path for that purpose too


the log file also gets large especially when the path is static. i believe, on osx at least, the os is allowed to wipe files in official tmp folders to save space.


Very good point, @U0BUV7XSA. /tmp is a very good place for log files like this. 😃


yes, but we could wipe the log every new session to avoid huge files too, maybe some testing in a big repro working for a few hours to see how big that log becomes

Dmytro Bunin19:03:42

Is there a way to find all available implementations of the method in the protocol?

Dmytro Bunin19:03:54

uh actually failing to use it in emacs, is it lsp-find-implementation ?


I made some improvements on master these days that should be available on next release


so it may worth checking a nightly release from #clojure-lsp-builds

Dmytro Bunin19:03:20

downloading 👀

Dmytro Bunin20:03:55

oh I think it doesn’t work for me because I kinda hide implementation behind the generator function eg

(defn make-service [db]
  (reify Foo
    (bar [_]
      (+ 1 2))))

Dmytro Bunin20:03:16

or I’m just dumb


hum, probably it doesn't work for reify

😢 1

almost sure we don't add reify to protocol-impls, right @U04V15CAJ?


@UKFSJSM38 not yet, we should


issue welcome

👍 1
Dmytro Bunin21:03:36

Created in clj-kondo. Do you want me to create one in clojure-lsp?


Thank you!, yes please!


Thanks, will hopefully fix this this week

💜 1
Dmytro Bunin21:03:18

thank you guys 💜

Dmytro Bunin08:03:17

Just tried the nightly build. You guys rock :the_horns:

metal 2
Drew Verlee19:03:20

some undesirable formatting going on here:


do you have a repro snippet? (the code doesn't need to compile, cljfmt doesn't check that)

Drew Verlee21:03:14

i don't as it went away and i moved on. Next time ill try to share a github snippet and more diagnostics. I have seen it a couple times, this time it lingered a bit longer.