Skip to content
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

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

Open
glacambre opened this issue Dec 16, 2016 · 4 comments
Open

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

glacambre opened this issue Dec 16, 2016 · 4 comments

Comments

@glacambre
Copy link

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.

@Shougo
Copy link
Collaborator

Shougo commented Dec 16, 2016

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

@glacambre
Copy link
Author

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)

@zchee
Copy link
Member

zchee commented Dec 17, 2016

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

@Shougo
Copy link
Collaborator

Shougo commented Jan 26, 2018

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.

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

No branches or pull requests

3 participants