abingham / emacs-ycmd

Emacs client for ycmd, the code completion system.
MIT License
383 stars 46 forks source link

ycmd-server can't start up. #443

Closed cobblau closed 7 years ago

cobblau commented 7 years ago

I configure my ycmd server as

(require 'ycmd)
(add-hook 'after-init-hook #'global-ycmd-mode)
(add-hook 'c++-mode-hook 'ycmd-mode)
(set-variable 'ycmd-server-command '("python" "/home/admin/.emacs.d/elpa/ycmd-20170723.1458/"))

where /home/admin/.emacs.d/elpa/ycmd-20170723.1458/ is the directory ycmd installed.

When I type M-x ycmd-open, emacs shows me the Error Message: ERROR: Ycmd server timeout. If this happens regularly you may need to increase 'ycmd-startup-timeout'.

ycmd-server Buffer shows /usr/bin/python: '/home/admin/.emacs.d/elpa/ycmd-20170723.1458/' is a directory, cannot continue

ycmd-show-debug-info shows

No debug info available from server

Server is not running

Ycmd Mode is disabled

--------------------

Ycmd version:   1.3snapshot (package: 20170723.1458)
Emacs version:  24.5.1
System:         x86_64-unknown-linux-gnu
Window system:  nil

So what does ycmd-server-command mean? How ycmd uses ycmd-server-command to start ycmd server? And finally, how can I fix this problem?

vheon commented 7 years ago

are you sure is "python" "/home/admin/.emacs.d/elpa/ycmd-20170723.1458/" and not "python" "/home/admin/.emacs.d/elpa/ycmd-20170723.1458/ycmd"?

ptrv commented 7 years ago

@cobblau Please read the Quickstart section of the Readme: https://github.com/abingham/emacs-ycmd#quickstart You need to install ycmd first and the set ycmd-server-command to the ycmd path. emacs-ycmd does not ship the ycmd server.

cobblau commented 7 years ago

@ptrv Thanks! I am a fresher to emacs-ycmd, now I finger out that ycmd server is a third-party binary lauched by emacs-ycmd. The problem I mentioned above is solved by compling a new ycmd, and ycmd-server-command informs the directory where ycmd server belongs to. Close this issue.