C++ 開発用に Vim で YCM を動作させようとしています。私はJUCEフレームワークを使用しています。Ctags とオートコンプリートはうまく機能しています。ただし、「ガター」に赤い矢印として多くの間違ったエラーが表示されます。
例えば
no matching member function for call to 'addAndMakeVisible'
whenaddAndMakeVisible
は継承されたクラスの関数でありComponent
、オートコンプリートにも表示されます。
また、次のような多くのエラーが発生します。
cannot initialize object parameter of type 'juce::Component' with an expression of type 'MyComponent'
私.ycm_extra_conf.py
: https://gist.github.com/adamski/a793a24b026f68a1074e
絶対パスとローカル プロジェクト バージョンを使用して JUCE ライブラリを追加し、@ladislas の例から提案をコピーしました。
:YCMDebugInfo の出力 https://gist.github.com/adamski/2e7dd79b45d0fb6f5010#file-ycmdebuginfo
:YCMDiags の現在の出力https://gist.github.com/adamski/8fad8e0724a03854912b
問題を再現するリポジトリの例: https://github.com/adamski/juce-chapter02-07
私.vimrc
のように見えます:
"" YouCompleteMe options
"
let g:ycm_register_as_syntastic_checker = 0 "default 1
"let g:Show_diagnostics_ui = 1 "default 1
"
""will put icons in Vim's gutter on lines that have a diagnostic set.
"Turning this off will also turn off the YcmErrorLine and YcmWarningLine
""highlighting
set tags=./tags,tags;
set autochdir
let g:ycm_enable_diagnostic_signs = 1
let g:ycm_enable_diagnostic_highlighting = 1
let g:ycm_always_populate_location_list = 1 "default 0
let g:ycm_open_loclist_on_ycm_diags = 1 "default 1
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_complete_in_strings = 1 "default 1
let g:ycm_collect_identifiers_from_tags_files = 1 "default 0
let g:ycm_path_to_python_interpreter = '' "default ''
let g:ycm_server_use_vim_stdout = 0 "default 0 (logging to console)
let g:ycm_server_log_level = 'info' "default info
let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' "where to search for .ycm_extra_conf.py if not found
let g:ycm_confirm_extra_conf = 1
let g:ycm_goto_buffer_command = 'same-buffer' "[ 'same-buffer', 'horizontal-split', 'vertical-split', 'new-tab' ]
let g:ycm_filetype_whitelist = { '*': 1 }
let g:ycm_key_invoke_completion = '<C-Space>'
nnoremap <F11> :YcmForceCompileAndDiagnostics <CR>