Fork me on GitHub
#conjure
<
2020-04-21
>
Olical14:04:59

Does anyone rely on omnifunc based completion and refuses to use an async completion plugin?

Olical14:04:33

Because I don't think I can get omnicompletion working with this single thread of Neovim, I need to be able to block and wait for a result from the nREPL but it just doesn't seem possible.

Olical14:04:59

Async completion tools will work great, omnicomplete requires sync code and I'm struggling to force async code to be sync within a single thread.

Olical14:04:24

Oh crap, I think I fixed it hah

Olical14:04:42

Hold up, just a little more hacking...

Olical14:04:30

Hahaha made it work

Olical14:04:44

:sleep ftw 😅

Nir Rubinstein14:04:27

Great! (because I only use omnicomplete 😉)

Olical14:04:30

Abbreviating namespace names in completion? Yay or nay? So you see the namespace each value resides in which is useful, but takes up a fair bit of space. You also see the full namespace path for namespaces you're completing.

Olical23:04:37

The question is, how many segments should be shortened (all but last?) and should it be on all namespace strings or just the contextual parts? Like, if you're autocompleting an actual namespace, maybe it's full, but if it's just "oh this function is from this ns" it gets shortened :thinking_face:

dave23:04:46

what about if the namespace is currently required with an alias, we use that alias?

dave23:04:57

i rarely see fully qualified namespace names

dave23:04:32

like if i'm using clojure.string/join and i have clojure.string required :as str, i'm going to start typing str/j

Olical23:04:16

Yeah, I know what you mean, pretty tricky to implement but will consider that sort of thing for the future. Same goes for auto requiring if you type a known prefix from other namespaces.

Olical14:04:51

So you might have my-fn F [x y] my.name.space.with.functions my.ns.that.begins.with.the.same N Should I shorten the one after the function completion? Should I also do the namespace in the list as a completion?

Olical14:04:09

By shorten, I mean to m.n.t.b.w.t.same or m.n.s.w.functions?

Olical14:04:27

Or leave everything exactly how it is, even it's it's L O N G sometimes?

Olical14:04:57

I think I'll leave them as is until it's a real problem since it brings up loads of questions around configuration and stuff.

Olical14:04:08

Completion clients can actually just remap these strings as they see fit anyway.

Olical14:04:40

Actually working though! I'm placing the arg lists next to the function names for now to make sure you can still see them even when a long name at the bottom is making things a bit too wide.

Olical14:04:03

(and it should work with cljs)

Olical16:04:17

Ayyyy working well! I've added context support for local lets and extended the omnifunc support to ANY Conjure client. So you just need to implement an async completions function then you get omnifunc for free. Next I'll implement async complete with deoplete and coc through the existing plugins that can hook into the async completions function provided by the clojure language client. If Racket gets added with completion support, all of the completion plugins will just work 😄

bananadance 8
Olical16:04:21

nREPL is getting a simple completion op built in (without CIDER) soon too, so this should work with that. And I haven't tried it but this should work with shadow-cljs too. Please let me know if you hit any issues! This is all on the develop branch.

nate16:04:45

oh man, this is getting so close

nate16:04:58

that async complete is the last thing before I try this as my daily