Add documents.

This commit is contained in:
hrsh7th
2021-08-11 18:43:22 +09:00
parent f352761df8
commit 5447f42444
4 changed files with 44 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ return function()
},
sorting = {
priority_weight = 2,
comparators = {
compare.offset,
compare.exact,

View File

@@ -89,7 +89,7 @@ menu.update = check.wrap(function(self, ctx, sources)
if s:has_items() and s.offset <= offset then
if not has_triggered_by_character_source or s.trigger_kind == types.lsp.CompletionTriggerKind.TriggerCharacter then
-- source order priority bonus.
local priority = (#sources - i - 1) * 2
local priority = (#sources - (i - 1)) * config.get().sorting.priority_weight
local filtered = s:get_entries(ctx)
for _, e in ipairs(filtered) do

View File

@@ -75,6 +75,7 @@ cmp.ScrollDirection.Down = 'down'
---@field select boolean
---@class cmp.SortingConfig
---@field public priority_weight number
---@field public comparators function[]
---@class cmp.FormattingConfig