good morning š
Morning, did Clojure just before sleeping, and just after waking up. What more can I want? š Now normal shit again..
mogge
Mornin!
š
https://twitter.com/borkdude/status/1356545209157488640 ^ clj-kondo analysis used from clojure-lsp to find things, in emacs
https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/
š®
Oh cool, you can use cider + lsp together? (from the tutorial linked)
I'll take a look at this later tonight
Thanks!
yes
it's awesome
we should maybe do a meetup about this, but I'm only using it for one day.
Iāve been meaning to try it as well
so if anyone else has been using it, feel free to do a talk about it :P
Iāve been using it for few months but it feels so straight forward that I donāt even know what can the talk be about š
I think the idea is more to just "show it off"
Because I'm sure many people don't know it even exists
I for one wouldn't know how to begin using. But I'm stuck on just leiningen from command line and IntelliJ.. I tried to use Emacs, but that was ages ago.
This is not emacs specific btw. The same LSP server is used in Calva/VSCode now
and you can also use it in vim
etc
any editor which supports LSP
Thatās the beauty of LSP, which is amazing in itās own right
I don't know if I was unlucky but last time I tried (right after the recent clj-kondo release) it was quite disapointing, like not able to do autocomplete on core.async fns (:require [clojure.core.async :as async])
and async/c would suggest nothing) and so on
for navigation I still prefer git-grep/ripgrep via consult+embark on emacs, but that's just me maybe, old habits die hard
I guess it will improve in time
@mpenet the clojure-lsp project uses static analysis and maybe those vars could not be statically recognized
oh chan
should be recognized, it's just a defn
no clue but that's quite a limitation if it's not a bug
might be a bug then
could you try if you have the time ? (my lsp conf is gone)
I was hoping to use lsp just for autocomplete when I am not runnig a repl for hit&runs modifications
let's see
I suspect it's also not able to pick up some of the stuff that's generated, like default spec generators aliased from test.check and other things like that.
but for common cases it's probably ok
yeah I guess I was not lucky with that build
I remember reading clj-kondo analysis was partially broken early on
This guide was helpful in setting it up: https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/ Also be sure to re-install lsp mode in emacs and delete your previous things from elpa, this got me
LSP :: Restarting LSP in buffer db.clj
LSP :: Connected to [clojure-lsp:59528/starting].
LSP :: clojure-lsp has exited (exited abnormally with code 1)
did you add the whole basic configuration?
check the *clojure-lsp*
buffers, your path may be wrong
else ask in the #lsp channel
ah
thanks
Error: Invalid or corrupt jarfile /Users/erooijak/.emacs.d/.cache/lsp/clojure/clojure-lsp
Error: Invalid or corrupt jarfile /Users/erooijak/.emacs.d/.cache/lsp/clojure/clojure-lsp
duidelijk
you also recompiled emacs.d right?
Please ask in #lsp
Don't have much time right now
Apparently thereās also lsp layer in spacemacs, okay thank you for the suggestions!
I mean the clj-lsp impl
that's the guide I followed
I am now using the native build on macOS, no JVM anymore for the server
anyway, it takes time to set this up, it also took me a long time to try it again after having tried probably more than a year ago
so I understand the hesitation
ā¢ I think I might have hit: Fix clj-kondo batch analysis when merging batchs - Fix #284
with my luck
@borkdude it's quite easy to setup, the docs are good
I also added this to my config: lsp-enable-indentation nil
as this was slow for me on emacs 26
and I'm using clojure-mode to indent anyway
yeah, last time I tried I disabled pretty much everything: lenses, formating, etc
lenses are cool though
I just want "offline" autocomplete
lenses: it's just noise for me
@mpenet if you just want auto-complete: https://github.com/didibus/anakondo. Also based on kondo's output.
oh nice
I remember seeing it, not sure why I didn't try
it might be less automatic than clojure-lsp since clj-kondo doesn't scan anything on its own so the user is responsible to invoke their build tool to provide a classpath, while clojure-lsp figures this stuff out for you
ah
but maybe @didibus can tell you more (not in this channel)
> itāll only auto-complete within the buffer, it wonāt be able to show candidates from the required dependencies
š
huh, that is a bit weird
since this isn't hard to support
it's already supported out of the box even on emacs
@mpenet I don't think that's true, given the screenshot in the README
"If it canāt find either, itāll only auto-complete within the buffer, it wonāt be able to show candidates from the required dependencies." I think the "If it can't find either" part is important.
> It supports the notion of projects, using projectile or clojure-mode and Clojureās tools.deps. This means itāll pick up the bufferās current project root using projectile or clojure-mode, and it will use Clojureās tools.deps to get the projectās classpath. If it canāt find either, itāll only auto-complete within the buffer, it wonāt be able to show candidates from the required dependencies.
taken out of context š
yes