This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-15
Channels
- # adventofcode (121)
- # bangalore-clj (5)
- # beginners (46)
- # boot-dev (9)
- # cider (20)
- # cljs-dev (7)
- # cljsrn (1)
- # clojure (341)
- # clojure-austin (7)
- # clojure-greece (144)
- # clojure-india (3)
- # clojure-italy (5)
- # clojure-spain (1)
- # clojure-spec (34)
- # clojure-sweden (3)
- # clojure-uk (90)
- # clojurescript (24)
- # core-async (1)
- # core-logic (7)
- # cursive (108)
- # datascript (2)
- # datomic (39)
- # events (1)
- # fulcro (225)
- # graphql (8)
- # hoplon (86)
- # instaparse (12)
- # jobs-discuss (2)
- # jvm (4)
- # keechma (1)
- # lein-figwheel (2)
- # leiningen (12)
- # off-topic (26)
- # onyx (35)
- # other-languages (1)
- # pedestal (3)
- # planck (11)
- # re-frame (12)
- # reagent (12)
- # reitit (5)
- # spacemacs (48)
- # specter (29)
- # sql (2)
- # test-check (1)
- # unrepl (71)
Hmm. Unfortunately you probably can’t. The issue is that the generated code has no line/col information in it, so you can’t associate the expansion with anywhere in the source code.
You can look at the expansion using the Cursive macroexpander, but that won’t help you with the exact location of the error within the expansion.
Getting this invokeNoArgInstanceMember
at the top of the stack trace so I'm guessing it isn't generating a method for a call that someone else is expecting. The stacktrace just points to line 126 though.
Can't navigate to the source on the line selected because there is no source. Though, it may be useful to look at.
Here's the textual version:
NullPointerException clojure.lang.Reflector.invokeNoArgInstanceMember (Reflector.java:301)
clojure.core/eval core.clj: 3206
...
dev.user/eval48615 REPL Input
compute.memcached.session-store/memcached-store session_store.clj: 16
compute.memcached.core/binary-connection core.clj: 32
clojurewerkz.spyglass.client/bin-connection client.clj: 95
net.spy.memcached.MemcachedClient.<init> MemcachedClient.java: 209
net.spy.memcached.DefaultConnectionFactory.createConnection DefaultConnectionFactory.java: 209
net.spy.memcached.MemcachedConnection.<init> MemcachedConnection.java: 282
net.spy.memcached.MemcachedConnection.createConnections MemcachedConnection.java: 345
AbstractLogger.java: 161
AbstractLogger.java: 150
net.spy.memcached.compat.log.Log4JLogger.log Log4JLogger.java: 99
org.apache.log4j.Category.log Category.java: 297
org.apache.log4j.Category.differentiatedLog Category.java: 193
com.github.fzakaria.slf4j.timbre.TimbreLoggerAdapter.log
...
slf4j-timbre.adapter/fn adapter.clj: 126
...
java.lang.NullPointerException:
At a guess, looking at invokeNoArgInstanceMember, I’d say the target is null because it calls target.getClass().
No idea who's passing that in though. I can actually walk the calls to get to that null
though. I forget the method someone was trying to call on it but it's probably useful.
That will stop you in invokeNoArgInstanceMember, and you can see what is null, and hopefully based on the other params you might get an idea.
How do I open breakpoints? I usually just ctrl+shift+n for the file I want and add one in.
I suspect it’s getting confused. What you’re looking at there is the decompilation of a gen-class’ed class. It’s possible that the generated bytecode doesn’t have accurate line information.
Right. Seems handy to be able to step inside though. I don't know the technical limitation there though.
The issue is that I suspect the bytecode generated for that method has no line number information.
Without that, the debugger can’t map back from the bytecode it’s currently executing to the source.
Makes sense. It does seem like because this class is statically generated, there could be more help there. That also probably means more work for a niche use-case.
Could probably create some hackery to generate the class and then include that class in the JAR.
You could save the generated class as a .java file, compile that and then put the .class at the front of the classpath so your version is loaded over the gen-classed one.
Totally. Fortunately this generated method is small and that's more work than just figuring out the values on my own.
I’m not sure why that method has no debug info though. It seems like it should point to inside the syntax-quoted block of define-log-method
No, it would just confirm that there are none. You probably need bronsa or someone over in #clojure-dev to help with the why.
That’s way outside my knowledge of how multiple levels of macroexpansion interact with the compiler’s line number generation.
Emacs actually allows you to edit the sources of libs and load them, which I would like to support.
Oh really? That seems quite useful. I'd imagine it by simply allowing edits in a library source (the yellow tabs). The tricky part would be making sure that edit is temporary.
For example, I want to go into that adapter.clj file, edit a line, and see if that fixes my issue. To do that right now I have to clone the project, edit the line, bump the version number, install the jar, restart the REPL, then test.
Back to the debugger.. Is there a way to save a var from one view and use it in another view?
Hi, I'm trying Cursive right now and I wonder if there is integration for Vagrant. My dev setup usually involves a Vagrant vm which contains the jdk, leiningen, database, ... I was able to set up PyCharm and PHPStorm in a way that they used the Vagrant vm for executing code, running the debugger, doing package managing, which was very nice. Is this doable with Cursive as well?
a question on debugging clojure clode in cursive. I would like to do a "step into" or "step over" per form and see them execute and highlight like they do in the following gif from cider: https://i.stack.imgur.com/wHaYC.gif maybe I just haven't figured cursive out, but it seems to me you can only debug on a 'per line' basis there which is not necessarily what you want in clojure. Is this true or am I just missing something?
and while I'm here : ) is there a way to create a global execution configuration for "lein repl". I find that I do a lot of small projects and every single time I go and create a new execution configuration with the exact same choices checked
@mbjarland found this about global run configurations: https://stackoverflow.com/questions/24642147/how-do-i-share-intellij-run-debug-configurations-between-projects
yeah I'm aware of that checkbox, it's just that it doesn't seem to do what I would want it to do
i.e. I check it in one project, open a new one and the configurations are still blank
not sure which is less painful, opening the dialog every time or switching to a terminal to locate and copy a file from some old project
Yeah, IntelliJ didn’t go out of their way to make that easy
found this on the Intellij discussions site : "If you enable Share checkbox in the run configuration panel it would be saved to .idea/runConfiguraions folder."
Added a request to an old Cursive-IDE issue #401 >>>I think this related, so commenting here rather than adding a new issue. Under Structural Editing, there are "Move Forward" and "Move Backward" actions, I'm requesting "Move Forward with Selection" and "Move Backward with Selection" be added as assignable actions. I currently have <option>-<right-arrow> assigned to the "Move Forward" action and I'd like a SHIFT variant <shift>-<option>-<right-arrow> to make the same movement while also extending the selection.
I’m having trouble searching https://github.com/cursive-ide/cursive/issues for what I’m looking for so Q: is Cursive interested in docstring or metadata support for referring to other namespaces or functions that are not directly require
d? Say, for CLJ/CLJS dependencies not formalizable as CLJC.