-
Notifications
You must be signed in to change notification settings - Fork 273
cquery
CQuery is a Low-latency language server for large C++ code-bases, powered by libclang.
let g:LanguageClient_serverCommands = {
\ 'cpp': ['yourCQueryDirectory/build/release/bin/cquery',
\ '--log-file=/tmp/cq.log',
\ '--init={"cacheDirectory":"/var/cquery/"}']
\ }
" Use an absolute configuration path if you want system-wide settings
" let g:LanguageClient_settingsPath = '/home/yourusername/.config/nvim/settings.json'
Make sure you have installed the latest versions of deoplete (after cbcdf10-20171203
) and LanguageClient-neovim (after https://github.com/autozimu/LanguageClient-neovim/pull/193 is merged).
Also install Neosnippet and configure:
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
to your kepmappings. After that you may invoke <C-k>
to expand and iterate over a completion item.
If you notice that certain completion candidates are missing (e.g. you know a function exists but you aren't seeing completions for it), try disabling the completion.filterAndSort
configuration option in cquery:
let g:LanguageClient_serverCommands = {
\ 'cpp': ['yourCQueryDirectory/build/release/bin/cquery',
\ '--log-file=/tmp/cq.log',
\ '--init={"cacheDirectory":"/var/cquery/", "completion": {"filterAndSort": false}}']
\ }
Completion plugins such as Deoplete already implement filtering/sorting logic, and cquery may omit certain suggestions if the suggestion text already appears in the buffer you're editing.