deoplete-clang icon indicating copy to clipboard operation
deoplete-clang copied to clipboard

deoplete-clang can't deal with files open with Netrw

Open glacambre opened this issue 7 years ago • 4 comments

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!)

  1. run nvim -u /tmp/vimrc scp://server/tmp/tmp.c
  2. Press a (in order to go into insert mode)
  3. 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.

glacambre avatar Dec 16 '16 13:12 glacambre

The file in the remote server is not supported. And it is hard to test.

Shougo avatar Dec 16 '16 20:12 Shougo

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 avatar Dec 17 '16 04:12 glacambre

@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.

zchee avatar Dec 17 '16 05:12 zchee

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.

Shougo avatar Jan 26 '18 02:01 Shougo