Skip to content

Commit

Permalink
feat(pack): add elixir/phoenix pack (#821)
Browse files Browse the repository at this point in the history
* Proposal to add a pack for elixir/phoenix

* fix(docs):  Fix wording of sentence

---------

Co-authored-by: Uzair Aftab <[email protected]>
Co-authored-by: luxus <[email protected]>
  • Loading branch information
3 people authored Apr 4, 2024
1 parent 7f95c2e commit 4a80be4
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lua/astrocommunity/pack/elixir-phoenix/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Elixir and Phoenix Pack

Adds baseline support for Elixir/Phoenix projects.

This plugin pack does the following:

- Adds the `tailwindcss` AstroCommunity pack
- Adds the `elixirls` language server
- Adds the `elixir` and `heex` Treesitter parsers
- Ensures `tailwindcss` is configured for html-eex and `class:` style hinting.
43 changes: 43 additions & 0 deletions lua/astrocommunity/pack/elixir-phoenix/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
return {
{ import = "astrocommunity.pack.tailwindcss" },
{
"williamboman/mason-lspconfig.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "elixirls" })
end,
},
{
"nvim-treesitter/nvim-treesitter",
optional = true,
opts = function(_, opts)
if opts.ensure_installed ~= "all" then
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "elixir", "heex" })
end
end,
},
{
"AstroNvim/astrolsp",
opts = {
config = {
tailwindcss = {
init_options = {
userLanguages = {
heex = "html-eex",
elixir = "html-eex",
},
},
settings = {
tailwindCSS = {
experimental = {
classRegex = {
'class[:]\\s*"([^"]*)"',
},
},
},
},
},
},
},
},
}

0 comments on commit 4a80be4

Please sign in to comment.