-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support distant:// scheme? #150
Comments
Ironically I looked at your plugin before creating netman! Because of how netman is structured, a distant provider can absolutely be created for netman. My provider creation docs aren't great though. If you're willing to provide some assistance/long term maintenance with the provider, I have no issue in including that provider in core :) I will not include it in the 1.15 or 1.2 milestones, imo something like this would be it's own work effort altogether. But I am very much behind adding this kind of support! |
Alright, so do you recommend revisiting this later? 😄 |
It depends on what you mean by "revisit". I am not (at this time) looking to create this provider and I don't know if that changes in the future. I am very much fine with supporting someone else's contribution of said provider (including helping them navigate the API, any confusion they have, etc). The latter can be done at anytime, in which case I don't know that revisiting makes sense unless the contributor wants to do so later :) The long short, I think your idea is good. I don't think I have the energy or time to do it (and I don't know enough about distant in order to feel comfortable maintaining it). |
Ah, okay. I misunderstood your earlier comments as needing to wait for documentation and reaching a later milestone. I'll take a look at the plugin docs, but my interest would be to avoid maintaining a second plugin myself (e.g. the standalone plugin route), so if I can help integrate the feature into netman directly and provide answers/support in this repo, that'd be my preference. How would you recommend proceeding when it comes to integrating into core? Any code pointers for me to look at? |
Its worth mentioning that Anyway! To your question Adding a new provider to core should be reasonably simple.
The above should get you an end result of a provider that is available by default in Netman, which is what we want with core providers. I would say the best "code" starting point is the docker provider which is what I would call the "most complete" provider. Please note, per #117 , Netman is purely synchronous currently. There will be optional functions that a provider can implement if it wishes to support asynchronous behavior, but I do not have them fleshed out yet. Feel free to reach out to me on discord And thank you! I have been hoping others would have interest in creating providers for netman, (as well as consumers but I haven't fleshed that out just yet). Please let me know how I can help you Edit: Which is probably important to mention. 3rd party plugins (what |
I can appreciate the strictness on dependencies as So it sounds like if I want to have distant be available as a provider in core, I would need to write the API communication again rather than importing I was skimming through your documentation and the docker provider, and didn't immediately see a standard way to support connection setup and/or authentication. For the distant plugin, when you launch a new server or connect to an existing server, a handshake is performed that includes zero or more authentication challenges. My first guess is that I could provide this synchronously through the optional |
This is correct unfortunately. It may be easier to add a bit of wrapper code to
Ya I haven't landed on exactly how I want connections to work unfortunately. I am currently toying with this as the core The optional "init" function is called on the initial load of the plugin (as seen in api.load_provider). This is called (most likely) during neovim startup and gives your provider an opportunity to verify it can run (all dependencies are met for example). It is not called on initial read of a URI as the API has no concept of URI connection states. Currently (until/unless an optional I want to call out, I am not against a adding this kind of functionality (so if you have an idea of what you would like it to look like, I would be fine with chatting about that spec), however as I call out in the api documentation the API should be as stateless as possible and as dumb as possible. Thus implementing some kind of URI connection logic would likely need to be very well thought through as I am not open to having the API manage if a URI is connected or not (as that is what the provider should do). I hope that answered your questions :) |
Yeah, thanks for the detailed responses here :) Figure having questions answered in this issue (versus discord chat) would be better for others who inquire later. For distant, I actually mirrored ssh's method of authentication (being in protocol and client APIs), so I'd be happy to chat about how that works in the future. Lazy validation of authentication seems like a path forward to me, so I can certainly implement that approach for netman. |
Makes sense to me! Let me know if/when you need anything. I would fork off of main as opposed to v1.15 (if you are unsure which branch to use). Anything not |
Any thoughts on supporting distant (https://distant.rocks) as another option for remote editing? It offers a JSON lines API that you can used for authentication, file I/O, process management (including running LSP servers), remote shells, file/directory watching, and automatic reconnecting for poor networking.
I've built out distant.nvim to leverage that CLI to both support SSH and the custom distant protocol, but would also love to see more adoption across fellow plugins and integrations to enable remote editing features.
The text was updated successfully, but these errors were encountered: