deoplete-clang
deoplete-clang copied to clipboard
deoplete-clang can't deal with files open with Netrw
Problems summary
I recently tried to open a file over the scp:// protocol which is handled by Vim's "Netrw" plugin. When trying to autocomplete a word, the message
[deoplete] Traceback (most recent call last):
[deoplete] File "/home/me/.vim/bundle/repos/github.com/Shougo/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 100, in gather_results
[deoplete] ctx['candidates'] = source.gather_candidates(ctx)
[deoplete] File "/home/me/.vim/bundle/repos/github.com/zchee/deoplete-clang/rplugin/python3/deoplete/sources/deoplete_clang.py", line 151, in gather_candidates
[deoplete] params)
[deoplete] File "/home/me/.vim/bundle/repos/github.com/zchee/deoplete-clang/rplugin/python3/deoplete/sources/deoplete_clang.py", line 314, in get_completion
[deoplete] tu = self.get_translation_unit(fname, args, buf)
[deoplete] Traceback (most recent call last):
[deoplete] File "/home/me/.vim/bundle/repos/github.com/zchee/deoplete-clang/rplugin/python3/deoplete/sources/deoplete_clang.py", line 302, in get_translation_unit
[deoplete] File "/home/me/.vim/bundle/repos/github.com/Shougo/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 100, in gather_results
[deoplete] tu.save(ast_file)
[deoplete] ctx['candidates'] = source.gather_candidates(ctx)
[deoplete] File "/home/me/.vim/bundle/repos/github.com/zchee/deoplete-clang/rplugin/python3/deoplete/clang/clang/cindex.py", line 2638, in save
[deoplete] File "/home/me/.vim/bundle/repos/github.com/zchee/deoplete-clang/rplugin/python3/deoplete/sources/deoplete_clang.py", line 151, in gather_candidates
[deoplete] 'Error saving TranslationUnit.')
[deoplete] params)
[deoplete] clang.cindex.TranslationUnitSaveError: Error 1: Error saving TranslationUnit.
[deoplete] File "/home/me/.vim/bundle/repos/github.com/zchee/deoplete-clang/rplugin/python3/deoplete/sources/deoplete_clang.py", line 314, in get_completion
[deoplete] Could not get completions from: clang. Use :messages for error details.
[deoplete] tu = self.get_translation_unit(fname, args, buf)
[deoplete] File "/home/me/.vim/bundle/repos/github.com/zchee/deoplete-clang/rplugin/python3/deoplete/sources/deoplete_clang.py", line 302, in get_translation_unit
[deoplete] tu.save(ast_file)
[deoplete] File "/home/me/.vim/bundle/repos/github.com/zchee/deoplete-clang/rplugin/python3/deoplete/clang/clang/cindex.py", line 2638, in save
[deoplete] 'Error saving TranslationUnit.')
[deoplete] clang.cindex.TranslationUnitSaveError: Error 1: Error saving TranslationUnit.
[deoplete] Could not get completions from: clang. Use :messages for error details.
is shown.
Expected
No error message and the autocompletion popup is filled as it would be with a local file.
Environment Information
- OS: Gentoo GNU/Linux 4.4.6
- Neovim version: NVIM v0.2.0-44-g8089292
Provide a minimal init.vim with less than 50 lines and not plugin manager (Required!)
set runtimepath+=/tmp/deoplete.nvim/
set runtimepath+=~/tmp/deoplete-clang/
let g:deoplete#enable_at_startup = 1
The reproduce ways from neovim starting (Required!)
- run nvim -u /tmp/vimrc scp://server/tmp/tmp.c
- Press a (in order to go into insert mode)
- press "int". Once the 't' is pressed, the error messages will be shown.
Upload the log file
Since the log file is very large I uploaded it here: https://gist.github.com/glacambre/bb959fd61acd3385c95e8aa4b5e134d9 There's nothing interesting in my .nvimlog.
I think this is a bug with deoplete-clang because other autocompletion plugins (deoplete-jedi for example) do not have this bug.
The file in the remote server is not supported. And it is hard to test.
Alright, thanks. Do you know what the difference between deoplete-clang and deoplete-jedi is? Could the way deoplete-jedi works be implemented in deoplete-clang? (I'm willing to try to do it if you think it is)
@glacambre Thanks for issue. But sorry, Now I don't know why the only jedi haven't problem.
However,
Alright, thanks. Do you know what the difference between deoplete-clang and deoplete-jedi is? Could the way deoplete-jedi works be implemented in deoplete-clang? (I'm willing to try to do it if you think it is)
Note that now deoplete-clang will be planned dynamically change using zchee/clang-server backend.(now development). So, If you try to solve this problem(very thanks), only for deoplete-go is better.
Because all of the implementation will change, such as not using the libclang-python3 module, msgpack-rpc(or google/grpc) server/client architecture and deoplete-clang will client side only, or etc.
Note that now deoplete-clang will be planned dynamically change using zchee/clang-server backend.(now development). So, If you try to solve this problem(very thanks), only for deoplete-go is better.
Progress?
I work for deoplete parallel feature.