Skip to content

Conversation

fasfsfgs
Copy link
Contributor

@fasfsfgs fasfsfgs commented Jun 8, 2017

Instead of using the PROBLEMS Panel, we use now the OUTPUT Panel to show errors raised during eval. It shows the error message with the stacktrace as well.

This closes #28 and closes #4.

@avli
Copy link
Owner

avli commented Jun 8, 2017

Thank you for the pull request, @fasfsfgs

While playing with your code I spotted a bug with the output. Here are the steps to reproduce:

  1. Connect to nREPL.
  2. Open an empty Clojure module.
  3. Add the following code: (foo 1 2 3) (suppose the foo function is undefined).
  4. Run the Eval and show the result command.

The result is something unexpected:

screen shot 2017-06-08 at 22 21 47

Could you fix this before I merge your changes?

@avli avli closed this Jun 8, 2017
@fasfsfgs
Copy link
Contributor Author

fasfsfgs commented Jun 8, 2017

My testing skills sucks. =(

Can you specify better what do you mean by:

  1. Open an empty Clojure module.

I was unable to reproduce. I open an empty file and it shows the following on my console:

clojure.lang.Compiler$CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo in this context
 at Untitled-1:1:0
    clojure.lang.Compiler.analyze (Compiler.java:6688)
    clojure.lang.Compiler.analyze (Compiler.java:6625)
    clojure.lang.Compiler$InvokeExpr.parse (Compiler.java:3766)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6870)
    clojure.lang.Compiler.analyze (Compiler.java:6669)
    clojure.lang.Compiler.analyze (Compiler.java:6625)
    clojure.lang.Compiler$BodyExpr$Parser.parse (Compiler.java:6001)
    clojure.lang.Compiler$FnMethod.parse (Compiler.java:5380)
    clojure.lang.Compiler$FnExpr.parse (Compiler.java:3972)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6866)
    clojure.lang.Compiler.analyze (Compiler.java:6669)
    clojure.lang.Compiler.eval (Compiler.java:6924)
    clojure.lang.Compiler.load (Compiler.java:7379)
    clojure.lang.Compiler.eval (Compiler.java:6927)
    clojure.lang.Compiler.eval (Compiler.java:6890)
    clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__648.invoke (interruptible_eval.clj:87)
    clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invokeStatic (interruptible_eval.clj:85)
    clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke (interruptible_eval.clj:55)
    clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__693$fn__696.invoke (interruptible_eval.clj:222)
    clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__688.invoke (interruptible_eval.clj:190)

@avli
Copy link
Owner

avli commented Jun 12, 2017

Sorry, I wasn't clear enough. Just open a file and save it with the .clj suffix and add the code snippet I suggested above – that's what I mean.

@fasfsfgs
Copy link
Contributor Author

@avli I was unable to reproduce this bug with the correct configuration.

But I found out it happens when you don't have cider-repl dependency in your profiles.clj.

Do you have this configuration set when trying out this PR? Maybe you deleted that to work on your embedded-nrepl branch. Can you verify that please?

@avli
Copy link
Owner

avli commented Jun 13, 2017

You're right, I don't have cider-nrepl in my dependencies. I'm wondering if we should notify a user explicitly about missing dependencies?

@fasfsfgs
Copy link
Contributor Author

Yup. I thought about that as well. Can we make this another issue or do you want me to try to add this behavior here?

@avli
Copy link
Owner

avli commented Jun 13, 2017

Sure thing, let's do it this way!

@fasfsfgs
Copy link
Contributor Author

Which way? =p

  1. merge this pr and create another issue to handle unmet dependencies
  2. handle unmet dependencies in this pr

I'm more in favor of 1. since we can do a more broad work on it in the other issue and we are working to get hid of those deps anyway.
But if you like 2., we can discuss more here what should happen when someone tries to connect to the repl without the dependencies.

@avli
Copy link
Owner

avli commented Jun 13, 2017

I agree with you – let's stick with the first option. If you don't want to do any changes in this pull request I'll check it once again and merge it.

@fasfsfgs
Copy link
Contributor Author

Alright I have nothing to add to this PR then.

Please merge it (and publish if you feel comfortable) to close #4 and #28.

I reported #31 to handle undeclared dependencies and I'll work on it next.

@avli avli merged commit 00aa3c7 into avli:master Jun 15, 2017
@fasfsfgs fasfsfgs deleted the show-errors branch June 15, 2017 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation errors in "Output" panel instead of "Problems" panel Show Detailed Compilation Errors
2 participants