Shougo / deoplete.nvim

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

Failed to integrate with ALE: completion window won't show up after setting sources to ale #1164

Closed glyh closed 3 years ago

glyh commented 3 years ago

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

Problems summary

After setting the completion source to ALE, the completion window won't show up.

Expected

completion window shows up.

Environment Information

 silent! let g:plugs['ale'].commit = '88d052b5a9ee3a41364497e1b98f01305d01df35'
 silent! let g:plugs['deoplete.nvim'].commit = '27af4ab2de157f80c8a8391aebb60061318814ea'
Linux arch 5.10.15-arch1-1 #1 SMP PREEMPT Wed, 10 Feb 2021 18:32:40 +0000 x86_64 GNU/Linux

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

 * `:checkhealth` or `:CheckHealth` result(neovim only):

:version NVIM v0.4.4 Build type: Release LuaJIT 2.0.5 Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion - Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATE D_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/ src/neovim-0.4.4/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include Compiled by builduser

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

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

```vim
" Your minimal init.vim/vimrc

call plug#begin('~/.vim/plugged')
" Tools
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " autocomplete
Plug 'dense-analysis/ale' " linter

call plug#end()

" deoplete.nvim
call deoplete#custom#option('sources', {
\ '_': ['ale'],
\})
let g:deoplete#enable_at_startup = 1

How to reproduce the problem from neovim/Vim startup (Required!)

  1. Create some empty *.clj file
  2. Write '(def '
  3. No auto completion window appears

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}

Sorry but I don't know how to...

Screenshot (if possible)

2021-02-18_02-06

Upload the log file

glyh commented 3 years ago

by the way, I've got joker and clj-kondo installed.

Shougo commented 3 years ago

I have tested ale, it checks linters lsp feature.

" This function can be called to check if ALE can provide completion data for
" the current buffer. 1 will be returned if there's a potential source of
" completion data ALE can use, and 0 will be returned otherwise.
function! ale#completion#CanProvideCompletions() abort
    for l:linter in ale#linter#Get(&filetype)
        if !empty(l:linter.lsp)
            return 1
        endif
    endfor

    return 0
endfunction

by the way, I've got joker and clj-kondo installed.

But both joker and clj-kondo does not provide lsp feature. So the completion does not work as expected.

Closing.