    [clojure.tools.nrepl.middleware.interruptible-eval :as nrepl-eval]
    [figwheel-sidecar.components.figwheel-server :as server]
    
-   [figwheel-sidecar.config :as config])
+   [figwheel-sidecar.config :as config]
+   [clojure.pprint :as pp])
   (:import [clojure.lang IExceptionInfo]))
 
 ;; slow but works


(defn warning-handler [form opts]
  (fn [warning-type env extra]
    (when (warning-type cljs.analyzer/*cljs-warnings*)
      (when-let [s (cljs.analyzer/error-message warning-type extra)]
        (let [warning-data {:line   (:line env)
                            :column (:column env)
                            :ns     (-> env :ns :name)
                            :file (if (= (-> env :ns :name) 'cljs.core)
                                    "cljs/core.cljs"
                                    ana/*cljs-file*)
                            :source-form   form
                            :message s
                            :extra   extra}
              parsed-warning (cljs-ex/parse-warning warning-data)]
          (debug-prn (with-color
                       (cljs-ex/format-warning warning-data))))))))

(defn catch-warnings-and-exceptions-eval-cljs
  ([repl-env env form]

        {:host host}
        {:host host :port (Integer/parseInt port)})
      {})))

(defn clean-stacktrace [stack-trace]
    (map #(update-in % [:file]
                   (fn [x]
                     (when (string? x)
                       (first (string/split x #"\?")))
                     ))
       stack-trace))

(defrecord FigwheelEnv [figwheel-server]
  cljs.repl/IJavaScriptEnv
