【发布时间】:2017-11-12 06:43:39
【问题描述】:
我目前有一个结构如此的项目
project
|
|----src/
| |
| |----test.cpp
|
|----include/
| |
| |----test.hpp
|
|----.ycm_extra_conf.py
但是当 test.hpp 包含在 test.cpp 中时,我无法让 YouCompleteMe 识别它
#include "test.hpp"
这是我的:YcmDebugInfo的输出
Printing YouCompleteMe debug information...
-- Client logfile: /tmp/ycm_tcrryhfo.log
-- Server Python interpreter: /usr/bin/python2.7
-- Server Python version: 2.7.14
-- Server has Clang support compiled in: True
-- Clang version: clang version 3.9.1 (tags/RELEASE_391/final)
-- Extra configuration file found and loaded
-- Extra configuration path: /home/jake/project/.ycm_extra_conf.py
-- C-family completer debug information:
-- Compilation database path: None
-- Flags: ['-std=c++11', '-x', 'c++', '-Wall', '-I', 'include', '-isystem', '/usr/include', '-resource-dir=/home/jake/.local/share/nvim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../clang_includes', '-fspell-checking']
-- Server running at: http://127.0.0.1:59337
-- Server process ID: 21577
-- Server logfiles:
-- /tmp/ycmd_59337_stdout_kndkmx3g.log
-- /tmp/ycmd_59337_stderr__xriaszp.log
服务器日志文件中没有错误,但客户端日志文件有一些错误,最终以以下开头:
Traceback (most recent call last):
File "/home/jake/.local/share/nvim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/home/jake/.local/share/nvim/plugged/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 237, in CheckIfServerIsReady
'ready' )
File "/home/jake/.local/share/nvim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 68, in GetDataFromHandler
timeout ) )
File "/home/jake/.local/share/nvim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 180, in JsonFromFuture
response = future.result()
File "/usr/lib64/python3.4/concurrent/futures/_base.py", line 402, in result
return self.__get_result()
File "/usr/lib64/python3.4/concurrent/futures/_base.py", line 354, in __get_result
raise self._exception
File "/home/jake/.local/share/nvim/plugged/YouCompleteMe/autoload/../python/ycm/unsafe_thread_pool_executor.py", line 43, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/jake/.local/share/nvim/plugged/YouCompleteMe/third_party/ycmd/third_party/requests/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/home/jake/.local/share/nvim/plugged/YouCompleteMe/third_party/ycmd/third_party/requests/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/home/jake/.local/share/nvim/plugged/YouCompleteMe/third_party/ycmd/third_party/requests/requests/adapters.py", line 437, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=34155): Max retries exceeded with url: /ready (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f32a77aa048>: Failed to establish a new connection: [Errno 111] Connection refused',))
除此之外,一切似乎都在工作,尽管它会在自动完成时提供超出范围的变量作为建议(建议不同类的成员变量)。
我按照完整的安装指南,将外部 clang 设置为 /usr/lib/libclang.so
我不知道是什么原因造成的。
【问题讨论】:
标签: linux vim gentoo neovim youcompleteme