Shougo / ddu.vim

Dark deno-powered UI framework for Vim/NeoVim
MIT License
295 stars 24 forks source link

Can't use aliased things #68

Closed kuuote closed 1 year ago

kuuote commented 1 year ago

Problems summary

sourceなどのaliasを作成して使おうとするとエラーが発生して起動しません。

Expected

以前と同じように使用できるようになってほしいです。

Environment Information

Provide a minimal init.vim/vimrc without plugin managers

set rtp+=/path/to/Shougo/ddu-filter-matcher_substring
set rtp+=/path/to/Shougo/ddu-source-file
set rtp+=/path/to/Shougo/ddu-ui-ff
set rtp+=/path/to/Shougo/ddu.vim
set rtp+=/path/to/vim-denops/denops.vim

call ddu#custom#alias('source', 'f', 'file')
call ddu#custom#alias('filter', 'm', 'matcher_substring')
call ddu#custom#alias('ui', 'f', 'ff')
call ddu#custom#patch_global('sourceOptions', #{file: #{matchers: ['matcher_substring']}})
call ddu#custom#patch_global('sources', [#{name: 'file'}])
call ddu#custom#patch_global('ui', 'ff')
nnoremap a <Cmd>call ddu#start()<CR>
" filter alias
nnoremap b <Cmd>call ddu#start(#{sourceOptions: #{file: #{matchers: ['m']}}})<CR>
" source alias
nnoremap c <Cmd>call ddu#start(#{sources: [#{name: 'f'}]})<CR>
" ui alias
nnoremap d <Cmd>call ddu#start(#{ui: 'f'})<CR>

How to reproduce the problem from neovim/Vim startup

上記のvimrcを使用してVim/Neovimを起動します。 aを押したら正しく起動しますが、b, c, dだとエラーが起きます。

Note

https://github.com/Shougo/ddu.vim/commit/a088887257ae75f6eb10551eeb21fea56bacdb90 こちらのコミット以降再現します。

Upload the log messages by :redir and :message (if errored)

[denops] Failed to handle message 2,invoke,dispatch,ddu,start,[object Object] TypeError: Cannot read properties of undefined (reading 'Source')
[denops]     at Extension.getSource (file:///tmp/dein/cache/nvim/.cache/init.vim/.dein/denops/ddu/loader.ts:176:31)
[denops]     at Loader.getSource (file:///tmp/dein/cache/nvim/.cache/init.vim/.dein/denops/ddu/loader.ts:90:37)
[denops]     at Ddu.getSource (file:///tmp/dein/cache/nvim/.cache/init.vim/.dein/denops/ddu/ddu.ts:1452:32)
[denops]     at async Ddu.start (file:///tmp/dein/cache/nvim/.cache/init.vim/.dein/denops/ddu/ddu.ts:221:53)
[denops]     at async file:///tmp/dein/cache/nvim/.cache/init.vim/.dein/denops/ddu/app.ts#379.791514:202:9
[denops]     at async Lock.lock (https://deno.land/x/async@v2.0.2/lock.ts:51:14)
[denops]     at async Object.start (file:///tmp/dein/cache/nvim/.cache/init.vim/.dein/denops/ddu/app.ts#379.791514:180:7)
[denops]     at async dispatch (https://deno.land/x/messagepack_rpc@v2.0.1/dispatcher.ts:36:12)
[denops]     at async Session.#dispatch (https://deno.land/x/messagepack_rpc@v2.0.1/session.ts:244:22)
[denops]     at async Session.#handleRequestMessage (https://deno.land/x/messagepack_rpc@v2.0.1/session.ts:271:33)
Shougo commented 1 year ago

Reproduced. It is broken by #65 .

Shougo commented 1 year ago

Fixed.