languages/liquid: add lsp/presets/emmet-ls to lsp.servers

This commit is contained in:
Snoweuph 2026-04-15 19:08:48 +02:00
commit db13552f57
No known key found for this signature in database
GPG key ID: BEFC41DA223CEC55

View file

@ -4,11 +4,16 @@
lib, lib,
... ...
}: let }: let
inherit (lib.options) mkEnableOption literalExpression; inherit (lib) genAttrs;
inherit (lib.options) mkEnableOption literalExpression mkOption;
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf mkMerge;
inherit (lib.types) enum listOf;
inherit (lib.nvim.types) mkGrammarOption; inherit (lib.nvim.types) mkGrammarOption;
cfg = config.vim.languages.liquid; cfg = config.vim.languages.liquid;
defaultServers = [];
servers = ["emmet-ls"];
in { in {
options.vim.languages.liquid = { options.vim.languages.liquid = {
enable = mkEnableOption "Liquid templating language support"; enable = mkEnableOption "Liquid templating language support";
@ -22,6 +27,21 @@ in {
}; };
package = mkGrammarOption pkgs "liquid"; package = mkGrammarOption pkgs "liquid";
}; };
lsp = {
enable =
mkEnableOption "Liquid LSP support"
// {
default = config.vim.lsp.enable;
defaultText = literalExpression "config.vim.lsp.enable";
};
servers = mkOption {
description = "Liquid LSP server to use";
type = listOf (enum servers);
default = defaultServers;
};
};
# TODO: if curlylint gets packaged for nix, add it. # TODO: if curlylint gets packaged for nix, add it.
}; };
@ -30,5 +50,14 @@ in {
vim.treesitter.enable = true; vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.package]; vim.treesitter.grammars = [cfg.treesitter.package];
}) })
(mkIf cfg.lsp.enable {
vim.lsp = {
presets = genAttrs cfg.lsp.servers (_: {enable = true;});
servers = genAttrs cfg.lsp.servers (_: {
filetypes = ["liquid"];
});
};
})
]); ]);
} }