cursive-ide / cursive

Cursive: The IDE for beautiful Clojure code
590 stars 7 forks source link

lazy-seq causes IntelliJ to hang while debugging. #1939

Open brianfeaster opened 6 years ago

brianfeaster commented 6 years ago

IntelliJ hangs when debugging code involving arguments containing lazy-sequences. You can trigger the hang with a breakpoint inside of fun (code below) then try and step with F7.

(ns bug.core)

(defn mystream
  ([]
   (mystream 0))

  ([x]
   (cons x
         (lazy-seq x
                   (mystream (inc x))))))

(defn fun
  [s]
  (prn (meta s))) ; SET BREAKPOINT HERE TO CAUSE INTELLIJ TO HANG AFTER STEPPING.

(defn -main [& args]
  (fun (mystream)))

IntelliJ IDEA 2017.3.4 (Community Edition) Build #IC-173.4548.28, built on January 29, 2018 JRE: 1.8.0_152-release-1024-b11 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Mac OS X 10.13.3

Cursive Version: 1.6.3-2017.3 Built on: 2018-02-08 15:05 Built from: 1.6.3-4-g6df20b8

brianfeaster commented 6 years ago

My temporary workaround currently is to assign the lazy-stream to a global and alter-var-root after every next on the sequence. IntelliJ doesn't seem to mind if the lazy-stream isn't on the stackframe.