Fork me on GitHub
#lsp
<
2021-08-15
>
pez10:08:39

Hello. When I open one of my repos in Gitpod, clojure-lsp is mostly working, but looking up sources from jars doesn’t work. So if I command click apply it opens a tab for core.clj but it doesn’t load. If I jack-in to the project the lookup works though, so nrepl seems to be able to do it. This is the repo I am testing with: https://github.com/PEZ/pirate-lang If you open it in Gitpod it will take quite a long time the first time (like five or ten minutes) so be a bit patient. 😃 Subsequent opens of the workspace will be quicker.

ericdallo13:08:27

Probably the classpath lookup failed, did you notice any messages popup about it? We need to check the server log as well, not sure how can we find that on gitpod

ericdallo14:08:13

Just tried with your project and it worked perfect :thinking_face:

3
ericdallo14:08:06

BTW, really nice to see clojure-lsp + Calva running in Gitpod 😄

💪 3
pez15:08:31

And you haven’t jacked in there?

ericdallo15:08:09

yes, no repl connected

pez15:08:29

Very strange! For me it is consistent. If I disconnect the repl, it stops working.

ericdallo15:08:36

What if you don't connect the repl at all? Does it work?

ericdallo16:08:45

What the trace log show to you?

pez17:08:07

I’ll check later tonight.

pez13:08:06

Better late than never? These are the logs from me hovering apply and then pressing cmd (which should trigger a preview in the hover) and then, while holding cmd down, clicking (which should open the file). The tab opens, with the correct file name, but the contents never loads. It’s just that blue progress “bar” running at the top of the window.

pez13:08:37

I can’t see anything there that says it goes wrong, can you?

ericdallo13:08:53

No, from server side looks everything correct 😕

ericdallo13:08:32

I can't understand how it works for me but not for you, and this is not even in my machine to say: "Works on my machine" 😂

pez13:08:06

It is specifically a machine that should en all “works on my machine”! 😃

pez13:08:48

I am doing this in Safari. I can’t imagine how that should matter, but now will try in Chrome.

ericdallo13:08:42

hum, yeah, not sure if it should behave differently, but I'm using Chrome

pez13:08:47

It worked in Chrome for me. Using the Rich 4Clojure project though, so will try with the same repo as I used in Safari as well.

pez13:08:02

Same there. Crome yes, Safari no. How very odd. I’ll check the Gitpod issues a bit for this.

ericdallo13:08:18

uh, glad we found the issue

pez14:08:20

Not sure we have yet. 😃 But there is something with that nREPL can open the files also in Safari that gives hope.

ericdallo14:08:27

yeah, I meant glad is not a bug on clojure-lsp or Calva, but on Gipod itself

pez15:08:55

Writing the repro steps for the issue on Gitpod it doesn’t work in Chrome any longer…

ericdallo15:08:44

Maybe it's something related with network?

pez15:08:42

Everything should be going on in the network inside that machine, right?

ericdallo15:08:01

Really odd, I can't repro one single time, all tries worked for me

pez15:08:14

This is the start of my repro: 1. Open a workspace using this link: https://gitpod.io/#https://github.com/pez/rich4clojure 1. Open the file src/rich4clojure/hard/problem_164.clj 1. On line 58, use the mouse to hover set in:

clojure
    (set (__ ’{:states #{q0 q1 q2 q3}
    
* [x] A hover shows up showing the docs for set 1. …

pez15:08:51

Maybe you can check what happens if you try the nexts steps there?

pez15:08:33

I tagged you here, don’t know if you get notified: https://github.com/gitpod-io/gitpod/issues/5225

ericdallo16:08:40

it works for me those steps

ericdallo16:08:12

For some reason the gif didn't capture the hover window, but it showed before the find definition

lassemaatta15:08:39

I noticed that sometimes I get highlighted errors regarding unmatched delimiters even though my code looks valid. These errors disappear if e.g. add some empty lines into the buffer. After investigating I noticed that it's caused by interaction between lsp and justinbarclay/parinfer-rust-mode, where the latter automatically inserts closing ], ) or } as I type. It seems that although these closing delimiters appear in emacs, they are not visible to lsp (until I add some empty lines between top level forms). If I look at the clojure-lsp logs, I can see stacktraces caused by "Unmatched delimiter: ) [at line N, column M]" etc. Is this something that could/should be solved within clojure-lsp (or lsp-mode?) or should I rather raise an issue over at parinfer-rust-mode?

all-clear 2
ericdallo17:08:02

this should be fixed only on client (emacs), not sure if lsp-mode or the parifer mode, the issue is that the lsp client (lsp-mode) should send the correct changes to didChange request, I suggest you debug this on lsp-mode using https://emacs-lsp.github.io/lsp-mode/page/troubleshooting/#log-client-server-json

lassemaatta17:08:49

thanks, I'll try to dig deeper 👍

👍 3
ericdallo17:08:44

Never saw this kind of issue, it'd odd, maybe try other paren manipulations like paredit, lispyville, parinfer to check if it works

ericdallo17:08:25

oh, there is a flag on clojure-lsp that you can try to "avoid" this issue on client side maybe

ericdallo17:08:50

set text-document-sync-kind to :full

ericdallo17:08:49

oh, I forgot :full is the default, so nvm

lassemaatta17:08:04

thanks anyway 🙂