Skip to content

Commit

Permalink
docs: fix invalid WindowConfig schema, should match to the docs
Browse files Browse the repository at this point in the history
Problem: `cmp.WindowConfig` was defined twice.

Solution: Introduce
  `cmp.CompletionWindowOptions` and `cmp.DocumentationWindowOptions`.
Make fields of these two class consistent with |cmp-config.window.*|
  • Loading branch information
wookayin committed Dec 19, 2023
1 parent 538e37b commit 6d61d11
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lua/cmp/types/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 max_view_entries integer

---@class cmp.WindowConfig
---@field completion? cmp.WindowConfig
---@field documentation? cmp.WindowConfig|nil

---@class cmp.CompletionConfig
---@field public autocomplete? cmp.TriggerEvent[]|false
---@field public completeopt? string
Expand All @@ -119,14 +115,24 @@ cmp.ItemField = {
---@field public keyword_pattern? string

---@class cmp.WindowConfig
---@field completion? cmp.CompletionWindowOptions
---@field documentation? cmp.DocumentationWindowOptions|nil

---@class cmp.WindowOptions
---@field public border? string|string[]
---@field public winhighlight? string
---@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 col_offset? integer|nil
---@field public side_padding? integer|nil
---@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
---@field public default_behavior cmp.ConfirmBehavior
---@field public get_commit_characters fun(commit_characters: string[]): string[]
Expand Down

0 comments on commit 6d61d11

Please sign in to comment.