Fork me on GitHub
#lsp
<
2022-10-24
>
plexus07:10:30

Is there or could there be a way to signal to clojure-lsp that the classpath changed?

plexus07:10:44

I'm not an LSP user myself, but I do want lambdaisland/launchpad to work well for LSP users. With launchpad the classpath will differ from invocation to invocation (depending on which aliases people choose), and can change at any time during runtime when people edit their deps.edn or deps.local.edn.

borkdude08:10:24

normally lsp inspects deps.edn or clj-kondo configs and then rescans everything if changes happened. otherwise you can do lsp-workspace-restart manually (in lsp-mode, not sure about eglot, which is the other lsp package in emacs)

plexus08:10:02

does lsp watch for changes to its own config file?

plexus08:10:21

ok, that's great, that does open possibilities. I could alter the classpath command when it changes.

jacob.maine15:10:58

clojure-lsp does re-read its own config periodically, but I don't think there's any way to convince it to re-scan part of the project or its dependencies by changing any of the config, including the :classpath-cmd. AFAIK, that requires a restart of the clojure-lsp server

borkdude15:10:58

I think that is the way most clojure-lsp users are used to anyway

plexus05:10:10

That might change when they get used to more dynamic workflows.

plexus05:10:54

If only there was some kind of... protocol. For signaling to the lsp... server, that a rescan is in order.