djblue / portal

A clojure tool to navigate through your data.
https://djblue.github.io/portal/
MIT License
869 stars 81 forks source link

nREPL #179

Open blindcoding9 opened 1 year ago

blindcoding9 commented 1 year ago

I'm trying to run the REPL middleware but I'm not able to.

Shouldn't I see the result of (range 10) in Portal?

project.clj

(defproject clean "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
            :url "https://www.eclipse.org/legal/epl-2.0/"}
  :dependencies [[org.clojure/clojure "1.11.1"]
                 [djblue/portal "0.40.0"]
                 [ch.qos.logback/logback-classic "1.4.5"]]
  :repl-options {:nrepl-middleware [portal.nrepl/wrap-portal]})

core.ns

(ns clean.core
  (:require [portal.api :as p]
            [portal.api :as p]))

(p/open)

(add-tap portal.api/submit)

(tap> 123)
(range 10)

portal

image

djblue commented 1 year ago

Since editor tooling will also use eval and it causes a lot of noise being sent to portal. The nREPL middleware checks if a file is included for an eval to distinguish between tooling and user evals. This is my best guess as to why values aren't being sent to portal.