Fork me on GitHub
#calva
<
2019-01-07
>
mseddon08:01:54

@lspector, I can relate. I have issues jumping between different editing environments, even things like IntelliJ and vscode, let alone emacs.

pez08:01:39

@tomd: not sure my answer about tests made all that much sense. But maybe it gets clearer once you familiarize yourself some with the spec. What I have done so far is to introduce my changes Test-first. And maybe @mseddon knows about meta-expressions and can advice about if that also should be covered by the change.

tomd09:01:28

@pez I'm trying to familiarisze myself with the Calva codebase so hopefully I understand things better 🙂 I only just read this: > Calva Formatter is made using a mix or TypeScript and ClojureScript. Generally the integration with VS Code is done in TypeScript and the actual formatting is done in ClojureScript. which expalins a lot. I'm just looking through calva-lib now. I assume the tests all live in test/calva/fmt/ ?

mseddon09:01:39

@tomd, yep, that's the place!

mseddon09:01:31

@pez I am not particularly familiar with tmLanguage atm, to me the phrase 'meta-expressions' makes me think of M-Expr's which is definitely not something lisp has used for 50 years 🙂

mseddon10:01:36

oh! sorry about that. I hadn't realised that had appeared

tomd10:01:52

thanks both! I'll take a look today if I get a minute

pez10:01:23

calva-lib is not involved for this grammar thing. It is quite isolated. But I needed to move it inside the calva-fmt repo to keep some of my sanity. 😀

👌 5
mattly19:01:40

does calva have the equivalent of cider's doc function to get the docstring for a var?

mattly19:01:58

I seem to remember having this some time before but can't find it now

pez20:01:51

@mattly: If you just want to see the docstring you can hover on the var. Or using the keyboard cmd-k cmd-i. If you want to print the docstring (I am not sure what that cider-function does) you can peek at the definition of the var using alt+f12 and copy the string, or go to the definition with just f12 (also cmd+click).

mattly20:01:06

I build muscle memory from looking up stuff with the command palette and then noting the keyboard shortcut

mattly20:01:45

but I haven't found the relevant command

mattly20:01:04

hm I don't seem to have that command

pez20:01:32

They are built in vscode commands. Show Hover, Peek at definition, Go to defnition.

mattly20:01:54

nada, same for the definition stuff

pez20:01:09

wow, do you have a repl connected?

mattly20:01:12

I do have a connected repl, and this used to work

mattly20:01:16

yeah, lemme check something

pez20:01:54

try it in a typescript file too, it’s done statically there.

mattly20:01:24

yeah that's what I was doing 😛

mattly20:01:30

it works as expected there

pez20:01:01

Then I suspect you have an uncompatible version of nrepl running.

mattly20:01:24

this is quite honestly my least favorite part of working with clojure

pez20:01:50

Mine too. And I have procrastinated fixing it for too long.

pez20:01:32

I have on my todo to fix some jack-in commands that inject the needed middleware for you.

mattly20:01:00

in the meantime for lein I could use ~/.profiles.clj or something right?

pez20:01:21

But for now, make sure you have nrepl ´0.0.17` at least. I recommend 0.0.19.

pez20:01:34

Yeah, I use my profiles.clj

pez20:01:03

But I am not sure which will win if you have something else in the project.clj

mattly20:01:06

is your dotfile anywhere I can crib from?

pez20:01:37

my dotfiles repo is a total mess. But I can paste that file here for you. just a sec

pez20:01:02

{:repl {:plugins [[cider/cider-nrepl "0.19.0-SNAPSHOT"]
                  [lein-figwheel "0.5.18-SNAPSHOT"]]
        :dependencies [[cider/piggieback "0.3.10"]
                       [nrepl "0.5.0"]
                       [figwheel-sidecar "0.5.18-SNAPSHOT"]]
        :repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}}}

mattly20:01:28

thanks again

pez20:01:32

I think both those SNAPSHOTs might have been cut since I updated the file, but this should work.

mattly20:01:02

I'll check

mattly21:01:41

No such var: nrepl.transport/uri-scheme

mattly21:01:45

got it working with this:

mattly21:01:55

and it works!

mattly21:01:49

now I just need a good magit clone

pez21:01:46

Awesome. I should try the newer versions as well.

pez21:01:33

I can recommend the GitLense extension.

mattly22:01:45

yeah, it still won't let me stage by hunk

mattly22:01:19

is there a way to change the color of the "nREPL" text in the statusbar? it doesn't work well with light themes

pez22:01:30

Nor currently. But an issue report on that is welcome.

pez22:01:38

What is staging by hunk?

mattly22:01:37

similar to git add --patch

mattly22:01:50

Atom and Magit have this by default

mattly22:01:14

you can stage individual change hunks instead of the whole file

mattly22:01:22

vscode lets you do this, but only linewise

mattly22:01:52

I've actually taken to just opening a terminal and using the cli there

mattly22:01:23

ok issue filed about the colors