From 180c3e4f55bf10bb5c8189f8772659a49ad4b8f7 Mon Sep 17 00:00:00 2001 From: Daniel <22460147+dwinkler1@users.noreply.github.com> Date: Mon, 27 Jul 2026 01:09:25 +0000 Subject: [PATCH] feat: add Harper grammar checker LSP --- modules/module/settings/cat-packages.nix | 1 + plugin/25_lsp.lua | 31 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/modules/module/settings/cat-packages.nix b/modules/module/settings/cat-packages.nix index ee1a255..dbdba3f 100644 --- a/modules/module/settings/cat-packages.nix +++ b/modules/module/settings/cat-packages.nix @@ -53,6 +53,7 @@ in marksman texlab imagemagick + harper ]); nix = maybe "nix" (with pkgs; [ diff --git a/plugin/25_lsp.lua b/plugin/25_lsp.lua index e249872..5250cdd 100644 --- a/plugin/25_lsp.lua +++ b/plugin/25_lsp.lua @@ -17,6 +17,37 @@ now_if_args(function() marksman = { filetypes = { "markdown", "markdown_inline", "codecompanion" }, }, + harper_ls = { + cmd = { "harper-ls", "--stdio" }, + filetypes = { "markdown", "quarto", "text", "tex", "typst" }, + root_markers = { ".git", ".harper" }, + settings = { + ["harper-ls"] = { + linters = { + SpellCheck = true, + SpelledNumbers = false, + AnA = true, + SentenceCapitalization = true, + UnclosedQuotes = true, + WrongApostrophe = false, + LongSentences = true, + RepeatedWords = true, + Spaces = true, + CorrectNumberSuffix = true, + }, + codeActions = { + ForceStable = false, + }, + markdown = { + IgnoreLinkTitle = false, + }, + diagnosticSeverity = "hint", + isolateEnglish = false, + dialect = "American", + maxFileLength = 120000, + }, + }, + }, nil_ls = { settings = { ["nil"] = {