[vim/vim] complete_info() does not report the item highlight groups (PR #21105)

7 views
Skip to first unread message

glepnir

unread,
Aug 20, 2026, 6:59:03 AM (6 days ago) Aug 20
to vim/vim, Subscribed

Problem: complete_info() omits "abbr_hlgroup" and "kind_hlgroup".
Solution: Keep the highlight group ID with the match instead of the resolved
attribute and add both entries to the returned items.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/21105

Commit Summary

  • 078b37b complete_info() does not report the item highlight groups

File Changes

(4 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21105@github.com>

Christian Brabandt

unread,
Aug 20, 2026, 1:54:53 PM (5 days ago) Aug 20
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#21105)

But why? Why do you need to know the group name of the highlight group from the completion menu? That seems unnecessary, a plugin already knows what highlighting it specified for the completion, so I am guessing it doesn't need to capture this information again.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21105/c5359684638@github.com>

glepnir

unread,
Aug 20, 2026, 11:37:07 PM (5 days ago) Aug 20
to vim/vim, Subscribed
glepnir left a comment (vim/vim#21105)

Because the plugin refreshing the list isn't always the one that made it. LSP servers send isIncomplete=true, so the client re-queries and calls complete() again on nearly every keystroke — and matches from the other 'complete' sources have to be read back with complete_info() and passed along. Everything survives that round trip except abbr_hlgroup and kind_hlgroup. They're the only keys complete() takes that you can't read back.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21105/c5364882903@github.com>

glepnir

unread,
Aug 20, 2026, 11:37:28 PM (5 days ago) Aug 20
to vim/vim, Subscribed
glepnir left a comment (vim/vim#21105)

Because the plugin refreshing the list isn't always the one that made it. LSP servers send isIncomplete=true, so the client re-queries and calls complete() again on nearly every keystroke — and matches from the other 'complete' sources have to be read back with complete_info() and passed along. Everything survives that round trip except abbr_hlgroup and kind_hlgroup. They're the only keys complete() takes that you can't read back.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21105/c5364885073@github.com>

h_east

unread,
Aug 21, 2026, 2:59:21 AM (5 days ago) Aug 21
to vim/vim, Subscribed
h-east left a comment (vim/vim#21105)

The round trip does not survive a highlight group that is not defined yet.

get_user_highlight_id() calls syn_name2id(), which returns 0 for a name no
:highlight has created, and syn_id2name(0) is an empty string. So an item
passed to complete() with abbr_hlgroup: 'MyKind' comes back from
complete_info() with an empty abbr_hlgroup, and feeding it back in drops
the highlight. A client that links its groups with :highlight default link
when it loads, or leaves them to the user, runs into this. The added test uses
Title and SpecialKey, which already exist, so it does not cover it.

Keeping the name instead of the ID would not have that hole.

One more thing: holding the ID rather than the resolved attribute means the
menu now follows a :highlight issued after complete(). That looks like an
improvement, but it is a behaviour change and it is not in the commit message
or the docs.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21105/c5366302056@github.com>

glepnir

unread,
Aug 21, 2026, 6:11:12 AM (5 days ago) Aug 21
to vim/vim, Subscribed
glepnir left a comment (vim/vim#21105)

Updated, switched to syn_check_group() so an undefined group keeps its name, and documented the late lookup.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21105/c5368493229@github.com>

Christian Brabandt

unread,
Aug 23, 2026, 3:52:06 PM (2 days ago) Aug 23
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#21105)

okay, fine thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21105/c5388124109@github.com>

Reply all
Reply to author
Forward
0 new messages