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

Fix rtags completion over tramp with unsaved buffer for remote file #1441

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pcooksey
Copy link

Just wanted to say rtags is awesome and thanks for making my life easier.

To work with my remote project, I followed this PR #546 which was pretty straight forward (it was very helpful so should we add the details to the wiki?). Next, I added company-rtags for completion as described in the wiki#code-completion-in-emacs. However, it would fail with a company async timeout. After quite a bit of digging (and learning 😅 ), I found that rtags elisp code was sending the unsaved buffer as a temp file but this temp file was being created locally. Just a few small changes and everything was working like a charm.

Fixes:

  1. Use the tramp aware function make-nearby-temp-file to create the temp file on the remote host (if default-directory is remote).
  2. Change the path prefix to a relative path as absolute forces it to always be a local file.
  3. Change the path prefix to be unique to rtags as suggested by the documentation for make-temp-file (See "To prevent conflicts...").
  4. Use rtags-untrampify on the temp file name so that we always pass the local file name to rc.

Let me know if there is anything else I can do to make this PR approved.

1. Use the tramp aware function make-nearby-temp-file to create the tmp
file on the remote host  (if default-directory is remote).
2. Change the path prefix to a relative path as absolute forces it to
always be a local file.
3. Change the path prefix to be unique to rtags as suggested by the
documentation for make-temp-file.
4. Use rtags-untrampify on the temp file name so that we pass the
local file name to rc on the remote system.
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

Successfully merging this pull request may close these issues.

1 participant