YouCompleteMe无法找到本地头文件

时间:2017-11-12 06:43:39

标签: linux vim gentoo neovim youcompleteme

我目前有一个结构如此的项目

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',))

除此之外,一切似乎都有效,尽管它会提供超出范围的变量作为自动填充时的建议(建议不同类的成员变量)。

我按照完整的安装指南将外部铿锵声设置为/usr/lib/libclang.so

我不知道造成这种情况的原因。

1 个答案:

答案 0 :(得分:1)

默认*ngFor不会在附近的.ycm_extra_conf.py目录中查找标题。

此查找在JDevlieghere's configuration中完成,我也适应为包含路径根添加标记(在函数include中):

FlagsForInclude