abingham / emacs-ycmd

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

Ycmd server is not running. Can’t send ‘semantic_completion_available’ request! #429

Open JaydenFish opened 7 years ago

JaydenFish commented 7 years ago

ENV: win10 x64, emacs 25, python3.6.1 64bit(anaconda), and latest ycmd successfuly built under visual studio 2017. problem: In emacs c++-mode, whatevet I type, it hints me Ycmd server is not running. Can’t send ‘semantic_completion_available’ request! ycmd-buffer show 2017-06-01 20:21:29,995 - DEBUG - Global extra conf not loaded or no function YcmCorePreload And it's set like this:

(setq ycmd-global-config "D:/emacs/ycmd/cpp/ycm/.ycm_extra_conf.py")
(setq ycmd-server-command '("python" "D:/emacs/ycmd/ycmd"))
abingham commented 7 years ago

There's a note in the README that might be relevant. Try putting -u in your ycmd-server-command:

(setq ycmd-server-command '("python" "-u" "D:/emacs/ycmd/ycmd"))
JaydenFish commented 7 years ago

It doesn't for me.

abingham commented 7 years ago

What does ycmd-show-debug-info show you?

abingham commented 7 years ago

ycmd-buffer show 2017-06-01 20:21:29,995 - DEBUG - Global extra conf not loaded or no function YcmCorePreload

Is that literally all that appears in your *ycmd-server* buffer? If so, then the problem is related to buffer flushing. The server is supposed to print a line that says "serving on http://127.0.0.1:[some port]". If we don't see that, then we don't know on which port the server is running.

It doesn't for me.

Are you absolutely sure that you a) properly changed the server command and b) restarted ycmd? You can use ycmd-open to restart the server. The missing port line seems like the most likely explanation right now.

ptrv commented 7 years ago

It seems that the server started successfully but we could not parse the port from the server output because there is only the first line in the server buffer

ptrv commented 7 years ago

ycmd-show-debug-info won't work because it sends also a request which won't work without port

JaydenFish commented 7 years ago

ycmd-show-debug-info

Ycmd debug information for buffer p.cpp in c++-mode:

No debug info available from server

Server is not running

Ycmd Mode is enabled

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

Ycmd version:   1.2snapshot (package: 20170515.2255)
Emacs version:  25.2.2
System:         x86_64-w64-mingw32
Window system:  w32
JaydenFish commented 7 years ago

I run command ycmd-open,ycmd-buffershow:

2017-06-02 22:07:51,136 - ERROR - Error occurred while loading global extra conf D:/emacs/ycmd/cpp/ycm/.ycm_extra_conf.py
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\extra_conf_store.py", line 94, in _CallGlobalExtraConfMethod
    module = Load( global_ycm_extra_conf, force = True )
  File "D:\emacs\ycmd\ycmd\..\ycmd\extra_conf_store.py", line 173, in Load
    module = LoadPythonSource( _RandomName(), module_file )
  File "D:\emacs\ycmd\ycmd\..\ycmd\utils.py", line 410, in LoadPythonSource
    return importlib.machinery.SourceFileLoader( name, pathname ).load_module()
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 251, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 675, in _load
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "D:/emacs/ycmd/cpp/ycm/.ycm_extra_conf.py", line 32, in <module>
    import ycm_core
ImportError: Module use of python27.dll conflicts with this version of Python.
2017-06-02 22:07:51,144 - ERROR - ycm_core library compiled for Python 2 but loaded in Python 3.
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\server_utils.py", line 95, in CompatibleWithCurrentCore
    ycm_core = ImportCore()
  File "D:\emacs\ycmd\ycmd\server_utils.py", line 87, in ImportCore
    import ycm_core as ycm_core
ImportError: Module use of python27.dll conflicts with this version of Python.

It's weird.I am sure I compiled it with python3. I installed python3 and python2 on my computer, and the environment viarables is set to that python3 is in front of python2. I did a test, I rename the python3 directory.So in this way I launched emacs with python2.In c++-mode, whatever I type, emacs was always stuck.And I have to type C-g to recontrol emacs. And in this way,ycmd-buffer show:

2017-06-02 22:14:48,381 - DEBUG - Global extra conf not loaded or no function YcmCorePreload
serving on http://127.0.0.1:12721
2017-06-02 22:15:13,115 - INFO - Dropping request with bad HMAC.
2017-06-02 22:15:20,309 - INFO - Dropping request with bad HMAC.
2017-06-02 22:15:20,378 - INFO - Dropping request with bad HMAC.
2017-06-02 22:15:20,598 - INFO - Dropping request with bad HMAC.
2017-06-02 22:15:34,694 - INFO - Dropping request with bad HMAC.
2017-06-02 22:15:43,845 - INFO - Dropping request with bad HMAC.
2017-06-02 22:15:58,749 - INFO - Dropping request with bad HMAC.
abingham commented 7 years ago

