1
0
Fork 0

Make dictionary apply to harper

This commit is contained in:
Ethan Reece 2025-07-18 20:50:18 -05:00
parent 73f84b50da
commit 95b91e5ac4
Signed by: me
GPG key ID: DD8CE04D5D8FF832
2 changed files with 15 additions and 1 deletions

View file

@ -18,6 +18,7 @@
# https://github.com/helix-editor/helix/blob/master/languages.toml
# https://helix-editor.vercel.app/reference/formatters
# https://docs.helix-editor.com/lang-support.html
# https://docs.helix-editor.com/languages.html
languages = lib.mkOption {
description = ''
Configuration for Helix `languages.toml`.

View file

@ -98,6 +98,16 @@
};
file = tomlFormatter.generate "typos.toml" typos.content;
};
harper = {
dictionary = {
name = "dictionary.txt";
text = builtins.concatStringsSep "\n" config.languages.en-us.dictionary;
path = pkgs.writeTextFile {
name = harper.dictionary.name;
text = harper.dictionary.text;
};
};
};
in
{
languages.en-us.dictionary = [
@ -126,7 +136,10 @@
config.configPath = "${vale.directory.path}/${vale.config.name}";
};
# https://writewithharper.com/docs/integrations/language-server#Supported-Languages
harper-ls.command = "${pkgs.harper}/bin/harper-ls";
harper-ls = {
command = "${pkgs.harper}/bin/harper-ls";
config.harper-ls.userDictPath = harper.dictionary.path;
};
typos = {
command = "${pkgs.typos-lsp}/bin/typos-lsp";
config.config = typos.file.outPath;