lsp/harper-ls: init

This commit is contained in:
gmvar 2025-08-22 14:56:00 -07:00
commit c752aaa24f
6 changed files with 68 additions and 0 deletions

View file

@ -0,0 +1,19 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.meta) getExe;
cfg = config.vim.lsp;
in {
config = mkIf (cfg.enable && cfg.harper-ls.enable) {
vim.lsp.servers.harper-ls = {
root_markers = [".git"];
cmd = [(getExe pkgs.harper) "--stdio"];
settings = {harper-ls = cfg.harper-ls.settings;};
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./harper-ls.nix
./config.nix
];
}

View file

@ -0,0 +1,35 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) anything attrsOf;
in {
options.vim.lsp.harper-ls = {
enable = mkEnableOption "Harper grammar checking LSP";
settings = mkOption {
type = attrsOf anything;
default = {};
example = {
userDictPath = "";
workspaceDictPath = "";
fileDictPath = "";
linters = {
BoringWords = true;
PossessiveNoun = true;
SentenceCapitalization = false;
SpellCheck = false;
};
codeActions = {
ForceStable = false;
};
markdown = {
IgnoreLinkTitle = false;
};
diagnosticSeverity = "hint";
isolateEnglish = false;
dialect = "American";
maxFileLength = 120000;
ignoredLintsPath = {};
};
description = "Settings to pass to harper-ls";
};
};
}