From 72634c2603187f1b66a13f1342ab5c0e63a34bd8 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 26 Sep 2024 17:58:01 +0300 Subject: [PATCH] add more setupOpts for conform.nvim --- .../formatter/conform-nvim/conform-nvim.nix | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/modules/plugins/formatter/conform-nvim/conform-nvim.nix b/modules/plugins/formatter/conform-nvim/conform-nvim.nix index a4e0d31..be977e6 100644 --- a/modules/plugins/formatter/conform-nvim/conform-nvim.nix +++ b/modules/plugins/formatter/conform-nvim/conform-nvim.nix @@ -4,7 +4,7 @@ ... }: let inherit (lib.options) mkOption mkEnableOption literalExpression; - inherit (lib.types) attrs; + inherit (lib.types) attrs enum; inherit (lib.nvim.types) mkPluginSetupOption; in { options.vim.formatter.conform-nvim = { @@ -28,6 +28,34 @@ in { default = {lsp_format = "fallback";}; description = "Default values when calling `conform.format()`"; }; + + format_on_save = mkOption { + type = attrs; + default = { + lsp_format = "fallback"; + timeout_ms = 500; + }; + description = '' + Table that will be passed to `conform.format()`. If this + is set, Conform will run the formatter on save. + ''; + }; + + format_after_save = mkOption { + type = attrs; + default = {lsp_format = "fallback";}; + description = '' + Table that will be passed to `conform.format()`. If this + is set, Conform will run the formatter asynchronously after + save. + ''; + }; + + log_level = mkOption { + type = enum ["vim.log.levels.ERROR" "vim.log.levels.WARN" "vim.log.levels.INFO" "vim.log.levels.DEBUG"]; + default = "vim.log.levels.ERROR"; # TODO: make this luaInline + description = "Logging level for conform-nvim"; + }; }; }; }