Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] configing fallbacks for conjure auto connect? #453

Closed
glyh opened this issue Jan 5, 2023 · 3 comments
Closed

[FR] configing fallbacks for conjure auto connect? #453

glyh opened this issue Jan 5, 2023 · 3 comments

Comments

@glyh
Copy link
Contributor

glyh commented Jan 5, 2023

Right now conjure is doing a great job by auto connecting. But I want it to start REPLs when it fails to do so. I know there's vim-jack-in, but how should I make it only start a REPL only when it fails to auto connect?

Is there a hook function or something?

@glyh glyh changed the title configing fallbacks for conjure auto connect? [FR] configing fallbacks for conjure auto connect? Jan 5, 2023
@Olical
Copy link
Owner

Olical commented Jan 7, 2023

I think the new conjure.hook module I've just added today could help with this, I'll probably add a hook for you to interject your own logic and inspect Conjure's result then act upon it in a way you see fit. Will integrate the Clojure client connect code with hooks and document it, should be all you need 🎉

@Olical
Copy link
Owner

Olical commented Jan 7, 2023

See the commit above for more info, there's now a hook where you can intercept, replace or augment the current passive connection behaviour. More can be added when required. Should allow you to do basically anything you want although it will require a little thought and reading, not just a simple option to toggle I'm afraid.

I think you can also override the nrepl.connect arguments now, at least I hope I made it possible for you. So you can basically set your own on-* handler functions that are passed to the actual connection. Meaning you can define your own failure cases. Or you can detect when no portfile was found (it returns nil) and then start your own REPL.

@Olical
Copy link
Owner

Olical commented Jan 7, 2023

This is only on the develop branch for now. There's general docs on hooks in the main conjure.txt file and specific ones about this Clojure connect hook in the clojure doc txt.

@Olical Olical closed this as completed Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants