docs: fix invalid WindowConfig schema, should match to the docs (#1779)
Problem: `cmp.WindowConfig` was defined twice. Solution: Introduce `cmp.CompletionWindowOptions` and `cmp.DocumentationWindowOptions`. Make fields of these two class consistent with |cmp-config.window.*|
This commit is contained in:
@@ -107,10 +107,6 @@ cmp.ItemField = {
|
|||||||
---@field public async_budget integer Maximum time (in ms) an async function is allowed to run during one step of the event loop.
|
---@field public async_budget integer Maximum time (in ms) an async function is allowed to run during one step of the event loop.
|
||||||
---@field public max_view_entries integer
|
---@field public max_view_entries integer
|
||||||
|
|
||||||
---@class cmp.WindowConfig
|
|
||||||
---@field completion? cmp.WindowConfig
|
|
||||||
---@field documentation? cmp.WindowConfig|nil
|
|
||||||
|
|
||||||
---@class cmp.CompletionConfig
|
---@class cmp.CompletionConfig
|
||||||
---@field public autocomplete? cmp.TriggerEvent[]|false
|
---@field public autocomplete? cmp.TriggerEvent[]|false
|
||||||
---@field public completeopt? string
|
---@field public completeopt? string
|
||||||
@@ -119,14 +115,24 @@ cmp.ItemField = {
|
|||||||
---@field public keyword_pattern? string
|
---@field public keyword_pattern? string
|
||||||
|
|
||||||
---@class cmp.WindowConfig
|
---@class cmp.WindowConfig
|
||||||
|
---@field public completion? cmp.CompletionWindowOptions
|
||||||
|
---@field public documentation? cmp.DocumentationWindowOptions|nil
|
||||||
|
|
||||||
|
---@class cmp.WindowOptions
|
||||||
---@field public border? string|string[]
|
---@field public border? string|string[]
|
||||||
---@field public winhighlight? string
|
---@field public winhighlight? string
|
||||||
---@field public zindex? integer|nil
|
---@field public zindex? integer|nil
|
||||||
---@field public max_width? integer|nil
|
|
||||||
---@field public max_height? integer|nil
|
---@class cmp.CompletionWindowOptions: cmp.WindowOptions
|
||||||
---@field public scrolloff? integer|nil
|
---@field public scrolloff? integer|nil
|
||||||
|
---@field public col_offset? integer|nil
|
||||||
|
---@field public side_padding? integer|nil
|
||||||
---@field public scrollbar? boolean|true
|
---@field public scrollbar? boolean|true
|
||||||
|
|
||||||
|
---@class cmp.DocumentationWindowOptions: cmp.WindowOptions
|
||||||
|
---@field public max_height? integer|nil
|
||||||
|
---@field public max_width? integer|nil
|
||||||
|
|
||||||
---@class cmp.ConfirmationConfig
|
---@class cmp.ConfirmationConfig
|
||||||
---@field public default_behavior cmp.ConfirmBehavior
|
---@field public default_behavior cmp.ConfirmBehavior
|
||||||
---@field public get_commit_characters fun(commit_characters: string[]): string[]
|
---@field public get_commit_characters fun(commit_characters: string[]): string[]
|
||||||
|
|||||||
@@ -118,6 +118,8 @@ end
|
|||||||
|
|
||||||
custom_entries_view.open = function(self, offset, entries)
|
custom_entries_view.open = function(self, offset, entries)
|
||||||
local completion = config.get().window.completion
|
local completion = config.get().window.completion
|
||||||
|
assert(completion, 'config.get() must resolve window.completion with defaults')
|
||||||
|
|
||||||
self.offset = offset
|
self.offset = offset
|
||||||
self.entries = {}
|
self.entries = {}
|
||||||
self.column_width = { abbr = 0, kind = 0, menu = 0 }
|
self.column_width = { abbr = 0, kind = 0, menu = 0 }
|
||||||
|
|||||||
Reference in New Issue
Block a user