Skip to content

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

@glacambre

Description

@glacambre

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions