avli / clojureVSCode

Clojure support for Visual Studio Code
https://avli.github.io/clojureVSCode/
MIT License
204 stars 34 forks source link

Show at least eval error output instead undefined values #78

Closed dimapaloskin closed 6 years ago

dimapaloskin commented 7 years ago

Hello.

I'm newbie in clojure, but if I understand correctly, I need to setup cider-nrepl for my project. Looks like it's needed to support stracktrace op. Anyway, if error occurred and cider-nrepl is not configured I can see next output:

undefined undefined
  at undefined:6:0

This PR brings ability to print at least eval error, so it's a bit more informative :)

For me it's looks something like that if I trying to add a number with a string: image

What do you think about it?

avli commented 6 years ago

Hi @dimapaloskin

First of all, thank you for the PR!

I try to reproduce the issue you're describing but can't do it for some reason.

By default, the extension runs an internal nREPL process which installs all dependencies such as cider-nrepl automatically.

There is the option clojureVSCode.autoStartNRepl which been set to false disables the behavior described above. Do you use this option?


Interesting observation: code evaluation works fo me even when cider-nrepl isn't installed. Autocompletion and go to definition, however, don't. I don't remember whether it was possible to run code without cider-nrepl before...

dimapaloskin commented 6 years ago

Hello @avli Thank you for the answer :)

I try to reproduce the issue you're describing but can't do it for some reason

It's strange. What I do to reproduce this bug step by step:

1) Create new project by lein new showcase image 2) Navigate to showcase directory and run code . command 3) Then I run repl via lein repl 4) Connect to repl (Connect to a running nREPL) 5) Trying to evaluate some code image 6) Then I try to evaluate invalid code image

I saw clojure streams by @tonsky and looks like he's faced with the same problem.

In any case, this PR can be closed in case if plugin work isn't expected without installed cider-nrepl. Otherwise it brings ability to showing errors even nrepl wasn't installed (or, probably, we can change PR and write to output something like link to manual with setup instructions).

P.S. If my english isn't clear for you I can rewrite in russian :)

tonsky commented 6 years ago

I saw same error, yes. I might have had CIDER not installed as well, and I usually start my own nREPL server and then connect to it through menu

dimapaloskin commented 6 years ago

I saw same error, yes. I might have had CIDER not installed as well, and I usually start my own nREPL server and then connect to it through menu

That's exactly what I doing too.

Btw, Nikita. Thanks for the your streams :)

avli commented 6 years ago

Thank you for your input, guys.

@dimapaloskin I believe a more clear way to do what you've already done in the PR is to add code for checking if cider-nrepl is installed. In case it is not, the extension should show a warning.

dimapaloskin commented 6 years ago

@avli

If so, this PR should be closed, but in this case would be super cool if we (or you only) will create detailed manual how to add cider-nrepl to empty project.

I spent a lot of time to sort out the problem. Looks like manual will be useful for newbie guys like i am.

avli commented 6 years ago

@dimapaloskin

The section about manual configuring was added to README ;-)

By the way, it did exist before we added the embedded REPL functionality so you can check out the old documentation here. Be aware of the outdated dependency versions though.