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

Issues with evaling a new ns form in clojurescript #54

Closed
djblue opened this issue Aug 4, 2019 · 4 comments
Closed

Issues with evaling a new ns form in clojurescript #54

djblue opened this issue Aug 4, 2019 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@djblue
Copy link

djblue commented Aug 4, 2019

Hello, I am super excited about conjure. It looks like a pretty sweet plugin for integrating prepl (especially clojurescript) into neovim. Everything seems to be working like a charm except for this weird edge case I ran into.

The issue happens when I try to eval a ns form in clojurescript that hasn't been eval'd before. I found eval-str and noticed that conjure unconditionally wraps all code in a do form.

This probably works in almost all use cases except the one I mentioned above. The clojurescript compiler seems to be emitting different code if ns is wrapped in a do form. This causes issues resolving the ns dependencies unlinke if it were a top level form.

I would be open to providing a PR but wanted to bring up the issue for discussion first, thanks.

@Olical
Copy link
Owner

Olical commented Aug 4, 2019

Thank you for opening an issue first! I'm off to sleep now but I'll think on this a little and get back to you with my thoughts ASAP. Maybe we can avoid the do without breaking anything else 🤔

@Olical Olical self-assigned this Aug 5, 2019
@Olical Olical added the bug Something isn't working label Aug 5, 2019
@Olical Olical added this to the v1.0.0 milestone Aug 5, 2019
Olical added a commit that referenced this issue Aug 5, 2019
@Olical
Copy link
Owner

Olical commented Aug 5, 2019

Check out the develop branch, I've pushed a commit that'll only wrap ClojureScript evals if it thinks there's more than one form or it can't work out how many there are. So if you send a single form it'll remove the (do ...) wrapped. Maybe that'll fix it? If not, it'll be the in-ns switching.

@djblue
Copy link
Author

djblue commented Aug 5, 2019

@Olical That seems to fix my issue. Thanks for the quick fix!

@Olical
Copy link
Owner

Olical commented Aug 5, 2019

:shipit: 🎉

Also worth noting that CLJS exceptions will be ugly data that just gets returned as a result to you until someone merges and releases my prepl patch: https://clojure.atlassian.net/browse/CLJS-3096

As soon as that's in you'll get nicely formatted errors, just like Clojure.

@Olical Olical closed this as completed Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants