lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
2021-03-04T09:57:29.416800Z

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

borkdude 2021-03-04T09:59:07.417500Z

@rickmoynihan This can be related to

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

2021-03-04T10:01:18.418Z

@borkdude what do you have it to set to?

borkdude 2021-03-04T10:01:56.418200Z

0.5

borkdude 2021-03-04T10:02:20.418600Z

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

2021-03-04T10:06:41.419Z

ahh great upgrading seems to have made a big difference!

2021-03-04T10:06:45.419200Z

thanks! 🙇

2021-03-04T10:12:52.419600Z

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

2021-03-04T10:26:33.420Z

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

2021-03-04T10:27:09.420700Z

Running

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

2021-03-04T10:27:47.421300Z

however nothing appears in the log

ericdallo 2021-03-04T11:47:17.421900Z

@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

ericdallo 2021-03-04T11:47:50.422100Z

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

ericdallo 2021-03-04T11:47:57.422300Z

otherwise we need to check the log

ericdallo 2021-03-04T11:48:17.422500Z

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

2021-03-04T11:48:36.422700Z

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

2021-03-04T11:48:45.422900Z

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

ericdallo 2021-03-04T11:49:00.423200Z

what is the error you receive on emacs?

2021-03-04T11:49:54.423400Z

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

2021-03-04T11:50:15.423700Z

and no lsp features

ericdallo 2021-03-04T11:50:28.423900Z

what happens when you M-x lsp

2021-03-04T11:50:53.424100Z

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

2021-03-04T11:51:32.424300Z

(I was running M-x lsp-mode)

ericdallo 2021-03-04T11:51:46.424500Z

https://github.com/emacs-lsp/lsp-mode/issues/2615

ericdallo 2021-03-04T11:51:58.424800Z

TLDR update your dash.el package and everything should work

2021-03-04T11:54:28.425Z

ok that seems to work

2021-03-04T11:54:36.425200Z

thanks a million! 🙇

ericdallo 2021-03-04T11:56:54.425400Z

You're welcome 😉

2021-03-04T11:57:40.425600Z

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

ericdallo 2021-03-04T11:58:09.425800Z

I suggest you re install your packages

2021-03-04T11:58:26.426Z

That’s what got me here 😆

2021-03-04T11:58:33.426200Z

but yeah I’ll try reinstall again…

2021-03-04T12:01:42.426400Z

ok seems to be working

2021-03-04T12:01:45.426600Z

🙇

1
devn 2021-03-04T17:38:14.430100Z

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

devn 2021-03-04T17:38:28.430600Z

am i missing something config-wise?

ericdallo 2021-03-04T17:39:29.430900Z

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

devn 2021-03-04T17:53:33.431300Z

hm, no dice… :thinking_face:

devn 2021-03-04T18:03:49.431500Z

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

devn 2021-03-04T18:05:01.431700Z

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

ericdallo 2021-03-04T18:06:12.431900Z

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

devn 2021-03-04T18:23:56.432100Z

sure,

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

ericdallo 2021-03-04T18:24:29.432300Z

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

devn 2021-03-04T18:24:36.432500Z

yes

devn 2021-03-04T18:24:47.432700Z

but i could swear globally unused publics highlighted awhile back

devn 2021-03-04T18:24:54.432900Z

i may be mistaken

ericdallo 2021-03-04T18:25:12.433100Z

oh yeah

ericdallo 2021-03-04T18:25:26.433300Z

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

devn 2021-03-04T18:33:52.433500Z

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

devn 2021-03-04T18:34:35.433700Z

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

👍 1
ericdallo 2021-03-04T18:34:47.433900Z

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

ericdallo 2021-03-04T18:34:53.434100Z

need some hammock time though how to do it

ericdallo 2021-03-04T21:20:58.436500Z

@borkdude lsp already supports info lint, green color

borkdude 2021-03-04T21:21:26.436700Z

nice. how does it do the local highlighting?

ericdallo 2021-03-04T21:21:30.436900Z

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

ericdallo 2021-03-04T21:21:41.437100Z

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

borkdude 2021-03-04T21:21:54.437300Z

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

borkdude 2021-03-04T21:22:08.437500Z

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

ericdallo 2021-03-04T21:22:11.437700Z

yes, I think it's the best option

devn 2021-03-04T21:23:22.437900Z

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…”

ericdallo 2021-03-04T21:23:58.438100Z

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

devn 2021-03-04T21:24:17.438300Z

oh, that sounds great

ericdallo 2021-03-04T21:25:42.438500Z

https://github.com/clojure-lsp/clojure-lsp/issues/359

devn 2021-03-04T21:26:26.438800Z

yay! big thanks!

😃 1
borkdude 2021-03-04T21:28:26.439100Z

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

borkdude 2021-03-04T21:28:41.439300Z

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

borkdude 2021-03-04T21:28:52.439500Z

maybe using a regex, namespace, fully qualified var

ericdallo 2021-03-04T21:28:59.439700Z

yeah, that looks perfect 🙂

ericdallo 2021-03-04T21:29:23.439900Z

I think I saw that pattern somewhere 😛

borkdude 2021-03-04T21:29:33.440100Z

;)

borkdude 2021-03-04T21:29:52.440300Z

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

ericdallo 2021-03-04T22:15:03.440700Z

@devn 🙂

👍 1
borkdude 2021-03-04T22:15:43.441100Z

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

👍 2
borkdude 2021-03-04T22:15:58.441300Z

but looks nice!

1