Shougo / deoplete.nvim

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

Auto Suggestions works only for buffer, while <C-x><C-o> is giving language based suggestions #690

Closed grmano closed 6 years ago

grmano commented 6 years ago

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

I transitioned to NeoVim recently and being struggling to get deoplete autocompletion working. Apparently it only works for buffers and some other strange suggestions, while works as i would expect.

Deoplete -

deoplete.png

ControlX - controlx.png

Expected

Completion with meaningful suggestions

Environment Information

checkhealth.png

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

Plug 'Shougo/neosnippet'
Plug 'Shougo/neosnippet-snippets'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } "Auto completion
Plug 'carlitux/deoplete-ternjs', { 'do': 'npm install -g tern' }

filetype plugin indent on    " required

if has("syntax")
    syntax on
endif

set runtimepath +=~/.local/share/nvim/plugged/deoplete.nvim/
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_ignore_case = 1
let g:deoplete#enable_smart_case = 1
let g:deoplete#enable_camel_case = 1
let g:deoplete#enable_refresh_always = 1
let g:deoplete#max_abbr_width = 0
let g:deoplete#max_menu_width = 0
let g:deoplete#omni#input_patterns = get(g:,'deoplete#omni#input_patterns',{})

let g:tern_request_timeout = 1
let g:tern_request_timeout = 6000
let g:tern#command = ["tern"]
let g:tern#arguments = ["--persistent"]

let g:deoplete#sources#ternjs#tern_bin = '/path/to/tern_bin'

" deoplete tab-complete
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
" tern
autocmd FileType javascript nnoremap <silent> <buffer> gb :TernDef<CR>

The reproduce ways from neovim/Vim starting (Required!)

  1. nvim
  2. has('python3') gives 1
  3. Did UpdateRemotePluggin
Shougo commented 6 years ago

It is not deoplete issue.

It is just "deoplete-tern does not work". You should ask it in deoplete-tern repository.

let g:deoplete#sources#ternjs#tern_bin = '/path/to/tern_bin'

This location is correct?

nvim-typescript is available. It may work. https://github.com/mhartington/nvim-typescript