Conversation
New options: - remote_compl_dir - remote_R_addr - local_nvim_addr
|
On this branch, it's possible to run R on a remote machine while |
| |remote_compldir| Mount point of remote cache directory | ||
| |remote_compl_dir| Mount point of remote cache directory | ||
| |remote_R_addr| Address of remote R host | ||
| |local_nvim_addr| Address of local Neovim machine |
There was a problem hiding this comment.
Have you checked SSH_CONNECTION to replace both of the above by simply remote_R_host?
|
With the new config, it means that people will have to reconfigure |
|
Personally I would prefer being able to overwrite these settings with good old environment variables. Then this sort of project-specific environment thing could be configured on the shell level rather than in R. For example, I might work on the same project (synced via Git) in several environments. An example: When I am connected to my work LAN, I want to use the local big compute server to run my code. But when I go home and continue working in the evening, I might prefer sending the R commands from my notebook to my workstation in the other room rather than connecting to the work server via VPN. Then again, when a job gets too heavy for my workstation, I might reconsider, turn on the VPN and switch to working on the compute server. So for me, the remote is not so much project dependent as it is situational and it would be easy to write simple shell scripts that (dis-)connect VPN connections (if needed) and change a few environment variables. |
Yes, maybe,
Would something like this work for your case? remote_compl_dir = vim.env.PROJ_XYZ_CMP_DIR,
remote_R_addr = vim.env.PROJ_XYZ_REMOTE_ADDRESS,
local_nvim_addr = vim.env.PROJ_XYZ_LOCAL_ADDRESS, |
I didn't forget this, but I don't know how to configure remote_compl_dir = "hostname",Can you try it? |
|
@jalvesaq: Sorry for not being clearer in my original message. This is what I meant: Right now, one needs to i) specify the remote host via I have two issues with this:
ssh <host> -- 'printf "$SSH_CONNECTION"'(where The last part is the most important for me as I would usually use remote R session when using a less powerful machine, like my notebook. That machine though I typically use from different networks, typically using DHCP to get a non-static IP. Thus, not having to keep track of it myself would be nice. I hope this clarifies my points a bit. |
- Rename `remote_R_addr` as `remote_R_host`. - Remove `local_nvim_addr` superfluous. - Make `remote_compl_dir` optional in a specific case.
I really like the idea. |
|
Thanks, @mschilli87! I renamed However, there will be a bug if the user connects to the server through SSH and then starts nvim to run both Neovim and R on the remote machine. I will fix this... |
I implemented it as |
|
The correct way of using an environment variable is: remote_R_host = vim.env.PROJ_XYZ_R_HOST and vim.env.PROJ_XYZ_R_HOST or "", |
Co-authored-by: Marcel Schilling <mschilling@ub.edu>
Excellent! |
There was a problem hiding this comment.
Pull request overview
This PR reorganizes/builds rnvimserver as a standalone binary (instead of under nvimcom/src/apps), expands remote-R support (ssh/sshfs flow), and updates Neovim-side Lua and docs to match the new layout and remote workflow.
Changes:
- Added/rewired a standalone
rnvimserverC codebase (TCP server, utilities, completion/hover/signature/definition helpers) and updated build files to compile it fromrnvimserver/. - Updated Lua remote-R workflow (sshfs mount, ssh execution, nvimcom tarball handling) and switched LSP startup to run
rnvimserverfromPATH. - Updated nvimcom client connection logic for remote sessions, and consolidated/updated documentation for remote access.
Reviewed changes
Copilot reviewed 26 out of 46 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| rnvimserver/utilities.h | New shared utility header (buffer, JSON helpers, etc.). |
| rnvimserver/utilities.c | New utility implementations (buffer growth, file read, JSON escape/cutters, fuzzy search). |
| rnvimserver/tcp.h | New TCP interface for rnvimserver. |
| rnvimserver/tcp.c | New TCP server implementation and message parsing/dispatch. |
| rnvimserver/signature.h | New signature feature header. |
| rnvimserver/signature.c | Updated include path for shared common.h. |
| rnvimserver/roxygen.h | New roxygen completion header. |
| rnvimserver/roxygen.c | Updated include path for shared common.h. |
| rnvimserver/rnvimserver.c | Updated include path and removed localtmpdir usage. |
| rnvimserver/rhelp.h | New Rhelp completion header. |
| rnvimserver/rhelp.c | Updated include path for shared common.h. |
| rnvimserver/resolve.h | New resolve/docs header. |
| rnvimserver/resolve.c | Updated include path for shared common.h. |
| rnvimserver/obbr.h | New object-browser helper header. |
| rnvimserver/obbr.c | Updated include path and moved object browser temp files to tmpdir. |
| rnvimserver/Makefile.win | Build rnvimserver against ../nvimcom/src/common.c. |
| rnvimserver/Makefile | Build rnvimserver against ../nvimcom/src/common.c. |
| rnvimserver/lsp.h | New header for LSP-facing helpers. |
| rnvimserver/logging.h | New logging header (Debug_NRS gated). |
| rnvimserver/logging.c | New logging implementation. |
| rnvimserver/hover.h | New hover feature header. |
| rnvimserver/hover.c | Updated include path for shared common.h. |
| rnvimserver/global_vars.h | New header consolidating rnvimserver globals. |
| rnvimserver/definition.h | New definition feature header. |
| rnvimserver/definition.c | New definition resolution logic (incl. srcref parsing and R fallback). |
| rnvimserver/data_structures.h | New header for package/cache/object-browser structures. |
| rnvimserver/data_structures.c | New data/cache/object-browser data structures and update logic. |
| rnvimserver/complete.h | New completion header. |
| rnvimserver/complete.c | Updated include path for shared common.h. |
| rnvimserver/chunk.h | New chunk completion header. |
| rnvimserver/chunk.c | Updated include path for shared common.h. |
| resources/before_rns.R | Remote-aware nvimcom install/update flow; changes working directory to compldir. |
| nvimcom/src/nvimcom.c | Adds remote rnvimserver IP selection based on SSH session; uses derived address in connect(). |
| nvimcom/src/Makevars.win | Stops building apps/ as part of the R package build. |
| nvimcom/src/Makevars | Stops building apps/ as part of the R package build. |
| nvimcom/src/apps/global_vars.h | Removed (apps directory no longer used for rnvimserver). |
| nvimcom/DESCRIPTION | Bumps nvimcom version/date. |
| lua/r/server.lua | Builds rnvimserver, manages sshfs mount, remote init/build flows; starts LSP via env. |
| lua/r/run.lua | Remote-R env setup and temp file handling changes; sets additional RNVIM env vars in start options. |
| lua/r/lsp/init.lua | Changes LSP startup signature and runs rnvimserver from PATH. |
| lua/r/edit.lua | Remote cleanup: unmount sshfs instead of rmdir on tmpdir. |
| lua/r/config.lua | Renames/expands remote options; adds per-directory rnvim_config.lua override support; remote ssh adjustments. |
| lua/r/browser.lua | Uses tmpdir instead of removed localtmpdir. |
| doc/remote_access.md | Removed (documentation moved/rewritten into main help). |
| doc/R.nvim.txt | Adds per-directory config docs; updates remote access docs/options. |
| .gitignore | Adjust ignore patterns to new rnvimserver binary location. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Thank you, @mschilli87 and @PMassicotte! I will merge it now. |
|
Good job @jalvesaq ! |
New options: