From f6da4534bd95deaccd7e98ffda81c9b1de763004 Mon Sep 17 00:00:00 2001 From: Snoweuph Date: Sat, 11 Apr 2026 12:31:21 +0200 Subject: [PATCH] lsp/presets/harper: move to new lsp/presets namespace --- configuration.nix | 2 +- docs/manual/release-notes/rl-0.9.md | 2 + modules/plugins/lsp/default.nix | 1 - modules/plugins/lsp/harper-ls/config.nix | 57 --------------------- modules/plugins/lsp/harper-ls/default.nix | 6 --- modules/plugins/lsp/harper-ls/harper-ls.nix | 35 ------------- modules/plugins/lsp/presets/default.nix | 4 +- modules/plugins/lsp/presets/harper.nix | 53 +++++++++++++++++++ 8 files changed, 59 insertions(+), 101 deletions(-) delete mode 100644 modules/plugins/lsp/harper-ls/config.nix delete mode 100644 modules/plugins/lsp/harper-ls/default.nix delete mode 100644 modules/plugins/lsp/harper-ls/harper-ls.nix create mode 100644 modules/plugins/lsp/presets/harper.nix diff --git a/configuration.nix b/configuration.nix index 2c687794..08c4b1c1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -34,7 +34,7 @@ isMaximal: { lspSignature.enable = !isMaximal; # conflicts with blink in maximal otter-nvim.enable = isMaximal; nvim-docs-view.enable = isMaximal; - harper-ls.enable = isMaximal; + presets.harper.enable = isMaximal; }; debugger = { diff --git a/docs/manual/release-notes/rl-0.9.md b/docs/manual/release-notes/rl-0.9.md index 85c56e03..1ef7fe8e 100644 --- a/docs/manual/release-notes/rl-0.9.md +++ b/docs/manual/release-notes/rl-0.9.md @@ -63,6 +63,8 @@ - Added `json5` into `languages.json`. Some options where renamed. +- Moved `vim.lsp.harper-ls` to `vim.lsp.presets.haper`. + ## Changelog {#sec-release-0-9-changelog} [SecBear](https://github.com/SecBear): diff --git a/modules/plugins/lsp/default.nix b/modules/plugins/lsp/default.nix index 05731e97..6f135858 100644 --- a/modules/plugins/lsp/default.nix +++ b/modules/plugins/lsp/default.nix @@ -9,7 +9,6 @@ ./lspconfig ./lspsaga ./null-ls - ./harper-ls # lsp plugins ./lspsaga diff --git a/modules/plugins/lsp/harper-ls/config.nix b/modules/plugins/lsp/harper-ls/config.nix deleted file mode 100644 index 41a51c62..00000000 --- a/modules/plugins/lsp/harper-ls/config.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ - 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" ".harper-dictionary.txt"]; - cmd = [(getExe pkgs.harper) "--stdio"]; - settings = {harper-ls = cfg.harper-ls.settings;}; - filetypes = - # - [ - "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" - ]; - }; - }; -} diff --git a/modules/plugins/lsp/harper-ls/default.nix b/modules/plugins/lsp/harper-ls/default.nix deleted file mode 100644 index 9b4b3ec7..00000000 --- a/modules/plugins/lsp/harper-ls/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - imports = [ - ./harper-ls.nix - ./config.nix - ]; -} diff --git a/modules/plugins/lsp/harper-ls/harper-ls.nix b/modules/plugins/lsp/harper-ls/harper-ls.nix deleted file mode 100644 index 9fab45fe..00000000 --- a/modules/plugins/lsp/harper-ls/harper-ls.nix +++ /dev/null @@ -1,35 +0,0 @@ -{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"; - }; - }; -} diff --git a/modules/plugins/lsp/presets/default.nix b/modules/plugins/lsp/presets/default.nix index 70dec767..f203f801 100644 --- a/modules/plugins/lsp/presets/default.nix +++ b/modules/plugins/lsp/presets/default.nix @@ -1,3 +1,5 @@ { - imports = []; + imports = [ + ./harper.nix + ]; } diff --git a/modules/plugins/lsp/presets/harper.nix b/modules/plugins/lsp/presets/harper.nix new file mode 100644 index 00000000..3739e937 --- /dev/null +++ b/modules/plugins/lsp/presets/harper.nix @@ -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 = [ + # + "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" + ]; + }; + }; +}