Could you post the ycmd-show-debug-info now? It may not show anything, but I'd like to get the easy stuff out of the way.

JaydenFish commented 7 years ago

I compiled it in python3.And in python3 with emacs,there is a dialog box pop up.

Microsoft Visual C++ Runtime Library
Assertion failed!
Program: D:\emacs\ycmd\libclang.dll
File: D:\src\llvm_package_4.0.0\llvm\tools.../SourceLocation.h Line: 319
Expression: SrcMgr == Loc.SrcMgr && "Loc comes from another SourceManager!"
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts
(Press Retry to debug the application - JIT must be enabled)

ycmd-show-debug-info

Ycmd debug information for buffer p.cpp in c++-mode:

No debug info available from server

Server is not running

Ycmd Mode is enabled

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

Ycmd version:   1.2snapshot (package: 20170515.2255)
Emacs version:  25.2.2
System:         x86_64-w64-mingw32
Window system:  w32

ycmd-server buffer:

2017-06-04 06:45:14,087 - DEBUG - Global extra conf not loaded or no function YcmCorePreload
serving on http://127.0.0.1:2382
2017-06-04 06:45:17,460 - INFO - Received completion request
2017-06-04 06:45:17,462 - DEBUG - Using filetype completion: True
2017-06-04 06:45:17,505 - INFO - Received completion request
2017-06-04 06:45:17,505 - DEBUG - Using filetype completion: True
2017-06-04 06:45:17,508 - ERROR - Exception from semantic completer (using general): Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\handlers.py", line 103, in GetCompletions
    .ComputeCandidates( request_data ) )
  File "D:\emacs\ycmd\ycmd\..\ycmd\completers\completer.py", line 217, in ComputeCandidates
    candidates = self._GetCandidatesFromSubclass( request_data )
  File "D:\emacs\ycmd\ycmd\..\ycmd\completers\completer.py", line 233, in _GetCandidatesFromSubclass
    raw_completions = self.ComputeCandidatesInner( request_data )
  File "D:\emacs\ycmd\ycmd\..\ycmd\completers\cpp\clang_completer.py", line 95, in ComputeCandidatesInner
    raise RuntimeError( PARSING_FILE_MESSAGE )
RuntimeError: Still parsing file, no completions yet.

2017-06-04 06:45:17,750 - INFO - Received filetype completion available request
2017-06-04 06:45:17,888 - INFO - Received command request

I compiled it with python2. ycmd-server show

serving on http://127.0.0.1:4411
2017-06-04 06:57:08,015 - INFO - Dropping request with bad HMAC.
2017-06-04 06:57:12,630 - INFO - Dropping request with bad HMAC.
2017-06-04 06:57:16,006 - INFO - Dropping request with bad HMAC.
2017-06-04 06:57:19,183 - INFO - Dropping request with bad HMAC.
2017-06-04 06:57:20,352 - INFO - Dropping request with bad HMAC.
2017-06-04 06:57:27,569 - INFO - Dropping request with bad HMAC.
2017-06-04 06:57:27,608 - INFO - Dropping request with bad HMAC.
2017-06-04 06:57:27,844 - INFO - Dropping request with bad HMAC.
2017-06-04 06:57:39,628 - INFO - Dropping request with bad HMAC.
2017-06-04 06:57:48,312 - INFO - Dropping request with bad HMAC.
2017-06-04 06:57:56,049 - INFO - Dropping request with bad HMAC.
2017-06-04 06:58:03,183 - INFO - Dropping request with bad HMAC.

ycmd-show-debug-info is stuck.

abingham commented 7 years ago

I have to admit, I'm not sure what's going on here. My best guess is that you're either mis-compiling ycmd or your Python environment is messed up.

JaydenFish commented 7 years ago

As you remind me my python env is messed up.I delete whole anaconda2, and reinstall Anaconda3,recompile ycmd. And things get a little different. ycmd-server buffer:

