This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-11
Channels
- # adventofcode (33)
- # babashka (1)
- # beginners (11)
- # biff (3)
- # calva (2)
- # cider (24)
- # clj-kondo (9)
- # cljfx (5)
- # clojure (39)
- # clojure-austin (2)
- # clojure-europe (11)
- # clojure-nl (1)
- # clojure-norway (22)
- # clojure-uk (10)
- # community-development (18)
- # data-science (24)
- # datahike (3)
- # events (3)
- # hyperfiddle (11)
- # lsp (22)
- # malli (3)
- # matrix (1)
- # off-topic (24)
- # other-languages (3)
- # overtone (7)
- # pathom (5)
- # reitit (2)
- # shadow-cljs (34)
- # sql (20)
- # squint (13)
Hi, since a couple of days (don't know exactly) there seems to be something wrong with the symbol index: in Calva I don't see all references and "go to symbol" also doesn't always work. Is this a known issue? Am I doing somthing wrong? I didn't consciously change anything...
It seems to happen in multiple repos and both on Linux and macOS at least for me and my colleagues. I don't have anything public but I asked my colleagues, I'll update if they have something. What happens is that VSCode says "0 references" when in fact there are references. And such a function also doesn't show up when using the command "go to symbol in workspace". I don't see anything strange in the clojure-lsp log file and I already tried clearing .lsp/.cache
.
2023-12-11T10:13:00.664Z ERROR [clojure-lsp.server:55] - Error receiving message: Internal error (-32603)
{:method "workspace/didChangeConfiguration"}
com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine PosixPlatformThreads.java: 211
com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine PlatformThreads.java: 833
java.lang.Thread.run Thread.java: 1583
java.lang.Thread.runWith Thread.java: 1596
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 642
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1144
...
clojure.core.async/thread-call/fn async.clj: 486
lsp4clj.server/thread-loop/fn server.clj: 122
lsp4clj.server.ChanServer/fn server.clj: 261
lsp4clj.server.ChanServer/receive-notification server.clj: 403
...
clojure.lang.ArityException: Wrong number of args (3) passed to: clojure-lsp.server/fn--36308
I don't see a pattern to what it can and cannot find. It's not that entire namespaces are missing, it just a symbol here and there. Actually not sure, need to verify
Hmm it seems that everything that is public and not used in the namespace itself is not found. I have to fix some other urgent things first @UKFSJSM38, so I can't spend the time to try and reproduce just now. I'll try to do it later. Sorry for not being able to provide more info at the moment (other than that this is a quite large monorepo that is polylith-based).
no problem, sounds like it's a classpath issue, and being a monorepo increases the chance we have to configure that, although clojure-lsp has built-in support for polylith based projects.
One good way to debug that is via Calva: clojure-lsp server info
and check the :source-paths
and :classpath
if it's correct
Hmm :source-paths contains only a fraction of the actual source folders. Not sure what's going on yet.
yeah, that' s the problem so, clojure-lsp to calculate the source-paths just delegates to lein
, clj
, shadow-cljs
etc, so a way is to know what command clojure-lsp is running first so you can run and understand why it's missing source-paths
check the https://clojure-lsp.io/troubleshooting/#server-log to find that command, first delete the cache .lsp/.cache
to make sure clojure-lsp will run the command
Ah I think I found it. Joyride recently told me to create a .lsp/config.edn
containing {:source-aliases #{:joyride}}
. I did exactly that, not quite understanding why. Now I understand that I should add my own aliases (e.g. :dev
) there as well, that seems to solve the issue. Not sure why it became a problem only a few days ago, but I think this solves it.
c/c @U0ETXRFEW ☝️ good point to mention when suggesting to add joyride, maybe we should suggest :test :dev :joyride
Good find, @UGNFXV1FA! I’ll update that suggestion.