tpope / vim-fireplace

fireplace.vim: Clojure REPL support
https://www.vim.org/scripts/script.php?script_id=4978
1.74k stars 139 forks source link

Include port in transport #339

Closed SevereOverfl0w closed 5 years ago

SevereOverfl0w commented 5 years ago

I've been a little naughty in async-clj-omni and replant in that I have been using the port field in the transport to create an async side-connection.

This seems to reintroduce it in transport.vim (~line 152):

  let transport.port = port

I know async is coming (here?) but could this workaround be introduced until I have time to migrate?

tpope commented 5 years ago

Async is here, call fireplace#message({...}, callback) to use it.

I just pushed some local changes that introduce an easily parsable url attribute, good enough?

SevereOverfl0w commented 5 years ago

That should be great, thanks!

There's a few forms of async that I need, I'll have a noodle and I'll open new issues if I need more.

tpope commented 5 years ago

The API is still pending, but you can do session.clone(callback) to get a session with a callback for all messages. I'm struggling to think of a use case that isn't covered by these 2, but if you find one let me know.

SevereOverfl0w commented 5 years ago

replant was easily updated (although could use further improvements). async_clj_omni does not seem to work as the use of sleep() in fireplace#client() causes deoplete to fail (hitting some timer in deoplete). I can't really see an easy fix to that, so I'm stuck there for now.

tpope commented 5 years ago

This first time you call fireplace#client(), there's a bit of setup that takes about 100-200ms on my machine. Is this what you're referring to? Subsequent calls have no network chatter and no sleeping.

SevereOverfl0w commented 5 years ago

The initial call sleeps, which triggers a deoplete timer which then blows up. I'm a little confused by the whole thing really, deoplete is kinda complicated.

In better news, I managed to knock up a quick https://github.com/prabirshrestha/asyncomplete.vim client this morning using the async api, which is very simple. I will investigate what async completions should look like as an api in fireplace to make the integration stupid simple.