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-07-23T09:20:43.490500Z

2020-07-23T09:20:54.490600Z

dharrigan 2020-07-23T12:53:09.491200Z

I remapped ConjureConnect to ,cu...old skool 🙂

Olical 2020-07-23T12:57:05.492500Z

Haha, the old ConjureUp command 😄 I did kinda like that "describe what you want, I'll sync it" thing but it did mean learning a whole new concept. It didn't sit right with me since you had to learn this whole conjure.edn thing then everyone ended up using the exact same "just load my .nrepl-port file" config anyway 😅

dharrigan 2020-07-23T13:11:58.492900Z

sometimes I quit out of the repl, then come in, and I want vim to reattach to the running session

Olical 2020-07-23T13:14:07.493Z

You mean automatically as the repl comes up? Because I guess you could have a little set interval checking for that sort of thing :thinking_face:

dave 2020-07-23T13:24:10.493200Z

If you're suggesting what I think you're suggesting, that's been on my wish list for a long time too

dave 2020-07-23T13:24:45.493400Z

like ideally, i shouldn't have to press ,cf to reconnect every time i restart my nrepl server

Olical 2020-07-23T13:26:57.493600Z

:thinking_face:

Olical 2020-07-23T13:27:33.493800Z

Simpler: On any operation that requires a connection (I already have this path running through a single check function), if there is no conn, attempt to connect to a port-file in the background passively before proceeding.

Olical 2020-07-23T13:27:46.494Z

Consider this TODOed

Olical 2020-07-23T13:29:31.494200Z

Also could tie in well with https://github.com/clojure-vim/vim-jack-in/issues/5 which I'm thinking about doing. So you could open foo.clj, run :Bb (or whatever) then just eval.

Olical 2020-07-23T13:32:06.494500Z

And likewise, open Clojure file, :Clj, eval

dave 2020-07-23T13:36:48.496Z

i like that idea!

dave 2020-07-23T13:37:00.496400Z

i think that would take ,cf out of the equation entirely

dave 2020-07-23T13:37:06.496700Z

although it might still be nice to have it around in case it's needed

Olical 2020-07-23T13:37:48.497700Z

I work in a machine over SSH that's on another continent day to day to pair with my team, this means I hit weird edge cases with Conjure I'd never normally find locally. There's one in particular where the HUD seems to get out of sync then all eval results won't show unless I have the log open (to remove the need for the HUD). Not sure if anyone else has seen this weird state / race condition bug, but just a heads up that I have it on my radar to squash. Very soon. I'll make the HUD state auto heal, so if you somehow kill the window without Conjure knowing (thus putting it's state out of sync) it'll just deal with it instead of going "aaaaa can't close window X, it's gone already".

Olical 2020-07-23T13:40:06.497800Z

Yeah, I'd still keep it just in case, but it'd be useful. Probably on by default but flagged behind yet another option just in case someone doesn't like it. Some people prefer every action to be intentful+specific, and I want to support that behaviour. I just think this as the default is safe and useful.

dharrigan 2020-07-23T13:44:22.498100Z

Yeah, something that is automatic, but not too heavy on constant polling would be super dooopar awesome

dharrigan 2020-07-23T13:44:38.498300Z

try to restablish a connection on the first attempt to do anything with the nrepl

dharrigan 2020-07-23T13:44:49.498500Z

(if connection is not already established)

Olical 2020-07-23T13:45:00.498700Z

Zero polling 😄 I hadn't thought about it when I suggested that.

Olical 2020-07-23T13:45:01.498900Z

Yep, exactly

2020-07-23T19:54:36.499800Z

With fireplace I use https://github.com/guns/vim-clojure-highlight; does anyone use something similar with Conjure?

Olical 2020-07-23T19:58:30.000100Z

Ohhhh this could totally be forked and adapted to Conjure!

3👍
Olical 2020-07-23T19:59:42.000300Z

Or even a whole new plugin so it could have CLJS support (which isn't in the original)

2020-07-23T21:01:59.003Z

Any suggestions on troubleshooting omni-complete slowness? It takes a couple of seconds to pop up. (I'm not working with deoplete, yet)

Olical 2020-07-24T08:51:05.003200Z

Hmm that's really odd... and all other evals seem okay? Like go to def and that sort of thing?

Olical 2020-07-24T08:51:20.003400Z

It's just omnicomplete that's slow? And I guess not just the first invocation but more after that too?

Olical 2020-07-24T08:51:47.003600Z

(conjure really doesn't do much here other than pass things through, so we're relying on CIDER really, and that's pretty battle tested)

2020-07-24T13:03:39.014300Z

Yes, not just after the first invocation. I thought I had noticed some eval slowness, but nothing like the omni complete. I do have some projects with very large namespaces. You're right though, I'll investigate CIDER issues and my setup there. 🙏

2020-07-25T16:27:11.029200Z

I compared omni-compete by eye -- no real measurement, so take this with a grain of salt -- on the same project in our largest namespace once using fireplace and once using conjure. It took 2-3 seconds to run omni-complete with vim-fireplace and 4-5 with conjure. I don't know if this additional context matters, but I was autocompleting after typing the namespace fragment + "/", which I mention only to note that I wasn't trying it after 2 characters. All of this to say, we're certainly at fault for having huge, unwieldy namespaces, and wrap-complete is definitely getting forced to do a lot of heavy lifting. Though fireplace may be processing those results more readily. I don't expect this to be any kind of priority, of course, just thought I'd share my informal observation

Olical 2020-07-26T11:39:12.031Z

:thinking_face: thank you for the information! I guess if there's LOTS of results I could be doing something inefficient while processing the results, I could definitely try to optimise that. Are there lots of results as far as you can tell? Like, thousands? LuaJIT is pretty damn fast (understatement) and all I'll be doing is mapping some strings into some tables, something that's pretty simple.

Olical 2020-07-26T11:44:23.031200Z

I suppose there could be some things in here I could make faster (looking at the source). But not by much, I'm wondering if I'm doing more work up front to extract the context, I guess Fireplace does the same? (like it sends the context code so you get (let [...] ...) completions? That's unlikely to be the culprit, but let g:conjure#debug = v:true might highlight it. It'll show how quickly the completion request is sent after you request completions at least. And how many results you're getting!

Olical 2020-07-26T12:08:43.031500Z

I've pushed some slight optimisations to develop for this, you may notice a difference! I've never had enough completions to cause a slow down really, so I should probably try to reproduce this and work at making that faster.

2020-07-26T14:30:43.035500Z

Oh, wow. Thanks a bunch! I'll take a look at this as soon as I can!

Olical 2020-07-26T14:39:23.035700Z

I'm semi-concerned it'll make 0 difference, but I replaced a bunch of higher level function calls with much simpler direct calls out to Lua builtins.

Olical 2020-07-26T14:39:41.035900Z

So maybe it was my fn overhead in a tight loop that was causing it to be O(n^2) slow or something like that