treewide: Reformat with nixfmt

This commit is contained in:
traxys 2024-05-05 19:39:35 +02:00
parent c6281260dc
commit 62f32bfc71
459 changed files with 28139 additions and 26377 deletions

View file

@ -4,42 +4,45 @@
pkgs,
config,
...
} @ args: let
cmpOptions = import ./options {inherit lib helpers;};
}@args:
let
cmpOptions = import ./options { inherit lib helpers; };
in
with lib;
helpers.neovim-plugin.mkNeovimPlugin config {
name = "cmp";
originalName = "nvim-cmp";
defaultPackage = pkgs.vimPlugins.nvim-cmp;
with lib;
helpers.neovim-plugin.mkNeovimPlugin config {
name = "cmp";
originalName = "nvim-cmp";
defaultPackage = pkgs.vimPlugins.nvim-cmp;
maintainers = [maintainers.GaetanLepage];
maintainers = [ maintainers.GaetanLepage ];
# Introduced on 2024 February 21
# TODO: remove ~June 2024
imports = [
./deprecations.nix
./sources
];
deprecateExtraOptions = true;
# Introduced on 2024 February 21
# TODO: remove ~June 2024
imports = [
./deprecations.nix
./sources
];
deprecateExtraOptions = true;
extraOptions = {
autoEnableSources = mkOption {
type = types.bool;
default = true;
description = ''
Scans the sources array and installs the plugins if they are known to nixvim.
'';
};
extraOptions = {
autoEnableSources = mkOption {
type = types.bool;
default = true;
description = ''
Scans the sources array and installs the plugins if they are known to nixvim.
'';
};
inherit (cmpOptions) filetype cmdline;
};
inherit (cmpOptions) filetype cmdline;
};
inherit (cmpOptions) settingsOptions settingsExample;
inherit (cmpOptions) settingsOptions settingsExample;
callSetup = false;
extraConfig = cfg: {
warnings = optional (cfg.autoEnableSources && (helpers.nixvimTypes.isRawType cfg.settings.sources)) ''
callSetup = false;
extraConfig = cfg: {
warnings =
optional (cfg.autoEnableSources && (helpers.nixvimTypes.isRawType cfg.settings.sources))
''
Nixvim (plugins.cmp): You have enabled `autoEnableSources` that tells Nixvim to automatically
enable the source plugins with respect to the list of sources provided in `settings.sources`.
However, the latter is proveded as a raw lua string which is not parseable by Nixvim.
@ -49,35 +52,25 @@ in
- Dismiss this warning by explicitly setting `autoEnableSources` to `false`;
'';
extraConfigLua =
''
local cmp = require('cmp')
cmp.setup(${helpers.toLuaObject cfg.settings})
extraConfigLua =
''
local cmp = require('cmp')
cmp.setup(${helpers.toLuaObject cfg.settings})
''
+ (
concatStringsSep "\n"
(
mapAttrsToList
(
filetype: settings: "cmp.setup.filetype('${filetype}', ${helpers.toLuaObject settings})\n"
)
cfg.filetype
)
)
+ (
concatStringsSep "\n"
(
mapAttrsToList
(
cmdtype: settings: "cmp.setup.cmdline('${cmdtype}', ${helpers.toLuaObject settings})\n"
)
cfg.cmdline
)
);
''
+ (concatStringsSep "\n" (
mapAttrsToList (
filetype: settings: "cmp.setup.filetype('${filetype}', ${helpers.toLuaObject settings})\n"
) cfg.filetype
))
+ (concatStringsSep "\n" (
mapAttrsToList (
cmdtype: settings: "cmp.setup.cmdline('${cmdtype}', ${helpers.toLuaObject settings})\n"
) cfg.cmdline
));
# If autoEnableSources is set to true, figure out which are provided by the user
# and enable the corresponding plugins.
plugins = (import ./cmp-helpers.nix args).autoInstallSourcePluginsModule cfg;
};
}
# If autoEnableSources is set to true, figure out which are provided by the user
# and enable the corresponding plugins.
plugins = (import ./cmp-helpers.nix args).autoInstallSourcePluginsModule cfg;
};
}