feat(completion): completeopt=preselect, LSP CompletionItem.preselect #36613

Problem: 
LSP CompletionItem.preselect is not supported.
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionClientCapabilities

Solution:
- Add "preselect" field to complete-items and "preselect" flag
  to 'completeopt'.
- Set preselectSupport=true in LSP client capabilities.
This commit is contained in:
glepnir
2026-04-13 17:59:07 +08:00
committed by GitHub
parent 09d4eba92b
commit 53a29dce0e
12 changed files with 150 additions and 22 deletions

View File

@@ -441,6 +441,7 @@ function M._lsp_to_complete_items(
empty = 1,
abbr_hlgroup = hl_group,
kind_hlgroup = kind_hlgroup,
preselect = item.preselect,
user_data = {
nvim = {
lsp = {