Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected token ( in JSON at position 0. Stopping the debug adapter. #129

Open
johnjelinek opened this issue May 14, 2017 · 3 comments
Open
Labels

Comments

@johnjelinek
Copy link

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

  1. Write some code like this:
(cubed 2)

(cubed 64)
  1. Highlight all of that code
  2. Execute the highlighted code: CTRL+ALT+E
  3. Unexpected token ( in JSON at position 0. Stopping the debug adapter.
@johnjelinek
Copy link
Author

In contrast, code like this:

(cubed 2)
(cubed 64)

works fine.

@johnjelinek
Copy link
Author

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)

@indiejames
Copy link
Owner

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.

@indiejames indiejames added the bug label May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants