Fork me on GitHub
#calva
<
2020-10-17
>
Joel06:10:32

I'm not able to navigate (go to definition of function) or list callers to a function. Does Calva not do that?

sogaiu08:10:50

@joel380 when connected to a repl that has the appropriate definitions loaded, i was able to use f12 to go to definition

sogaiu08:10:08

@pez i started passing some generated strings to calva's lexer today and noticed that _* is parsed as:

[{'type': 'junk', 'offset': 0, 'raw': '_', 'state': {'inString': False}}, 
 {'type': 'id', 'offset': 1, 'raw': '*', 'state': {'inString': False}},   
 {'type': 'eol', 'raw': '\n', 'offset': 2, 'state': {'inString': False}}]
is that intentional?

pez08:10:56

@joel380 Calva does not list callers/references. That would be sweet. It does allow you to peek and navigate to definitions, though. You probably need to check if you have the right nrepl dependencies and that the current file is loaded.

pez08:10:49

@sogaiu, thanks for digging up those! Please file it as an issue.

sogaiu08:10:42

ok. so if something looks odd, should i just file an issue and further discussion can take place there? i'm bound to be mistaken or uninformed on some of these things 🙂

pez08:10:23

Well, I appreciate that you inform here if you wonder if an issue might or might not be what we need. However, with these parsing things there is a truth to be consulted, the reader. We want the Calva parser to stay as close to the reader as possible. Maybe you can rephrase that other issue you filed, about ignore markers and the absence of spaces, to read more like a collection of parsing issues you've found. At least until we pick it up and start trying to fix them.

sogaiu08:10:02

ok, so let's see if i've got your idea correct: 1) rephrase existing issue and accumulate things there for the time being 2) if it looks like it differs from what the reader might say, add to the issue 3) if there seems to be a doubt, mention on this channel or contact you some other way to discuss and decide further action how does that seem?

pez08:10:21

If you agree, then it seems good.

pez08:10:57

Did you generate those strings using the fastcheck things in Calva's test harness, btw?

sogaiu09:10:31

i'm fine to try the above suggested course of action. re: generating the strings -- no, i am pretty ignorant of that which you mentioned :) i am applying this: https://github.com/sogaiu/hypothesis-grammar-clojure

sogaiu09:10:19

ah cool -- thanks for the info. will take a look.

pez09:10:23

🎉 Thanks, @stefan.van.den.oord!

❤️ 9
calva 3
Humanist196518:10:27

My Jack-in from Calva has just stopped working. The pop up window does not appear now at all. Any suggestions on how I can debug the problem.

👍 6
pez18:10:59

@humanist1965 can you try with v2.0.126? This could be an issue with the latest version, and if so we need to take immediate action.

Humanist196518:10:12

@pez Yes v2.0.1.126 works. So it does appear to be a problem with the latest version. I’m on macOS Catalina (in case that is relevant).

pez20:10:38

Does the Calva command for running all tests not work for your setup?

simon21:10:38

I probably missed that command @pez. Do you mean https://calva.io/test-runner/? I tried the ctrl+alt+c shift+t combo but maybe there's mismatch of shortcuts. I get this weird red-brown colored element in the VS Code sidebar

simon21:10:46

I think it searches file names that contain a "t" 😉

pez21:10:12

Haha, weird. But try from the command palette?

simon21:10:10

I refreshed my workspace and looked in the key bindings (I wasn't successful there though). I don't know what I did exactly now, but the test runner works now as expected 😉

jonathanhuston19:10:54

Hi @pez – same problem as @humanist1965 on Catalina, also works when I switch back to v2.0.126.

pez19:10:10

@humanist1965 @jonathan.huston what kind of projects are you jacking in to?

jonathanhuston20:10:02

@pez nothing fancy, just a simple Leiningen project with five source files and a project.clj, no external dependencies. Calva starts up just fine in v.2.0.127, but when I try to jack in with the keyboard shortcut or the command palette, nothing at all happens. No problems in 126.

👍 3
pez20:10:13

What can you see in the Developer Console? (Help menu)

jonathanhuston20:10:26

@pez jacking in has no effect whatsoever, even in the developer console, no error or warning

👍 3
pez20:10:06

Does it matter if you try jack-in from the command palette or via the keyboard shortcut?

jonathanhuston20:10:37

@pez nope, no effect in either case

pez20:10:31

I'm also on Catalina, so am looking for something that can reproduce the error...

bringe20:10:10

I'm on arch linux, and nothing happens at all when I run Jack-in 😬

bringe20:10:20

Clojure cli project

jonathanhuston21:10:25

checked on Fedora, with the same result

👍 3
bringe21:10:14

I see the start of the issue..

bringe21:10:55

https://github.com/BetterThanTomorrow/calva/blob/b5fa6d568f8e6da9a7c47c5e4262781bb9823893/src/nrepl/jack-in.ts#L145 liveShareSuppoer.setupLiveShareListener() is throwing an exception, and the catch block just returns and short-circuits jack-in

👍 3
pez21:10:08

Great. If you have some time to try to ship a fix, that would be great. Otherwise I'll give it a go tomorrow morning. It is getting too late here and my brain is not really up to it. 😃

bringe21:10:09

I may be able to ship something today, but should we roll back for now? I don't know the rollback process

bringe21:10:48

Which results in the next line throwing an error for calling a function on null

bringe21:10:54

So, a check there should fix. I'm on it now

pez21:10:17

Awesome. Will you be able to test a VSIX quickly, if @brandon.ringe posts it here, @jonathan.huston, @humanist1965?

pez21:10:49

Anyway, I'm sorry to abandon you, but I am pretty useless right now. 💤

bringe21:10:43

No problem! Sleep is important. Rest up

bringe21:10:08

The benefit of us having such different time zones 😄

simon21:10:00

Is there a way to auto-format clojure maps such that values are vertically aligned, similarly to how Intellij/Cursive can do it?

bringe22:10:05

Try the (experimental) command "Format and align current form" - default key kinding is ctrl+alt+L

bringe22:10:25

It's experimental, but seems to work for me

simon22:10:11

thanks @brandon.ringe :star-struck:

✌️ 3
simon22:10:40

Could I rebind it to be executed on save?

bringe22:10:02

Hmm... not that I'm aware of. @pez, is this possible? And if not, is this something that would be a good idea / possible to add to Format As You Type, or whatever the default formatting is that happens when you press tab?

pez06:10:11

There is a formatter config for this. See https://calva.io/formatting/

pez07:10:02

Beware that it behaves a bit crazy at times. I stick to manually aligning using he command.

pez10:10:56

(`:align-associative?` is the config param. I forgot to mention that.)

👌 3
bringe22:10:56

This is working for me, if I can get a confirmation from someone soon that would be awesome. Otherwise I may just push the new version since this is a time-sensitive thing imo.

bringe22:10:08

Have some other things to do today, so releasing now 🚀

bringe22:10:05

Version 2.0.128 is out, and jack-in should be working for all! Please report any issues.

👍 6
sogaiu23:10:51

seems to be working fine here 🙂 (sorry it's not an issue)