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

Remote server/TRAMP support (fix #84) #348

Closed
wants to merge 42 commits into from
Closed

Remote server/TRAMP support (fix #84) #348

wants to merge 42 commits into from

Conversation

FelipeLema
Copy link

Support remote files / tramp.

@joaotavora
Copy link
Owner

Hi @FelipeLema this looks good in general. But (as you probably already know)

  • it is existing failing tests;

  • it needs existing tests (how?);

  • some of the function names are hard to understand;

  • your formatting choices go against mine, so unless you feel very strongly about them, later on, I will ask you to review them.

@joaotavora
Copy link
Owner

it needs existing tests (how?);

Duh, I meant "new tests"

@FelipeLema
Copy link
Author

FelipeLema commented Nov 15, 2019

it is existing failing tests;

yup, I'm using travis as checker for now. This is why I'm doing this as a /draft/ pull request. I wanted this dPR to be visible so no one would be doing the same work twice (visibility).

it needs existing tests (how?);

I'm aware of this. For now, I'm working on unbreaking tests. Once I have that, will work out a way to test this. The way I see it, re-running the same tests using /ssh:localhost;/some/path should be enough, so I might end up adding a meta-config.

some of the function names are hard to understand;

Please, point them out, so I can address them directly. Naming in this context is real hard.

your formatting choices go against mine, so unless you feel very strongly about them, later on, I will ask you to review them.

I noticed that some alignment went different, but it was unintended. I'll add a TODO for them.

@garyo
Copy link
Contributor

garyo commented Nov 15, 2019

Hope you don't mind someone chiming in on this. Your work might help my case: I run Emacs on Windows, but all the rest of my development environment is in Linux using WSL on the same machine. So it's not remote as such. Right now I'm installing the language server on the Windows side just so eglot and intellisense will work; I'd love to use the Linux-side language server, but there's a filename translation problem. Windows c:/foo/bar becomes /mnt/c/foo/bar in Linux (with default mappings anyway). If in the work you're doing here, you could allow for a filename-mapping hook (i.e. between Emacs's idea of filename and the server's idea), so I could use the Linux language server, people in my situation would be very grateful! (Note that it's no problem for Windows Emacs to start a Linux process using WSL, and get its stdio and so on. It's just the filename mapping at issue.)

@joaotavora joaotavora changed the title Remote server (fix #84) Remote server/TRAMP support (fix #84) Nov 18, 2019
@joaotavora
Copy link
Owner

Hope you don't mind someone chiming in on this

Not at all.

the work you're doing here, you could allow for a filename-mapping hook (i.e. between Emacs's idea of

This looks like a simpler addition, but at any rate a prerequisite for TRAMP support.

You should be able to achieve a bit of this hooking if you advice-add to eglot--path-to-uri and eglot--uri-to-path.

We could ask @FelipeLema to split his PR into two parts. One that supplies this indirection, and another one with TRAMP support that will surely use this indirection. However, if that confuses or complicates Felipe's TRAMP goal, I'd rather it waits a bit.

@FelipeLema
Copy link
Author

I guess I could add some code for url and path treatment, but that might end up bloating up the code.

@garyo can you open an issue so we can discuss a (quicker) solution to your problem?

@joaotavora
Copy link
Owner

@garyo can you open an issue so we can discuss a (quicker) solution to your problem?

That's probably a good idea, yes.

FelipeLema and others added 21 commits November 22, 2019 22:12
* eglot.el (eglot--managed-mode): locally tweak
imenu-create-index-function.
* eglot.el (company-tooltip-align-annotations): Forward declare.
(eglot--cached-server): Renamed from eglot--cached-current-server.
(eglot--managed-mode, eglot-current-server)
(eglot--current-server-or-lose)
(eglot--maybe-activate-editing-mode): use it.
(eglot-completion-at-point): Don't use insertTextFormat.
- use `eglot--executable-find` instead of `executable-find`
- `make-temp-file` is not tramp-friendly
@FelipeLema
Copy link
Author

I have several reasons to not continue with this Pull Request

  • I have eglot working with tramp, but inconsistently... it seems I'm missing some low-level config/way of doing things (program setup works OK with small tests, language server program is getting incomplete strings/bytes). It's definitely not easy to debug and find out just what.
  • There are several tramp tools/functionalities from Emacs 27 not present in 26 that need to be re-written. I've tried this, but have been getting inconsistent results.
  • When 27 arrives (at my system), I will pick up this feature. This branch/PR is mostly patching things to get it working in 26, so these changes are mostly noise with 27 available.

@FelipeLema FelipeLema closed this Nov 29, 2019
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.

3 participants