Fork me on GitHub
#conjure
<
2020-10-11
>
fjolne07:10:05

hey! just started out playing with Conjure & nvim, quite refreshing after years on Cursive, thank you for your work! the one thing I couldn’t yet figure out is how to go to symbol definition for library functions, ‘gd’ just highlights all the usages in the current buffer: should i install some Cider middleware...?

dharrigan07:10:42

Have you 'eval'ed your buffer/file?

dharrigan07:10:48

For me, I have to use <localleader>gd to go to definition

fjolne07:10:13

ah, thanks, it works with localleader!

Olical07:10:51

Thanks for the catch, David! Beat me to it. I moved it off of gd because there were some nuanced cases where people wanted the original which can be very powerful. I felt bad for overriding core vim powers and thought this was a small price to pay.

fjolne08:10:35

having different commands for usages and definition is great actually, just couldn’t find it in the docs btw, is there a way to find all symbol usages across the loaded namespaces/source dir?

Olical08:10:26

Not yet, no, a separate refactor plugin or something that did that could be good. Not sure if CIDER has support for it? I don't recall it being a feature. If it does then it's case of integrating it.

dharrigan08:10:45

It's still listed as gd in the docs

Olical08:10:11

Ah good catch! There's two places it's mentioned in the docs and I only fixed one, I've fixed the other on develop now.

dharrigan08:10:54

needs localleader 🙂

fjolne08:10:37

@olical Cider supports it via clj-refactor.el [1], which uses refactor-nrepl middleware [2] [1] https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-find-usages [2] https://github.com/clojure-emacs/refactor-nrepl @matthew.newland thanks! just tested it, and unfortunately it gives a lot of false positives (like when the var with the same name defined in different namespaces) and even searches in strings (now that's weird); i see that it's based on regexes, so that's the limit, but definitely better than nothing 🙂

Olical08:10:02

Thanks for having a dig! Added to my todo list (it's fairly long at this point 😬 )

fjolne08:10:11

@olical i’d be happy to help, would be grateful for any pointers on where to start with nvim api & conjure (like for a total vim noob)

Olical08:10:03

I'm not totally sure myself yet, but when I start looking into it I'll shout in the chat 🙂

👍 3
sogaiu08:10:06

@fjolne.yngling if you don't mind generating a tags file that admittedly takes time, there is this option: https://github.com/sogaiu/alc.index-defs it uses clj-kondo for analysis and should work in one's dependencies

sogaiu08:10:23

there is no incremental updating though

fjolne08:10:52

@sogaiu thanks, looks cool!

sogaiu08:10:09

🙂 fwiw, if you use clj-kondo's hooks api, you may want the version in this branch: https://github.com/sogaiu/alc.index-defs/tree/update-clj-kondo

👍 3
Olical09:10:44

Fixed an issue on develop that was preventing you from setting filetypes for clients before Conjure loaded. Now you can set g:conjure#filetype_client = {...} before Conjure loads and it'll augment it rather than overwriting it.