cursive

Issues at: https://git.io/cursive-issues
tengstrand 2021-05-14T09:24:36.359700Z

I’m working on https://github.com/polyfy/polylith/issues/66 in the Polylith project. In that branch we have switched to use :deps when specifying which bricks to include in a project, e.g. in the https://github.com/polyfy/polylith/blob/issue-66/projects/poly/deps.edn project. It would be nice to switch to :extra-deps even in the root https://github.com/polyfy/polylith/blob/issue-66/projects/poly/deps.edn but right now I don’t want to do that, because I use Cursive and I problem I have is that Cursive doesn’t recognise the source code that is included using :extra-deps it only works when using extra-paths . It works in other IDE:s that I have tried, e.g. Calva, because they treat everything that is accessible from the REPL as code (this is my theory at least). It would be really nice if Cursive could support this too, so that src directories will be “green” even when they are defined as`extra-deps.` If this worked then all projects, development included, could be configured in the same way which would produce less code and be more consistent. What do you think @cfleming?

tengstrand 2021-05-20T15:21:53.014700Z

I also created https://github.com/cursive-ide/cursive/issues/2554 issue.

tengstrand 2021-05-14T09:27:15.359900Z

Here is how it looks like when using :extra-paths and when using :extra-deps.

2021-05-14T14:14:32.362600Z

Hey, has there been a regression around sending top form to REPL? It used to not send the comment block, so you could do this, where | is my caret:

(comment
  (identity coll)|)
Which now sends:
(comment
  (identity rows))
=> nil
Instead of:
(identity rows)
=> [1 2 3 4 5]

imre 2021-05-14T14:18:32.363Z

In your case I'd use the send form before caret command

imre 2021-05-14T14:19:07.363600Z

top form works as you'd expect inside a comment when your caret is within (identity coll)

imre 2021-05-14T14:19:24.363900Z

but not when it's directly in the comment form

imre 2021-05-14T14:19:45.364300Z

That's been like that ever since I use cursive correction: ever since I started sending forms to the repl in cursive 🙂.

2021-05-14T14:57:48.365200Z

That's interesting, in my experience cursive was aware if it was in a comment block and would not send the comment as part of the form...

2021-05-14T14:58:18.365700Z

Which I would have expected as that's basically the standard workflow of using rich comments...

2021-05-14T14:59:58.367100Z

I mean if this is the new behaviour fine, but it's pretty useful to be in a let block within a comment and not have to jump to the top most form to send it via send form before caret... I might be in the minority however 😃...

imre 2021-05-14T15:10:02.367500Z

I think you misunderstand me. Probably I wasn't clear enough.

imre 2021-05-14T15:10:49.368300Z

Standing here and issuing send top form:

(comment
  (identity |coll))
Should still send (identity coll) to the repl

imre 2021-05-14T15:12:38.369800Z

But if you're outside of the 'top' form you are trying to send, then from that position the correct 'top' from is indeed the comment

imre 2021-05-14T15:14:08.370Z

I use this all the time

imre 2021-05-14T15:14:26.370400Z

If I'm within a let block within a comment, I'll use send top and it'll send the let

imre 2021-05-14T15:15:13.371400Z

If I'm just outside (after) the let block, I need to use another command, 'send form before caret to repl'

imre 2021-05-14T15:15:51.372Z

And I haven't seen the behavior change in the past 4+ years in this regard

pez 2021-05-14T19:05:56.372900Z

When would you ever want the comment form to be sent?

imre 2021-05-14T19:19:49.373Z

I don't think I'd want that but the behavior is more consistent this way imo

imre 2021-05-14T19:21:34.373100Z

For a command named 'send topmost form', I'd be rather surprised if that worked like 'send form before caret' under certain conditions

alexmiller 2021-05-14T19:23:27.373600Z

this is why the principle of least surprise is a fallacy. people are surprised by different things

☝️ 1
1
pez 2021-05-14T20:32:44.374900Z

@imre , however, you would never get the surprise, since you wouldn't try to send the comment form. 😎

pez 2021-05-14T20:46:14.378500Z

Also, with the cursor at the top level, near some form. What should be sent if top level is requested? If we think of (comment …) as creating a new top level (since no-one wants to send comment forms anyway) it can send the same thing as would be sent in the top level case. Which, I think should be something, rather than nothing.

cfleming 2021-05-14T21:13:01.379300Z

My intention was definitely that this should work as @folcon expected, since I also can’t imagine when you’d ever want to sent the comment.

dpsutton 2021-05-14T21:15:25.379800Z

(comment
  (fire-missiles!)
  |
  (+ 1 1))
what is intended here, with | being cursor?

dpsutton 2021-05-14T21:17:51.380800Z

i implemented this feature in clojure-mode, and luckily emacs's idiom is last sexp almost all the time. so i would fire missles in emacs

emilaasa 2021-05-14T21:19:43.381300Z

Isn't it possible to just ignore the comment form completely? As if you were in the "root"

emilaasa 2021-05-14T21:20:41.382Z

Treat it the same as:

(fire-missiles!)
|
(+ 1 1)

cfleming 2021-05-14T21:26:56.382900Z

I’m not sure what would be intended, but yes, it should be treated as if the user were at top level, so probably nothing should be sent.

👍 2
1
2021-05-14T23:05:49.383800Z

I did an update and the behaviour seems to be what I expected 😃...

👍 1
2021-05-14T23:06:05.384200Z

Thanks for chiming in @cfleming 😃...