This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-14
Channels
- # announcements (1)
- # asami (3)
- # aws (1)
- # babashka (22)
- # beginners (39)
- # calva (21)
- # clj-kondo (10)
- # cljdoc (22)
- # cljs-dev (17)
- # clojure (93)
- # clojure-australia (3)
- # clojure-europe (39)
- # clojure-italy (3)
- # clojure-losangeles (17)
- # clojure-nl (14)
- # clojure-russia (2)
- # clojure-uk (5)
- # clojurescript (35)
- # community-development (7)
- # conjure (2)
- # cursive (13)
- # data-science (1)
- # datomic (25)
- # emacs (5)
- # events (4)
- # figwheel-main (2)
- # fulcro (12)
- # graphql (7)
- # gratitude (2)
- # inf-clojure (6)
- # leiningen (6)
- # lsp (49)
- # malli (13)
- # membrane (30)
- # minecraft (1)
- # pathom (3)
- # pedestal (26)
- # polylith (13)
- # portal (2)
- # quil (3)
- # random (1)
- # re-frame (13)
- # reagent (43)
- # reitit (6)
- # releases (1)
- # reveal (2)
- # ring (3)
- # shadow-cljs (30)
- # specter (5)
- # sql (8)
- # tools-build (1)
- # tools-deps (13)
- # videos (1)
Can I enable lsp just for one language? I want it for terraform but not for Clojure. I added terraform layer for spacemacs: https://develop.spacemacs.org/layers/+tools/terraform/README.html and installed terraform-lsp. But now it seems that lsp is enabled for clojure files too...
You can set the backend to be Cider in the Clojure layer
(clojure :variables clojure-backend 'cider)
It seems many Spacemacs layers will use an LSP backend if the LSP layer is added. There should be a variable to set the backend for each layer.
It depends on the layer, although it seems most layers will default to LSP if the LSP layer is enabled.
I'm getting "too many open files" when I have clojure-lsp open for multiple projects (on macOS Big Sur)
My experience with macOS suggests that's an incremental file handle leak in a bunch of software. I typically have to reboot my Mac every 30-60 days to reset that.
(! 887)-> uptime
0:12 up 46 days, 5:30, 36 users, load averages: 2.81 2.57 2.56
and I'm definitely seeing flakiness and slowdowns at this point.I typically have LSP running for seven or eight projects, including our monorepo at work which is 118K lines. I have adjusted my open file limit tho' (ages ago).
I have ulimit -n 16384
in my ~/.profile
I have had this issue with clj-kondo once: in that case the problem was that clj-kondo didn't close .jar
files. So when you would have a large classpath, you would get this issue.
@U11SJ6Q0K What editor (plugin) are you using? If in emacs, it might help to disable certain things like watching dirs
Oh, never faced this issue before on linux, where the error happens? emacs? clojure-lsp? OS? Also, not sure disabling file watchers would fix this kind of issue
macOS (Big Sur, specifically, but I've seen the issue on all versions of macOS -- if you don't raise the ulimit
).
Hi. I’m trying lsp-clojure with emacs on a large codebase. If I have many open .clj files and switch between git branches with many changed files, then it can take up to a minute for emacs to become responsive again. auto-revert will revert many buffers, and lsp is triggered to do something, and sits at 100% cpu for quite a while. Any ideas on how to find out what it would be doing?
Also seeing Invalid clj-kondo finding. Cannot find position data for {…, :row nil, :col nil, :end-row nil, :end-col nil, ..}
messages in the log, but they are not always present if there is a large time logged.
This probably is the file watcher, could you check if there are didChangeWatchedFiles?
did you have that notify-references-on-file-change
as true before? (because ATM it's false by default)
but yeah, that could cause that, I think we could try to be more smart on that :thinking_face:
What I think it's happening is that auto-revert-mode (which I didn't know before) send a lot of didChange
request close each other becasue multiple files have changed, and clojure-lsp call kondo for each one of those debouncing by 300ms but for each filename, which actually makes call kondo for each file
we could maybe change that to be smarter and try to send all those files in a single kondo call, but that would need some critical refactor
with
clojure-lsp --version
clojure-lsp 2021.09.30-15.28.01
clj-kondo 2021.09.25
setting :notify-references-on-file-change false
reduces time to switch branches from over a minute to around 7s.that's odd, are you sure you don't have this flag as true anywhere else? maybe your home config or something?
fwiw, the log shows running clj-kondo on start-up taks around 60s, and :initialize 97873ms
this happens when full analyzing the project, when it's the first time or some deps /kondo config have changed
would be possible to have a minimal repro for this issue? That probably would help a lot
I can see if I can find time to write a large project generator, but unlikely to be this week. Thanks for the help - with the config above it seems useable.
@U0HFRSY0M I wrote this very simple tool (https://github.com/lassemaatta/dummy-project-generator) a while back when trying to debug my performance issues with lsp, perhaps it might be of some use to you
@U0178V2SLAY thanks