Fork me on GitHub
#calva
<
2019-03-29
>
hoppy00:03:18

trying to migrate to calva from emacs, so far so good. It's painful reprogramming the central nervous system so brutally.

hoppy00:03:43

I noticed the hover-help to get the docstrings doesn't seem to be working. I'm wondering if I have everything setup right.

hoppy00:03:58

also noticed "go to definintion" doesn't work - so same question

pez08:03:36

And same answer 😀. It is probably due to insufficient nrepl dependencies. Calva doesn't yet inject them for you. If you scroll up some, you'll find a long and beautiful command line that injects everything that's needed (and then some, if you're not using figwheel).

pez08:03:19

Oh, noes, that had suffered the Death o’ Slack! No worries, though, here goes:

lein update-in :dependencies conj "[nrepl \"0.6.0\"]" -- update-in :dependencies conj "[cider/piggieback \"0.4.0\"]" -- update-in :plugins conj "[cider/cider-nrepl \"0.21.2-SNAPSHOT\"]" -- update-in "[:repl-options :nrepl-middleware]" conj "[\"cider.nrepl/cider-middleware\"]" -- update-in "[:repl-options :nrepl-middleware]" conj "[\"cider.piggieback/wrap-cljs-repl\"]" -- repl

pez08:03:38

^ @hoppy ^

hoppy11:03:48

will give that a try. I assume the piggieback is cljs only?

pez12:03:27

A lot of that stuff is cljs only. But afaik they don't get in the way for clj coding.

hoppy12:03:11

yeah, that lit things up - thanks

hoppy12:03:58

It might make sense to plop that magic lein command into the wiki - it will trip up even a patient n00b

hoppy12:03:59

salvaged/groomed from one of the github tickets & your comments above.

pez12:03:41

I actually added it to the wiki first page after I had pasted it here for you. 😃

pez12:03:23

But, yeah, it should go into the Getting Started page as well. Feel free to edit the wiki.

pez12:03:28

Hopefully it should be history soon, when we get the jack-in released.

hoppy12:03:42

a connundrum likely inherited from cider. Getting that guy setup was a pita too, although it has gotten a lot easier recently

pez12:03:58

If you are of the brave type, @hoppy, I welcome you to help beta test the new REPL window. It makes things quite a bit more like with Emacs.

hoppy12:03:32

I had always looked for the "hey stupid, this is how the pieces fit together, and what does what"

hoppy12:03:54

birthing a cljs repl was vexxing

pez12:03:39

The cljs repl story is quite nice with Calva I should say. Once you have gotten it connected, at least.

pez12:03:22

With Cider I get a bit confused which repl is working for me, but with Calva it is easy to know that and also easy to switch.

hoppy12:03:14

I will play with that shortly, and I'm happy to help/hack on wherever I can be of use.

pez12:03:50

Here’s the dev build with the new REPL window, anyway. It has quite a few rough edges, but I still find it more productive than the released Calva.

hoppy12:03:42

I'm trying to wean myself off emacs, this seems a much saner path. I need to be able to get new people into clojure, and as long as we have "step 1, master emacs" we are toast

hoppy12:03:32

Unfortunately I'm such a cider-freak it has bound itself to my spinal column, and I can't get much done without it.

pez12:03:45

Haha, yeah, that is sort of the why Calva exists. Some say it’s good to weed out the not-so-brave, but I kinda feel it is better to have this option.

pez12:03:22

There’s still a long way to go for Calva to give Cider a match, but VS Code is nice, and we’re slowly improving things.

hoppy12:03:16

I think this is the right trajectory. Guy that works with me touts cursive. I plopped that on my laptop and fired it up, and the damn thing did a short-field takeoff when the fans spun up.

hoppy12:03:19

way too heavy

pez12:03:27

And, Calva owes most of its functionality to The Orchard anyway. 😃

hoppy12:03:00

yeah, and I think that is where history will erect the statue of BB

pez12:03:00

Calva really is distilled from Cider.

pez12:03:51

Nice idea with a statue!

hoppy12:03:58

not sure how to consume the .vsix (I'm a vscode noob). I tried to just do "code <blah>" like I found instructions for, but it just tries to open it like a data file

hoppy13:03:30

nm, got it, needed --install-extension

hoppy13:03:09

wow. new world

pez13:03:24

Oh, I’m sorry, was afk. What I do is I do it from the extensions pane in vscode. There’s menu there at the top right.

hoppy13:03:59

no worries, all good. Trying to find my way around the new wonderland

pez13:03:38

The command palette is your friend in vscode. cmd+shift+p on mac.

pez13:03:21

Type in that menu and it will filter the commands. Calva is a good filter. 😃

hoppy13:03:29

yeah, been all over that

pez13:03:18

Also, I have changed some paredit key bindings on my machine to match those in Cider.

hoppy13:03:02

Im sure config hacking will become a new hobby

pez13:03:39

Well, much less so than with Emacs, hopefully. 😃

pez13:03:59

That said, I have this in my settings.json:

"editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": [
                    "meta.comment-expression.clojure"
                ],
                "settings": {
                    "fontStyle": "italic"
                }
            },
            {
                "scope": [
                    "constant.keyword.clojure"
                ],
                "settings": {
                    "foreground": "#9cdcfeff"
                }
            },
            {
                "scope": [
                    "punctuation.section.expression.begin.clojure",
                    "punctuation.section.expression.end.trailing.clojure"
                ],
                "settings": {
                    "foreground": "#999"
                }
            }
        ],
        "[Default Dark+]": {
            "textMateRules": []
        }
    },

