Open Mafeuser opened 5 years ago
This is related to (but different from) #241.
I was seeing some similar problems a while back, and I added something like this to my emacs configuration:
(unless (tramp-tramp-file-p (buffer-file-name (current-buffer)))
(ycmd-mode))
Basically, it says "don't go into ycmd-mode
if the file appears to be accessed via tramp". I think this was in my python-mode-hook
, but you could add it to c++-mode-hook
or wherever is most appropriate.
Maybe try this and let me know if it works for you.
I went this way, it works thanks
Can I close this?
I believe the correct solution is to add
(unless (file-remote-p default-directory)
(ycmd-mode)))
to ycmd--maybe-enable-mode
until #241 is resolved in which case there would be a defcustom
to toggle tramp
support and avoid the above condition.
can you elaborate on this please? How would one use the above snippet to prevent ycmd to kick in when tramp is used?
My point was that the snippet above should be added upstream, while if you want an immediate workaround with the same effect, you can do:
(define-advice ycmd--maybe-enable-mode
(:around (function &rest ...) ycmd--maybe-enable-mode/:around)
(unless (file-remote-p default-directory)
(apply function ...)))
It will simply not turn on ycmd-mode
in the current buffer by default if it detects that the buffer is visiting a remote file.
I realize it is non-trivial task to provide support for tramp within ycmd, but the problem is emacs freezes and works very unstable when C/C++ remote buffer is opened, thus I request for ignoring ycmd activity on remote C/C++ files
regards