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

@@ -474,7 +474,7 @@ function protocol.make_client_capabilities()
completionItem = {
snippetSupport = true,
commitCharactersSupport = false,
preselectSupport = false,
preselectSupport = true,
deprecatedSupport = true,
documentationFormat = { constants.MarkupKind.Markdown, constants.MarkupKind.PlainText },
insertReplaceSupport = true,