Shougo / ddc.vim

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

onCompleteDone is not fired #126

Closed uga-rosa closed 1 year ago

uga-rosa commented 1 year ago

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

Problems summary

ddc-source's onCompleteDone does not fire in pum#map#confirm().

Expected

Be fired.

Environment Information

Latest

Provide a minimal init.vim/vimrc without plugin managers (Required!)

set runtimepath+=/path/to/denops.vim
set runtimepath+=/path/to/ddc.vim
set runtimepath+=/path/to/ddc-ui-pum
set runtimepath+=/path/to/pum.vim

call ddc#custom#patch_global(#{
      \ ui: 'pum',
      \ sources: ['test']
      \})

inoremap <C-n> <Cmd>call pum#map#insert_relative(+1)<CR>
inoremap <C-p> <Cmd>call pum#map#insert_relative(-1)<CR>
inoremap <C-y> <Cmd>call pum#map#confirm()<CR>

call ddc#enable()

Source for test

type Params = Record<string, never>;

export class Source extends BaseSource { gather( _args: GatherArguments, ): Promise { return Promise.resolve({ items: [ { word: "test1" }, { word: "test2" }, ], isIncomplete: false, }); }

onCompleteDone( args: OnCompleteDoneArguments, ): Promise { console.log(args); return Promise.resolve(); }

params(): Params { return {}; } }



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

1. Input `te`.
2. Select a candidate with `<C-n>/<C-p>` and confirm with `<C-y>`.
3. Argument of onCompleteDone is not output

## Screenshot (if possible)

## Upload the log messages by `:redir` and `:message` (if errored)
Shougo commented 1 year ago

Please see this.

                    *ddc-source-attribute-onCompleteDone*
onCompleteDone      (function)          (Optional)
        Called after the completion.
        It is useful to substitute text after completion.
        NOTE: |ddc-item-attribute-user_data| must be "UserData" to use
        the feature.

user_data is needed for the feature.