assistant/supermaven-nvim: explicit type imports

This commit is contained in:
Devin Droddy 2025-07-05 11:15:37 -04:00
commit 53c85ca262
No known key found for this signature in database

View file

@ -1,80 +1,86 @@
{lib, ...}: let {lib, ...}: let
inherit (lib) types; inherit
(lib.types)
nullOr
str
bool
attrsOf
ints
enum
;
inherit (lib.options) mkOption mkEnableOption; inherit (lib.options) mkOption mkEnableOption;
in { in {
options.vim.assistant.supermaven-nvim = { options.vim.assistant.supermaven-nvim = {
enable = mkEnableOption "Supermaven AI assistant"; enable = mkEnableOption "Supermaven AI assistant";
setupOpts = lib.nvim.types.mkPluginSetupOption "Supermaven" { setupOpts = lib.nvim.mkPluginSetupOption "Supermaven" {
keymaps = { keymaps = {
accept_suggestion = mkOption { accept_suggestion = mkOption {
type = types.nullOr lib.types.str; type = nullOr str;
default = null; default = null;
example = "<Tab>"; example = "<Tab>";
description = "The key to accept a suggestion"; description = "The key to accept a suggestion";
}; };
clear_suggestion = mkOption { clear_suggestion = mkOption {
type = types.nullOr lib.types.str; type = nullOr str;
default = null; default = null;
example = "<C-]>"; example = "<C-]>";
description = "The key to clear a suggestion"; description = "The key to clear a suggestion";
}; };
accept_word = mkOption { accept_word = mkOption {
type = types.nullOr lib.types.str; type = nullOr str;
default = null; default = null;
example = "<C-j>"; example = "<C-j>";
description = "The key to accept a word"; description = "The key to accept a word";
}; };
}; };
ignore_filetypes = mkOption { ignore_file = mkOption {
type = types.nullOr (types.attrsOf types.bool); type = nullOr (attrsOf bool);
default = null; default = null;
example = { example = {
markdown = true; markdown = true;
}; };
description = "List of filetypes to ignore"; description = "List of fileto ignore";
}; };
color = { color = {
suggestion_color = mkOption { suggestion_color = mkOption {
type = types.nullOr types.str; type = nullOr str;
default = null; default = null;
example = "#ffffff"; example = "#ffffff";
description = "The hex color of the suggestion"; description = "The hex color of the suggestion";
}; };
cterm = mkOption { cterm = mkOption {
type = types.nullOr types.ints.u8; type = nullOr ints.u8;
default = null; default = null;
example = 244; example = 244;
description = "The cterm color of the suggestion"; description = "The cterm color of the suggestion";
}; };
}; };
log_level = mkOption { log_level = mkOption {
type = types.nullOr ( type = nullOr (enum [
types.enum [
"off" "off"
"trace" "trace"
"debug" "debug"
"info" "info"
"warn" "warn"
"error" "error"
] ]);
);
default = null; default = null;
example = "info"; example = "info";
description = "The log level. Set to `\"off\"` to disable completely"; description = "The log level. Set to `\"off\"` to disable completely";
}; };
disable_inline_completion = mkOption { disable_inline_completion = mkOption {
type = types.nullOr types.bool; type = nullOr bool;
default = null; default = null;
description = "Disable inline completion for use with cmp"; description = "Disable inline completion for use with cmp";
}; };
disable_keymaps = mkOption { disable_keymaps = mkOption {
type = types.nullOr types.bool; type = nullOr bool;
default = null; default = null;
description = "Disable built-in keymaps for more manual control"; description = "Disable built-in keymaps for more manual control";
}; };
condition = mkOption { condition = mkOption {
type = types.nullOr lib.nvim.types.luaInline; type = nullOr lib.nvim.luaInline;
default = null; default = null;
description = '' description = ''
Condition function to check for stopping supermaven. Condition function to check for stopping supermaven.