aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/ui/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-08-15 21:03:06 +0200
committerGitHub <noreply@github.com>2022-08-15 21:03:06 +0200
commit3c62386a396ae0c1cd7adbaacc379eb4af072a65 (patch)
tree4d00d20958839a04e6a996c11b97724c762e491a /lua/mason-core/ui/init.lua
parentchore: update generated code (#295) (diff)
downloadmason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.gz
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.bz2
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.lz
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.xz
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.zst
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.zip
refactor: introduce selene, harden type defs, and use proper EmmyLua syntax (#296)
Diffstat (limited to 'lua/mason-core/ui/init.lua')
-rw-r--r--lua/mason-core/ui/init.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/lua/mason-core/ui/init.lua b/lua/mason-core/ui/init.lua
index eafbf6ed..62f2e6fc 100644
--- a/lua/mason-core/ui/init.lua
+++ b/lua/mason-core/ui/init.lua
@@ -61,7 +61,7 @@ function M.CascadingStyleNode(styles, children)
return node
end
----@param virt_text string[][]: List of (text, highlight) tuples.
+---@param virt_text string[][] List of (text, highlight) tuples.
function M.VirtualTextNode(virt_text)
---@class VirtualTextNode
local node = {
@@ -71,7 +71,7 @@ function M.VirtualTextNode(virt_text)
return node
end
----@param diagnostic {message: string, severity: integer, source: string|nil}
+---@param diagnostic {message: string, severity: integer, source: string?}
function M.DiagnosticsNode(diagnostic)
---@class DiagnosticsNode
local node = {
@@ -95,10 +95,10 @@ function M.When(condition, node, default_val)
return default_val or M.Node {}
end
----@param key string: The keymap to register to. Example: "<CR>".
----@param effect string: The effect to call when keymap is triggered by the user.
----@param payload any: The payload to pass to the effect handler when triggered.
----@param is_global boolean|nil: Whether to register the keybind to apply on all lines in the buffer.
+---@param key string The keymap to register to. Example: "<CR>".
+---@param effect string The effect to call when keymap is triggered by the user.
+---@param payload any The payload to pass to the effect handler when triggered.
+---@param is_global boolean? Whether to register the keybind to apply on all lines in the buffer.
function M.Keybind(key, effect, payload, is_global)
---@class KeybindHandlerNode
local node = {
@@ -115,7 +115,7 @@ function M.EmptyLine()
return M.Text { "" }
end
----@param rows string[][][]: A list of rows to include in the table. Each row consists of an array of (text, highlight) tuples (aka spans).
+---@param rows string[][][] A list of rows to include in the table. Each row consists of an array of (text, highlight) tuples (aka spans).
function M.Table(rows)
local col_maxwidth = {}
for i = 1, #rows do