Fork me on GitHub
#lsp
<
2022-01-19
>
seancorfield03:01:54

Loving the LSP status improvements in VS Code (is that a new Calva feature?)

ericdallo04:01:54

Yes! Thank you It was missing on calva so I opened a PR there :)

1
ericdallo04:01:47

It actually has a percentage on emacs and vim, but I could not make it work for vscode 😔

robert-stuttaford07:01:56

(i've searched the google and the slack archives, and i didn't see this question raised) how do i resolve this error, when trying to use lsp-format-buffer? i figure i need to get cljfmt set up somehow, but i'm not finding any instructions about it. Error: (lsp-capability-not-supported "documentFormattingProvider")

ericdallo11:01:37

This usually means the server or client doesn't support format

ericdallo11:01:44

Which is incorrect

ericdallo11:01:04

Do you have any extra clojure-lsp config?

ericdallo11:01:34

What tis the value of your lsp-enable-identation?

robert-stuttaford13:01:13

it may have resolved itself after a restart!

robert-stuttaford13:01:29

or, rather, the formatting is working, but i'm also seeing this error message

robert-stuttaford13:01:57

the only thing i do after hooking lsp is to set these two:

lsp-lens-enable nil
      lsp-signature-auto-activate nil

robert-stuttaford13:01:24

lsp-enable-identation is 'void' when i evaluate it in an .el (i'm not a big emacs lisp person so if that's the wrong way to check, apologies)

ericdallo13:01:06

hum, that's weird, maybe some bad compiled lsp-mode package. Do you use some emacs framework like doom or spacemacs?

ericdallo15:01:29

I mean, even with your config, the packages are compiled and I stayed somewhere, right?

robert-stuttaford16:01:02

apologies, i don't want to waste your time, @UKFSJSM38 - let me regroup, and see if i can be clearer about what i'm seeing 🙂

lassemaatta11:01:54

Interesting. Every once in a while my emacs freezes completely (the UI doesn't redraw, cpu usage is minimal), C-g does nothing so I need to sigkill it. It happened again, but this time I decided to try what happens if I kill clojure-lsp -> emacs got unstuck and works again. Sadly there's nothing interesting in the clojure-lsp log file or the various lsp buffers in emacs 😞 I assume this is an issue with lsp-mode rather than clojure-lsp?

😔 1
ericdallo11:01:54

likely to be a issue on lsp-mode indeed unftortunately

ericdallo11:01:08

client should not freeze the editor

ericdallo11:01:30

and I know lsp-mode has some workarounds to avoid that, maybe something is missing

ericdallo11:01:37

I'd suggest open a issue there

lassemaatta12:01:01

yeah, I'm browsing through existing issues right now, just in case I'm not the first to notice this

teodorlu12:01:46

I think I've experienced this happen too -- without any reliable way to reproduce.

lassemaatta12:01:59

I think 90% of the time this happens after I've just created a new .clj , .cljs , or .cljc file and I'm in the process of adding various (:require [foo.bar]) statements into the ns form.

ericdallo12:01:49

never saw that with clj, interesting

borkdude15:01:08

@U0178V2SLAY are you by any chance using potemkin in your project?

borkdude15:01:44

there was an issue fixed in clj-kondo 2022.01.15 which had a circular reference problem with one of the deps, some ring-http-response library

borkdude15:01:18

could be that. you can check that by linting your classpath on the command with an older version of clj-kondo

borkdude15:01:35

but could also very well not be it :)

lassemaatta15:01:50