hoppy13:03:56

I'm having some confidence trouble with eval-file

pez13:03:01

Never mind the comment-expression things, they are for a dev build of Calva where I try to tokenize comments.

pez13:03:09

What about eval-file?

hoppy13:03:06

somethings just off. I got it bound to a key, and I wee the evaluation message happen, but it doesn't seem that the symbols get defined

hoppy13:03:12

it's weird

pez13:03:39

It’s a bit worse in the dev build you are using. It eats up more of the error messages… But it’s probably due to some form not compiling. Try evaluating them one at a time from the top. (`ctrl+alt+v space` is your friend here).

hoppy13:03:22

that's likely what's going on, this is code I'm actively hacking on atm.

pez13:03:29

I should file that issue on github, btw. Very annoying.

hoppy13:03:30

having a bit of fun here. so I had that option to chase the namespace from before. Now with the new repl when I'm in my file window, it shows that namespace, when I got back to the repl window, it goes back to user->

hoppy13:03:41

I think I better turn that off

pez13:03:26

That sounds like a bug, which I can’t reproduce at the moment.

pez13:03:10

But I think switching that option off is fine. I actually think we might remove it before release. The REPL window will temporarily switch namespace when you evaluate a form from a file. Which is enough of help, me thinks.

hoppy13:03:42

disabling it helped.

hoppy13:03:41

ok, I got my act together enough to actually -run- some clj code.

hoppy13:03:59

anything in particular you want me to check out in the new repl?

hoppy13:03:18

made it print a fat databall, seemed unfazed

pez13:03:50

I recmmend installing Clojure Warrior as well. It has raindbow parens and a sane highlight of current enclosing parens. Then disable vscode default matching paren highlight for clojure files (which is just weird).

hoppy13:03:05

already there.

pez13:03:38

Nothing in particular, no, but after having used it a while, I’d like to know what things hurt the most so that we can prioritize what to fix before release.

hoppy13:03:08

editing the repl line has some weird-feeling stuff.

pez13:03:19

It would be nice to see issues filed on github about the REPL window.

hoppy13:03:32

I can help with that

hoppy13:03:44

it's like the usual keys don't act as expected.

pez13:03:59

Yeah, that is a bit awkward yet.

hoppy13:03:11

and no history?

pez13:03:15

Some usual keys do work, some don’t. It is actually a completely new clojure editor written from scratch and hosted in a webview.

hoppy13:03:30

ah, that explains it.

pez13:03:41

alt+up/down for history.

hoppy13:03:00

jup, nice

hoppy13:03:05

on the history.

hoppy13:03:46

that's a big undertaking.

pez13:03:21

Oh, yes, would not have been possible w/o @mseddon, who’s a frontend wiz of proportions.

pez13:03:17

It really has the potential of powering lots of web based clojure editing. But we’re not opening that box up until we have it working in Calva.

hoppy13:03:31

is there a branch you guys are working on that I can tag along on?

pez13:03:40

But now and then I visit https://repl-interactor.netlify.com just to dream about it some.

hoppy13:03:33

geez, what is that thing.

pez13:03:29

It’s the REPL window frontend, basically.

pez13:03:36

Not much going on right now in development, but yes, please see the pez/repl+jack-in branch.

pez14:03:16

The jack-in functionality needs us moving the parsing of edn files into the cljs parts of the code. Might be something to take a look at.

hoppy15:03:02

I'm probably not understanding the intent of the line-editing in the new repl. Let's say I have "(query [:job-numbers])" in there, and I run it. Good. my next move is to alt-up and then I want to edit it to read "(count (query [:job-numbers]))" and rerun it. 'tis an all out war....

pez16:03:03

I would type (count the begonning of the line and then slurp forward. Then hit END and submit it.

pez16:03:05

Even if, truth be told, I work mostly in the files, also for such experiments. Calva will let you evaluate top level forms inside comments.

hoppy16:03:02

yeah, I use that too

pez16:03:20

Please take notes on things that seem awkward to you, before you get used to them.

hoppy18:03:11

your right, you quickly learn to plow around the stumps :face_with_cowboy_hat:

pez18:03:56

That's where i am 😎