-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Error when completing (System/getProperty ..) #24
Comments
When connecting with lein I get the following error. Probably related? lein repl :connect localhost:23456
Connecting to nREPL at localhost:23456
REPL-y 0.5.1, nREPL
Clojure 1.10.3
: Could not resolve symbol: java.lang.System/getProperty user
nil
Error loading namespace; falling back to user
nil |
(require '[sci.addons :as addons])
(def opts (-> {:namespaces {'foo.bar {'x 1}}} addons/future))
(def sci-ctx (sci/init opts))
(require '[sci.impl.interop :as interop])
(interop/resolve-class sci-ctx 'System)
nil
(interop/resolve-class sci-ctx 'Object)
java.lang.Object I came this far. I when I chek the sci context I see some raw classes. Maybe the fix involves fixing |
@benjamin-asdf The issue is not about |
@borkdude my current thinking is that impl/server.clj should check if the prefix is a static class (e.g. "System/") and then return the static members of the class. I guess I can check how cider-nrepl is completing interop. |
Yes, something like that. I think the nbb completions might be doing this better, maybe it's also worth checking there. |
master...benjamin-asdf:master this is my first version edit: it only accidentally works rn. I'm going to fix it |
Getting inspired by the nbb code indeed helped. for
else calling resolve inside sci/eval-string does not resolve |
@benjamin-asdf babashka.nrepl is more general than babashka only, it is an nREPL suited for babashka-like projects. Maybe the name should be changed to |
@borkdude yes you are right. In a running ns-found? (sci/eval-string* ctx (format "(find-ns '%s)" query-ns)) Added 2 functions
|
I'm thinking about the code and I wonder if from-current-ns (fully-qualified-syms ctx (sci/eval-string* ctx "(ns-name *ns*)"))
from-current-ns (map (fn [sym]
[(namespace sym) (name sym) :unqualified])
from-current-ns) this should somehow end up returning those class names. |
The text was updated successfully, but these errors were encountered: