Shougo / deoplete.nvim

:stars: Dark powered asynchronous completion framework for neovim/Vim8
Other
5.93k stars 295 forks source link

The omnifunc rubycomplete#Complete #420

Closed ikouchiha47 closed 7 years ago

ikouchiha47 commented 7 years ago

Warning: I will close the issue without the minimal init.vim and the reproduce ways.

Problems summary

I am trying to do rails developement, in neovim, I am using the vim-rails and deoplete. I did a sudo gem install neovim.

It shows a ruby plugin attempted to call neovim outside main thread, which is not yet supported by neovim gem.

Expected

Expected either to auto-complete or not to produce errors

Environment Information

health#deoplete#check
========================================================================
## deoplete.nvim
  - SUCCESS: has("nvim") was successful
  - SUCCESS: has("python3") was successful
  - INFO: If you're still having problems, try the following commands:
    $ export NVIM_PYTHON_LOG_FILE=/tmp/log
    $ export NVIM_PYTHON_LOG_LEVEL=DEBUG
    $ nvim
    $ cat /tmp/log_{PID}
    and then create an issue on github

health#nvim#check
========================================================================
## Configuration
  - SUCCESS: no issues found

## Performance
  - SUCCESS: Build type: RelWithDebInfo

## Remote Plugins
  - SUCCESS: Up to date

## terminfo
  - ERROR: key_backspace (kbs) entry is ^H (ASCII DELETE): key_backspace=^H,

    - SUGGESTIONS:
      - Set key_backspace to \177 (ASCII BACKSPACE). Run these commands:
          infocmp $TERM | sed 's/kbs=^[hH]/kbs=\\177/' > $TERM.ti
          tic $TERM.ti
      - See https://github.com/neovim/neovim/wiki/FAQ

health#provider#check
========================================================================
## Clipboard
  - SUCCESS: Clipboard tool found: pbcopy

## Python 2 provider
  - WARNING: No Python interpreter was found with the neovim module.  Using the first available for diagnostics.
  - WARNING: provider/pythonx: Could not load Python 2:
    python2 not found in search path or not executable.
    /usr/bin/python2.7 does not have the neovim module installed. See |provider-python|.
    /usr/bin/python2.6 does not have the neovim module installed. See |provider-python|.
    /usr/bin/python does not have the neovim module installed. See |provider-python|.
  - INFO: `g:python_host_prog` is not set.  Searching for python2.7 in the environment.
  - INFO: Executable: /usr/bin/python2.7
  - ERROR: Command error (9) /usr/bin/python2.7 -c import neovim; print(neovim.__file__): Traceback (most recent call last):  File "<string>", line 1, in <module>ImportError: No module named neovim
  - INFO: Python2 version: 2.7.10
  - INFO: python2.7-neovim version: unable to find nvim executable
  - ERROR: Neovim Python client is not installed.
    - SUGGESTIONS:
      - Error found was: unable to find nvim executable
      - Use the command `$ pip2 install neovim`
  - WARNING: Latest python2.7-neovim is NOT installed: 0.1.13

## Python 3 provider
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/local/bin/python3
  - INFO: Python3 version: 3.6.0
  - INFO: python3-neovim version: 0.1.13
  - SUCCESS: Latest python3-neovim is installed: 0.1.13

## Ruby provider
  - SUCCESS: Found up-to-date neovim RubyGem
  - INFO: Ruby Version: jruby 9.1.0.0 (2.3.0) 2016-05-02 a633c63 Java HotSpot(TM) 64-Bit Server VM 25.112-b16 on 1.8.0_112-b16 +jit [darwin-x86_64]
  - INFO: Host Executable: /Users/amitava/.gem/jruby/2.3.0/bin/neovim-ruby-host
  - INFO: Host Version: 0.3.1
## Neovim Python Diagnostic

- Neovim Version: NVIM v0.1.4-180-g2ba30a7

## Python versions visible to Neovim

### 'python' info from /usr/local/bin/nvim

WARN: 'g:python_host_prog' is not set
WARN: Fallback to '/usr/bin/python'
**Python Version**: `Python 3.5.1`
**Neovim Package Version**: `neovim (0.1.7)
neovim-gui (0.1.2)
neovim-remote (1.1.3)`

### 'python3' info from /usr/local/bin/nvim

WARN: 'g:python3_host_prog' is not set
WARN: Fallback to '/usr/bin/python3'
**Python Version**: `Python 3.5.1`
**Neovim Package Version**: `neovim (0.1.7)
neovim-gui (0.1.2)
neovim-remote (1.1.3)`

## Python versions visible in the current shell

- **python** version: `Python 3.5.1`
  - **neovim** version: `neovim (0.1.7)
neovim-gui (0.1.2)
neovim-remote (1.1.3)`
- **python3** version: `Python 3.5.1`
  - **neovim** version: `neovim (0.1.7)
neovim-gui (0.1.2)
neovim-remote (1.1.3)`

Provide a minimal init.vim with less than 50 lines (Required!)

"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
  set nocompatible               " Be iMproved
endif

let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')

let g:vim_bootstrap_langs = "c,elixir,go,javascript,ocaml,ruby"
let g:vim_bootstrap_editor = "nvim"             " nvim or vim

if !filereadable(vimplug_exists)
  echo "Installing Vim-Plug..."
  echo ""
  silent !\curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  let g:not_finish_vimplug = "yes"

  autocmd VimEnter * PlugInstall
endif

" Required:
call plug#begin(expand('~/.config/nvim/plugged'))

"*****************************************************************************
"" Plug install packages
"*****************************************************************************
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'airblade/vim-gitgutter'
Plug 'vim-scripts/grep.vim'
Plug 'vim-scripts/CSApprox'
Plug 'bronson/vim-trailing-whitespace'
Plug 'Raimondi/delimitMate'
Plug 'majutsushi/tagbar'
Plug 'scrooloose/syntastic'
Plug 'Yggdroot/indentLine'
Plug 'avelino/vim-bootstrap-updater'
Plug 'sheerun/vim-polyglot'
Plug 'derekwyatt/vim-scala'
Plug 'Shougo/deoplete.nvim'
Plug 'dracula/vim'

:imap zz <Esc>
let g:make = 'gmake'
if exists('make')
        let g:make = 'make'
endif
Plug 'Shougo/vimproc.vim', {'do': g:make}

"" Vim-Session
Plug 'xolox/vim-misc'
Plug 'xolox/vim-session'

if v:version >= 703
  Plug 'Shougo/vimshell.vim'
endif

if v:version >= 704
  "" Snippets
  " Plug 'SirVer/ultisnips'
  Plug 'FelikZ/ctrlp-py-matcher'
endif

Plug 'honza/vim-snippets'

"" Color
Plug 'tomasr/molokai'

"*****************************************************************************
"" Custom bundles
"*****************************************************************************

" c
Plug 'vim-scripts/c.vim', {'for': ['c', 'cpp']}
Plug 'ludwig/split-manpage.vim'

" elixir
Plug 'elixir-lang/vim-elixir'
Plug 'carlosgaldino/elixir-snippets'

" go
"" Go Lang Bundle
Plug 'fatih/vim-go', {'do': ':GoInstallBinaries'}

" javascript
"" Javascript Bundle
Plug 'jelera/vim-javascript-syntax'

" ocaml
"" OCaml Bundle
Plug 'def-lkb/ocp-indent-vim'

" ruby
Plug 'tpope/vim-rails'
Plug 'tpope/vim-rake'
Plug 'tpope/vim-projectionist'
Plug 'thoughtbot/vim-rspec'
Plug 'ecomba/vim-ruby-refactoring'

" Use deoplete.
let g:deoplete#enable_at_startup = 1
"*****************************************************************************
"*****************************************************************************

"" Include user's extra bundle
if filereadable(expand("~/.config/nvim/local_bundles.vim"))
  source ~/.config/nvim/local_bundles.vim
endif

call plug#end()

" Required:
filetype plugin indent on

"*****************************************************************************
"" Basic Setup
"*****************************************************************************"
"" Encoding
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8
set bomb
set binary

"" Fix backspace indent
set backspace=indent,eol,start

"" Tabs. May be overriten by autocmd rules
set tabstop=4
set softtabstop=0
set shiftwidth=4
set expandtab

"" Map leader to ,
let mapleader=','

"" Enable hidden buffers
set hidden

"" Searching
set hlsearch
set incsearch
set ignorecase
set smartcase

"" Directories for swp files
set nobackup
set noswapfile

set fileformats=unix,dos,mac
set showcmd
set shell=/bin/sh

" session management
let g:session_directory = "~/.config/nvim/session"
let g:session_autoload = "no"
let g:session_autosave = "no"
let g:session_command_aliases = 1

"*****************************************************************************
"" Visual Settings
"*****************************************************************************
syntax on
set ruler
set number

let no_buffers_menu=1
if !exists('g:not_finish_vimplug')
  colorscheme molokai 
endif

set mousemodel=popup
set t_Co=256
set guioptions=egmrti
set gfn=Monospace\ 10

if has("gui_running")
  if has("gui_mac") || has("gui_macvim")
    set guifont=Menlo:h12
    set transparency=7
  endif
else
  let g:CSApprox_loaded = 1

  " IndentLine
  let g:indentLine_enabled = 1
  let g:indentLine_concealcursor = 0
  let g:indentLine_char = '┆'
  let g:indentLine_faster = 1

endif

" terminal emulation
if g:vim_bootstrap_editor == 'nvim'
  nnoremap <silent> <leader>sh :terminal<CR>
else
  nnoremap <silent> <leader>sh :VimShellCreate<CR>
endif

"*****************************************************************************
"" Functions
"*****************************************************************************
if !exists('*s:setupWrapping')
  function s:setupWrapping()
    set wrap
    set wm=2
    set textwidth=79
  endfunction
endif

"*****************************************************************************
"" Autocmd Rules
"*****************************************************************************
"" The PC is fast enough, do syntax highlight syncing from start
augroup vimrc-sync-fromstart
  autocmd!
  autocmd BufEnter * :syntax sync fromstart
augroup END

"" Remember cursor position
augroup vimrc-remember-cursor-position
  autocmd!
  autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
augroup END

"" txt
augroup vimrc-wrapping
  autocmd!
  autocmd BufRead,BufNewFile *.txt call s:setupWrapping()
augroup END

"" make/cmake
augroup vimrc-make-cmake
  autocmd!
  autocmd FileType make setlocal noexpandtab
  autocmd BufNewFile,BufRead CMakeLists.txt setlocal filetype=cmake
augroup END

set autoread

autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4

augroup completion_preview_close
  autocmd!
  if v:version > 703 || v:version == 703 && has('patch598')
    autocmd CompleteDone * if !&previewwindow && &completeopt =~ 'preview' | silent! pclose | endif
  endif
augroup END

" javascript
let g:javascript_enable_domhtmlcss = 1

" vim-javascript
augroup vimrc-javascript
  autocmd!
  autocmd FileType javascript set tabstop=4|set shiftwidth=4|set expandtab softtabstop=4 smartindent
augroup END

" ocaml
" Add Merlin to rtp

" let g:opamshare = substitute(system('opam config var share'),'\n$','','''')
" execute "set rtp+=" . g:opamshare . "/merlin/vim"

" Set Merlin as Syntastic checker for OCaml
" let g:syntastic_ocaml_checkers = ['merlin']

" ruby
let g:rubycomplete_buffer_loading = 1
let g:rubycomplete_classes_in_global = 1
let g:rubycomplete_rails = 1

augroup vimrc-ruby
  autocmd!
  autocmd BufNewFile,BufRead *.rb,*.rbw,*.gemspec setlocal filetype=ruby
  autocmd FileType ruby set tabstop=2|set shiftwidth=2|set expandtab softtabstop=2 smartindent
augroup END

let g:tagbar_type_ruby = {
    \ 'kinds' : [
        \ 'm:modules',
        \ 'c:classes',
        \ 'd:describes',
        \ 'C:contexts',
        \ 'f:methods',
        \ 'F:singleton methods'
    \ ]
\ }

" RSpec.vim mappings
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>

" Ruby refactory
nnoremap <leader>rap  :RAddParameter<cr>
nnoremap <leader>rcpc :RConvertPostConditional<cr>
nnoremap <leader>rel  :RExtractLet<cr>
vnoremap <leader>rec  :RExtractConstant<cr>
vnoremap <leader>relv :RExtractLocalVariable<cr>
nnoremap <leader>rit  :RInlineTemp<cr>
vnoremap <leader>rrlv :RRenameLocalVariable<cr>
vnoremap <leader>rriv :RRenameInstanceVariable<cr>
vnoremap <leader>rem  :RExtractMethod<cr>

"*****************************************************************************
"*****************************************************************************

"" Include user's local vim config
if filereadable(expand("~/.config/nvim/local_init.vim"))
  source ~/.config/nvim/local_init.vim
endif

The reproduce ways from neovim starting (Required!)

  1. foo
  2. bar
  3. baz

Generate a logfile if appropriate

  1. export NVIM_PYTHON_LOG_FILE=/tmp/log
  2. export NVIM_PYTHON_LOG_LEVEL=DEBUG
  3. nvim -u minimal.vimrc
  4. some works
  5. cat /tmp/log_{PID}

Screen shot (if possible)

screen shot 2017-01-18 at 11 20 17 am

Upload the log file

ikouchiha47 commented 7 years ago

For now I have disabled deoplete and am relying on vim's omnicompletion.

Shougo commented 7 years ago

@argentum47 I cannot reproduce the issue with minimal init.vim. I think your neovim version is not the latest. Please update neovim manually.

Shougo commented 7 years ago

And, your init.vim is not the minimal. Please read the other issues. Your reproduce way is broken.

Shougo commented 7 years ago

You should use deoplete-rct instead. https://github.com/Shougo/deoplete-rct