vscode-clojure-debug
vscode-clojure-debug copied to clipboard
Unexpected token ( in JSON at position 0. Stopping the debug adapter.
Environment
- VSCode Version: 1.12.1
- OS Version: Windows 7 Ultimate
- Clojure Extension Version: 1.0.2
Description
If I highlight some code that is separated by a couple newlines, the repl attachment breaks with the error: Unexpected token ( in JSON at position 0. Stopping the debug adapter.
Steps to Reproduce
- Write some code like this:
(cubed 2)
(cubed 64)
- Highlight all of that code
- Execute the highlighted code:
CTRL+ALT+E Unexpected token ( in JSON at position 0. Stopping the debug adapter.
In contrast, code like this:
(cubed 2)
(cubed 64)
works fine.
Hrmm .. I tried to be tricky by prefixing newlines with a ;
(defn- cubed [x]
(* x x x))
;
(cubed 2)
but when I execute, it results in this:
continuum-demo.core=>(defn- cubed [x]
(* x x x))
;
(cubed 2)#'continuum-demo.core/cubed
(which means only the first s-expression gets evaluated)
I have not been able to reproduce the "Unexpected token" error, but I'm sure it's related to the way I am outputting the response from evaluations. I need to make that more robust; it should never break the debug adapter.
Regarding your second attempt with the commented line I can confirm this behavior. I will look into this to try to figure out why this is happening.