-
Notifications
You must be signed in to change notification settings - Fork 69
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
Upon connect, namespaces are reloaded in wrong order #126
Comments
Are you sure this is it? Lately I've noticed the In any event, this is |
Upon cider-connect namespaces are reloaded, as I can see reflection warnings being print again in console. I must manually reload namespace
I'm using boot, spacemacs 0.104.x with 0.10.0snapshot cider and 2.0.0-snapshot refector-nrepl. Does |
When the repl is started we eagerly build a cache of ASTs using It just occurred to me that |
How about running tools.analyzer in a separate classloader? You can use something like boot's pods for that https://github.com/boot-clj/boot/wiki/Pods |
we've been there and failed. see https://github.com/clojure-emacs/refactor-nrepl/tree/classloader-isolation for reference. we went to source inlining instead (to at least solve the dependency clash problems) which now cider-nrepl uses too does not mean we would not jubilate over a PR towards that direction ;) |
I ran into this and made a reproduction case at https://github.com/xeqi/nrepl-error. In it the user namespace is analyzed/loaded first by I believe this error could be prevented by analyzing the files in namespace dependency order. It looks like |
Yes. I've been meaning to fix this myself--I just haven't had the time. There's already a "tracker" ns here, although it doesn't do quite what you want. |
As a data point, I've run into what I believe is the same problem with Clara where rules (which refer to record types) sometimes fail to match any facts (expressed as records) even when they should. I haven't figured out the exact mechanism of action yet but I've confirmed that it only happens after connecting with refactor-nrepl loaded, and it stops happening after a |
when warming the AST cache - fixes error after global rename symbol when def(n) being renamed is referred - might give remedy for #126
@benedekfazekas with the latest snapshot I no longer experience this problem--thank you! |
no worries. if others in this issue experience the same this might be a close ;) |
I can confirm that namespaces are now reloaded in correct order. Note that classloader isolation would still be the best solution, as global vars like stuart sierra's components contain implementations of protocols that refactor-nrepl incidentally redefines. |
@wagjo thx. time to close this I guess.
noted. PR is still very welcome ;) |
When building AST, refactor-nrepl (re)loads namespaces, albeit in order that may cause defprotocols to be re-evaluated after deftypes using that protocols, that are defined in some other namespaces.
When that happens, calling protocol methods on those deftypes results in
No implementation of method
errors.The text was updated successfully, but these errors were encountered: