tani / ddc-path

Path completion for ddc.vim. This source collects path names with GNU find or sharkdp/fd.
15 stars 5 forks source link

Cannot trigger completions from this source. Something I am missing? #4

Closed jeffwillette closed 2 years ago

jeffwillette commented 2 years ago

I have other sources of ddc which are working just fine, but I cannot trigger completions from this source. Is there anything specific I have to do to trigger the completions other than typing something which looks like a path?

ddc.vim: 532bd20a7f862948dcd3e20397abffccef4ace4a ddc-path: 9c88d02b1ec199fc8b7636ccf65517611156943f denops: d01a89773b158255073cefa88f6527fb9f522e59

both fd and find are on my path and I have tried using both and none of them show any complete sources coming from mark P when I type something which looks like a path. Any idea where I went wrong? Or is there a bug somewhere?

call ddc#custom#patch_global('completionMenu', 'pum.vim')
call pum#set_option('border', 'rounded')

call ddc#custom#patch_global('sources', ['around', 'ale', 'rg', 'tmux', 'omni', 'path'])

call ddc#custom#patch_global('sourceOptions', {
      \ '_': {
      \       'matchers': ['matcher_fuzzy'],
      \       'sorters': ['sorter_fuzzy'],
      \       'converters': ['converter_fuzzy']
      \   },
      \   'rg': {'mark': 'rg', 'minAutoCompleteLength': 4,},
      \   'tmux': {'mark': 'T'},
      \   'omni': {'mark': 'O'},
      \   'path': {'mark': 'P'},
      \   'ale': {'mark': 'A'},
      \ })

" \    'path': {'cmd': ['fd', '--max-depth', '5'] },
call ddc#custom#patch_global('sourceParams', {
      \    'ale': {'cleanResultsWhitespace': v:true},
      \    'path': {'cmd': ["find", "-maxdepth", "3"] },
      \ })

" Use ddc.
call ddc#enable()
tani commented 2 years ago

Thank you for using my plugin. We are reviewing the large pull request #3 now. It may change the configuration manner of this plugin. Thus, could I reply your question after the completion of the pull request. I expect the revision process will be done in a few days.

jeffwillette commented 2 years ago

Thanks for the reply. I will wait for the update to see what happens with the new version.

FWIW, I noticed that ddc-path is working. The P marked completions do come up sometimes, but never when I want them to. For instance, when I type some random text it will trigger completions for random fuzzy matches...

image

but when I type something that is obviously a path, like /home/jeff/... there are no completions triggered. My intuition is that the plugin should probably ONLY trigger completions when typing something that is a path.

Milly commented 2 years ago

Update is done. Please retry.

I think the result of the completion looks random because you are using matcher_fuzzy.

jeffwillette commented 2 years ago

I get completions now so the issue is solved, but it still seems that the completions always come up at the wrong time when I am not typing a path. When I actually start typing something that looks like a path (like "/home/jeff/....") it never triggers completions.

It also appears to trigger more path completions when I am in something like a text file and not when I am in a program file, like something with a .py extension.

Thanks for your work on this plugin!