lsp/presets/harper: move to new lsp/presets namespace

This commit is contained in:
Snoweuph 2026-04-11 12:31:21 +02:00
commit f6da4534bd
No known key found for this signature in database
GPG key ID: BEFC41DA223CEC55
8 changed files with 59 additions and 101 deletions

View file

@ -1,3 +1,5 @@
{
imports = [];
imports = [
./harper.nix
];
}

View file

@ -0,0 +1,53 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.vim.lsp.presets.harper;
in {
options.vim.lsp.presets.harper = {
enable = mkEnableOption "the Harper grammar checking LSP";
};
config = mkIf cfg.enable {
vim.lsp.servers.harper = {
enable = true;
cmd = [(getExe pkgs.harper) "--stdio"];
root_markers = [".git" ".harper-dictionary.txt"];
filetypes = [
# <https://writewithharper.com/docs/integrations/language-server#Supported-Languages>
"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"
];
};
};
}