-
-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pack): Add purescript pack (#1222)
* feat(pack): added purescript pack * feat: finish nvimmer-ps * feat(pack): added purescript pack -> fix suggestions * Update lua/astrocommunity/pack/purescript/init.lua Co-authored-by: Uzair Aftab <[email protected]> * feat: default keymap configuration * feat: default keymap configuration --------- Co-authored-by: Uzair Aftab <[email protected]>
- Loading branch information
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# purescript Language Pack | ||
|
||
This plugin pack does the following: | ||
|
||
- Adds `purescript` Treesitter parsers | ||
- Adds `purescript-language-server` language server | ||
- Adds `purs-tidy` formatter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
return { | ||
{ | ||
"srghma/nvimmer-ps", | ||
opts = {}, -- if nil - M.setup wont be called | ||
}, | ||
{ | ||
"AstroNvim/astrocore", | ||
---@type AstroCoreOpts | ||
opts = { | ||
filetypes = { | ||
extension = { purs = "purescript" }, | ||
}, | ||
}, | ||
}, | ||
{ | ||
"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, { "purescript" }) | ||
end | ||
end, | ||
}, | ||
{ | ||
"williamboman/mason-lspconfig.nvim", | ||
optional = true, | ||
opts = function(_, opts) | ||
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "purescriptls" }) | ||
end, | ||
}, | ||
{ | ||
"jay-babu/mason-null-ls.nvim", | ||
optional = true, | ||
opts = function(_, opts) | ||
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "purs-tidy" }) | ||
end, | ||
}, | ||
{ | ||
"WhoIsSethDaniel/mason-tool-installer.nvim", | ||
optional = true, | ||
opts = function(_, opts) | ||
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { | ||
"purescript-language-server", | ||
"purs-tidy", | ||
}) | ||
end, | ||
}, | ||
{ | ||
"stevearc/conform.nvim", | ||
optional = true, | ||
opts = { | ||
formatters_by_ft = { | ||
purescript = { "purs-tidy" }, | ||
}, | ||
}, | ||
}, | ||
{ | ||
"AstroNvim/astrolsp", | ||
---@type AstroLSPOpts | ||
opts = { | ||
---@diagnostic disable: missing-fields | ||
config = { | ||
purescriptls = { | ||
flags = { | ||
debounce_text_changes = 150, | ||
}, | ||
-- root_dir fixes | ||
-- "Problem running build: Reading Spago workspace configuration...\n\n✘ Your spago.yaml doesn't contain a workspace section." | ||
-- when language server is being run in a monorepo (lot of spago.yaml files, but only the top one has "workspace section") | ||
root_dir = function(_) return vim.fn.getcwd() end, | ||
on_attach = function(...) require("nvimmer-ps").setup_on_attach(...) end, | ||
on_init = function(...) require("nvimmer-ps").setup_on_init(...) end, | ||
settings = { | ||
purescript = { | ||
formatter = "purs-tidy", | ||
addSpagoSources = true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} |