New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(completion): add pum_matches
key to complete_info()
#28576
base: master
Are you sure you want to change the base?
Conversation
3216ece
to
3bc1b7e
Compare
don't get point. When there are no candidate words, that is when match_array is empty, the completechanged event will still be triggered ? idk why there need a new vvar ..complete_info also provide some infomations.. |
Yes but you still need to know if completion is exhausted or not, and what the completion items are. Currently there is no way of getting that. Also, look at vim/vim#10007 to know why |
3bc1b7e
to
b673df5
Compare
It seems that because the items of complete_info are all items, it cannot distinguish the candidate words displayed in the current pum. I implemented similar behavior locally in my completion plugin. Now the order of items will not be disrupted #27955 so you can easily infer the candidate words displayed in the current pum. can't simply add the current index in pum to items, for example the shown_idx field? This should be easier than adding a new vvar. |
b673df5
to
afdf54d
Compare
v:complete_items
to get completion itemspum_items
key to complete_info()
daa01d2
to
6a0ea9f
Compare
6a0ea9f
to
de202e2
Compare
pum_items
key to complete_info()
shown
key to complete_info()
de202e2
to
40ec8dd
Compare
40ec8dd
to
0ebc8db
Compare
shown
key to complete_info()
visible
key to complete_info()
The name "visible" may also be ambiguous. If there are many matches, there will be a scrollbar and some matches are only shown after scrolling. Should those be considered "visible" or not? |
And that should be spelled out in the docs. I thought for sure that the purpose of this PR was to indicate which items are visible on the screen. What, then, is the purpose? (Say it in the docs, not to me) |
True. Maybe "matched" then? |
This doesn't work because completion items are called completion matches in several places in the documentation. I feel like at the end of the day, |
Problem: Currently there is no way of getting the list of completion items that are actually put in the popupmenu. Which means completion providers have no way of knowing if a completion was exhausted. Solution: Add a `pum_matches` key to `complete_info()` which contains the indices of items that are put in the popupmenu. Ref: vim/vim#10007
0ebc8db
to
c4f0235
Compare
visible
key to complete_info()
pum_matches
key to complete_info()
Problem: Currently there is no way of getting the list of completion items that are actually put in the popupmenu. Which means completion providers have no way of knowing if a completion was exhausted.
Solution: Add a
pum_matches
key tocomplete_info()
which contains the indices of items that are put in the popupmenu.Ref: vim/vim#10007