Compare commits

..

No commits in common. "b92d9e7e2638be558a466c6dfcc2d3e08b82e894" and "d33286d5495a4b0869e8cb8e25fc8e0778060eb8" have entirely different histories.

3 changed files with 7 additions and 83 deletions

View file

@ -283,15 +283,3 @@
[Sc3l3t0n](https://github.com/Sc3l3t0n): [Sc3l3t0n](https://github.com/Sc3l3t0n):
- Add F# support under `vim.languages.fsharp`. - Add F# support under `vim.languages.fsharp`.
[venkyr77](https://github.com/venkyr77):
- Add lint (luacheck) and formatting (stylua) support for Lua.
[tebuevd](https://github.com/tebuevd):
- Fix `pickers` configuration for `telescope` by nesting it under `setupOpts`
- Fix `find_command` configuration for `telescope` by nesting it under
`setupOpts.pickers.find_files`
- Update default `telescope.setupOpts.pickers.find_files.find_command` to only
include files (and therefore exclude directories from results)

View file

@ -4,30 +4,16 @@
lib, lib,
... ...
}: let }: let
inherit (builtins) attrNames;
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf mkMerge;
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
inherit (lib.lists) isList; inherit (lib.lists) isList;
inherit (lib.types) bool either enum listOf package str; inherit (lib.types) either listOf package str;
inherit (lib.nvim.types) diagnostics mkGrammarOption; inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua; inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.dag) entryBefore; inherit (lib.nvim.dag) entryBefore;
cfg = config.vim.languages.lua; cfg = config.vim.languages.lua;
defaultFormat = "stylua";
formats = {
stylua = {
package = pkgs.stylua;
};
};
defaultDiagnosticsProvider = ["luacheck"];
diagnosticsProviders = {
luacheck = {
package = pkgs.luajitPackages.luacheck;
};
};
in { in {
imports = [ imports = [
(lib.mkRemovedOptionModule ["vim" "languages" "lua" "lsp" "neodev"] '' (lib.mkRemovedOptionModule ["vim" "languages" "lua" "lsp" "neodev"] ''
@ -53,34 +39,6 @@ in {
lazydev.enable = mkEnableOption "lazydev.nvim integration, useful for neovim plugin developers"; lazydev.enable = mkEnableOption "lazydev.nvim integration, useful for neovim plugin developers";
}; };
format = {
enable = mkOption {
type = bool;
default = config.vim.languages.enableFormat;
description = "Enable Lua formatting";
};
type = mkOption {
type = enum (attrNames formats);
default = defaultFormat;
description = "Lua formatter to use";
};
package = mkOption {
type = package;
default = formats.${cfg.format.type}.package;
description = "Lua formatter package";
};
};
extraDiagnostics = {
enable = mkEnableOption "extra Lua diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
types = diagnostics {
langDesc = "Lua";
inherit diagnosticsProviders;
inherit defaultDiagnosticsProvider;
};
};
}; };
config = mkMerge [ config = mkMerge [
@ -116,27 +74,6 @@ in {
}) })
''; '';
}) })
(mkIf cfg.format.enable {
vim.formatter.conform-nvim = {
enable = true;
setupOpts.formatters_by_ft.lua = [cfg.format.type];
setupOpts.formatters.${cfg.format.type} = {
command = getExe cfg.format.package;
};
};
})
(mkIf cfg.extraDiagnostics.enable {
vim.diagnostics.nvim-lint = {
enable = true;
linters_by_ft.lua = cfg.extraDiagnostics.types;
linters = mkMerge (map (name: {
${name}.cmd = getExe diagnosticsProviders.${name}.package;
})
cfg.extraDiagnostics.types);
};
})
])) ]))
]; ];
} }

View file

@ -8,12 +8,6 @@
inherit (lib.nvim.binds) mkMappingOption; inherit (lib.nvim.binds) mkMappingOption;
inherit (lib.nvim.types) mkPluginSetupOption luaInline; inherit (lib.nvim.types) mkPluginSetupOption luaInline;
setupOptions = { setupOptions = {
pickers.find_files.find_command = mkOption {
description = "cmd to use for finding files";
type = either (listOf str) luaInline;
default = ["${pkgs.fd}/bin/fd" "--type=file"];
};
defaults = { defaults = {
vimgrep_arguments = mkOption { vimgrep_arguments = mkOption {
description = '' description = ''
@ -33,6 +27,11 @@
"--no-ignore" "--no-ignore"
]; ];
}; };
pickers.find_command = mkOption {
description = "cmd to use for finding files";
type = either (listOf str) luaInline;
default = ["${pkgs.fd}/bin/fd"];
};
prompt_prefix = mkOption { prompt_prefix = mkOption {
description = "Shown in front of Telescope's prompt"; description = "Shown in front of Telescope's prompt";
type = str; type = str;