From 1caad46f40e1965e4bf0cc68d98f341bc4310d8c Mon Sep 17 00:00:00 2001 From: Daniil Rozanov Date: Fri, 3 May 2024 01:24:29 +0300 Subject: docs: lua documentation for most used tables and functions --- lua/cmake/actions.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lua/cmake/actions.lua') diff --git a/lua/cmake/actions.lua b/lua/cmake/actions.lua index 9f16bf5..0eff4ed 100644 --- a/lua/cmake/actions.lua +++ b/lua/cmake/actions.lua @@ -54,7 +54,7 @@ end ---@return table local _extend_generate_command = function(command, opts) opts = opts or {} - local new = vim.tbl_deep_extend("keep", command, {}) + local new = vim.deepcopy(command) return new end @@ -63,13 +63,16 @@ end ---@param opts BuildOpts ---@return table local _extend_build_command = function(command, opts) - local new = vim.tbl_deep_extend("keep", command, {}) + local new = vim.deepcopy(command) if opts.j then new.args = new.args .. " -j " .. tostring(opts.j) end if opts.clean then new.args = new.args .. " --clean-first" end + if opts.target and #opts.target ~= 0 then + new.args = new.args .. " --target " .. table.concat(opts.target, " ") + end return new end @@ -157,7 +160,7 @@ end ---@class BuildOpts ---@field clean boolean|nil ---@field j number|nil ----@field target number|nil +---@field target string[]|nil --- Build project with current build option --- @param opts BuildOpts -- cgit v1.2.3