patch 9.1.1049: insert-completed items are always sorted

Problem:  insert-completed items are always sorted, although the LSP
          spec[1] standard defines sortText in the returned
          completionitem list. This means that the server has sorted the
          results. When fuzzy is enabled, this will break the server's
          sorting results.
Solution: disable sorting of candidates when "nosort" is set in
          'completeopt'

[1]
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItem

closes: #16501

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
glepnir
2025-01-23 19:55:14 +01:00
committed by Christian Brabandt
parent df098fedbc
commit f400a0cc41
7 changed files with 46 additions and 21 deletions

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 9.1. Last change: 2025 Jan 21
*options.txt* For Vim version 9.1. Last change: 2025 Jan 23
VIM REFERENCE MANUAL by Bram Moolenaar
@ -2164,6 +2164,10 @@ A jump table for the options with a short description can be found at |Q_op|.
characters can be skipped and matches can be found even
if the exact sequence is not typed.
nosort Disable sorting of completion candidates based on fuzzy
scores when "fuzzy" is enabled. Candidates will appear
in their original order.
*'completepopup'* *'cpp'*
'completepopup' 'cpp' string (default empty)
global