Fork me on GitHub
#lsp
<
2021-03-04
>
rickmoynihan09:03:29

has anyone here found that clojure-lsp / lsp-mode in emacs significantly slows down slurping and barfing expressions with smartparens?

borkdude09:03:07

@rickmoynihan This can be related to

company-idle-delay 0.5
If you set that to 0 things slowed down for me

rickmoynihan10:03:18

@borkdude what do you have it to set to?

borkdude10:03:20

Also update to the newest, there might have been some improvements around this

rickmoynihan10:03:41

ahh great upgrading seems to have made a big difference!

rickmoynihan10:03:52

ah it could also be that lsp-mode is no longer connecting hmmmm

rickmoynihan10:03:33

anyone here know how to debug lsp not connecting anymore after an upgrade?!

rickmoynihan10:03:09

Running

$ clojure-lsp
{}
appears to error like troubleshooting says it should

ericdallo11:03:17

@rickmoynihan the troubleshooting should be self explanatory otherwise we can improve it, but if the executable is working we need to understand why it's crashsing

ericdallo11:03:50

check the *clojure-lsp-stderr* buffer if has any thing relevant

ericdallo11:03:57

otherwise we need to check the log

ericdallo11:03:17

usually it's on /tmp/clojure-lsp.*.out

rickmoynihan11:03:36

Yeah I went through the troubleshooting section but nothing seemed to help

rickmoynihan11:03:45

the emacs buffers for logs etc didn’t seem to exist either

ericdallo11:03:00

what is the error you receive on emacs?

rickmoynihan11:03:54

no visible error — just LSP[Disconnected] in the mode line

rickmoynihan11:03:15

and no lsp features

ericdallo11:03:28

what happens when you M-x lsp

rickmoynihan11:03:53

aha! lsp--path-to-uri: Symbol's function definition is void: -compose

rickmoynihan11:03:32

(I was running M-x lsp-mode)

ericdallo11:03:58

TLDR update your dash.el package and everything should work

rickmoynihan11:03:28

ok that seems to work

rickmoynihan11:03:36

thanks a million! 🙇

ericdallo11:03:54

You're welcome 😉

rickmoynihan11:03:40

hmm now get apply: Cannot open load file: No such file or directory, lsp-ui

ericdallo11:03:09

I suggest you re install your packages

rickmoynihan11:03:26

That’s what got me here 😆

rickmoynihan11:03:33

but yeah I’ll try reinstall again…

rickmoynihan12:03:42

ok seems to be working

rickmoynihan10:03:47

however nothing appears in the log

devn17:03:14

recently updated lsp, and it seems like unused vars no longer highlight, but if i do a lsp-lens-show i can see it has 0 references

devn17:03:28

am i missing something config-wise?

ericdallo17:03:29

We didn't change anything related to that, check this section to see if it works for you: https://clojure-lsp.github.io/clojure-lsp/troubleshooting/#wrong-diagnosticslint

devn17:03:33

hm, no dice… :thinking_face:

devn18:03:49

pretty sure this is just me misunderstanding how the unused checking works

devn18:03:01

clj-kondo will look for private unused vars, and this wasn’t a private var. unfortunately whoever wrote the code im working on was not very judicious in their application of adding private metadata

ericdallo18:03:12

I don't get it the error, do you have a small sample?

devn18:03:56

sure,

(ns foo)
(defn bar [])
(defn- baz [])

ericdallo18:03:29

So clj-kondo should report only the unused private function baz, right?

devn18:03:47

but i could swear globally unused publics highlighted awhile back

devn18:03:54

i may be mistaken

ericdallo18:03:26

we used to have those for public functions before clj-kondo integration (2020 december)

devn18:03:52

i guess i understand why it’s not a clj-kondo thing, but it is useful when removing dead code

devn18:03:35

for instance, of course you don’t want your public API fns highlighted, but then again, i would assume those have a test…

👍 3
ericdallo18:03:47

yeah, for sure, it's something we lost when using clj-kondo, but I think we could implement it

ericdallo18:03:53

need some hammock time though how to do it

ericdallo21:03:58

@borkdude lsp already supports info lint, green color

borkdude21:03:26

nice. how does it do the local highlighting?

ericdallo21:03:30

But I think we don't use on clojure-lsp for any feature

ericdallo21:03:41

the local highlighting is a custom thing for highlighting on lsp-mode side

borkdude21:03:54

ok, we could do an info-level "warning" maybe

borkdude21:03:08

enable it by default, and if people complain offer a way to disable it

ericdallo21:03:11

yes, I think it's the best option

devn21:03:22

continuing the convo from #clj-kondo: eh, i’m not 100% sure on highlight v warn. i’ll say i’m biased because i was used to a warning-like indicator in the old clojure-lsp. I think lens is neat, but where I found the previous underline helpful was when i was cruising around in a file and it was like “oh look, someone left some dead code here…”

ericdallo21:03:58

the info lint is just like the warn lint but green not yellow

devn21:03:17

oh, that sounds great

devn21:03:26

yay! big thanks!

😃 3
borkdude21:03:26

maybe a better name {:unused-public-var {:level :info}}

borkdude21:03:41

so you can add more stuff to it and also :exclude stuff

borkdude21:03:52

maybe using a regex, namespace, fully qualified var

ericdallo21:03:59

yeah, that looks perfect 🙂

ericdallo21:03:23

I think I saw that pattern somewhere 😛

borkdude21:03:52

carve has a .carve/ignore file: https://github.com/borkdude/carve so you can interactively add it to the list of ignored vars

borkdude22:03:43

I would put "var" instead of "variable", that is the proper name or clojure vars

👍 6
borkdude22:03:58

but looks nice!

thanks 3
ericdallo02:03:13

Tomorrow morning I'll release it 🙂