mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-02-04 02:45:53 +00:00
lsp/harper-ls: add config option for filetypes
This commit is contained in:
parent
92854bd0ea
commit
9834eb3324
3 changed files with 47 additions and 2 deletions
|
|
@ -174,6 +174,9 @@
|
|||
|
||||
- Added Makefile support via `languages.make`.
|
||||
|
||||
- Added config option to [harper-ls](https://github.com/Automattic/harper) to
|
||||
limit it to supported filetypes.
|
||||
|
||||
[vagahbond](https://github.com/vagahbond): [codewindow.nvim]:
|
||||
https://github.com/gorbit99/codewindow.nvim
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,10 @@
|
|||
in {
|
||||
config = mkIf (cfg.enable && cfg.harper-ls.enable) {
|
||||
vim.lsp.servers.harper-ls = {
|
||||
root_markers = [".git"];
|
||||
root_markers = [".git" ".harper-dictionary.txt"];
|
||||
cmd = [(getExe pkgs.harper) "--stdio"];
|
||||
settings = {harper-ls = cfg.harper-ls.settings;};
|
||||
filetypes = cfg.harper-ls.filetypes;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) anything attrsOf;
|
||||
inherit (lib.types) anything attrsOf nullOr listOf str;
|
||||
in {
|
||||
options.vim.lsp.harper-ls = {
|
||||
enable = mkEnableOption "Harper grammar checking LSP";
|
||||
|
|
@ -31,5 +31,46 @@ in {
|
|||
};
|
||||
description = "Settings to pass to harper-ls";
|
||||
};
|
||||
filetypes = mkOption {
|
||||
type = nullOr (listOf str);
|
||||
# <https://writewithharper.com/docs/integrations/language-server#Supported-Languages>
|
||||
default = [
|
||||
"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"
|
||||
];
|
||||
description = "Filetypes to auto-attach LSP server in";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue