mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-27 03:47:37 +00:00
56 lines
1.1 KiB
Nix
56 lines
1.1 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}: let
|
|
inherit (lib.meta) getExe;
|
|
inherit (lib.modules) mkIf;
|
|
inherit (lib.nvim.types) mkLspPresetEnableOption;
|
|
|
|
cfg = config.vim.lsp.presets.harper;
|
|
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"
|
|
];
|
|
in {
|
|
options.vim.lsp.presets.harper = {
|
|
enable = mkLspPresetEnableOption "harper" "Harper" filetypes;
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
vim.lsp.servers.harper = {
|
|
enable = true;
|
|
cmd = [(getExe pkgs.harper) "--stdio"];
|
|
root_markers = [".git" ".harper-dictionary.txt"];
|
|
# Make Harper shut up in the logs, that its key is required, when nothing is configured.
|
|
settings.harper-ls = {};
|
|
inherit filetypes;
|
|
};
|
|
};
|
|
}
|