We actually are using potemkin (or at least our project has it, I don't personally use it in my code). But I'm also pretty sure I'm using the latest clj-kondo. My morning routine is to always check for a new version of kondo or lsp 🙂

borkdude15:01:25

but lsp might not be using the latest clj-kondo

lassemaatta15:01:41

good point 👍

borkdude15:01:56

so it would be worth checking using clj-kondo equal to the version in lsp, on the command line

borkdude15:01:08

and make sure you run it a few times, also with a clean cache

borkdude15:01:12

it was a nasty problem to figure out

borkdude15:01:22

and I could not always reproduce it

lassemaatta15:01:43

good thing I have a babashka script to re-initialize the kondo cache, I'll try tomorrow and report back

👍 1
ericdallo15:01:10

Yeah, latest LSP doesn't have the kondo fix yet

borkdude15:01:28

maybe a good reason to do a new release

ericdallo15:01:30

Only next release(few days)

ericdallo15:01:46

Yes, I should do soon

borkdude15:01:48

Maybe @U0178V2SLAY can test a pre-release from CI

ericdallo15:01:32

Yes, it's possible to download a static clonire-lsp binary from github CI

borkdude15:01:00

but then clj-kondo has to be updated, not sure if that was already done

ericdallo15:01:01

@U04V15CAJ how hard would be to make that binary available in a channel just like kondo?

borkdude15:01:43

for kondo I don't do it, but for babashka I do it in #babashka-circleci-builds

ericdallo15:01:46

It was already updated

borkdude15:01:02

but I have something even better now: https://github.com/babashka/babashka-dev-builds every master build gets posted over there and you can even install it using the normal install script

ericdallo15:01:19

Cool, I'll search for a slack GitHub action

borkdude15:01:38

the "even better one" isn't using slack

borkdude15:01:00

it's just a github project with releases that contain the master binaries

borkdude15:01:29

the slack integration is done using babashka of course ;)

ericdallo15:01:30

That works too

lassemaatta15:01:32

sure, I can be your guinea pig. but I'm not certain how easily I can reproduce my original issue. I've also previously built & used lsp locally when testing some earlier problem I think

lassemaatta15:01:33

but I'll at least try that linting trick wrt. potemkin

borkdude15:01:58

it should happen on clj-kondo from, say, a month ago

sakalli10:03:51

Just concurring with the above to add one more data point. Emacs occasionally freezes and does not unfreeze until killing clojure-lsp, as mentioned above. One tendency I've noticed is that it appears to occur when switching git branches and the underlying code changes, but I'm not sure about that.

sakalli10:03:38

This was an old thread. However, this issue persists for me.

borkdude11:03:51

There is an issue about this. Try the nightly build

borkdude11:03:19

From #clojure-lsp-builds

sakalli11:03:58

kk. cheers!

papachan19:01:54

Hi. i just tried the new clojure-lsp version to 2022.01.03-19.46.10 from github action but it failed over.

Run clojure-lsp clean-ns --dry
[  0%] clojure-lsp                 
[  5%] Finding kondo config        
[  8%] Finding project specs       
[ 10%] Finding cache               
[ 15%] Discovering classpath       
Error:  Classpath lookup failed when running `lein classpath`. Some features may not work properly. Error: Retrieving com/github/clojure-lsp/lein-clojure-lsp/0.1.0/lein-clojure-lsp-0.1.0.pom from clojars

ericdallo19:01:37

it seems lein classpath is failing to download one of your dependencies, in this case lein-clojure-lsp 😛

ericdallo19:01:48

I'd suggest bumping your lein-clojure-lsp in your project.clj which is old

ericdallo19:01:51

1.1.7 is the latest

✔️ 1
papachan00:01:51

hmmm it failed also with 1.1.7

ericdallo01:01:23

that's quite weird, never saw that behavior

ericdallo01:01:53

also this jar has thousand of downloads, it sounds like some issue with your lein or project

✔️ 1
papachan21:01:02

It looks it run ok with my project from 2021.12.01-12.28.16 but any posterior versions it failed the same way. I think its because it parse something from the deps of my project before running lein classpath

ericdallo21:01:38

clojure-lsp just delegate to lein the classpath lookkup, so it only runs lein classpath under the hood, not sure why it's not finding only for your project, any chance to share this project or a minimal repro?

papachan21:01:59

since its a dummy template

papachan21:01:19

will create a git repo and be back to you

👍 1