2017-06-06 18:32:44,554 - DEBUG - Global extra conf not loaded or no function YcmCorePreload
serving on http://127.0.0.1:4830
2017-06-06 18:32:49,973 - INFO - Received event notification
2017-06-06 18:32:49,973 - DEBUG - Event name: BufferVisit
2017-06-06 18:32:49,974 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:32:50,089 - INFO - Received event notification
2017-06-06 18:32:50,089 - DEBUG - Event name: FileReadyToParse
2017-06-06 18:32:50,089 - INFO - Adding buffer identifiers for file: d:/project/oj/lintcode/p/p/p.cpp
2017-06-06 18:32:50,089 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:32:58,337 - INFO - Received completion request
2017-06-06 18:32:58,337 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:32:58,338 - DEBUG - Using filetype completion: False
2017-06-06 18:32:58,432 - INFO - Received completion request
2017-06-06 18:32:58,432 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:32:58,432 - DEBUG - Using filetype completion: False
2017-06-06 18:32:58,640 - INFO - Received filetype completion available request
2017-06-06 18:32:58,641 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:00,178 - INFO - Received debug info request
2017-06-06 18:33:00,179 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\handlers.py", line 237, in DebugInfo
    request_data ).DebugInfo( request_data )
  File "D:\emacs\ycmd\ycmd\..\ycmd\handlers.py", line 284, in _GetCompleterForRequestData
    return _server_state.GetFiletypeCompleter( request_data[ 'filetypes' ] )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:04,524 - INFO - Received completion request
2017-06-06 18:33:04,524 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:04,525 - DEBUG - Using filetype completion: False
2017-06-06 18:33:04,606 - INFO - Received completion request
2017-06-06 18:33:04,606 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:04,606 - DEBUG - Using filetype completion: False
2017-06-06 18:33:05,031 - INFO - Received completion request
2017-06-06 18:33:05,031 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:05,031 - DEBUG - Using filetype completion: False
2017-06-06 18:33:05,118 - INFO - Received completion request
2017-06-06 18:33:05,118 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:05,119 - DEBUG - Using filetype completion: False
2017-06-06 18:33:05,693 - INFO - Received completion request
2017-06-06 18:33:05,694 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:05,694 - DEBUG - Using filetype completion: False
2017-06-06 18:33:05,796 - INFO - Received completion request
2017-06-06 18:33:05,796 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:05,796 - DEBUG - Using filetype completion: False
2017-06-06 18:33:06,018 - INFO - Received completion request
2017-06-06 18:33:06,018 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:06,018 - DEBUG - Using filetype completion: False
2017-06-06 18:33:06,065 - INFO - Received completion request
2017-06-06 18:33:06,065 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:06,065 - DEBUG - Using filetype completion: False
2017-06-06 18:33:07,204 - INFO - Received completion request
2017-06-06 18:33:07,204 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:07,204 - DEBUG - Using filetype completion: False
2017-06-06 18:33:07,282 - INFO - Received completion request
2017-06-06 18:33:07,282 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:07,282 - DEBUG - Using filetype completion: False
2017-06-06 18:33:08,112 - INFO - Received completion request
2017-06-06 18:33:08,112 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:08,112 - DEBUG - Using filetype completion: False
2017-06-06 18:33:08,189 - INFO - Received completion request
2017-06-06 18:33:08,189 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:08,189 - DEBUG - Using filetype completion: False
2017-06-06 18:33:09,651 - INFO - Received completion request
2017-06-06 18:33:09,652 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:09,652 - DEBUG - Using filetype completion: False
2017-06-06 18:33:09,737 - INFO - Received completion request
2017-06-06 18:33:09,737 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:09,738 - DEBUG - Using filetype completion: False
2017-06-06 18:33:12,341 - INFO - Received completion request
2017-06-06 18:33:12,341 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:12,341 - DEBUG - Using filetype completion: False
2017-06-06 18:33:12,435 - INFO - Received completion request
2017-06-06 18:33:12,435 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:12,436 - DEBUG - Using filetype completion: False
2017-06-06 18:33:14,339 - INFO - Received completion request
2017-06-06 18:33:14,339 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:14,339 - DEBUG - Using filetype completion: False
2017-06-06 18:33:14,432 - INFO - Received completion request
2017-06-06 18:33:14,433 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:14,433 - DEBUG - Using filetype completion: False
2017-06-06 18:33:15,578 - INFO - Received completion request
2017-06-06 18:33:15,578 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:15,578 - DEBUG - Using filetype completion: False
2017-06-06 18:33:15,705 - INFO - Received completion request
2017-06-06 18:33:15,705 - ERROR - No semantic completer exists for filetypes: ['cpp']
Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 100, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "D:\emacs\ycmd\ycmd\..\ycmd\server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['cpp']
2017-06-06 18:33:15,705 - DEBUG - Using filetype completion: False

ycmd-debug-show-info:

Ycmd debug information for buffer p.cpp in c++-mode:

