Fork me on GitHub
#conjure
<
2020-07-23
>
dharrigan12:07:09

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

Olical12:07:05

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 😅

dharrigan13:07:58

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

Olical13:07:07

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:

dave13:07:10

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

dave13:07:45

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

Olical13:07:57

:thinking_face:

Olical13:07:33

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.

Olical13:07:46

Consider this TODOed

Olical13:07:31

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.

Olical13:07:06

And likewise, open Clojure file, :Clj, eval

dave13:07:48

i like that idea!

dave13:07:00

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

dave13:07:06

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

Olical13:07:06

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.

dharrigan13:07:22

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

dharrigan13:07:38

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

dharrigan13:07:49

(if connection is not already established)

Olical13:07:00

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

Olical13:07:01

Yep, exactly

Olical13:07:48

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

uwo19:07:36

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

Olical19:07:30

Ohhhh this could totally be forked and adapted to Conjure!

👍 3
Olical19:07:42

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

uwo21:07:59

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

Olical08:07:05

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

Olical08:07:20

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

Olical08:07:47

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

uwo13:07:39

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

uwo16:07:11

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

Olical11:07:12

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

Olical11:07:23

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!

Olical12:07:43

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.

uwo14:07:43

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

Olical14:07:23

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.

Olical14:07:41

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