This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-13
Channels
- # announcements (13)
- # beginners (52)
- # bitcoin (2)
- # calva (2)
- # cider (7)
- # clara (1)
- # clj-commons (11)
- # clj-kondo (6)
- # cljdoc (14)
- # clojure (68)
- # clojure-belgium (1)
- # clojure-denmark (6)
- # clojure-europe (57)
- # clojure-nl (2)
- # clojure-norway (10)
- # clojure-uk (3)
- # clojurescript (7)
- # code-reviews (17)
- # conjure (1)
- # cursive (5)
- # dev-tooling (11)
- # emacs (9)
- # fulcro (12)
- # hugsql (20)
- # introduce-yourself (6)
- # joyride (2)
- # leiningen (1)
- # lsp (61)
- # malli (30)
- # missionary (11)
- # nbb (6)
- # off-topic (26)
- # portal (5)
- # practicalli (5)
- # re-frame (8)
- # releases (8)
- # sci (21)
- # shadow-cljs (3)
- # sql (17)
- # squint (1)
- # xtdb (3)
lsp-workspace-command-execute: 'workspace/executeCommand' with 'add-missing-libspec' failed.
(error "The connected server(s) does not support method workspace/executeCommand.
To find out what capabilities support your server use 'M-x lsp-describe-session'
and expand the capabilities section")
What could I be doing wrong?Other issue, lsp in emacs shows this header bar, but there is a character that shows as: E5CC instead of a character, this seems to not be a valid unicode character?
Seems add-missing-libspec doesn't ask you which one you want when there are possible conflicts?
Or actually it's just buggy. Seems it adds a namespace that doesn't even have the method
It's better to delegate to clojure-lsp code action (lsp-execute-code-actions) instead of manually calling the add missing libspec command, this way clojure-lsp ask to you which require to add with multiple choices
We should address this bug tho, if ns a
has a method and b
doesn't add-missing should pick a
if your cursor is on an exact match
It seems it happens more when I have a small alias. I was trying: (c/quick-bench ...) Where criterium.core :as c is what I wanted. And it imported arrangement.core :as c But also that namespace doesn't have a quick-bench function. So I'm not sure what's up. If I just did: (quick-bench ...) Then it would work and require criterium.core :refer [quick-bench]
I'm having trouble getting clojure-lsp
to work with my emacs config - is this the right place to ask questions?
Do some folks want to try out clojure-lsp nightly? It should support navigation now for quoted symbols like (requiring-resolve 'nextjournal.clerk/build!
) and vars mentioned in deps.edn
Are there any limitations that might prevent textDocument/hover
from working? I can't get it working on any work projects š Have tried eglot, lsp-mode & calva and all the same behaviour; returns a blank response for everything including core functions. It works no problem on my aoc repo, any other pointers trying to debug this would be appreciated š
That sounds like classpath not found, so analysis of external deps are not included, for emacs, a message is printed asking if you wanna skip it or retry if an error is found, I'm about to try to fix that on calva
clj -Spath
returns
src:/home/elken/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.jar:/home/elken/.m2/repository/org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar:/home/elken/.m2/repository/org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar
which is correct, I assume
theoretically, it is clj -A:dev:test -Spath
but it should bring similar classpath.
Anyway, check server logs, it could be a wrong project root and other things
All clear, the only thing throwing me is the fact it's watching 200 folders in this particular example
Nope š I've ignored everything now except the smallest subset of the codebase & I still can't get textDocument/hover
to resolve for anything (including core) LSP seems to initialize fine
Logs: https://gist.github.com/elken/22b07c33117a659ae2918104408cca2c
that is the client<-> server log, check the https://clojure-lsp.io/troubleshooting/#server-log
No change š Project only paths analyzed by clj-depend, took 0ms
concerns me, is it possible for it to index in fractional milliseconds?
that' s expected if you don' t have any clj-depend config, not relevant to your issue
I've tried adding them in .lsp/config.edn
as :source-paths
and there's some analysis at startup now, but still no textDocument/hover
resolving š
https://gist.github.com/elken/3890e632a29e550684b22020ee733da0
I intend to create a post/tutorial on how to setup monorepos with clojure-lsp, but you can use clojure-lsp project itself as it' s a deps.edn monorepo
basically, you need to add a dev alias linking to the sub repos so clojure-lsp can consider everything
top level deps.edn, like https://github.com/clojure-lsp/clojure-lsp/blob/master/deps.edn, it' s similar to how #polylith handle mono-repo projects where tools can understand that
if the cljs one has a different package manager, like shadow.cljs, it should have a root shadown unfortunately as well, not sure, that's a corner case I didnt face yet
Seems this is all that's needed in a root-level shadow-cljs.edn
{:source-paths ["cljs-project"]}
Thanks again Eric š Always a pleasureFeel free to ping me when you have a draft if you want to add in any of my confusions š
I feel the Emacs lsp package is not very good. I'm still trying to mess with it, but it seems to have a lot of conflicts with other things I use. Even the completion are strange, like it uses a different font for some reason? One thing I found really annoying is: (defn ) would be autocorrected to (defn) Now I'm not sure why. I don't think lsp does auto-format on every character? But I also have aggressive-indent mode which does, so maybe there's some weird conflict with lsp and aggressive-indent mode. Do others find lsp-mode in Emacs to be working reliably for them and without minor issues like this?
I have this:
lsp-enable-on-type-formatting nil
Not sure if it's related, but I don't think I'm using lsp formatting at allThat was it! Ok, so it does have a reformat on every char type. My guess is it calls cljfmt which removes the space. It's so annoying haha. Thanks!
I probably need to configure more things in it to get it to all work smoothly. I'll do some more digging.
more of my settings are here: https://github.com/borkdude/prelude/blob/master/personal/init.el#L391 I've disabled a few things that I found too much, like the breadcrumb
aggressive indent mode and LSP formatting will fight I've the code as it's typed. I removed aggressive indent a while ago and use LSP to format the code as it's typed. Sometimes I found aggressive mode too aggressive... Other that that Clojure LSP works very well for Emacs (specifically when I use https://practical.li/spacemacs/install-spacemacs/clojure-lsp/ or https://practical.li/doom-emacs/install/clojure-configuration/) I disable some of the Emacs LSP UI features (doc popup, sideline) as I prefer a simpler UI
@U0K064KQV Note that I disabled diagnostics in my config because I'm running clj-kondo separately (as I always use my own dev version)
@U04V15CAJ Do you know what: ā¢ lsp-enable-indentation ā¢ lsp-signature-auto-activate ā¢ lsp-enable-file-watchers do? File Watchers I think I understand that clojure-lsp does it's own file watching for deps.edn and such, and so lsp-mode doesn't need to do it?
@U05254DQM Thanks. I love aggressive-indent mode, because I use adjust-parens mode, the combination is very nice, a kind of hybrid between paredit and pareinfer. But I might also try with just the lsp formatting. I'll look at your config as well for inspo.
Also, anyone knows what this thing about LSP-PLIST is? In their https://emacs-lsp.github.io/lsp-mode/page/performance/ they say it's faster, but if it was faster I don't know why lsp would default to hash-tables? Clearly there's some trade off I'm missing?
@U0K064KQV There are docs for those - not sure exactly, I think when you change git branches, they take care that everything is re-analyzed, but it's not much of an issue to me