YouCompleteMe无法识别STL文件问题求助及相关疑问
Vim中YouCompleteMe无法识别STL文件的问题
在Vim中使用YouCompleteMe插件时,近期遇到了无法识别STL文件的问题,以下是相关调试信息:
:YcmDebugInfo输出信息
Printing YouCompleteMe debug information... -- Resolve completions: Up front -- Client logfile: /tmp/ycm_squvcfr3.log -- Server Python interpreter: /usr/bin/python3 -- Server Python version: 3.10.6 -- Server has Clang support compiled in: False -- Clang version: None -- No extra configuration file found -- C-family completer debug information: -- Clangd running -- Clangd process ID: 1295096 -- Clangd executable: ['/home/vailii/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clangd/output/bin/clangd', '-header-insertion-decorators=0', '-resource-dir=/home/vailii/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clang/lib/clang/15.0.1', '-limit-results=500'] -- Clangd logfiles: -- /tmp/clangd_stderr8_kc02pn.log -- Clangd Server State: Initialized -- Clangd Project Directory: /home/vailii/src/testTest -- Clangd Settings: {} -- Clangd Compilation Command: False -- Server running at: http://127.0.0.1:43779 -- Server process ID: 1295083 -- Server logfiles: -- /tmp/ycmd_43779_stdout_3fzpz77h.log -- /tmp/ycmd_43779_stderr_clzjpieb.log -- Semantic highlighting supported: True -- Virtual text supported: False -- Popup windows supported: True
clangd日志信息
2023-04-09 23:05:26,531 - INFO - Completion config: 50, detailing -1 candiates 2023-04-09 23:05:26,531 - INFO - Completion config: 50, detailing -1 candiates 2023-04-09 23:05:26,531 - INFO - Completion config: 50, detailing -1 candiates 2023-04-09 23:05:26,532 - INFO - Completion config: 50, detailing -1 candiates 127.0.0.1 - - [09/Apr/2023 23:05:26] "GET /ready HTTP/1.1" 200 4 2023-04-09 23:05:26,546 - INFO - Adding buffer identifiers for file: /home/vailii/src/testTest/src/main.cpp 2023-04-09 23:05:26,572 - INFO - Clangd executable found at /home/vailii/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clangd/output/bin and up to date 2023-04-09 23:05:26,572 - INFO - Using Clangd from /home/vailii/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clangd/output/bin/clangd 2023-04-09 23:05:26,572 - INFO - Computed Clangd command: ['/home/vailii/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clangd/output/bin/clangd', '-header-insertion-decorators=0', '-resource-dir=/home/vailii/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clang/lib/clang/15.0.1', '-limit-results=500'] 2023-04-09 23:05:26,573 - INFO - Completion config: 50, detailing -1 candiates 2023-04-09 23:05:26,573 - INFO - Returning cached Clangd command: ['/home/vailii/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clangd/output/bin/clangd', '-header-insertion-decorators=0', '-resource-dir=/home/vailii/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clang/lib/clang/15.0.1', '-limit-results=500'] 2023-04-09 23:05:26,574 - INFO - Starting Clangd: ['/home/vailii/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clangd/output/bin/clangd', '-header-insertion-decorators=0', '-resource-dir=/home/vailii/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clang/lib/clang/15.0.1', '-limit-results=500'] 127.0.0.1 - - [09/Apr/2023 23:05:26] "GET /signature_help_available?subserver=cpp HTTP/1.1" 200 23 127.0.0.1 - - [09/Apr/2023 23:05:26] "POST /event_notification HTTP/1.1" 200 2 2023-04-09 23:05:26,576 - INFO - Clangd started with PID 1295096 127.0.0.1 - - [09/Apr/2023 23:05:26] "POST /event_notification HTTP/1.1" 200 2 2023-04-09 23:05:26,601 - INFO - cfamily: Language server does not require resolve request 2023-04-09 23:05:26,601 - INFO - cfamily: Language server requires sync type of Incremental 2023-04-09 23:05:26,601 - INFO - cfamily: Using characters for signature triggers: (,),{,},<,>, 127.0.0.1 - - [09/Apr/2023 23:05:26] "POST /semantic_completion_available HTTP/1.1" 200 4 127.0.0.1 - - [09/Apr/2023 23:05:26] "POST /receive_messages HTTP/1.1" 200 3017 127.0.0.1 - - [09/Apr/2023 23:05:31] "POST /debug_info HTTP/1.1" 200 800 127.0.0.1 - - [09/Apr/2023 23:05:36] "POST /receive_messages HTTP/1.1" 200 4 127.0.0.1 - - [09/Apr/2023 23:05:46] "POST /receive_messages HTTP/1.1" 200 4 127.0.0.1 - - [09/Apr/2023 23:05:56] "POST /receive_messages HTTP/1.1" 200 4 127.0.0.1 - - [09/Apr/2023 23:06:07] "POST /receive_messages HTTP/1.1" 200 4 127.0.0.1 - - [09/Apr/2023 23:06:17] "POST /receive_messages HTTP/1.1" 200 4
已尝试的解决方法
- 执行
python3 install.py --clangd-completer重新配置YCM - 设置
g:ycm_clangd_binary_path参数,改用系统clangd
疑问与求助
注意到:YcmDebugInfo中显示以下内容:
-- Server has Clang support compiled in: False -- Clang version: None
但clangd明明处于运行状态,这种情况是否正常?希望能找到修复方法,让YCM(或clangd)正常识别STL文件。
内容的提问来源于stack exchange,提问作者Vasilii
相关产品推荐
相关产品推荐

