Skip to content

Commit

Permalink
feat(pack): add Harper (#1199)
Browse files Browse the repository at this point in the history
feat(utility): add `harper-ls` integration
  • Loading branch information
cristobalgvera authored Sep 16, 2024
1 parent 6f7ecaf commit 84ecff9
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
31 changes: 31 additions & 0 deletions lua/astrocommunity/pack/harper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Harper LS

[Harper](https://writewithharper.com) is an English grammar checker designed to be _just right_.

**Repository:** <https://github.com/elijah-potter/harper/blob/master/harper-ls>

## 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
},
},
},
},
},
},
}
```
39 changes: 39 additions & 0 deletions lua/astrocommunity/pack/harper/init.lua
Original file line number Diff line number Diff line change
@@ -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,
},
}

0 comments on commit 84ecff9

Please sign in to comment.