sanel / monroe

Clojure nREPL client for Emacs
161 stars 21 forks source link

Fix #29 - Report error when jump to definition doesn't find var #35

Open bbuccianti opened 3 years ago

bbuccianti commented 3 years ago

I know it's not the most elegant solution, but it's working.

Let me know if some changes are needed.

Thanks!

bbuccianti commented 3 years ago

With the last force-push I've added the lexical-binding: t as a file variable in order to use a closure in monroe-eval-jump. This work as a medium to have the var and ns we are looking for inside the callback.

Please let me know if changes are needed.

Thanks!

bbuccianti commented 3 years ago

I've added the closure for have ns on the calback, but never used it! My mistake. Now I think it's okay.

sanel commented 3 years ago

Thank you for this! Can you just please show me example of what it tries to address?

bbuccianti commented 3 years ago

Sure!

On this issue #29 , you've added a sample implementation for a way to being able to jump to function definitions. I've just taked that, and make it work with current state of the project (monroe).

Personally, I've never used that feature, but a few tests showed that it's working properly. You just need to make a function and from a invocation you can try monroe-jump and you're there. In the case the function doesn't exist, the nrepl server return a exception and that's when we know that we can't jump to that function (I think). So it shows you with a message which function was looking for and in which namespace.

Let me know if this helps!

Thanks