afucher / clojure-repl-intellij

Free OpenSource IntelliJ plugin for Clojure REPL development.
MIT License
52 stars 5 forks source link

Support clojure.core/tap> #79

Open devurandom opened 1 month ago

devurandom commented 1 month ago

Describe the bug

It would be nice if values captures using clojure.core/tap> would be shown somewhere in the IDE (ideally next to the code that emitted it), both when evaluating something on the REPL and also when running tests.


Right now I cannot even evaluate (tap> {:test 1}):

;; Connected to nREPL server - nrepl://localhost:7888
;; Clojure REPL Intellij 1.3.1
;; Clojure 1.11.3, Java 11.0.22, nREPL 1.1.1

user> {:test 1})

             java.lang.RuntimeException: Unmatched delimiter: )
clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Unmatched delimiter: )
             clojure.lang.ExceptionInfo:

user> 

             java.lang.RuntimeException: Unmatched delimiter: )
clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Unmatched delimiter: )
             clojure.lang.ExceptionInfo:

;; => {:test 1}
user> {:test 1})

             java.lang.RuntimeException: Unmatched delimiter: )
clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Unmatched delimiter: )
             clojure.lang.ExceptionInfo:

user> 

             java.lang.RuntimeException: Unmatched delimiter: )
clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Unmatched delimiter: )
             clojure.lang.ExceptionInfo:

;; => {:test 1}
user> {:test 1})

             java.lang.RuntimeException: Unmatched delimiter: )
clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Unmatched delimiter: )
             clojure.lang.ExceptionInfo:

user> 

             java.lang.RuntimeException: Unmatched delimiter: )
clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Unmatched delimiter: )
             clojure.lang.ExceptionInfo:

;; => {:test 1}
user> 

Each time I entered (tap> {:test 1}), but the Clojure REPL plugin seems to only pass {:test 1}) to the REPL.

isaiasvallejos commented 1 month ago

@devurandom I understand that the suggestion isn't equal to that, but for the sake of knowledge, I use the Portal plugin for IntelliJ. It works well with tap> and achieves a similar effect to what you suggested (print all tap> in a tab and you can interact with the data in a visual matter).

Maybe can be used as a inspiration also.