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

Inherit/use PATH variable from the client #27

Closed
IndianBoy42 opened this issue Jun 9, 2023 · 2 comments · Fixed by #65
Closed

Inherit/use PATH variable from the client #27

IndianBoy42 opened this issue Jun 9, 2023 · 2 comments · Fixed by #65
Labels
enhancement New feature or request

Comments

@IndianBoy42
Copy link

IndianBoy42 commented Jun 9, 2023

I use mason.nvim to install most of my lsps in neovim. Which installs everything to ~/.local/share/nvim/mason/bin to not interfere with the system. I think adding an argument to the client binary to take a custom PATH variable (or just some directories to prepend to the PATH) would work to use these.

The alternatives are:

  • Compute the absolute path of the binary from the editor and pass that to --ra-mux-server (nothing in ra-multiplex side)
  • Make mason install to a location that I add to my global path (or at least to the PATH that ra-multiplex-server sees)
  • have ra-multiplex binary automatically get the PATH env variable and send it to the server (rather than having to manually add it on the editor)

I think if two ra-multiplex clients specify the same server but with different PATHs they should be run with different instances. Does that make sense? I'm just considering if the different PATHs might be used to require different versions of the server. Actually what makes more sense is to use the actual absolute path of the found server binary.

I can help with the implementation if you're happy with the feature and the direction for it.

@pr2502
Copy link
Owner

pr2502 commented Jun 14, 2023

Hi, I'm not sure I entirely understand what the issue is (I've never used mason.nvim), wouldn't it be solved by setting the path for the ra-multiplex-server in the service file (or whichever way you launch it)?

Any passing of variables between the ra-multiplex client and server is complexity that makes debugging harder so unless it's a very common use case or it cannot be easily solved another way I'd prefer not to add it to ra-multiplex.

@IndianBoy42
Copy link
Author

Mason.nvim does not install the lsps that we might want to use with ra-multiplex globally, it just changes the PATH variable inside neovim so that any plugin or tool that needs it can find it automatically. except ra-multiplex-server doesn't live inside neovim so its PATH is unchanged. Where the lsp/tool is installed and the change in environment is technically a hidden implementation detail of Mason.nvim, adding it to the ra-multiplex service doesn't seem appropriate.

There are other reasons that neovim may have a different PATH environment or find a different executable for the same command as ra-multiplex-server: python/conda virtual environments, node/julia/go version managers that also work in userspace, nix flakes/dev environments etc. where the just add it to the global service PATH solution is even less viable if not impossible.

I think the least surprising thing for the user, and to be a true drop-in replacement, ra-multiplex --server <name> and <name> run by the client editor should trigger the same program.

Resolving the command to the full absolute path on the client side and sending that is probably the least complex implementation now that I think about it more, but I still think it should be done in ra-multiplex not in the editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants