diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 8e3d93e0..5d0e1dbe 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -283,15 +283,3 @@ [Sc3l3t0n](https://github.com/Sc3l3t0n): - 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) diff --git a/modules/plugins/languages/lua.nix b/modules/plugins/languages/lua.nix index d5be4905..4ad49784 100644 --- a/modules/plugins/languages/lua.nix +++ b/modules/plugins/languages/lua.nix @@ -4,30 +4,16 @@ lib, ... }: let - inherit (builtins) attrNames; inherit (lib.options) mkEnableOption mkOption; inherit (lib.modules) mkIf mkMerge; inherit (lib.meta) getExe; inherit (lib.lists) isList; - inherit (lib.types) bool either enum listOf package str; - inherit (lib.nvim.types) diagnostics mkGrammarOption; + inherit (lib.types) either listOf package str; + inherit (lib.nvim.types) mkGrammarOption; inherit (lib.nvim.lua) expToLua; inherit (lib.nvim.dag) entryBefore; cfg = config.vim.languages.lua; - defaultFormat = "stylua"; - formats = { - stylua = { - package = pkgs.stylua; - }; - }; - - defaultDiagnosticsProvider = ["luacheck"]; - diagnosticsProviders = { - luacheck = { - package = pkgs.luajitPackages.luacheck; - }; - }; in { imports = [ (lib.mkRemovedOptionModule ["vim" "languages" "lua" "lsp" "neodev"] '' @@ -53,34 +39,6 @@ in { 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 [ @@ -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); - }; - }) ])) ]; } diff --git a/modules/plugins/utility/telescope/telescope.nix b/modules/plugins/utility/telescope/telescope.nix index beacc990..0665eb11 100644 --- a/modules/plugins/utility/telescope/telescope.nix +++ b/modules/plugins/utility/telescope/telescope.nix @@ -8,12 +8,6 @@ inherit (lib.nvim.binds) mkMappingOption; inherit (lib.nvim.types) mkPluginSetupOption luaInline; 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 = { vimgrep_arguments = mkOption { description = '' @@ -33,6 +27,11 @@ "--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 { description = "Shown in front of Telescope's prompt"; type = str;