cursive

shaunlebron 2025-05-29T23:10:34.901549Z

Is it possible to get cursive to recognize <> as a special symbol in swiss.arrows threading macros? https://github.com/rplevy/swiss-arrows

misha 2025-09-19T16:42:09.205839Z

@shaunlebron use https://github.com/akovantsev/archery _> _>> and _ instead :) trick there is to refer that _ placeholder:

(ns com.akovantsev.archery
...

(def _ (symbol "_"))
(ns foo.bar
 (:refer-clojure :exclude [-> ->> some-> some->>])
 (:require
  [com.akovantsev.archery :refer [some_>> _>> _] :rename {_>> ->, some_>> some->}]

                                              ^

misha 2025-09-19T16:58:04.525889Z

(ns swiss.arrows)
...
   (cond (> c 1) (throw (Exception. "No more than one position per form is allowed."))
unusable :D

shaunlebron 2025-05-30T19:07:39.422459Z

thanks, unfortunately indentation isn’t the problem and its behavior is distinct from clojure’s normal arrow functions. <> controls where the argument is inserted

Bob B 2025-05-30T19:59:35.973929Z

ahhh, so it's sort of an anaphoric as->, right? In that case, based on the docs, it seems like the best solution currently offered is to resolve -<> as 'none', which purports to basically turn off complaints about unresolved symbols in the scope of the macro

shaunlebron 2025-05-30T20:06:08.106759Z

oh yes as-> is a better comparison, and you can omit the special symbol (the anaphor? had to look that up, nice)

Rachel Westmacott 2025-06-12T10:47:38.196909Z

another option would be to (declare <>) somewhere, so that cursive recognizes the symbol - I've seen a similar thing in tests with clojure.test where people declare 'thrown?' and 'thrown-with-msg?' to keep the syntax highlighter happy. That does mean changing the source to satisfy the tooling though, so that might be too distasteful for you.

Bob B 2025-05-30T01:36:32.612809Z

I think it should be possible to right-click or alt+enter on the symbol and get "resolve -<> as ...", and then tell cursive to treat it like an arrow (for purposes of indenting)

Bob B 2025-05-30T01:38:11.346519Z

<https://cursive-ide.com/userguide/macros.html#customising-symbol-resolution> has more context/description if it helps

🙏 1