diff options
| author | William Boman <william@redwill.se> | 2022-07-14 17:27:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-14 17:27:12 +0200 |
| commit | 63de62cd0b0b53c5946d67ee2a3c2dac16379707 (patch) | |
| tree | 54d69e3bc51370787dfef71856747727ed5a84d5 /lua/mason-core/ui | |
| parent | fix(arduino_language_server): fix Windows asset files (#72) (diff) | |
| download | mason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.tar mason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.tar.gz mason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.tar.bz2 mason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.tar.lz mason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.tar.xz mason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.tar.zst mason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.zip | |
chore: change emmylua annotation syntax from @ to : for comments (#73)
Diffstat (limited to 'lua/mason-core/ui')
| -rw-r--r-- | lua/mason-core/ui/display.lua | 12 | ||||
| -rw-r--r-- | lua/mason-core/ui/init.lua | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/lua/mason-core/ui/display.lua b/lua/mason-core/ui/display.lua index 47368079..7a61d766 100644 --- a/lua/mason-core/ui/display.lua +++ b/lua/mason-core/ui/display.lua @@ -76,8 +76,8 @@ local function render_node(viewport_context, node, _render_context, _output) ---@field diagnostic {message: string, severity: integer, source: string|nil} ---@class RenderOutput - ---@field lines string[] @The buffer lines. - ---@field virt_texts string[][] @List of (text, highlight) tuples. + ---@field lines string[]: The buffer lines. + ---@field virt_texts string[][]: List of (text, highlight) tuples. ---@field highlights RenderHighlight[] ---@field keybinds RenderKeybind[] ---@field diagnostics RenderDiagnostic[] @@ -168,7 +168,7 @@ M._render_node = render_node ---@alias WindowOpts {effects: table<string, fun()>, highlight_groups: table<string, table>, border: string|table} ---@param opts WindowOpenOpts ----@param sizes_only boolean @Whether to only return properties that control the window size. +---@param sizes_only boolean: Whether to only return properties that control the window size. local function create_popup_window_opts(opts, sizes_only) local win_height = vim.o.lines - vim.o.cmdheight - 2 -- Add margin for status and buffer line local win_width = vim.o.columns @@ -191,7 +191,7 @@ local function create_popup_window_opts(opts, sizes_only) return popup_layout end ----@param name string @Human readable identifier. +---@param name string: Human readable identifier. ---@param filetype string function M.new_view_only_win(name, filetype) local namespace = vim.api.nvim_create_namespace(("installer_%s"):format(name)) @@ -491,12 +491,12 @@ function M.new_view_only_win(name, filetype) vim.api.nvim_del_augroup_by_id(window_mgmt_augroup) vim.api.nvim_del_augroup_by_id(autoclose_augroup) end), - ---@param pos number[] @(row, col) tuple + ---@param pos number[]: (row, col) tuple set_cursor = function(pos) assert(win_id ~= nil, "Window has not been opened, cannot set cursor.") return vim.api.nvim_win_set_cursor(win_id, pos) end, - ---@return number[] @(row, col) tuple + ---@return number[]: (row, col) tuple get_cursor = function() assert(win_id ~= nil, "Window has not been opened, cannot get cursor.") return vim.api.nvim_win_get_cursor(win_id) diff --git a/lua/mason-core/ui/init.lua b/lua/mason-core/ui/init.lua index 0b288b20..eafbf6ed 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 = { @@ -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|nil: 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 |
