Fork me on GitHub
#calva
<
2019-04-27
>
mattford11:04:17

Hey all 🙂 I'm giving Calva a whirl. All connected and running great after 5 mins! But....don't have any inline def lookups or intellisense like behaviour.

pez12:04:36

Welcome! It’s a very common pattern, @mattford… Very probable to do with some nrepl dependency that is not met. What kind of project is this?

mattford12:04:55

out and out clojure

mattford12:04:25

:repl {:plugins [[cider/cider-nrepl "0.21.2-SNAPSHOT"]
                   [org.clojure/tools.nrepl "0.2.13"]]
         :dependencies [[nrepl "0.6.0"]]}

mattford12:04:35

That's what I added.

mattford12:04:53

Do I need to somehow do cider-jack-in equivalent?

mattford12:04:49

On REPL startup I see this

nREPL server started on port 61198 on host 127.0.0.1 - 
REPL-y 0.3.7, nREPL 0.2.12

mattford12:04:57

Which seems a version behind.

mattford12:04:58

hmmm - why's my dep being ignored (I'm guessing lein is providing a value as that's the only place in my project it's defined)

pez12:04:51

nrepl 0.6.0 is hardcoded in Leiningen so you don’t need that dependency. Maybe [org.clojure/tools.nrepl "0.2.13"] throws things off though, (if two different versions of nrepl are loaded…) in any case, remove that.

mattford12:04:31

okay now all I have is

mattford12:04:57

:repl {:plugins [[cider/cider-nrepl "0.21.2-SNAPSHOT"]]}

pez12:04:28

Does it work? 😃

mattford12:04:57

ah shite! My bad.

pez12:04:03

Otherwise you could try with 0.20.0

mattford12:04:19

Didn't have the :repl in profile, rather I had it as top level key.

mattford12:04:23

Things are happening now.

pez12:04:25

Cool. I am working on injecting that stuff for you, so it should get less messy when that is released.

pez12:04:02

Let us know how you fare and what you like and miss and such in Calva, please.

mattford12:04:06

ah too old a lein now.

mattford12:04:13

But I'm progressing.

mattford12:04:41

Some other things: can I get Joker to run on more than just save?

mattford12:04:41

Hoozah! All working now 🙂

mattford12:04:47

My immediate questions are: joker on edit rather than save, paredit enforcing balance.

mattford12:04:12

But seems to work great

mattford12:04:30

I like it, been an Emacs user for 20 years or so, but the modern intellisense stuff and the lack of decent way of rendering inside the editor keeps me looking.

mattford12:04:40

Testing seems integrated nicely.

mattford12:04:54

Is there a way to run a single test rather than all in namespace?

mattford12:04:42

I'm gonna use Calva as my main driver for a bit 🙂

mattford12:04:57

I guess the big missing thing for me is no sign of debugging?

pez12:04:09

Unfortunately not. There might be an issue about it on github. I think that in general it should be easy to add, but the testing as such is a bit flaky…

mattford12:04:31

Cider's debugging step through stuff in emacs is great.

pez12:04:26

Debugging will be missing until someone like @mseddon has time to add it. It is a bit too far from my skill level.

pez12:04:15

I might give it a shot some day anyway, but right now there are too many more pressing things.

mattford12:04:48

Seems a great start. I can happily use this 🙂

pez12:04:10

About joker… iirc the integration operates on the saved file. Not sure if it offers some other integration option but if it does it would be feasiable to add lint-on-type.

mattford12:04:09

Not sure I know that in Emacs joker is lint-on-type

pez12:04:14

Glad you like it! I am quite determined to make it a productive tool. Inching it slowly, but we’ll get there! 😃

mattford12:04:19

Via flymake

mattford12:04:57

Sorry flycheck

pez12:04:11

It was a while ago since I looked at the joker integration in Calva. But it is quite little code,I can check it out.

pez13:04:55

It doesn’t seem that joker supports linting something else than a file.

d4hines16:04:04

How does Emacs do it then…?

d4hines16:04:36

This extension says in the docs it can lint on type: https://github.com/martinklepsch/vscode-joker-clojure-linter

d4hines16:04:37

Hmmmm…. Looking at the code I’m not sure how that’s possible, since it just calls joker --lint [filename]

d4hines16:04:10

kondo accepts from stdin.

pez16:04:47

@d4hines: I don’t think Emacs uses joker. But interesting that that extension uses joker and can lint on type. Martin is a very smart guy, so might be some magic involved. 😃

pez16:04:17

And clj-kondo looks very interesting! If @d4hines or @mattford has the time you are welcome to try figure out how jiker and clj-kondo compares and what we might lose and win by switching. Seems like it might give us less false positives.

d4hines16:04:18

Yeah - I’ll give it a look when I have a chance. As I understand Michiel made Kondo to add to, not replace joker. But the main purpose of Joker was to be fast, and since Kondo is in Graal, it might make sense for to grow and eventually replace Joker.

d4hines16:04:44

(these inferences are my own, might be misunderstanding the respective authors’ intents)

pez16:04:59

Kondo only seems to are about the linting part, so it can’t replace joker for those using it for clojure scripting.

pez16:04:06

But the use case we are talking about is considered by Kondo and not by joker. 😃 It would be possible to support both and have it as a user setting, but I much rather maintain just one integration. The Clojure world has so many different branches I need to support w/o adding several linters to the mix. I have considered scrapping linting all together since there is an extension for that, but also, I like that Calva just packs the tools together.

d4hines16:04:32

Doesn’t look like it would be too difficult to swap out https://github.com/BetterThanTomorrow/calva/blob/61e6a0d97104a82bb9d2245db4fa0d5b1c7a072b/calva/repl/middleware/lint.ts for Kondo. I’ll give it a shot (can’t promise when). I don’t know what Windows support for Kondo would look like… I think you’d be forced to use WSL until Graal supports windows binaries.

d4hines16:04:48

Man… the fact that Calva is in Typescript is so nice … I would have no idea how to start hacking on an emacs lisp package…

pez17:04:02

Haha, I would wish more of it was in ClojureScript, but yeah TS is quite nice.

pez17:04:50

We have wsl trickery for joker.

pez17:04:22

But before we swap things, I'd like a comparison of the linters of some sort. Maybe we can holler in @borkdude here?