home: vim: lua: util: fix comments

This commit is contained in:
Bruno BELANYI 2023-09-14 11:13:27 +00:00
parent 550436eee5
commit 3f7a062376

View file

@ -1,29 +1,29 @@
local M = {} local M = {}
-- pretty print lua object --- pretty print lua object
-- @param obj any object to pretty print --- @param obj any object to pretty print
M.dump = function(obj) M.dump = function(obj)
print(vim.inspect(obj)) print(vim.inspect(obj))
end end
--- checks if a given command is executable --- checks if a given command is executable
---@param cmd string? command to check --- @param cmd string? command to check
---@return boolean executable --- @return boolean executable
M.is_executable = function(cmd) M.is_executable = function(cmd)
return cmd and vim.fn.executable(cmd) == 1 return cmd and vim.fn.executable(cmd) == 1
end end
--- return a function that checks if a given command is executable --- return a function that checks if a given command is executable
---@param cmd string? command to check --- @param cmd string? command to check
---@return fun(cmd: string): boolean executable --- @return fun(cmd: string): boolean executable
M.is_executable_condition = function(cmd) M.is_executable_condition = function(cmd)
return function() return function()
return M.is_executable(cmd) return M.is_executable(cmd)
end end
end end
-- whether or not we are currently in an SSH connection --- whether or not we are currently in an SSH connection
-- @return boolean ssh connection --- @return boolean ssh connection
M.is_ssh = function() M.is_ssh = function()
local variables = { local variables = {
"SSH_CONNECTION", "SSH_CONNECTION",
@ -40,9 +40,9 @@ M.is_ssh = function()
return false return false
end end
-- list all active LSP clients for current buffer --- list all active LSP clients for current buffer
-- @param bufnr int? buffer number --- @param bufnr int? buffer number
-- @return table all active LSP client names --- @return table all active LSP client names
M.list_lsp_clients = function(bufnr) M.list_lsp_clients = function(bufnr)
local clients = vim.lsp.buf_get_clients(bufnr) local clients = vim.lsp.buf_get_clients(bufnr)
local names = {} local names = {}