From 8c7b0a6b2e79857c4478a4b0087fd125288d44d4 Mon Sep 17 00:00:00 2001 From: Luco Bellic Date: Wed, 31 Jan 2024 22:37:57 +0100 Subject: [PATCH] docs: add code type documentation --- lua/edgy-group/commands.lua | 4 ++-- lua/edgy-group/config.lua | 24 ++++++++++++------------ lua/edgy-group/groups.lua | 4 ++-- lua/edgy-group/init.lua | 2 +- lua/edgy-group/stl/statusline.lua | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lua/edgy-group/commands.lua b/lua/edgy-group/commands.lua index c2351b7..7d0bb1f 100644 --- a/lua/edgy-group/commands.lua +++ b/lua/edgy-group/commands.lua @@ -3,8 +3,8 @@ local Group = require('edgy-group') local M = {} ---@class SelectionItem ----@field pos Edgy.Pos Position of the group ----@field index number Relative index in the group +---@field pos Edgy.Pos position of the group +---@field index number relative index in the group ---@field group EdgyGroup -- Get a list of groups with relative index and position diff --git a/lua/edgy-group/config.lua b/lua/edgy-group/config.lua index 46721ee..a17900b 100644 --- a/lua/edgy-group/config.lua +++ b/lua/edgy-group/config.lua @@ -3,25 +3,25 @@ local M = {} local Groups = require('edgy-group.groups') ---@class EdgyGroup ----@field icon string ----@field titles string[] +---@field icon string icon used in statusline and vim.ui.select +---@field titles string[] list of titles from edgy.nvim ---@field pick_key? string Key to use for group pick. ---@class EdgyGroup.Statusline.Opts ----@field separators string[] ----@field clickable boolean ----@field colored boolean ----@field colors EdgyGroup.Statusline.Colors +---@field separators { [1]: string, [2]: string } suffix and prefix separators between icons +---@field clickable boolean enable `open_group` on click +---@field colored boolean enable highlighting support +---@field colors EdgyGroup.Statusline.Colors highlight colors for icon and pick key ---@class EdgyGroup.Statusline.Colors ----@field active string ----@field inactive string ----@field pick_active string ----@field pick_inactive string +---@field active string highlight color for open group +---@field inactive string highlight color for closed group +---@field pick_active string highlight color for pick key for open group +---@field pick_inactive string highlight color for pick key for closed group ---@class EdgyGroup.Opts ----@field groups table ----@field statusline EdgyGroup.Statusline.Opts +---@field groups table list of groups for each position +---@field statusline EdgyGroup.Statusline.Opts statusline options ---@type EdgyGroup.Opts local default_options = { diff --git a/lua/edgy-group/groups.lua b/lua/edgy-group/groups.lua index 14112fb..f4df3df 100644 --- a/lua/edgy-group/groups.lua +++ b/lua/edgy-group/groups.lua @@ -1,6 +1,6 @@ ---@class EdgyGroup.IndexedGroups ----@field selected_index number Index of the selected group ----@field groups EdgyGroup[] List of groups +---@field selected_index number index of the selected group +---@field groups EdgyGroup[] list of groups local M = {} ---@param opts EdgyGroup.IndexedGroups? diff --git a/lua/edgy-group/init.lua b/lua/edgy-group/init.lua index f51852c..78ebc21 100644 --- a/lua/edgy-group/init.lua +++ b/lua/edgy-group/init.lua @@ -3,7 +3,7 @@ local Util = require('edgy.util') -- Define groups of edgebar views by title ---@class EdgyGroups ----@field groups_by_pos table List of groups for each position +---@field groups_by_pos table list of groups for each position local M = {} ---@param opts EdgyGroup.Opts diff --git a/lua/edgy-group/stl/statusline.lua b/lua/edgy-group/stl/statusline.lua index 47df837..f737471 100644 --- a/lua/edgy-group/stl/statusline.lua +++ b/lua/edgy-group/stl/statusline.lua @@ -3,7 +3,7 @@ local Group = require('edgy-group') ---@class EdgyGroup.Statusline ---@field private cache EdgyGroup.Statusline.Cache ----@field private pick_mode boolean True when pick is active, false otherwise +---@field private pick_mode boolean true when pick is active, false otherwise ------@diagnostic disable-next-line: missing-fields local M = {}