Skip to content

Commit

Permalink
refactor(plugins): simplify list_insert_unique calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed May 1, 2023
1 parent 01ac6de commit bb38952
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
9 changes: 3 additions & 6 deletions plugins/mason.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ return {
-- overrides `require("mason-lspconfig").setup(...)`
opts = function(_, opts)
-- add more things to the ensure_installed table protecting against community packs modifying it
if not opts.ensure_installed then opts.ensure_installed = {} end
require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
-- "lua_ls",
})
end,
Expand All @@ -18,8 +17,7 @@ return {
-- overrides `require("mason-null-ls").setup(...)`
opts = function(_, opts)
-- add more things to the ensure_installed table protecting against community packs modifying it
if not opts.ensure_installed then opts.ensure_installed = {} end
require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
-- "prettier",
-- "stylua",
})
Expand All @@ -30,8 +28,7 @@ return {
-- overrides `require("mason-nvim-dap").setup(...)`
opts = function(_, opts)
-- add more things to the ensure_installed table protecting against community packs modifying it
if not opts.ensure_installed then opts.ensure_installed = {} end
require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
-- "python",
})
end,
Expand Down
3 changes: 1 addition & 2 deletions plugins/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ return {
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add more things to the ensure_installed table protecting against community packs modifying it
if not opts.ensure_installed then opts.ensure_installed = {} end
require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
-- "lua"
})
end,
Expand Down

0 comments on commit bb38952

Please sign in to comment.