gleam: not using formatter

This commit is contained in:
Soliprem 2024-12-03 15:34:37 +01:00
commit 75b27f2198

View file

@ -30,22 +30,6 @@
'';
};
};
defaultFormat = "gleam_format";
formats = {
gleam_format = {
package = pkgs.gleam;
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.gleam_format.with({
command = "${cfg.format.package}/bin/gleam",
})
)
'';
};
};
in {
options.vim.languages.gleam = {
enable = mkEnableOption "Gleam language support";
@ -74,22 +58,6 @@ in {
description = "gleam LSP server package, or the command to run as a list of strings";
};
};
format = {
enable = mkEnableOption "Gleam formatting" // {default = config.vim.languages.enableFormat;};
type = mkOption {
type = enum (attrNames formats);
default = defaultFormat;
description = "Gleam formatter to use";
};
package = mkOption {
type = package;
default = formats.${cfg.format.type}.package;
description = "Gleam formatter package";
};
};
};
config = mkIf cfg.enable (mkMerge [
@ -102,10 +70,5 @@ in {
vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.gleam-lsp = servers.${cfg.lsp.server}.lspConfig;
})
(mkIf cfg.format.enable {
vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources.gleam-format = formats.${cfg.format.type}.nullConfig;
})
]);
}