abingham / emacs-ycmd

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

No semantic completer exists for major-mode: ‘c++-mode’ #464

Closed yoacompsci closed 6 years ago

yoacompsci commented 6 years ago

Hello, When I hopen .cpp file I get the next error message:

No semantic completer exists for major-mode: c++-mode

OS: Windows 10. Emacs: GNU Emacs 25.3.1 (x86_64-w64-mingw32).

I have downloaded and install ycmd following next procedure:

gitclone https://github.com /Valloric/ycmd.git cd ycmd git submodule update --init --recursive build.py --clang-completer

In my init.el file I have included next commands:

(set-variable 'ycmd-server-command '("python" "-u" "D:/hh_home/.emacs.d/ycmd/ycmd/ycmd")) (set-variable 'ycmd-extra-conf-whitelist '("D:/hh_home/.emacs.d/ycm_extra_conf.py")) (set-variable 'ycmd-global-config "D:/hh_home/.emacs.d/ycm_extra_conf.py")

Opening Emcas and loading .cpp file, I get the following message error:

No semantic completer exists for major-mode: ‘c++-mode’. Ycmd ELDoc mode disabled in current buffer.

The ycmd-server shows the following:

2018-02-27 19:06:35,533 - DEBUG - No global extra conf, not calling method YcmCorePreload serving on http://DESKTOP-NOQ9I9H:51399 2018-02-27 19:07:03,381 - INFO - Received event notification 2018-02-27 19:07:03,381 - DEBUG - Event name: BufferVisit 2018-02-27 19:07:03,381 - ERROR - No semantic completer exists for filetypes: ['cpp'] Traceback (most recent call last): File "D:\hh_home\.emacs.d\ycmd\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable self.GetFiletypeCompleter( filetypes ) File "D:\hh_home\.emacs.d\ycmd\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter current_filetypes ) ) ValueError: No semantic completer exists for filetypes: ['cpp'] 2018-02-27 19:07:03,459 - INFO - Received event notification 2018-02-27 19:07:03,459 - DEBUG - Event name: FileReadyToParse 2018-02-27 19:07:03,459 - INFO - Adding buffer identifiers for file: d:/tt_tools/emacs/emacs-25.3-x86_64/bin/adl_mult.cpp 2018-02-27 19:07:03,459 - ERROR - No semantic completer exists for filetypes: ['cpp'] Traceback (most recent call last): File "D:\hh_home\.emacs.d\ycmd\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable self.GetFiletypeCompleter( filetypes ) File "D:\hh_home\.emacs.d\ycmd\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter current_filetypes ) ) ValueError: No semantic completer exists for filetypes: ['cpp'] 2018-02-27 19:07:04,693 - INFO - Received filetype completion available request 2018-02-27 19:07:04,693 - ERROR - No semantic completer exists for filetypes: ['cpp'] Traceback (most recent call last): File "D:\hh_home\.emacs.d\ycmd\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable self.GetFiletypeCompleter( filetypes ) File "D:\hh_home\.emacs.d\ycmd\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter current_filetypes ) ) ValueError: No semantic completer exists for filetypes: ['cpp']

The contend of the ycmd-debug-info message is the next: ycmd debug information for buffer adl_mult.cpp in c++-mode: ((python (executable . "d:\\tt_tools\\python\\3_6_3\\python.exe") (version . "3.6.3")) (clang (has_support . :json-false) (version)) (extra_conf (path) (is_loaded . :json-false)) (completer)) Server is running at: 127.0.0.1:51399 Ycmd Mode is enabled Ycmd version: 1.3snapshot (package: 20171111.854) Emacs version: 25.3.1 System: x86_64-w64-mingw32 Window system: w32

Can you help me to fix that issue? Many thanks.

abingham commented 6 years ago

Do you have an ycm_extra_conf.py?

micbou commented 6 years ago

@yoacompsci Your ycmd doesn't have support for C++ because the --clang-completer argument was ignored when running the build.py script. See issue https://github.com/Valloric/YouCompleteMe/issues/2929. Run the script with the Python executable:

python build.py --clang-completer

and try again.

yoacompsci commented 6 years ago

Running the script with the Python executable gets the support for C++. Solved. Thanks!