manateelazycat / lsp-bridge

A blazingly fast LSP client for Emacs
GNU General Public License v3.0
1.35k stars 197 forks source link

An error occurred when I use lap-bridge to edit a file remotely #966

Closed fzcsyglq closed 3 weeks ago

fzcsyglq commented 3 weeks ago

Error "remote file ... is updating info... skip call ..." when editing a file remotely. As a result, many functions of the lsp-bridge are unavailable. I use clangd as c++ server. I want to know why it happens and how to fix it.

manateelazycat commented 3 weeks ago
Skip calling file api when we are updating tramp file info

When a tramp file is opened, its information is updated by calling
'lsp-bridge-sync-tramp-remote' and will be finished in
'lsp-bridge-update-tramp-file-info'. Before it is done,
'lsp-bridge-remote-file-flag' is nil and related remote file info
variables are not set. If we call file api this time, it will send the
request to local lsp server(local epc call). Because the file is a
remote file in fact, we won't get right result frome local server and it
might leads to some unpredicatable exception. So we add check in
'lsp-bridge-call-file-api' to skip the call if update is not finished.
manateelazycat commented 3 weeks ago

tramp is slow, please open remote file by ip and ssh public key.

fzcsyglq commented 3 weeks ago

I use (setq lsp-bridge-enable-with-tramp t) to avoid using tramp and use ssh to open a file. But it will still exist.

fzcsyglq commented 3 weeks ago

I have fixed it. It comes up because I modified C-x C-f using ivy-mode. When I use ssh to open a file and use C-x C-f to open other file, tramp is used. When I turned ivy-mode off, the problem was solved, thanks.