Fork me on GitHub
#lsp
<
2021-08-10
>
pinkfrog14:08:08

I’ve a file containing unused vars. Now I deleted the file, but lsp (calva) still shows the problems in the problems tab.

ericdallo14:08:57

I can repro that, probably clojure-lsp is missing clean the diags for that file when it's deleted, could you open a issue please?

simonkatz15:08:50

I’m trying LSP and Clojure LSP for the first time, with Emacs. I’m really looking forward to adding this to my setup. I can’t get the clj-kondo part working. Up to now, I’ve used clj-kondo with flycheck-clj-kondo — that works fine. But with clojure-lsp I no longer see flycheck linting reports. I tried adding :linters {:clj-kondo {:level :off}} to my .lsp/config.edn, but that makes no difference. I tried not using flycheck-clj-kondo, and that also makes no difference. Any thoughts on what might be going on?

borkdude15:08:31

perhaps you emacs side lsp config has diagnostics turned off?

simonkatz15:08:51

Is that lsp-modeline-diagnostics-enable? That’s t.

all-clear 2
simonkatz15:08:42

@U04V15CAJ If I use eval-expression to run (lsp-cur-line-diagnostics) with the cursor on a line with a problem, I can see that the result describes the error.

borkdude15:08:59

just wanted to check if that was enabled, don't know anything beyond that unfortunately ;)

simonkatz15:08:05

OK; thanks anyway.

ericdallo16:08:11

:linters {:clj-kondo {:level :off}} disable clj-kondo linting, make sure you don't add that 🙂

ericdallo16:08:36

besides that, lsp-mode default configuration should work

ericdallo16:08:07

Can you confirm lsp is properly running? if you M-x lsp , does it says it's connected?

ericdallo16:08:03

(`lsp-modeline-diagnostics-enable` show diagnostics on modeline, it's a extra feature)

simonkatz16:08:33

It’s running. 🙂 I have other Clojure LSP functionality working.

simonkatz16:08:36

Hmmm, I think this may be relevant:

Error while checking syntax automatically: (error "Keyword argument :end-line not one of (:buffer :checker :filename :line :column :message :level :id :group)")

ericdallo16:08:12

it seems an lsp-mode/emacs issue

ericdallo16:08:29

try M-x toggle-debug-on-error and repro that issue again

simonkatz16:08:07

I get a backtrace with: Debugger entered--Lisp error: (error "Keyword argument :end-line not one of (:buffer :checker :filename :line :column :message :level :id :group)") signal(error ("Keyword argument :end-line not one of (:buffer :checker :filename :line :column :message :level :id :group)")) flycheck-buffer() lsp-diagnostics--flycheck-buffer() run-hooks(lsp-on-idle-hook) lsp--on-idle(#<buffer assigner.clj>) apply(lsp--on-idle #<buffer assigner.clj>) timer-event-handler([t 0 0 500000 nil lsp--on-idle (#<buffer assigner.clj>) idle 0])

simonkatz17:08:05

Solved! It turns out that lsp-mode needs a later version of flycheck than is at MELPA Stable (which has version 31). I’ve grabbed version <tel:202107081337|20210708.1337> from MELPA, and all is OK now. See https://github.com/emacs-lsp/lsp-mode/issues/1480 and https://github.com/flycheck/flycheck/issues/1754

simonkatz17:08:24

Thanks @UKFSJSM38 for getting me looking in the right direction.

👍 2
ericdallo17:08:41

good, I really suggest you use MELPA unstable instead of stable 🙂

simonkatz17:08:56

OK. I has assumed that would be asking for trouble, but perhaps not. Thanks for the suggeston.

ericdallo17:08:04

yeah, but there are lot of libs that don't release normally, like lsp-mode, which stable is a version from last year, there were a lot of fix and improvements after that version

ericdallo17:08:29

I use melpa unstable since I use emacs and it's not common to have breaking changes

simonkatz17:08:39

OK — thanks for the info.

👍 2