add: global variable unique_list

This commit is contained in:
asep.komarudin 2024-06-28 08:49:33 +07:00
parent 024214153a
commit fc32c1b69c

View file

@ -37,6 +37,20 @@ _G.idxOf = function(array, value)
return nil
end
_G.unique_list = function(list)
local seen = {}
local result = {}
for _, val in ipairs(list) do
if not seen[val] then
table.insert(result, val)
seen[val] = true
end
end
return result
end
-- run if rust config true
if pcode.active_rust_config then
table.insert(pcode.mason_ensure_installed, "rust_analyzer")