((python (executable . "d:\\Anaconda3\\python.exe") (version . "3.6.1"))
 (clang (has_support . :json-false) (version))
 (extra_conf (path . "D:/emacs/ycmd/cpp/ycm/.ycm_extra_conf.py")
             (is_loaded . t))
 (completer))

Server is running at: 127.0.0.1:4830

Ycmd Mode is enabled

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

Ycmd version:   1.2snapshot (package: 20170515.2255)
Emacs version:  25.2.2
System:         x86_64-w64-mingw32
Window system:  w32
JaydenFish commented 7 years ago

I compiled ycmd with python build.py --all the result is:

    31 个警告
    0 个错误

已用时间 00:00:41.43
ERROR: msbuild or xbuild is required to build Omnisharp.

No error. But I can't get through the run_tests.py.

ptrv commented 7 years ago

Actually it looks good. The server is running. But it has no clang support.

Maybe someone from ycmd project has an idea what is going wrong here? @micbou or @Valloric

micbou commented 7 years ago

@asdyjd Could you run the script with only the --clang-completer flag:

python build.py --clang-completer

and paste its output in a Gist?

JaydenFish commented 7 years ago

https://gist.github.com/asdyjd/92f9c4914f68e4bd7bc955df4c969881 I compiled it with python build.py --clang-completer Now this is the case.A dialog pop up,shows:

Microsoft Visual C++ Runtime Library
Assertion failed!
Program: D:\emacs\ycmd\libclang.dll
File: D:\src\llvm_package_4.0.0\llvm\tools.../SourceLocation.h Line: 319
Expression: SrcMgr == Loc.SrcMgr && "Loc comes from another SourceManager!"
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts
(Press Retry to debug the application - JIT must be enabled)

emacs message:

Ycmd server exited abnormally with code 116

ycmd-server:

2017-06-06 18:58:00,978 - DEBUG - Global extra conf not loaded or no function YcmCorePreload
serving on http://127.0.0.1:7095
2017-06-06 18:58:04,345 - INFO - Received completion request
2017-06-06 18:58:04,349 - DEBUG - Using filetype completion: True
2017-06-06 18:58:04,429 - INFO - Received completion request
2017-06-06 18:58:04,429 - DEBUG - Using filetype completion: True
2017-06-06 18:58:04,430 - ERROR - Exception from semantic completer (using general): Traceback (most recent call last):
  File "D:\emacs\ycmd\ycmd\..\ycmd\handlers.py", line 103, in GetCompletions
    .ComputeCandidates( request_data ) )
  File "D:\emacs\ycmd\ycmd\..\ycmd\completers\completer.py", line 217, in ComputeCandidates
    candidates = self._GetCandidatesFromSubclass( request_data )
  File "D:\emacs\ycmd\ycmd\..\ycmd\completers\completer.py", line 233, in _GetCandidatesFromSubclass
    raw_completions = self.ComputeCandidatesInner( request_data )
  File "D:\emacs\ycmd\ycmd\..\ycmd\completers\cpp\clang_completer.py", line 95, in ComputeCandidatesInner
    raise RuntimeError( PARSING_FILE_MESSAGE )
RuntimeError: Still parsing file, no completions yet.

2017-06-06 18:58:04,627 - INFO - Received filetype completion available request
2017-06-06 18:58:04,737 - INFO - Received command request
micbou commented 7 years ago

Thanks. So, you are experiencing a libclang crash. Could you open an issue on the ycmd repository with a minimal reproducible test case (including the .cpp and .ycm_extra_conf.py files) that leads to the crash?

SharryXu commented 6 years ago

@asdyjd Actually, python build.py --clang-completer --system-libclang is working for me. And it seems like we need to use latest libclang instead of the system default which has marked as obsolete in the help doc. By the way, I just use the default one and it's working. 😄

micbou commented 6 years ago

And it seems like we need to use latest libclang instead of the system default which has marked as obsolete in the help doc.

Right, not recommended has clearly the same meaning as obsolete.

By the way, I just use the default one and it's working.

I didn't know there was a default system libclang on Windows. Nice.

SharryXu commented 6 years ago

@micbou You are right. This option is obsolete and the system I am working on is OS X 10.13.4, not Windows, sorry for the confusion.

aijony commented 6 years ago

I experienced the original issue on my Arch Linux machine, Where DEBUG - Global extra conf not loaded or no function YcmCorePreload was the only thing in the *ycmd-server* buffer. Adding -u to my ycmd-server-command fixed it. I created a pull request #471 to clarify the readme for non-Windows users.