Shougo / ddc.vim

Dark deno-powered completion framework for Vim/NeoVim
MIT License
668 stars 33 forks source link

no pum when inserting a dot #84

Closed blithefeng closed 2 years ago

blithefeng commented 2 years ago

Problems summary

I configured ddc.vim and vim-lsp as source. When I edited a file in a "go.mod" project, <Tab> can trigger a complete as expected. But there's no complete when i insert a dot

Expected

a complete popup should show up

Environment Information

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

" Your minimal init.vim/vimrc
set runtimepath+=~/path/to/ddc.vim/
" Async LSP plugin
Plug 'prabirshrestha/vim-lsp'

Plug 'Shougo/ddc.vim'
Plug 'vim-denops/denops.vim'

" ddc.vim sources
Plug 'shun/ddc-vim-lsp'

" ddc.vim filters
Plug 'Shougo/ddc-matcher_head'
Plug 'Shougo/ddc-sorter_rank'

call ddc#enable()

inoremap <silent><expr> <TAB>
            \ ddc#map#pum_visible() ? '<C-n>' :
            \ (col('.') <= 1 <Bar><Bar> getline('.')[col('.') - 2] =~# '\s') ?
            \ '<TAB>' : ddc#map#manual_complete()

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

  1. Install gopls and create a go.mod project
  2. Configure vim using ddc and vim-lsp as source
  3. Edit a main file and insert like "fmt."

Screenshot (if possible)

截屏2022-01-19 上午12 56 39
Shougo commented 2 years ago

You should know what is ddc.vim. It works as expected. You don't configure to complete when inserting dot.

call ddc#custom#patch_global('sourceOptions', {
      \ 'nvim-lsp': {
      \   'mark': 'lsp',
      \   'forceCompletionPattern': '\.\w*|:\w*|->\w*' },
      \ })

You should read the plugin documentation.

Note: You don't configure both matcher_head and sorter_rank. It does not work. ddc.vim is not zero configuration plugin,

Shougo commented 2 years ago

Configure vim using ddc and vim-lsp as source

Why the configuration is not exists in your minimal vimrc?

blithefeng commented 2 years ago

Sorry for incomplete information. With "forceCompletionPattern" It works good. Thanks!