Add documents.
This commit is contained in:
@@ -46,6 +46,7 @@ return function()
|
||||
},
|
||||
|
||||
sorting = {
|
||||
priority_weight = 2,
|
||||
comparators = {
|
||||
compare.offset,
|
||||
compare.exact,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user