From 8f1abefd3af53cf5ea823d6609843f7e05fad95e Mon Sep 17 00:00:00 2001 From: taskylizard <75871323+taskylizard@users.noreply.github.com> Date: Wed, 15 Mar 2023 13:42:48 +0100 Subject: [PATCH] feat(pack): add astro pack Signed-off-by: taskylizard <75871323+taskylizard@users.noreply.github.com> --- lua/astrocommunity/pack/astro/README.md | 8 ++++++ lua/astrocommunity/pack/astro/astro.lua | 34 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 lua/astrocommunity/pack/astro/README.md create mode 100644 lua/astrocommunity/pack/astro/astro.lua diff --git a/lua/astrocommunity/pack/astro/README.md b/lua/astrocommunity/pack/astro/README.md new file mode 100644 index 000000000..3acc1de96 --- /dev/null +++ b/lua/astrocommunity/pack/astro/README.md @@ -0,0 +1,8 @@ +# Astro Language Pack + +This plugin pack does the following: + +- Adds `astro` Treesitter parser +- Adds `astro` language server +- Adds `js-debug-adapter` for debugging +- Adds [nvim-dap-vscode-js](https://github.com/mxsdev/nvim-dap-vscode-js) for debugging diff --git a/lua/astrocommunity/pack/astro/astro.lua b/lua/astrocommunity/pack/astro/astro.lua new file mode 100644 index 000000000..2d6b2aeac --- /dev/null +++ b/lua/astrocommunity/pack/astro/astro.lua @@ -0,0 +1,34 @@ +local utils = require "astrocommunity.utils" +return { + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- Ensure that opts.ensure_installed exists and is a table or string "all". + if not opts.ensure_installed then + opts.ensure_installed = {} + elseif opts.ensure_installed == "all" then + return + end + -- Add the required file types to opts.ensure_installed. + utils.list_insert_unique(opts.ensure_installed, "astro") + end, + }, + { + "williamboman/mason-lspconfig.nvim", + opts = function(_, opts) + -- Ensure that opts.ensure_installed exists and is a table. + if not opts.ensure_installed then opts.ensure_installed = {} end + -- Add tsserver to opts.ensure_installed using vim.list_extend. + utils.list_insert_unique(opts.ensure_installed, "astro") + end, + }, + { + "jay-babu/mason-nvim-dap.nvim", + opts = function(_, opts) + -- Ensure that opts.ensure_installed exists and is a table. + if not opts.ensure_installed then opts.ensure_installed = {} end + -- Add to opts.ensure_installed using table.insert. + utils.list_insert_unique(opts.ensure_installed, "js") + end, + }, +}