diff --git a/lua/astrocommunity/pack/odin/README.md b/lua/astrocommunity/pack/odin/README.md new file mode 100644 index 000000000..48546c227 --- /dev/null +++ b/lua/astrocommunity/pack/odin/README.md @@ -0,0 +1,9 @@ +# Odin Language Pack + +**Requirements:** `odin` should be in your `PATH` to use the language server + +This plugin pack does the following: + +- Adds `odin` Treesitter parser +- Adds [`ols`](https://github.com/DanielGavin/ols) language server +- Adds `odinfmt` formatter (bundled with `ols`) via [`conform.nvim`](https://github.com/stevearc/conform.nvim) diff --git a/lua/astrocommunity/pack/odin/init.lua b/lua/astrocommunity/pack/odin/init.lua new file mode 100644 index 000000000..9048d773b --- /dev/null +++ b/lua/astrocommunity/pack/odin/init.lua @@ -0,0 +1,34 @@ +return { + { + "AstroNvim/astrocore", + optional = true, + ---@type AstroCoreOpts + opts = { + treesitter = { ensure_installed = { "odin" } }, + }, + }, + { + "mason-org/mason-lspconfig.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "ols" }) + end, + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + optional = true, + opts = function(_, opts) + -- `ols` ships the `odinfmt` formatter binary alongside the language server + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "ols" }) + end, + }, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + odin = { "odinfmt" }, + }, + }, + }, +}