Fork me on GitHub
#lsp
<
2021-03-16
>
rickmoynihan11:03:58

I’m still having problems with lsp-lens-mode making smartparens commands e.g. slurp/barf etc intollerably slow (like several seconds). I’ve set the lsp-idle-delay to 1.0 and similarly for company-idle-delay, is there anything else I can do?

ericdallo12:03:11

lsp-lens should not affect that I think, does the issue only happen with lsp-lens-mode enabled?

rickmoynihan12:03:53

to be honest I’m not too sure, it seems slowest with it… but also slower than it used to be without it

rickmoynihan12:03:07

It could well be something else

rickmoynihan12:03:10

- command-execute                                                 785  95%
 - call-interactively                                             785  95%
  - funcall-interactively                                         785  95%
   + counsel-M-x                                                  560  67%
   - sp-forward-barf-sexp                                         136  16%
    - sp--indent-region                                           126  15%
     - indent-region                                              126  15%
      - lsp-format-region                                         126  15%
       - lsp-request                                              120  14%
        - accept-process-output                                     1   0%
         - timer-event-handler                                      1   0%
          + apply                                                   1   0%
       - lsp--apply-text-edits                                      6   0%
        - mapc                                                      6   0%
         + #<compiled 0x1fe085d5cab5>                               6   0%

rickmoynihan12:03:32

Is there a way to switch of lsp indentation support?

ericdallo12:03:48

lsp-enable-identation or something like that

ericdallo12:03:06

We have a issue about indentation performance on huge buffers

rickmoynihan12:03:25

current buffer is maybe just 200 locs

rickmoynihan12:03:00

ok setting that to nil seems to improve things

ericdallo12:03:29

so maybe the issue is indeed the indentation, could you check the logs between server and client and see how much time is taking each server response

ericdallo12:03:34

via lsp-workspace-show-log

ericdallo13:03:29

I created a issue to solve this problem on cljfmt: https://github.com/clojure-lsp/clojure-lsp/issues/266

rickmoynihan13:03:41

incidentally it seems sometimes my smartparen commands like slurp forward are now generating garbled states, is that a known issue?

ericdallo13:03:27

not really, could you elaborate with a repro?

rickmoynihan13:03:05

not sure I’ve only seen it in a proprietary code base at the minute… but it looks like the parser is generating a syntax error where there isn’t one

rickmoynihan13:03:39

hmm actually there is an error, but it’s really a semantic one… i.e. an unbound var that I’m trying to slurp forward a let over…

rickmoynihan13:03:07

I suspect the broken highlighting is because of that too

rickmoynihan13:03:30

that’s the before state above… If I slurp forward the let vanishes

rickmoynihan13:03:22

hmm I fixed it up by hand but still got the syntax error, however closing and reopening the file worked

rickmoynihan13:03:50

It’s weird though because lsp indentation should also now be disabled

rickmoynihan13:03:22

ahh maybe I need to restart the workspace…

ericdallo13:03:07

yeah, that's definitively is a out of sync clojure-lsp error 😞 the same issue we are discussing yesterday on the channel

ericdallo13:03:28

at least now we have a way to repro, that always happen with smartparens actions?

rickmoynihan13:03:00

They seem prone to it

rickmoynihan13:03:06

not sure if it’s always the case

rickmoynihan13:03:39

only started using lsp in the past few weeks; so I’m still figuring it all out

ericdallo13:03:46

yeah, I could not repro using paredit

rickmoynihan13:03:56

I wasn’t expecting formatting to be baked in

rickmoynihan13:03:16

ok, I suppose I could switch back to paredit at somepoint

ericdallo13:03:01

we still need to fix it somehow on clojure-lsp side, but if you could test with paredit just to check if that makes any difference, would help a lot

ericdallo13:03:14

I need to repro the issue to understand how to fix it

👍 3
dpsutton16:03:10

i'm getting lots of out-of-sync issues requiring reopening the buffer.

ericdallo16:03:14

😕 Do you have a repro?

ericdallo16:03:34

Maybe we will need to disable that by default

dpsutton16:03:35

no, but using it for longer than 20 minutes i kinda can't not run into it

dpsutton16:03:41

i made a function

dpsutton16:03:45

(defun personal/kick-it ()
  (interactive)
  (let ((b (buffer-file-name (current-buffer))))
    (save-buffer)
    (kill-buffer)
    (find-file b)
    (inf-clojure-minor-mode)))

ericdallo16:03:46

yeah, we need to understand when that happens, I suspect is related with some specific client changes, like a change with iedit , smartparens and etc

ericdallo20:03:38

Could you try latest release?

dpsutton20:03:44

one thing i remembered i had was the semantic tokens turned on, but i never really saw any benefit

dpsutton20:03:57

i just turned it off, and gonna try it out to make sure that wasn't it

ericdallo20:03:17

The semantic tokens should not affect that, they are only visual

ericdallo20:03:48

also, clojure-lsp only support macros, but I'll add support for other things like functions calls etc just like CIDER add colors when repl is on

dpsutton20:03:29

that's weird that it would highlight the f function binding and the entire call site

ericdallo20:03:37

Yeah, I think that is another issue when you have a local variable that is a function call

ericdallo20:03:04

I think it's a clj-kondo analysis range issue, but I need to test it locally and confirm that

dpsutton21:03:35

feeling better after upgrading

ericdallo20:03:18

clojure-lsp Released 2021.03.16-20.28.06 version • Fix server not analyzing after a wrong code on cljs files - https://github.com/clojure-lsp/clojure-lsp/pull/367Rollback incremental didChange adding a new :text-document-sync-kind setting with :full as default. Check https://clojure-lsp.github.io/clojure-lsp/settings/for more details This release should fix the out of sync issues until we make the incremental changes stable.