spacemacs

Spacemacs docs: http://develop.spacemacs.org/doc/DOCUMENTATION.html http://develop.spacemacs.org/layers/+lang/clojure/README.html https://practicalli.github.io/spacemacs/
sebastian 2021-04-11T12:22:53.070300Z

Hi. Very new to cljs here. I've encountered a problem with lsp in cljs. Whenever lsp detects an error it prevents me from typing. A current example: I am trying out the re-frame starter app and playing around with it. In events.cljs is this function:

(re-frame/reg-event-fx
 ::set-active-panel
 (fn-traced [{:keys [db]} [_ active-panel]]
            {:db (assoc db :active-panel active-panel)}))
lsp says active-panel is an "unresolved symbol". If I put my cursor after active-panel in the params list lsp prevents any input. This also happens when I type my own functions. When I swap out the backend to cider I don't have that problem. So lsp has to be at fault here. What exactly is causing these issues and how can I prevent this? Has anyone else had that happen to them? My Clojure layer setup is very basic.
(setq-default dotspacemacs-configuration-layers
'(
     (clojure :variables
              clojure-enable-fancify-symbols t
              clojure-enable-clj-refactor t
              ;; clojure-backend 'cider
              )
     lsp
))

practicalli-john 2021-04-11T12:53:05.072300Z

@sebastian I have been trying to get a workable LSP configuration with minimal impact, but it requires a fair bit of configuration. You may have luck by just disabling indentation on the lsp layer, e.g.

(lsp :variables
          lsp-enable-on-type-formatting nil
          lsp-enable-indentation nil)
I have a bit of a walk through of my lsp config for Clojure here: https://practicalli.github.io/spacemacs/install-spacemacs/clojure-lsp/configure-lsp-and-cider.html

practicalli-john 2021-04-11T12:53:56.073100Z

I also disabled cljfmt as it seemed a bit aggressive, although the above may also disable that already https://github.com/practicalli/spacemacs.d/blob/live/dot-lsp/config.edn#L89

sebastian 2021-04-11T12:54:28.073400Z

great. I'll check that out.

practicalli-john 2021-04-11T12:55:38.074700Z

I keep tweeking this configuration to see what works best. However, unless there is something you definiately benefit from lsp, then I suggest disabling (use cider as the clojure backend) it until you have time to set things up.

sebastian 2021-04-11T12:57:33.074800Z

this config fixes the issue with lsp preventing my input. thanks.

👍 1
sebastian 2021-04-11T12:59:54.075Z

True. Currently there isn't as I am just starting out with clj/s. If I bump into more problems with lsp I'll go back to cider.

practicalli-john 2021-04-11T13:08:44.075900Z

The clojure-lsp project has had a lot more work put into it in the last few months and continues to be very active, so improvements are coming. However, it still needs a bit of time to configure unless you want the whole IDE experience

ericdallo 2021-04-11T14:58:30.076100Z

@sebastian lsp-mode should not prevent you from input anything, make sure to update both clijure-lsp and lsp-mode, you can ask for help on #lsp as well :)