Languageclient-neovim: Failed to work with cquery

Created on 19 Nov 2017  路  2Comments  路  Source: autozimu/LanguageClient-neovim

filetype on
filetype plugin on
set shell=/bin/bash
call plug#begin('~/.local/share/nvim/plugged')

Plug 'autozimu/LanguageClient-neovim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/deoplete.nvim'

call plug#end()

let g:LanguageClient_autoStart = 1  
let g:LanguageClient_settingsPath = '/home/lz/.config/nvim/settings.json'
let g:LanguageClient_loadSettings = 1

let g:LanguageClient_serverCommands = {
  \ 'cpp': ['cquery', '--language-server'],
\ }
let g:deoplete#omni_patterns = {}
let g:deoplete#omni_patterns.cpp = '[^. *\t]\.\w*|[^. *\t]\::\w*|[^. *\t]\->\w*|#include\s*[<"][^>"]*'
let g:deoplete#omni#functions={}
let g:deoplete#omni#functions.cpp = ['LanguageClient#complete']
let g:deoplete#enable_at_startup = 1

settings.json:

{
        "initializationOptions": {
                "cacheDirectory": "/tmp/cquery"
        }
}
  • Content of :CheckHealth: All OK
  • Content of ~/.local/share/nvim/rplugin.vim.
" python3 plugins
call remote#host#RegisterPlugin('python3', '/home/lz/.local/share/nvim/plugged/LanguageClient-neovim/rplugin/python3/LanguageClient', [
      \ {'sync': v:true, 'name': 'LanguageClient_alive', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_call', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_completionItem/resolve', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_completionManager_refresh', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_exit', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_FZFSinkTextDocumentCodeAction', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_FZFSinkTextDocumentDocumentSymbol', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_FZFSinkTextDocumentReferences', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_FZFSinkWorkspaceSymbol', 'type': 'function', 'opts': {}},
      \ {'sync': v:true, 'name': 'LanguageClient_getState', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'BufReadPost', 'type': 'autocmd', 'opts': {'pattern': '*', 'eval': '[{''buftype'': &buftype, ''languageId'': &filetype, ''filename'': expand(''%:p'')}]'}},
      \ {'sync': v:false, 'name': 'BufWritePost', 'type': 'autocmd', 'opts': {'pattern': '*', 'eval': '[{''languageId'': &filetype, ''filename'': expand(''%:p'')}]'}},
      \ {'sync': v:false, 'name': 'CursorMoved', 'type': 'autocmd', 'opts': {'pattern': '*', 'eval': '[{''buftype'': &buftype, ''line'': line(''.'')}]'}},
      \ {'sync': v:false, 'name': 'TextChanged', 'type': 'autocmd', 'opts': {'pattern': '*', 'eval': '[{''filename'': expand(''%:p''), ''buftype'': &buftype}]'}},
      \ {'sync': v:false, 'name': 'TextChangedI', 'type': 'autocmd', 'opts': {'pattern': '*', 'eval': '[{''filename'': expand(''%:p''), ''buftype'': &buftype}]'}},
      \ {'sync': v:false, 'name': 'LanguageClient_initialize', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_notify', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_registerServerCommands', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_rustDocument_implementations', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_setLoggingLevel', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClientStart', 'type': 'command', 'opts': {'nargs': '*', 'range': ''}},
      \ {'sync': v:false, 'name': 'LanguageClientStop', 'type': 'command', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_textDocument_codeAction', 'type': 'function', 'opts': {}},
      \ {'sync': v:true, 'name': 'LanguageClient_textDocument_completion', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_textDocument_completionOmnifunc', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_textDocument_definition', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'textDocument_didChange', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_textDocument_didClose', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'textDocument_didSave', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_textDocument_documentSymbol', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_textDocument_formatting', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_textDocument_hover', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_textDocument_rangeFormatting', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_textDocument_references', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_textDocument_rename', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_textDocument_signatureHelp', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_workspace_didChangeConfiguration', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_workspace_executeCommand', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'LanguageClient_workspace_symbol', 'type': 'function', 'opts': {}},
     \ ])
call remote#host#RegisterPlugin('python3', '/home/lz/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete', [
      \ {'sync': v:false, 'name': '_deoplete_init', 'type': 'function', 'opts': {}},
     \ ])


" ruby plugins


" python plugins

  • Language server name and version: cquery, 667-c99512e5
  • Reproduction steps (from clean state): Open a.cpp, type:
#include <iostream>
int main()
{
    std::cin.
}

some incorrect results appeared after std::, and no completion appeared after the dot or std::cin.c.

  • Run :call LanguageClient_setLoggingLevel('DEBUG') and then
    :LanguageClientStart, reproduce the bug, attach contents of
    /tmp/LanguageClient.log and /tmp/LanguageServer.log.

LanguageServer.log
LanguageClient.log

Most helpful comment

FWIW I'm happy to integrate any needed changes into the main cquery repo and/or add dedicated vimscript there, though I'm not super familiar with vimscript so I can only answer questions w.r.t. cquery. Please feel free to check out the gitter.

All 2 comments

FWIW I'm happy to integrate any needed changes into the main cquery repo and/or add dedicated vimscript there, though I'm not super familiar with vimscript so I can only answer questions w.r.t. cquery. Please feel free to check out the gitter.

With the adding of project setting support, I don't see there is any main blocker.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mqudsi picture mqudsi  路  3Comments

nabezokodaikon picture nabezokodaikon  路  4Comments

norcalli picture norcalli  路  4Comments

languitar picture languitar  路  7Comments

fortes picture fortes  路  7Comments