Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lua/astrocommunity/pack/odin/README.md
Original file line number Diff line number Diff line change
@@ -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)
34 changes: 34 additions & 0 deletions lua/astrocommunity/pack/odin/init.lua
Original file line number Diff line number Diff line change
@@ -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" },
},
},
},
}
Loading