Fork me on GitHub
#cursive
<
2019-10-25
>
cfleming00:10:33

@helios Ah, I see the problem (after finally opening your link) - it looks like rewrite-clj has vendored potemkin as rewrite-clj.potemkin. You should be able to fix that by using Resolve As… potemkin.namespaces/import-vars (see https://cursive-ide.com/userguide/macros.html#customising-symbol-resolution)

helios06:10:25

so i need to resolve it as "potemkin/import-vars" ?

cfleming07:10:09

Yes, either that or potemkin.namespaces/import-vars

cfleming07:10:21

They’re just aliases for the same thing IIRC

helios06:10:35

thank you! 🙂

helios06:10:56

did you need to add "manual" support for that or cursive infers it from the defmacro directly?

cfleming22:10:48

I needed to teach Cursive about it.

cfleming22:10:10

There’s really no good way to automatically determine what arbitrary macros do.

tekacs06:10:31

I have a variation on the resolution issue, I’m guessing/hoping a naïve one — in my shadow-cljs/deps.edn project, I’m finding that nothing based upon the (js/ namespace resolves. I do have a clojurescript dependency explicitly listed and for what it’s worth, trying to ‘Go to definition’ (Cmd+Click) on js leads nowhere (although the hover-box reads alias "js"). These are my shadow-cljs.edn and deps.edn files: https://gist.github.com/tekacs/ddbf8536846c52138d3bbeca6f736ebd Might anyone be able to tell me what I’m missing? 🙂

tekacs17:10:04

@thheller solved this in #shadow-cljs. Thanks! He pointed out that Cursive doesn’t support js/ — that works for me, since I have little use for it and I’ll just keep it to a few places, as nice as it would be to have that function (it works well in Scala.js which has explicit bindings matching MDN, but I understand why it would not here). :)

danieroux12:10:05

How do I do a “Raise All”? Turn this:

(try
  (fn-1)
  (fn-2))
(catch Exception e
  (println "Oops"))
Into
(fn-1)
(fn-2)
Just Raising (fn-1) deletes the forms following it, and thus kills (fn-2).

danieroux12:10:07

Actually, getting to this is what I want. Raise the two forms out of the try (or do, or let, or …)

(fn-1)
(fn-2)
(catch Exception e
  (println "Oops"))

Alex Miller (Clojure team)12:10:37

+1 - seems like this is the behavior I got in emacs paredit but don't have in cursive and it still throws me off sometimes

sgerguri14:10:23

Not sure if there is a way to do that - the way I do it is in two strokes - Alt+S to splice the try, then kill the leftover try on that line (I use the Vim plugin so that's DD for me subsequently).

sgerguri14:10:01

On a somewhat unrelated note, even after so many years editing Clj is such a drug that writing anything other than a Lisp always feels incredibly cumbersome.

onetom14:10:49

i've settled on the alt-s(plice) approach; it feels like unnecessary overhead to learn extra shortcuts for a not so frequent operation when it's quite trivial to compose from simpler primitives

nmkip23:10:30

Is there an evaluate and print in the editor command?

sogaiu23:10:14

do you mean something like (with a connected repl): • put cursor after an expression in the editor • bring up context menu, say by right-clicking • choose the REPL submenu • choose "Send '<code>' to REPL" (here, alt-shift-p shortcuts the process) ?

sogaiu23:10:04

in the case i was testing, there were two menu items that were labeled the same, but it appears the second one is labeled 'Send form before caret to REPL' under other circumstances -- not sure how the two differ.

sogaiu23:10:57

may be the first one detects the top-level form corresponding to where the cursor / caret is -- except if that top-level form happens to be (comment ...), in which case it looks lower, skipping other containing comment forms...or something like that 🙂

sogaiu23:10:12

from testing it appears to look upwards starting from where one's caret / cursor is

nmkip23:10:22

Hi sogaiu 😄

nmkip23:10:22

I want to evaluate a form in the editor and to get the answer also there

(+ 1 1)
;; 2

nmkip23:10:40

in a comment

sogaiu23:10:44

ah, i don't know how to do that ordinarily, but i do see something similar while using the debugger.