Skip to content

Failed to work with cquery #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
htfy96 opened this issue Nov 19, 2017 · 2 comments
Closed

Failed to work with cquery #181

htfy96 opened this issue Nov 19, 2017 · 2 comments

Comments

@htfy96
Copy link

htfy96 commented Nov 19, 2017

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

@jacobdufault
Copy link

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.

@autozimu
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants