They achieve these beautiful colors by regex substitute completion.details from language server and apply highlight to them.Currently cmp apply different highlight at a fix width, would be great to expose variable-size highlight(the same format as nvim_buf_set_extmark?) interface to users(and full lsp response message).
Edit: they are just concating detail items to fake it into valid treesitter grammer and apply highlight directly using treesitter query. The fake process is fairly easy and already can be done by formatting config. I assume cmp only needs an option to apply treesitter highlights or not for completion items.
Zed:
They achieve these beautiful colors by regex substitute
completion.details
from language server and apply highlight to them.Currently cmp apply different highlight at a fix width, would be great to expose variable-size highlight(the same format as nvim_buf_set_extmark?) interface to users(and full lsp response message).Edit: they are just concating detail items to fake it into valid treesitter grammer and apply highlight directly using treesitter query. The fake process is fairly easy and already can be done by formatting config. I assume cmp only needs an option to apply treesitter highlights or not for completion items.