conjure

:neovim:+:clj: https://github.com/Olical/conjure - If you're enjoying Conjure and want to say thanks: https://github.com/users/Olical/sponsorship :smile: (alt https://conjure.fun/discord)
2020-10-11T01:15:09.102Z

fjolne 2020-10-11T07:29:05.107600Z

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...?

dharrigan 2020-10-11T07:37:42.108400Z

Have you 'eval'ed your buffer/file?

dharrigan 2020-10-11T07:43:48.109Z

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

dharrigan 2020-10-11T07:44:00.109300Z

i.e., ,gd

fjolne 2020-10-11T07:45:13.109900Z

ah, thanks, it works with localleader!

Olical 2020-10-11T07:49:51.111900Z

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.

fjolne 2020-10-11T08:01:35.115700Z

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?

Olical 2020-10-11T08:03:26.117400Z

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.

2020-10-11T08:05:45.117800Z

Take a look at https://github.com/pechorin/any-jump.vim

dharrigan 2020-10-11T08:08:45.118200Z

It's still listed as gd in the docs

dharrigan 2020-10-11T08:08:54.118700Z

needs localleader 🙂

fjolne 2020-10-11T08:24:37.122800Z

@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 🙂

2020-10-11T08:27:06.124400Z

@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

2020-10-11T08:27:23.124900Z

there is no incremental updating though

Olical 2020-10-11T08:34:11.126600Z

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.

fjolne 2020-10-11T08:35:52.127900Z

@sogaiu thanks, looks cool!

Olical 2020-10-11T08:37:02.128600Z

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

2020-10-11T08:37:09.128800Z

🙂 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

👍 1
fjolne 2020-10-11T08:47:11.131100Z

@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)

Olical 2020-10-11T08:48:03.131300Z

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

👍 1
Olical 2020-10-11T09:31:44.132500Z

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.