Fork me on GitHub
#spacemacs
<
2017-03-20
>
asragab19:03:52

Hi all, more of a general question, so in an ide like Cursive (IntelliJ) you can browse source code of third-party dependencies fairly easy, the decompiler (I think) lets you look at the libraries you’ve imported, I have found this to be a fairly useful feature. Is there some tool in spacemacs or emacs generally that lets you examine project dependencies?

bja19:03:35

, g g works for me if my repl is connected (for clojure sources)

asragab19:03:24

You know, I thought I had tried that, and while that worked for clojure specifically, I was trying to use the apache storm library, and I was not able to do it. Let me give it another go.

asragab19:03:21

I wonder what needs to be defined for that to work?

jumar19:03:13

@asragab do you mean for Java source files?

asragab19:03:06

Yes, those and even other clojure libraries

bja19:03:45

for clojure sources, it should work as long as you're connected via nrepl and the sources are available locally (even inside a jar)

bja19:03:46

IIRC, storm's clojure parts don't always do require/use/loads inside of the ns macro (it provides some other convenience macro) and that might affect the jump to functionality

asragab19:03:34

I see…so it might be a storm specific thing. Good to know.

bja19:03:53

one quick way to test would be to do something like create a new project and include clj-time as a dependency

asragab19:03:59

Do you have evaluate the namespace before you can navigate to a source

asragab19:03:15

or does simply “jacking-in"

bja19:03:30

then write a wrapper for clj-time.core/now in your namespace, and then try to jump to your invocation of clj-time.core/now. It should jump you to clj-time.core

bja19:03:42

@asragab that should be enough (in my experience)

jumar19:03:57

I often need to eval buffer (`, e b`) before I can navigate to a symbol in another namespace/library

asragab19:03:57

@bja so I was able to navigate through the “yahoo-finance-api"

asragab19:03:07

apparently it is storm in specific

asragab19:03:36

does , h j do what I think it does and browses the javadoc if available?

bja19:03:22

@asragab in the past, I added storm to my dev profile as a checkout dependency (https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies) so that I could make SPC p f find the storm stuff, and then I select all of the java and clj files using a regex and load them. Then I can use SPC j i for jump inside the buffer and SPC j I for jump across the project

bja19:03:58

it'll take a bit of memory to load all of the files, but if you have the memory to spare, it makes life easy

asragab19:03:06

indeed thanks!

donyorm20:03:12

I created a pull request to add the sayid debugger to the clojure mode layer of spacemacs, to give more people access to that.