Fork me on GitHub
#lsp
<
2022-03-15
>
pez13:03:19

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.

ericdallo13:03:28

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

pez13:03:59

Meaning the log path is configurable?

ericdallo13:03:25

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/

ericdallo13:03:12

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

pez13:03:28

It's this issue that I am looking at. I'm running out of ideas what to suggest the user to test. https://github.com/BetterThanTomorrow/calva/issues/1590

ericdallo13:03:31

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

pez13:03:12

Thanks. Let's see whet they answer.

ericdallo13:03:03

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?

1
ericdallo13:03:01

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

ericdallo13:03:10

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

👍 2
ericdallo13:03:21

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

ericdallo13:03:39

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

pez13:03:41

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

ericdallo13:03:20

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

snoe14:03:42

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.

pez14:03:52

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

ericdallo14:03:54

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 ?

ericdallo19:03:04

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

ericdallo19:03:15

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

ericdallo20:03:38

hum, probably it doesn't work for reify

😢 1
ericdallo20:03:02

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

borkdude20:03:39

@UKFSJSM38 not yet, we should

borkdude20:03:50

issue welcome

👍 1
Dmytro Bunin21:03:36

Created https://github.com/clj-kondo/clj-kondo/issues/1613 in clj-kondo. Do you want me to create one in clojure-lsp?

ericdallo21:03:19

Thank you!, yes please!

borkdude21:03:52

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:

ericdallo19:03:46

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.