diff --git a/lua/astrocommunity/pack/harper/README.md b/lua/astrocommunity/pack/harper/README.md new file mode 100644 index 000000000..c7f014dfe --- /dev/null +++ b/lua/astrocommunity/pack/harper/README.md @@ -0,0 +1,31 @@ +# Harper LS + +[Harper](https://writewithharper.com) is an English grammar checker designed to be _just right_. + +**Repository:** + +## How do I set my own LSP configuration? + +To add your configuration, you have to extend `AstroNvim/astrolsp` opts. + +> See the options that `harper-ls` support [here](https://github.com/elijah-potter/harper/blob/master/harper-ls/README.md#configuration). + +```lua +---@type LazySpec +return { + { + "AstroNvim/astrolsp", + opts = { + config = { + harper_ls = { + settings = { + ["harper-ls"] = { + --- Your configuration + }, + }, + }, + }, + }, + }, +} +``` diff --git a/lua/astrocommunity/pack/harper/init.lua b/lua/astrocommunity/pack/harper/init.lua new file mode 100644 index 000000000..e17c5887e --- /dev/null +++ b/lua/astrocommunity/pack/harper/init.lua @@ -0,0 +1,39 @@ +---@type LazySpec +return { + { + "AstroNvim/astrolsp", + optional = true, + ---@type AstroLSPOpts + opts = { + ---@diagnostic disable-next-line: missing-fields + config = { + harper_ls = { + settings = { + ["harper-ls"] = { + codeActions = { + forceStable = true, + }, + linters = { + spelled_numbers = true, + linking_verbs = true, + }, + }, + }, + }, + }, + }, + }, + { + "williamboman/mason-lspconfig.nvim", + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "harper-ls" }) + end, + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "harper-ls" }) + end, + }, +}