From bafa6dc0ed24493b3db3ddc2d68400a580514099 Mon Sep 17 00:00:00 2001 From: "M. Casqueira" <3946250+20k-ultra@users.noreply.github.com> Date: Thu, 29 Jun 2023 16:24:54 -0400 Subject: [PATCH] feat(pack): add ProtoBuf pack (#330) Signed-off-by: Miguel Casqueira <20k-ultra@users.noreply.github.com> Co-authored-by: Miguel Casqueira <20k-ultra@users.noreply.github.com> --- lua/astrocommunity/pack/proto/README.md | 7 +++++++ lua/astrocommunity/pack/proto/init.lua | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 lua/astrocommunity/pack/proto/README.md create mode 100644 lua/astrocommunity/pack/proto/init.lua diff --git a/lua/astrocommunity/pack/proto/README.md b/lua/astrocommunity/pack/proto/README.md new file mode 100644 index 000000000..136008eaf --- /dev/null +++ b/lua/astrocommunity/pack/proto/README.md @@ -0,0 +1,7 @@ +# Protocal Buffers Pack + +This plugin pack does the following: + +- Adds `proto` Treesitter parsers +- Adds `bufls` language servers +- Adds `buf` formatter diff --git a/lua/astrocommunity/pack/proto/init.lua b/lua/astrocommunity/pack/proto/init.lua new file mode 100644 index 000000000..47788a8b9 --- /dev/null +++ b/lua/astrocommunity/pack/proto/init.lua @@ -0,0 +1,20 @@ +local utils = require "astronvim.utils" +return { + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- Ensure that opts.ensure_installed exists and is a table or string "all". + if opts.ensure_installed ~= "all" then + opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "proto") + end + end, + }, + { + "williamboman/mason-lspconfig.nvim", + opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "bufls") end, + }, + { + "jay-babu/mason-null-ls.nvim", + opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "buf") end, + }, +}