This commit is contained in:
Snoweuph 2026-02-03 18:02:38 +01:00 committed by GitHub
commit 985beb1cc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 47 additions and 2 deletions

View file

@ -174,6 +174,9 @@
- Added Makefile support via `languages.make`.
- Added config option to [harper-ls](https://github.com/Automattic/harper) to
limit it to supported filetypes.
[vagahbond](https://github.com/vagahbond): [codewindow.nvim]:
https://github.com/gorbit99/codewindow.nvim

View file

@ -11,9 +11,10 @@
in {
config = mkIf (cfg.enable && cfg.harper-ls.enable) {
vim.lsp.servers.harper-ls = {
root_markers = [".git"];
root_markers = [".git" ".harper-dictionary.txt"];
cmd = [(getExe pkgs.harper) "--stdio"];
settings = {harper-ls = cfg.harper-ls.settings;};
filetypes = cfg.harper-ls.filetypes;
};
};
}

View file

@ -1,6 +1,6 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) anything attrsOf;
inherit (lib.types) anything attrsOf nullOr listOf str;
in {
options.vim.lsp.harper-ls = {
enable = mkEnableOption "Harper grammar checking LSP";
@ -31,5 +31,46 @@ in {
};
description = "Settings to pass to harper-ls";
};
filetypes = mkOption {
type = nullOr (listOf str);
# <https://writewithharper.com/docs/integrations/language-server#Supported-Languages>
default = [
"asciidoc"
"c"
"clojure"
"cmake"
"cpp"
"cs"
"daml"
"dart"
"gitcommit"
"go"
"haskell"
"html"
"ink"
"java"
"javascript"
"javascriptreact"
"kotlin"
"lhaskell"
"lua"
"mail"
"markdown"
"nix"
"php"
"python"
"ruby"
"rust"
"scala"
"sh"
"swift"
"text"
"toml"
"typescript"
"typescriptreact"
"typst"
];
description = "Filetypes to auto-attach LSP server in";
};
};
}