mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-26 19:37:36 +00:00
lsp/presets/harper: move to new lsp/presets namespace
This commit is contained in:
parent
fae3be6c27
commit
f6da4534bd
8 changed files with 59 additions and 101 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
./lspconfig
|
||||
./lspsaga
|
||||
./null-ls
|
||||
./harper-ls
|
||||
|
||||
# lsp plugins
|
||||
./lspsaga
|
||||
|
|
|
|||
|
|
@ -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 =
|
||||
# <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"
|
||||
"scala"
|
||||
"sh"
|
||||
"swift"
|
||||
"text"
|
||||
"toml"
|
||||
"typescript"
|
||||
"typescriptreact"
|
||||
"typst"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
imports = [
|
||||
./harper-ls.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
{
|
||||
imports = [];
|
||||
imports = [
|
||||
./harper.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
53
modules/plugins/lsp/presets/harper.nix
Normal file
53
modules/plugins/lsp/presets/harper.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue