Fork me on GitHub
#clojure-nl
<
2021-02-02
>
Ruben.Hamers08:02:37

good morning 🙂

gklijs08:02:43

Morning, did Clojure just before sleeping, and just after waking up. What more can I want? 😀 Now normal shit again..

😂 2
borkdude10:02:16

https://twitter.com/borkdude/status/1356545209157488640 ^ clj-kondo analysis used from clojure-lsp to find things, in emacs

kwrooijen10:02:43

Oh cool, you can use cider + lsp together? (from the tutorial linked)

kwrooijen10:02:10

I'll take a look at this later tonight

borkdude10:02:36

it's awesome

borkdude10:02:52

we should maybe do a meetup about this, but I'm only using it for one day.

Mno10:02:09

I’ve been meaning to try it as well

borkdude10:02:11

so if anyone else has been using it, feel free to do a talk about it :P

Dmytro Bunin10:02:24

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 😄

kwrooijen11:02:35

I think the idea is more to just "show it off"

kwrooijen11:02:53

Because I'm sure many people don't know it even exists

gklijs11:02:25

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.

borkdude11:02:13

This is not emacs specific btw. The same LSP server is used in Calva/VSCode now

borkdude11:02:21

and you can also use it in vim

borkdude11:02:28

any editor which supports LSP

Mno11:02:06

That’s the beauty of LSP, which is amazing in it’s own right

mpenet12:02:10

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

mpenet12:02:04

for navigation I still prefer git-grep/ripgrep via consult+embark on emacs, but that's just me maybe, old habits die hard

mpenet12:02:40

I guess it will improve in time

borkdude12:02:01

@mpenet the clojure-lsp project uses static analysis and maybe those vars could not be statically recognized

borkdude12:02:45

oh chan should be recognized, it's just a defn

mpenet12:02:48

no clue but that's quite a limitation if it's not a bug

borkdude12:02:57

might be a bug then

mpenet12:02:16

could you try if you have the time ? (my lsp conf is gone)

mpenet12:02:52

I was hoping to use lsp just for autocomplete when I am not runnig a repl for hit&runs modifications

mpenet12:02:10

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.

mpenet12:02:52

but for common cases it's probably ok

mpenet13:02:59

yeah I guess I was not lucky with that build

mpenet13:02:15

I remember reading clj-kondo analysis was partially broken early on

borkdude13:02:21

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

erwinrooijakkers13:02:09

LSP :: Restarting LSP in buffer db.clj
LSP :: Connected to [clojure-lsp:59528/starting].
LSP :: clojure-lsp has exited (exited abnormally with code 1)

erwinrooijakkers13:02:33

did you add the whole basic configuration?

borkdude13:02:36

check the *clojure-lsp* buffers, your path may be wrong

borkdude13:02:53

else ask in the #lsp channel

erwinrooijakkers13:02:37

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

erwinrooijakkers13:02:49

you also recompiled emacs.d right?

borkdude13:02:52

Please ask in #lsp

borkdude13:02:05

Don't have much time right now

👍 1
erwinrooijakkers13:02:30

Apparently there’s also lsp layer in spacemacs, okay thank you for the suggestions!

mpenet13:02:22

I mean the clj-lsp impl

mpenet13:02:44

that's the guide I followed

borkdude13:02:09

I am now using the native build on macOS, no JVM anymore for the server

borkdude13:02:48

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

borkdude13:02:56

so I understand the hesitation

mpenet13:02:45

• I think I might have hit: Fix clj-kondo batch analysis when merging batchs - Fix #284

mpenet13:02:05

with my luck

mpenet13:02:43

@borkdude it's quite easy to setup, the docs are good

borkdude13:02:18

I also added this to my config: lsp-enable-indentation nil as this was slow for me on emacs 26

borkdude13:02:24

and I'm using clojure-mode to indent anyway

mpenet13:02:45

yeah, last time I tried I disabled pretty much everything: lenses, formating, etc

borkdude13:02:54

lenses are cool though

mpenet13:02:57

I just want "offline" autocomplete

mpenet13:02:12

lenses: it's just noise for me

borkdude13:02:46

@mpenet if you just want auto-complete: https://github.com/didibus/anakondo. Also based on kondo's output.

mpenet13:02:22

I remember seeing it, not sure why I didn't try

borkdude13:02:36

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

borkdude13:02:07

but maybe @didibus can tell you more (not in this channel)

mpenet13:02:28

> it’ll only auto-complete within the buffer, it won’t be able to show candidates from the required dependencies

borkdude13:02:55

huh, that is a bit weird

borkdude13:02:00

since this isn't hard to support

mpenet13:02:25

it's already supported out of the box even on emacs

borkdude13:02:26

@mpenet I don't think that's true, given the screenshot in the README

borkdude13:02:02

"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.

mpenet13:02:03

> 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.

mpenet13:02:07

taken out of context 🙂