From a436aca603a0c95b9b085d05ce9593b9afd99c1b Mon Sep 17 00:00:00 2001 From: rice-cracker-dev Date: Sat, 12 Apr 2025 20:53:19 +0700 Subject: [PATCH 01/19] nvim-lint: added required files support --- docs/release-notes/rl-0.8.md | 1 + .../plugins/diagnostics/nvim-lint/config.nix | 25 ++++++++++- .../diagnostics/nvim-lint/nvim-lint.nix | 7 +++ modules/plugins/languages/astro.nix | 43 +++++++------------ modules/plugins/languages/svelte.nix | 23 ++++------ modules/plugins/languages/ts.nix | 40 +++++++---------- 6 files changed, 71 insertions(+), 68 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 710578eb..d5190855 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -290,6 +290,7 @@ - `eslint_d` now checks for configuration files to load. - Fixed an error where `eslint_d` fails to load. +- Added required files support for linters under `vim.diagnostics.nvim-lint.linters.*.required_files`. [Sc3l3t0n](https://github.com/Sc3l3t0n): diff --git a/modules/plugins/diagnostics/nvim-lint/config.nix b/modules/plugins/diagnostics/nvim-lint/config.nix index b284270b..c7326cff 100644 --- a/modules/plugins/diagnostics/nvim-lint/config.nix +++ b/modules/plugins/diagnostics/nvim-lint/config.nix @@ -38,8 +38,29 @@ in { { event = ["BufWritePost"]; callback = mkLuaInline '' - function() - require("lint").try_lint() + function(args) + local ft = vim.api.nvim_get_option_value("filetype", { buf = args.buf }) + local linters = require("lint").linters + local linters_from_ft = require("lint").linters_by_ft[ft] + + -- if no linter is configured for this filetype, stops linting + if linters_from_ft == nil then return end + + for _, name in ipairs(linters_from_ft) do + local cwd = linters[name].required_files + + -- if no configuration files are configured, lint + if cwd == nil then + require("lint").try_lint(name) + else + -- if configuration files are configured and present in the project, lint + for _, fn in ipairs(cwd) do + if vim.uv.fs_stat(fn) then + require("lint").try_lint(name) + end + end + end + end end ''; } diff --git a/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix b/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix index 20f14f0b..cb830975 100644 --- a/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix +++ b/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix @@ -69,6 +69,13 @@ default = null; description = "Parser function"; }; + + required_files = mkOption { + type = nullOr (listOf str); + default = null; + description = "Required files to lint"; + example = ["eslint.config.js"]; + }; }; }; in { diff --git a/modules/plugins/languages/astro.nix b/modules/plugins/languages/astro.nix index c12f6ada..2ecbbe47 100644 --- a/modules/plugins/languages/astro.nix +++ b/modules/plugins/languages/astro.nix @@ -53,24 +53,20 @@ # TODO: specify packages defaultDiagnosticsProvider = ["eslint_d"]; diagnosticsProviders = { - eslint_d = { - package = pkgs.eslint_d; + eslint_d = let + pkg = pkgs.eslint_d; + in { + package = pkg; config = { - # HACK: change if nvim-lint gets a dynamic enable thing - parser = mkLuaInline '' - function(output, bufnr, cwd) - local markers = { "eslint.config.js", "eslint.config.mjs", - ".eslintrc", ".eslintrc.json", ".eslintrc.js", ".eslintrc.yml", } - for _, filename in ipairs(markers) do - local path = vim.fs.joinpath(cwd, filename) - if vim.loop.fs_stat(path) then - return require("lint.linters.eslint_d").parser(output, bufnr, cwd) - end - end - - return {} - end - ''; + cmd = getExe pkg; + required_files = [ + "eslint.config.js" + "eslint.config.mjs" + ".eslintrc" + ".eslintrc.json" + ".eslintrc.js" + ".eslintrc.yml" + ]; }; }; }; @@ -153,16 +149,9 @@ in { vim.diagnostics.nvim-lint = { enable = true; linters_by_ft.astro = cfg.extraDiagnostics.types; - linters = mkMerge (map ( - name: { - ${name} = - diagnosticsProviders.${name}.config - // { - cmd = getExe diagnosticsProviders.${name}.package; - }; - } - ) - cfg.extraDiagnostics.types); + linters = + mkMerge (map (name: {${name} = diagnosticsProviders.${name}.config;}) + cfg.extraDiagnostics.types); }; }) ]); diff --git a/modules/plugins/languages/svelte.nix b/modules/plugins/languages/svelte.nix index e01ec427..536ff2c1 100644 --- a/modules/plugins/languages/svelte.nix +++ b/modules/plugins/languages/svelte.nix @@ -55,21 +55,14 @@ package = pkg; config = { cmd = getExe pkg; - # HACK: change if nvim-lint gets a dynamic enable thing - parser = mkLuaInline '' - function(output, bufnr, cwd) - local markers = { "eslint.config.js", "eslint.config.mjs", - ".eslintrc", ".eslintrc.json", ".eslintrc.js", ".eslintrc.yml", } - for _, filename in ipairs(markers) do - local path = vim.fs.joinpath(cwd, filename) - if vim.loop.fs_stat(path) then - return require("lint.linters.eslint_d").parser(output, bufnr, cwd) - end - end - - return {} - end - ''; + required_files = [ + "eslint.config.js" + "eslint.config.mjs" + ".eslintrc" + ".eslintrc.json" + ".eslintrc.js" + ".eslintrc.yml" + ]; }; }; }; diff --git a/modules/plugins/languages/ts.nix b/modules/plugins/languages/ts.nix index ffab265b..df1353ab 100644 --- a/modules/plugins/languages/ts.nix +++ b/modules/plugins/languages/ts.nix @@ -91,27 +91,20 @@ # TODO: specify packages defaultDiagnosticsProvider = ["eslint_d"]; diagnosticsProviders = { - eslint_d = { - package = pkgs.eslint_d; - config = let - pkg = pkgs.eslint_d; - in { + eslint_d = let + pkg = pkgs.eslint_d; + in { + package = pkg; + config = { cmd = getExe pkg; - # HACK: change if nvim-lint gets a dynamic enable thing - parser = mkLuaInline '' - function(output, bufnr, cwd) - local markers = { "eslint.config.js", "eslint.config.mjs", - ".eslintrc", ".eslintrc.json", ".eslintrc.js", ".eslintrc.yml", } - for _, filename in ipairs(markers) do - local path = vim.fs.joinpath(cwd, filename) - if vim.loop.fs_stat(path) then - return require("lint.linters.eslint_d").parser(output, bufnr, cwd) - end - end - - return {} - end - ''; + required_files = [ + "eslint.config.js" + "eslint.config.mjs" + ".eslintrc" + ".eslintrc.json" + ".eslintrc.js" + ".eslintrc.yml" + ]; }; }; }; @@ -221,10 +214,9 @@ in { linters_by_ft.typescript = cfg.extraDiagnostics.types; linters_by_ft.typescriptreact = cfg.extraDiagnostics.types; - linters = mkMerge (map (name: { - ${name}.cmd = getExe diagnosticsProviders.${name}.package; - }) - cfg.extraDiagnostics.types); + linters = + mkMerge (map (name: {${name} = diagnosticsProviders.${name}.config;}) + cfg.extraDiagnostics.types); }; }) From 5c3a90e3f661572ddcb23ccd52a9e7fb67d8ab32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phan=20=C4=90=C4=83ng=20Khoa?= Date: Sun, 13 Apr 2025 16:06:42 +0700 Subject: [PATCH 02/19] Update modules/plugins/diagnostics/nvim-lint/config.nix Co-authored-by: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> --- modules/plugins/diagnostics/nvim-lint/config.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/plugins/diagnostics/nvim-lint/config.nix b/modules/plugins/diagnostics/nvim-lint/config.nix index c7326cff..69d9b35b 100644 --- a/modules/plugins/diagnostics/nvim-lint/config.nix +++ b/modules/plugins/diagnostics/nvim-lint/config.nix @@ -47,7 +47,13 @@ in { if linters_from_ft == nil then return end for _, name in ipairs(linters_from_ft) do - local cwd = linters[name].required_files + local linter = linters[name] + assert(linter, 'Linter with name `' .. name .. '` not available') + + if type(linter) == "function" then + linter = linter() + end + local cwd = linter.required_files -- if no configuration files are configured, lint if cwd == nil then From f4ee6a275f2cd4dc40c599c63c13e6cbab31256e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phan=20=C4=90=C4=83ng=20Khoa?= Date: Sun, 13 Apr 2025 16:06:58 +0700 Subject: [PATCH 03/19] Update modules/plugins/diagnostics/nvim-lint/config.nix Co-authored-by: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> --- modules/plugins/diagnostics/nvim-lint/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/plugins/diagnostics/nvim-lint/config.nix b/modules/plugins/diagnostics/nvim-lint/config.nix index 69d9b35b..e1ef789a 100644 --- a/modules/plugins/diagnostics/nvim-lint/config.nix +++ b/modules/plugins/diagnostics/nvim-lint/config.nix @@ -57,7 +57,7 @@ in { -- if no configuration files are configured, lint if cwd == nil then - require("lint").try_lint(name) + require("lint").lint(linter) else -- if configuration files are configured and present in the project, lint for _, fn in ipairs(cwd) do From 2b62a441e9c0383451bc1796380e7ce8d76866dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phan=20=C4=90=C4=83ng=20Khoa?= Date: Sun, 13 Apr 2025 16:07:27 +0700 Subject: [PATCH 04/19] Update modules/plugins/diagnostics/nvim-lint/nvim-lint.nix Co-authored-by: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> --- modules/plugins/diagnostics/nvim-lint/nvim-lint.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix b/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix index cb830975..6657be69 100644 --- a/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix +++ b/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix @@ -73,7 +73,7 @@ required_files = mkOption { type = nullOr (listOf str); default = null; - description = "Required files to lint"; + description = "Required files to lint. These files must exist relative to the cwd of the linter or else this linter will be skipped"; example = ["eslint.config.js"]; }; }; From 90d09ba05f1460214759241ce08c0dc686eb0b32 Mon Sep 17 00:00:00 2001 From: rice-cracker-dev Date: Sun, 13 Apr 2025 20:57:23 +0700 Subject: [PATCH 05/19] nvim-lint: switch to .lint() --- modules/plugins/diagnostics/nvim-lint/config.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/plugins/diagnostics/nvim-lint/config.nix b/modules/plugins/diagnostics/nvim-lint/config.nix index e1ef789a..f1c2f8c2 100644 --- a/modules/plugins/diagnostics/nvim-lint/config.nix +++ b/modules/plugins/diagnostics/nvim-lint/config.nix @@ -53,6 +53,8 @@ in { if type(linter) == "function" then linter = linter() end + -- for require("lint").lint() to work, linter.name must be set + linter.name = linter.name or name local cwd = linter.required_files -- if no configuration files are configured, lint @@ -61,8 +63,10 @@ in { else -- if configuration files are configured and present in the project, lint for _, fn in ipairs(cwd) do - if vim.uv.fs_stat(fn) then - require("lint").try_lint(name) + local path = vim.fs.joinpath(linter.cwd or vim.fn.getcwd(), fn); + if vim.uv.fs_stat(path) then + require("lint").lint(linter) + break end end end From acbeb26854300be3186ac6176e98f5f84c129f30 Mon Sep 17 00:00:00 2001 From: rice-cracker-dev Date: Mon, 14 Apr 2025 00:02:54 +0700 Subject: [PATCH 06/19] nvim-lint: moved linting into its own global function "nvf_lint(buf)" --- .../plugins/diagnostics/nvim-lint/config.nix | 68 ++++++++++--------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/modules/plugins/diagnostics/nvim-lint/config.nix b/modules/plugins/diagnostics/nvim-lint/config.nix index f1c2f8c2..fca38cfa 100644 --- a/modules/plugins/diagnostics/nvim-lint/config.nix +++ b/modules/plugins/diagnostics/nvim-lint/config.nix @@ -28,6 +28,41 @@ in { end end end + + function nvf_lint(buf) + local ft = vim.api.nvim_get_option_value("filetype", { buf = buf }) + local linters = require("lint").linters + local linters_from_ft = require("lint").linters_by_ft[ft] + + -- if no linter is configured for this filetype, stops linting + if linters_from_ft == nil then return end + + for _, name in ipairs(linters_from_ft) do + local linter = linters[name] + assert(linter, 'Linter with name `' .. name .. '` not available') + + if type(linter) == "function" then + linter = linter() + end + -- for require("lint").lint() to work, linter.name must be set + linter.name = linter.name or name + local cwd = linter.required_files + + -- if no configuration files are configured, lint + if cwd == nil then + require("lint").lint(linter) + else + -- if configuration files are configured and present in the project, lint + for _, fn in ipairs(cwd) do + local path = vim.fs.joinpath(linter.cwd or vim.fn.getcwd(), fn); + if vim.uv.fs_stat(path) then + require("lint").lint(linter) + break + end + end + end + end + end ''; }; }) @@ -39,38 +74,7 @@ in { event = ["BufWritePost"]; callback = mkLuaInline '' function(args) - local ft = vim.api.nvim_get_option_value("filetype", { buf = args.buf }) - local linters = require("lint").linters - local linters_from_ft = require("lint").linters_by_ft[ft] - - -- if no linter is configured for this filetype, stops linting - if linters_from_ft == nil then return end - - for _, name in ipairs(linters_from_ft) do - local linter = linters[name] - assert(linter, 'Linter with name `' .. name .. '` not available') - - if type(linter) == "function" then - linter = linter() - end - -- for require("lint").lint() to work, linter.name must be set - linter.name = linter.name or name - local cwd = linter.required_files - - -- if no configuration files are configured, lint - if cwd == nil then - require("lint").lint(linter) - else - -- if configuration files are configured and present in the project, lint - for _, fn in ipairs(cwd) do - local path = vim.fs.joinpath(linter.cwd or vim.fn.getcwd(), fn); - if vim.uv.fs_stat(path) then - require("lint").lint(linter) - break - end - end - end - end + nvf_lint(args.buf) end ''; } From a3051d49aa5f32d9ceab672bad52d591b8a78a8e Mon Sep 17 00:00:00 2001 From: rice-cracker-dev Date: Mon, 14 Apr 2025 00:03:22 +0700 Subject: [PATCH 07/19] format: formatted the project --- npins/sources.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/npins/sources.nix b/npins/sources.nix index 162f1d94..3ae0b99e 100644 --- a/npins/sources.nix +++ b/npins/sources.nix @@ -98,7 +98,9 @@ builtins.mapAttrs Channel = getZip; Tarball = getUrl; } - .${spec.type} + .${ + spec.type + } or (builtins.throw "Unknown source type ${spec.type}"); in spec // {outPath = mayOverride (func spec);} From f830553166bbf38963413c638d9240d71a0ea8bb Mon Sep 17 00:00:00 2001 From: rice-cracker-dev Date: Mon, 14 Apr 2025 18:01:52 +0700 Subject: [PATCH 08/19] nvim_lint: moved the function into a separate option "lint_function" --- docs/release-notes/rl-0.8.md | 5 +- .../plugins/diagnostics/nvim-lint/config.nix | 35 +----------- .../diagnostics/nvim-lint/nvim-lint.nix | 56 ++++++++++++++++++- 3 files changed, 58 insertions(+), 38 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index d5190855..b8c51358 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -289,8 +289,9 @@ [rice-cracker-dev](https://github.com/rice-cracker-dev): - `eslint_d` now checks for configuration files to load. -- Fixed an error where `eslint_d` fails to load. -- Added required files support for linters under `vim.diagnostics.nvim-lint.linters.*.required_files`. +- Fix an error where `eslint_d` fails to load. +- Add required files support for linters under `vim.diagnostics.nvim-lint.linters.*.required_files`. +- Add global function `nvf_lint` under `vim.diagnostics.nvim-lint.lint_function`. [Sc3l3t0n](https://github.com/Sc3l3t0n): diff --git a/modules/plugins/diagnostics/nvim-lint/config.nix b/modules/plugins/diagnostics/nvim-lint/config.nix index fca38cfa..488bd70f 100644 --- a/modules/plugins/diagnostics/nvim-lint/config.nix +++ b/modules/plugins/diagnostics/nvim-lint/config.nix @@ -29,40 +29,7 @@ in { end end - function nvf_lint(buf) - local ft = vim.api.nvim_get_option_value("filetype", { buf = buf }) - local linters = require("lint").linters - local linters_from_ft = require("lint").linters_by_ft[ft] - - -- if no linter is configured for this filetype, stops linting - if linters_from_ft == nil then return end - - for _, name in ipairs(linters_from_ft) do - local linter = linters[name] - assert(linter, 'Linter with name `' .. name .. '` not available') - - if type(linter) == "function" then - linter = linter() - end - -- for require("lint").lint() to work, linter.name must be set - linter.name = linter.name or name - local cwd = linter.required_files - - -- if no configuration files are configured, lint - if cwd == nil then - require("lint").lint(linter) - else - -- if configuration files are configured and present in the project, lint - for _, fn in ipairs(cwd) do - local path = vim.fs.joinpath(linter.cwd or vim.fn.getcwd(), fn); - if vim.uv.fs_stat(path) then - require("lint").lint(linter) - break - end - end - end - end - end + nvf_lint = ${toLuaObject cfg.lint_function} ''; }; }) diff --git a/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix b/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix index 6657be69..59c50f1d 100644 --- a/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix +++ b/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix @@ -1,7 +1,8 @@ {lib, ...}: let - inherit (lib.options) mkOption mkEnableOption; + inherit (lib.options) mkOption mkEnableOption literalExpression; inherit (lib.types) nullOr attrsOf listOf str either submodule bool enum; inherit (lib.nvim.types) luaInline; + inherit (lib.generators) mkLuaInline; linterType = submodule { options = { @@ -73,8 +74,11 @@ required_files = mkOption { type = nullOr (listOf str); default = null; - description = "Required files to lint. These files must exist relative to the cwd of the linter or else this linter will be skipped"; example = ["eslint.config.js"]; + description = '' + Required files to lint. These files must exist relative to the cwd + of the linter or else this linter will be skipped + ''; }; }; }; @@ -124,5 +128,53 @@ in { }; lint_after_save = mkEnableOption "autocmd to lint after each save" // {default = true;}; + + lint_function = mkOption { + type = luaInline; + default = mkLuaInline '' + function(buf) + local ft = vim.api.nvim_get_option_value("filetype", { buf = buf }) + local linters = require("lint").linters + local linters_from_ft = require("lint").linters_by_ft[ft] + + -- if no linter is configured for this filetype, stops linting + if linters_from_ft == nil then return end + + for _, name in ipairs(linters_from_ft) do + local linter = linters[name] + assert(linter, 'Linter with name `' .. name .. '` not available') + + if type(linter) == "function" then + linter = linter() + end + -- for require("lint").lint() to work, linter.name must be set + linter.name = linter.name or name + local cwd = linter.required_files + + -- if no configuration files are configured, lint + if cwd == nil then + require("lint").lint(linter) + else + -- if configuration files are configured and present in the project, lint + for _, fn in ipairs(cwd) do + local path = vim.fs.joinpath(linter.cwd or vim.fn.getcwd(), fn); + if vim.uv.fs_stat(path) then + require("lint").lint(linter) + break + end + end + end + end + end + ''; + example = literalExpression '' + mkLuaInline ''' + function(buf) + require("lint").try_lint() + end + ''' + ''; + description = "Define the global function nvf_lint which is used by nvf to lint."; + }; }; } From 05954eec6d6bff2d0ed00f507aa0b50674d051c4 Mon Sep 17 00:00:00 2001 From: rice-cracker-dev Date: Fri, 18 Apr 2025 11:00:16 +0700 Subject: [PATCH 09/19] docs: update vim.diagnostics.nvim-lint.*.required_files description --- modules/plugins/diagnostics/nvim-lint/nvim-lint.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix b/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix index 59c50f1d..956bd76e 100644 --- a/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix +++ b/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix @@ -78,6 +78,13 @@ description = '' Required files to lint. These files must exist relative to the cwd of the linter or else this linter will be skipped + + ::: {.note} + This option is an nvf extension that only takes effect if you + use the `nvf_lint()` lua function. + + See {option}`vim.diagnostics.nvim-lint.lint_function`. + ::: ''; }; }; From ef3ab83254e51e42b17cde9322070eef565a06d6 Mon Sep 17 00:00:00 2001 From: Noah765 Date: Fri, 18 Apr 2025 15:49:11 +0200 Subject: [PATCH 10/19] languages/dart: add necessary dependency of flutter-tools.nvim on lsp --- docs/release-notes/rl-0.8.md | 1 + modules/plugins/languages/dart.nix | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 642599ba..f17ca59e 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -332,3 +332,4 @@ [Noah765](https://github.com/Noah765): - Add missing `flutter-tools.nvim` dependency `plenary.nvim`. +- Add necessary dependency of `flutter-tools.nvim` on lsp diff --git a/modules/plugins/languages/dart.nix b/modules/plugins/languages/dart.nix index 77d92d3b..d8d44d88 100644 --- a/modules/plugins/languages/dart.nix +++ b/modules/plugins/languages/dart.nix @@ -13,7 +13,7 @@ inherit (lib.strings) optionalString; inherit (lib.nvim.lua) expToLua; inherit (lib.nvim.types) mkGrammarOption; - inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.dag) entryAfter; cfg = config.vim.languages.dart; ftcfg = cfg.flutter-tools; @@ -122,19 +122,21 @@ in { }; }; - config = mkIf cfg.enable (mkMerge [ + config.vim = mkIf cfg.enable (mkMerge [ (mkIf cfg.treesitter.enable { - vim.treesitter.enable = true; - vim.treesitter.grammars = [cfg.treesitter.package]; + treesitter.enable = true; + treesitter.grammars = [cfg.treesitter.package]; }) (mkIf cfg.lsp.enable { - vim.lsp.lspconfig.enable = true; - vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig; + lsp.lspconfig.enable = true; + lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig; }) (mkIf ftcfg.enable { - vim.startPlugins = [ + lsp.enable = true; + + startPlugins = [ ( if ftcfg.enableNoResolvePatch then "flutter-tools-patched" @@ -143,7 +145,7 @@ in { "plenary-nvim" ]; - vim.pluginRC.flutter-tools = entryAnywhere '' + pluginRC.flutter-tools = entryAfter ["lsp-setup"] '' require('flutter-tools').setup { lsp = { color = { -- show the derived colours for dart variables From 99d600f40f4bf4d7b50524f760979886acab8ad7 Mon Sep 17 00:00:00 2001 From: Noah765 Date: Fri, 18 Apr 2025 15:51:03 +0200 Subject: [PATCH 11/19] languages/dart: remove invalid config key lsp.flags from flutter-tools.nvim setup The lsp.flags key is not present in the documentation of flutter-tools.nvim and lsp_flags always evaluates to nil. --- modules/plugins/languages/dart.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/plugins/languages/dart.nix b/modules/plugins/languages/dart.nix index d8d44d88..b3747099 100644 --- a/modules/plugins/languages/dart.nix +++ b/modules/plugins/languages/dart.nix @@ -158,7 +158,6 @@ in { capabilities = capabilities, on_attach = default_on_attach; - flags = lsp_flags, }, ${optionalString cfg.dap.enable '' debugger = { From df0e2060c6cd3471fb1964b99b8dc5bacd36c10e Mon Sep 17 00:00:00 2001 From: Noah765 Date: Fri, 18 Apr 2025 17:05:57 +0200 Subject: [PATCH 12/19] languages/dart: add flutter-tools.flutterPackage option Previously, flutter-tools was dependent on the flutter SDK, which it found in the PATH. Having such undeclared and non-reproducible dependencies is against the principles of nix. The flutterPackage option has been made optional for people who have installed the flutter SDK differently and want to keep it that way. The enableNoResolvePatch option has been retained for people who have installed the flutter SDK using nix outside the scope of nvf and do not want to have to install it twice. The default value has been changed to false, assuming that most people who use nix to install flutter will use the flutterPackage option instead. --- docs/release-notes/rl-0.8.md | 3 ++- modules/plugins/languages/dart.nix | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index f17ca59e..312b1896 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -332,4 +332,5 @@ [Noah765](https://github.com/Noah765): - Add missing `flutter-tools.nvim` dependency `plenary.nvim`. -- Add necessary dependency of `flutter-tools.nvim` on lsp +- Add necessary dependency of `flutter-tools.nvim` on lsp. +- Add the `vim.languages.dart.flutter-tools.flutterPackage` option. diff --git a/modules/plugins/languages/dart.nix b/modules/plugins/languages/dart.nix index b3747099..b61585d4 100644 --- a/modules/plugins/languages/dart.nix +++ b/modules/plugins/languages/dart.nix @@ -81,16 +81,23 @@ in { description = "Enable flutter-tools for flutter support"; }; + flutterPackage = mkOption { + type = nullOr package; + default = pkgs.flutter; + description = "Flutter package, or null to detect the flutter path at runtime instead."; + }; + enableNoResolvePatch = mkOption { type = bool; - default = true; + default = false; description = '' Whether to patch flutter-tools so that it doesn't resolve symlinks when detecting flutter path. - This is required if you want to use a flutter package built with nix. - If you are using a flutter SDK installed from a different source - and encounter the error "`dart` missing from PATH", disable this option. + This is required if flutterPackage is set to null and the flutter + package in your PATH was built with nix. If you are using a flutter + SDK installed from a different source and encounter the error "`dart` + missing from PATH", leave this option disabled. ''; }; @@ -147,6 +154,7 @@ in { pluginRC.flutter-tools = entryAfter ["lsp-setup"] '' require('flutter-tools').setup { + ${optionalString (ftcfg.flutterPackage != null) "flutter_path = \"${ftcfg.flutterPackage}/bin/flutter\","} lsp = { color = { -- show the derived colours for dart variables enabled = ${boolToString ftcfg.color.enable}, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10 From a6a7bd37f314d2bff8212a452ae22bd6698c44e3 Mon Sep 17 00:00:00 2001 From: Howard Nguyen-Huu Date: Fri, 18 Apr 2025 19:52:44 -0400 Subject: [PATCH 13/19] fix: change python dap name from python to debugpy --- modules/plugins/languages/python.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/plugins/languages/python.nix b/modules/plugins/languages/python.nix index 476b56ef..d6dec1c2 100644 --- a/modules/plugins/languages/python.nix +++ b/modules/plugins/languages/python.nix @@ -99,7 +99,7 @@ # idk if this is the best way to install/run debugpy package = pkgs.python3.withPackages (ps: with ps; [debugpy]); dapConfig = '' - dap.adapters.python = function(cb, config) + dap.adapters.debugpy = function(cb, config) if config.request == 'attach' then ---@diagnostic disable-next-line: undefined-field local port = (config.connect or config).port @@ -125,10 +125,10 @@ end end - dap.configurations.python = { + dap.configurations.debugpy = { { -- The first three options are required by nvim-dap - type = 'python'; -- the type here established the link to the adapter definition: `dap.adapters.python` + type = 'debugpy'; -- the type here established the link to the adapter definition: `dap.adapters.debugpy` request = 'launch'; name = "Launch file"; From b7627523333b1ac64111e0f030934f9d17dbb063 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sat, 19 Apr 2025 13:22:06 +0200 Subject: [PATCH 14/19] languages/go: default disable gofmt if lsp is enabled --- modules/plugins/languages/go.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/plugins/languages/go.nix b/modules/plugins/languages/go.nix index 9f8bca3c..3f232669 100644 --- a/modules/plugins/languages/go.nix +++ b/modules/plugins/languages/go.nix @@ -5,7 +5,7 @@ ... }: let inherit (builtins) attrNames; - inherit (lib.options) mkEnableOption mkOption; + inherit (lib.options) mkEnableOption mkOption literalMD; inherit (lib.modules) mkIf mkMerge; inherit (lib.meta) getExe; inherit (lib.lists) isList; @@ -84,7 +84,14 @@ in { }; format = { - enable = mkEnableOption "Go formatting" // {default = config.vim.languages.enableFormat;}; + enable = + mkEnableOption "Go formatting" + // { + default = !cfg.lsp.enable && config.vim.languages.enableFormat; + defaultText = literalMD '' + disabled if Go LSP is enabled, otherwise follows {option}`vim.languages.enableFormat` + ''; + }; type = mkOption { description = "Go formatter to use"; From 5db21bae6f9073bf08608449ba7ea50da4040c13 Mon Sep 17 00:00:00 2001 From: Noah765 Date: Sat, 19 Apr 2025 15:51:47 +0200 Subject: [PATCH 15/19] languages/dart: update flutter-tools.enableNoResolvePatch description --- modules/plugins/languages/dart.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/plugins/languages/dart.nix b/modules/plugins/languages/dart.nix index b61585d4..7b9584b9 100644 --- a/modules/plugins/languages/dart.nix +++ b/modules/plugins/languages/dart.nix @@ -94,10 +94,12 @@ in { Whether to patch flutter-tools so that it doesn't resolve symlinks when detecting flutter path. - This is required if flutterPackage is set to null and the flutter - package in your PATH was built with nix. If you are using a flutter + ::: {.note} + This is required if `flutterPackage` is set to null and the flutter + package in your `PATH` was built with Nix. If you are using a flutter SDK installed from a different source and encounter the error "`dart` - missing from PATH", leave this option disabled. + missing from `PATH`", leave this option disabled. + ::: ''; }; From b67e151d22567c9cca367ea430253299e34344c4 Mon Sep 17 00:00:00 2001 From: Howard Nguyen-Huu Date: Sat, 19 Apr 2025 13:53:15 -0400 Subject: [PATCH 16/19] docs: add changes to release notes --- docs/release-notes/rl-0.8.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index bd88ab7c..4c345d15 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -290,8 +290,10 @@ - `eslint_d` now checks for configuration files to load. - Fix an error where `eslint_d` fails to load. -- Add required files support for linters under `vim.diagnostics.nvim-lint.linters.*.required_files`. -- Add global function `nvf_lint` under `vim.diagnostics.nvim-lint.lint_function`. +- Add required files support for linters under + `vim.diagnostics.nvim-lint.linters.*.required_files`. +- Add global function `nvf_lint` under + `vim.diagnostics.nvim-lint.lint_function`. [Sc3l3t0n](https://github.com/Sc3l3t0n): @@ -334,3 +336,7 @@ [Noah765](https://github.com/Noah765): - Add missing `flutter-tools.nvim` dependency `plenary.nvim`. + +[howird](https://github.com/howird): + +- Change python dap adapter name from `python` to commonly expected `debugpy`. From fb7f47b375160db5845f6f7bf3815e33eae8cac3 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 20 Apr 2025 17:48:59 +0300 Subject: [PATCH 17/19] flake: bump inputs --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 540715e9..3c089070 100644 --- a/flake.lock +++ b/flake.lock @@ -38,11 +38,11 @@ }, "mnw": { "locked": { - "lastModified": 1744592022, - "narHash": "sha256-QuWrCRiF3CUM99sgj3gXbIzB1IAVWS5IEfFHadbMA2g=", + "lastModified": 1744597985, + "narHash": "sha256-lLYB9/tQ0OAKonL0Ku963nqOm0aE1TmLavrzmXAr5Zc=", "owner": "Gerg-L", "repo": "mnw", - "rev": "cf9e19413b6c2d995b55565cd99facf9c751b653", + "rev": "cbdcbb5f8eb24e25b932bbc87e29299a72e34b64", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1744473229, - "narHash": "sha256-rGXvIsD/Hn+bJRFb7hqSx7UUZUIlxXs0fM6ix5+iT5w=", + "lastModified": 1744868846, + "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "52d0eded529af34e91df6b2a2bc32eb636637cd2", + "rev": "ebe4301cbd8f81c4f8d3244b3632338bbeb6d49c", "type": "github" }, "original": { From 27c0b5caf3ce04f5190d360028a2ee0bc39fc5e7 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 20 Apr 2025 17:49:06 +0300 Subject: [PATCH 18/19] pins: bump all plugins --- npins/sources.json | 240 ++++++++++++++++++++++----------------------- 1 file changed, 120 insertions(+), 120 deletions(-) diff --git a/npins/sources.json b/npins/sources.json index d11d16c4..05a8c173 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -35,9 +35,9 @@ }, "branch": "master", "submodules": false, - "revision": "3f13e15c53ea2aaf79c24ceab725309d87f0619c", - "url": "https://github.com/rrethy/base16-nvim/archive/3f13e15c53ea2aaf79c24ceab725309d87f0619c.tar.gz", - "hash": "1z6pdf707r2rpmzi057dhcmd045695v03215asn1hdn8r294zcmg" + "revision": "965160025d0facbe9caa863e5beef2a7a488e9d1", + "url": "https://github.com/rrethy/base16-nvim/archive/965160025d0facbe9caa863e5beef2a7a488e9d1.tar.gz", + "hash": "02w1mn15gydma9canvqrlwf4l5z76s1vs01zanipwwflvwclsb8f" }, "blink-cmp": { "type": "GitRelease", @@ -77,9 +77,9 @@ }, "branch": "main", "submodules": false, - "revision": "2ed6d9a28b07fa6f3bface818470605f8896408c", - "url": "https://github.com/saghen/blink.compat/archive/2ed6d9a28b07fa6f3bface818470605f8896408c.tar.gz", - "hash": "009475xy41l4dpayswhx65q6a7djzw7rz2ycbrbpyg041y0qynqs" + "revision": "f1836ed7a07f8d082ff6c3fbae1e476ba2adee84", + "url": "https://github.com/saghen/blink.compat/archive/f1836ed7a07f8d082ff6c3fbae1e476ba2adee84.tar.gz", + "hash": "0b22c943vbxn8cgfc3m0wmmia9rja6x766ywa798nx7s7x0sd53x" }, "blink-emoji-nvim": { "type": "Git", @@ -103,9 +103,9 @@ }, "branch": "main", "submodules": false, - "revision": "56084d1f45c8621d23d4bac724c2dc50b1eb75db", - "url": "https://github.com/mikavilpas/blink-ripgrep.nvim/archive/56084d1f45c8621d23d4bac724c2dc50b1eb75db.tar.gz", - "hash": "1lyczjvwpi5f1mjgw059yzkxxjrk48vcvhdjzkjgakhsq76s125x" + "revision": "ca538d15bd22fedd3408064d2b25ff8d56ec8ce8", + "url": "https://github.com/mikavilpas/blink-ripgrep.nvim/archive/ca538d15bd22fedd3408064d2b25ff8d56ec8ce8.tar.gz", + "hash": "1rg40x0lvz11rl95b3q3kqzb8ygvyvhcxiw255200ccxl6q21jg8" }, "bufdelete-nvim": { "type": "Git", @@ -272,9 +272,9 @@ }, "branch": "main", "submodules": false, - "revision": "9654cb31f10c9eda3e777d03d32b29df606ab0fe", - "url": "https://github.com/olimorris/codecompanion.nvim/archive/9654cb31f10c9eda3e777d03d32b29df606ab0fe.tar.gz", - "hash": "0ff4mbfim0kj5prv9xfqp8gsk1fw0y2d0kmazfivkhg04my8m89l" + "revision": "030f305930a25bd9e45b5e5252b47b7069fb800e", + "url": "https://github.com/olimorris/codecompanion.nvim/archive/030f305930a25bd9e45b5e5252b47b7069fb800e.tar.gz", + "hash": "1n59gkzfs05ybf7xvrbxacmwk8nbz8ybgdjwv8irdz5la5hi6wmn" }, "codewindow-nvim": { "type": "Git", @@ -311,9 +311,9 @@ }, "branch": "master", "submodules": false, - "revision": "eebc724d12c5579d733d1f801386e0ceb909d001", - "url": "https://github.com/stevearc/conform.nvim/archive/eebc724d12c5579d733d1f801386e0ceb909d001.tar.gz", - "hash": "122v0svrsss8g4gzy9fz2ppzm2lxf85l4m8wincxsy75x9v3ywgn" + "revision": "6632e7d788a85bf8405ea0c812d343fc308b7b8c", + "url": "https://github.com/stevearc/conform.nvim/archive/6632e7d788a85bf8405ea0c812d343fc308b7b8c.tar.gz", + "hash": "0dv4h87jjb2dp6whgc7wvxisc7hcx1828ixzci80py8kjky013zw" }, "copilot-cmp": { "type": "Git", @@ -337,9 +337,9 @@ }, "branch": "master", "submodules": false, - "revision": "c62a2a7616a9789a7676b6b7a8d9263b1082cdc8", - "url": "https://github.com/zbirenbaum/copilot.lua/archive/c62a2a7616a9789a7676b6b7a8d9263b1082cdc8.tar.gz", - "hash": "1agbxzq43wsga9szgaz45s638my8d7cxqwg2aa3rizyf7g8f7szy" + "revision": "dc579f98536029610cfa32c6bad86c0d24363679", + "url": "https://github.com/zbirenbaum/copilot.lua/archive/dc579f98536029610cfa32c6bad86c0d24363679.tar.gz", + "hash": "16zx9a8f2mjmj7ibdsjyj0vqdsc10yl1vrna0kkkgccj957rd99x" }, "crates-nvim": { "type": "Git", @@ -506,9 +506,9 @@ }, "branch": "main", "submodules": false, - "revision": "efff286dd74c22f731cdec26a70b46e5b203c619", - "url": "https://github.com/rafamadriz/friendly-snippets/archive/efff286dd74c22f731cdec26a70b46e5b203c619.tar.gz", - "hash": "1vb5l8ipfjwsrqffbq8v2z5p1cpg035b3gk57692wd7835kr3i13" + "revision": "31f2a2657b6261724313281fe0d8ba6f43f4a4fa", + "url": "https://github.com/rafamadriz/friendly-snippets/archive/31f2a2657b6261724313281fe0d8ba6f43f4a4fa.tar.gz", + "hash": "0rkz7zbv1maqhr22nxq39w7pahahcapfyc4rgscmr3bm4dcymk2a" }, "fzf-lua": { "type": "Git", @@ -519,9 +519,9 @@ }, "branch": "main", "submodules": false, - "revision": "dc693475c4463463d84a0c7c43d463b8a8cd3aea", - "url": "https://github.com/ibhagwan/fzf-lua/archive/dc693475c4463463d84a0c7c43d463b8a8cd3aea.tar.gz", - "hash": "1his2nwjrb9xbjmz5i6nln7v5mk2f85dla10qn5xwji9zgnfy24l" + "revision": "ea2bda8a9717307affd921e1b540dc06acdf8ea8", + "url": "https://github.com/ibhagwan/fzf-lua/archive/ea2bda8a9717307affd921e1b540dc06acdf8ea8.tar.gz", + "hash": "0ba9ncwjv9kcnw7nimifyad54xdf1cacbdlc7hjyy2zlivf4pm3g" }, "gesture-nvim": { "type": "Git", @@ -584,9 +584,9 @@ }, "branch": "main", "submodules": false, - "revision": "fcfa7a989cd6fed10abf02d9880dc76d7a38167d", - "url": "https://github.com/lewis6991/gitsigns.nvim/archive/fcfa7a989cd6fed10abf02d9880dc76d7a38167d.tar.gz", - "hash": "1grkw8x1fycw1hbppy0zakwwkk7h2f8x5qy4wh34yj5f5g9jn3vj" + "revision": "02eafb1273afec94447f66d1a43fc5e477c2ab8a", + "url": "https://github.com/lewis6991/gitsigns.nvim/archive/02eafb1273afec94447f66d1a43fc5e477c2ab8a.tar.gz", + "hash": "1m507jyyi1nny14q2bxydy6a54g28yq855g4yaj9jslz7dml2v4i" }, "glow-nvim": { "type": "Git", @@ -610,9 +610,9 @@ }, "branch": "main", "submodules": false, - "revision": "12b5420b665e8053d74eb075d8a589477333f67d", - "url": "https://github.com/ellisonleao/gruvbox.nvim/archive/12b5420b665e8053d74eb075d8a589477333f67d.tar.gz", - "hash": "16fa841cv0dbn7pkcs44r5ch241vhax8jfxgcxwwd0z4srlbj6gy" + "revision": "a933d8666dad9363dc6908ae72cfc832299c2f59", + "url": "https://github.com/ellisonleao/gruvbox.nvim/archive/a933d8666dad9363dc6908ae72cfc832299c2f59.tar.gz", + "hash": "02r2h0ip2vzmgmv9b36ff2r6br3ql0b9ggzl8ijsyjy7pgiij04y" }, "harpoon": { "type": "Git", @@ -636,9 +636,9 @@ }, "branch": "master", "submodules": false, - "revision": "18fef08cba01de6b5022e85ac4468f74edc45259", - "url": "https://github.com/mrcjkb/haskell-tools.nvim/archive/18fef08cba01de6b5022e85ac4468f74edc45259.tar.gz", - "hash": "1bhr9w58hy63zilbqdwfvwzca6sk667yagjbzf13acl306nvgnhd" + "revision": "797610ad83d2730d0a8659ecac5d98ccb476ac23", + "url": "https://github.com/mrcjkb/haskell-tools.nvim/archive/797610ad83d2730d0a8659ecac5d98ccb476ac23.tar.gz", + "hash": "1i1ivfhl34yi9xff5s1wkr252vlfjazsf75bjphbi4c50s64wbaa" }, "highlight-undo-nvim": { "type": "Git", @@ -743,9 +743,9 @@ }, "branch": "main", "submodules": false, - "revision": "03eaa2e0c0ec9436dea0e954bc47564ff3ca9196", - "url": "https://github.com/ggandor/leap.nvim/archive/03eaa2e0c0ec9436dea0e954bc47564ff3ca9196.tar.gz", - "hash": "1lskih4hvf1c57d0f6gibc36c926lqky0y2h6ypmkgh8gmcdazdw" + "revision": "8a0efa79133fee211017d769c8031512192008b3", + "url": "https://github.com/ggandor/leap.nvim/archive/8a0efa79133fee211017d769c8031512192008b3.tar.gz", + "hash": "0pgg26r5rh1r2364yj05w4scarzy6zwsp6w7s9yxgfmk7l9x89yk" }, "leetcode-nvim": { "type": "Git", @@ -795,9 +795,9 @@ }, "branch": "main", "submodules": false, - "revision": "778d56ff9b387dacd14ae648ed5604394b486f51", - "url": "https://github.com/nvimdev/lspsaga.nvim/archive/778d56ff9b387dacd14ae648ed5604394b486f51.tar.gz", - "hash": "1rm8ww8krxliwli9m2j6j37xgwgjsrgapvgrcdr6nd4mi6hgmczm" + "revision": "920b1253e1a26732e53fac78412f6da7f674671d", + "url": "https://github.com/nvimdev/lspsaga.nvim/archive/920b1253e1a26732e53fac78412f6da7f674671d.tar.gz", + "hash": "0wkcgy2x119sd9xn6k9vs83pvrj0m4ali1ac72pah8pnlzfvkw7i" }, "lua-utils-nvim": { "type": "Git", @@ -847,9 +847,9 @@ }, "branch": "master", "submodules": false, - "revision": "2ef8dfbef6f8f97873da4c5820067343690d114c", - "url": "https://github.com/nvim-neorocks/lz.n/archive/2ef8dfbef6f8f97873da4c5820067343690d114c.tar.gz", - "hash": "11i6ayqvyamh8i2scq7qbf6rrxrq9v0hax9gxmdxhdxd18djyq8n" + "revision": "c22bd7ef977a32b792ea70e203126a9063519a62", + "url": "https://github.com/nvim-neorocks/lz.n/archive/c22bd7ef977a32b792ea70e203126a9063519a62.tar.gz", + "hash": "0q8bz28dbmdsyndbnajw73x2cr8kpcx0fcj9lip9mr24vgx2vb8v" }, "lzn-auto-require": { "type": "Git", @@ -1016,9 +1016,9 @@ }, "branch": "main", "submodules": false, - "revision": "cf3625d2c4a437f5edf7e61382e0fe522fc76fb7", - "url": "https://github.com/echasnovski/mini.completion/archive/cf3625d2c4a437f5edf7e61382e0fe522fc76fb7.tar.gz", - "hash": "0lpvl1kd7vmyy00p97am9ghj6gdmnk1dbw93wjmnvin057w9sysw" + "revision": "35130cebc63ace7d6e4583f349af8cd3f3141af7", + "url": "https://github.com/echasnovski/mini.completion/archive/35130cebc63ace7d6e4583f349af8cd3f3141af7.tar.gz", + "hash": "0h5z5i62cc780bzw60rbizngvpyl4vk7j858pndyi2g572plz929" }, "mini-diff": { "type": "Git", @@ -1289,9 +1289,9 @@ }, "branch": "main", "submodules": false, - "revision": "e05106957fc178285dbc510ff833985da59d3e5a", - "url": "https://github.com/echasnovski/mini.snippets/archive/e05106957fc178285dbc510ff833985da59d3e5a.tar.gz", - "hash": "0pn9i6sfh3fxkjzh9yyyc05lgcgm8wsanvl7axmy4p7a9spnfa2q" + "revision": "d005684e620e76eb2a5fbbbd211a1eba7212b4aa", + "url": "https://github.com/echasnovski/mini.snippets/archive/d005684e620e76eb2a5fbbbd211a1eba7212b4aa.tar.gz", + "hash": "19xmqzgx0lv6m6lp6dn4pcr53clgjyrlnh45j795cy9szizw4y0x" }, "mini-splitjoin": { "type": "Git", @@ -1461,9 +1461,9 @@ }, "branch": "main", "submodules": false, - "revision": "5224467c6a49a6c77b8a8333f4d9af0abc788e10", - "url": "https://github.com/nvim-neo-tree/neo-tree.nvim/archive/5224467c6a49a6c77b8a8333f4d9af0abc788e10.tar.gz", - "hash": "0dzppxi4w38s3pqsgwd3z0xr1r14bd0v4qpakxw3kjn9wr2d8y7n" + "revision": "1ef260eb4f54515fe121a2267b477efb054d108a", + "url": "https://github.com/nvim-neo-tree/neo-tree.nvim/archive/1ef260eb4f54515fe121a2267b477efb054d108a.tar.gz", + "hash": "0j0gr2pisrj5vsiwsvrd3dkrdrd3q2742srk23rw2x0h055c0mxh" }, "neocord": { "type": "Git", @@ -1487,9 +1487,9 @@ }, "branch": "main", "submodules": false, - "revision": "a1e19618c012a712c5ed7cd5ebd01b48ad9f4b5b", - "url": "https://github.com/nvim-neorg/neorg/archive/a1e19618c012a712c5ed7cd5ebd01b48ad9f4b5b.tar.gz", - "hash": "1lp1chm788rnzqjndw64rnjn299889fx66lm01lvfgail0509dw0" + "revision": "35da593c55d78086a3203ee3e6d749fafe2e4e73", + "url": "https://github.com/nvim-neorg/neorg/archive/35da593c55d78086a3203ee3e6d749fafe2e4e73.tar.gz", + "hash": "0kxygwpfffa0blcy54g7cvm5laj77q0f72p69s43j9dpsps1h63y" }, "neorg-telescope": { "type": "Git", @@ -1500,9 +1500,9 @@ }, "branch": "main", "submodules": false, - "revision": "ddb2556644cae922699a239bbb0fe16e25b084b7", - "url": "https://github.com/nvim-neorg/neorg-telescope/archive/ddb2556644cae922699a239bbb0fe16e25b084b7.tar.gz", - "hash": "0p2s3n22fy1vkqc9n55x6kssqs4n0znwlszfrs532hj8m992wbks" + "revision": "7fb6ca6a632c3c095601d379a664c0c1f802dc6c", + "url": "https://github.com/nvim-neorg/neorg-telescope/archive/7fb6ca6a632c3c095601d379a664c0c1f802dc6c.tar.gz", + "hash": "12pbixkb7175qb9wblq01mbpkccm9h0si7b2jjaf7yip8j8frxmn" }, "neovim-session-manager": { "type": "Git", @@ -1565,9 +1565,9 @@ }, "branch": "main", "submodules": false, - "revision": "8d99472fcccffd73d7501e54e9018bab5cb0c4ad", - "url": "https://github.com/nvimtools/none-ls.nvim/archive/8d99472fcccffd73d7501e54e9018bab5cb0c4ad.tar.gz", - "hash": "1x1fmpy65j8smn5lfl9bknmfnan33gd5dila49gyblgcgfvpd7ph" + "revision": "fb50cf17e926a037c9f8d96d8db29ddbd04965d4", + "url": "https://github.com/nvimtools/none-ls.nvim/archive/fb50cf17e926a037c9f8d96d8db29ddbd04965d4.tar.gz", + "hash": "07zfkjdqwlrm1d07za0payqs37gmn4x8m489438nv84sqqhnfrvd" }, "nord": { "type": "Git", @@ -1604,9 +1604,9 @@ }, "branch": "master", "submodules": false, - "revision": "2a406cdd8c373ae7fe378a9e062a5424472bd8d8", - "url": "https://github.com/windwp/nvim-autopairs/archive/2a406cdd8c373ae7fe378a9e062a5424472bd8d8.tar.gz", - "hash": "06i7bdq4msy2gia6mczxaj2y7chhrmw9xwjj8q4dix0pk58hjfp1" + "revision": "4d74e75913832866aa7de35e4202463ddf6efd1b", + "url": "https://github.com/windwp/nvim-autopairs/archive/4d74e75913832866aa7de35e4202463ddf6efd1b.tar.gz", + "hash": "0q6pv89x05l71nfg2chqf9p0d2ha72agmll2svimq0npp84ymfxz" }, "nvim-bufferline-lua": { "type": "Git", @@ -1630,9 +1630,9 @@ }, "branch": "main", "submodules": false, - "revision": "059e89495b3ec09395262f16b1ad441a38081d04", - "url": "https://github.com/hrsh7th/nvim-cmp/archive/059e89495b3ec09395262f16b1ad441a38081d04.tar.gz", - "hash": "0yfxjkascn45svvzx727kz20bm6lkflkx4jc8nrx3rxv0j39wbb0" + "revision": "b5311ab3ed9c846b585c0c15b7559be131ec4be9", + "url": "https://github.com/hrsh7th/nvim-cmp/archive/b5311ab3ed9c846b585c0c15b7559be131ec4be9.tar.gz", + "hash": "07674djcyac9wlj08y9p5gsmdpsm8zxjfgk3fwyvvx8j7qyzx74p" }, "nvim-colorizer-lua": { "type": "Git", @@ -1669,9 +1669,9 @@ }, "branch": "master", "submodules": false, - "revision": "7aade9e99bef5f0735cf966e715b3ce45515d786", - "url": "https://github.com/mfussenegger/nvim-dap/archive/7aade9e99bef5f0735cf966e715b3ce45515d786.tar.gz", - "hash": "0cr2y3lkr6ffxxd9b2pj8hr3fzb5dlj003fcknswqwsdhws75l22" + "revision": "98bf130702eaafad8567c0e3ea1171c2552d58bb", + "url": "https://github.com/mfussenegger/nvim-dap/archive/98bf130702eaafad8567c0e3ea1171c2552d58bb.tar.gz", + "hash": "045sajd5amwxq4964yj4lbh20daa0g8473a0ggbwggxpq6qz2678" }, "nvim-dap-go": { "type": "Git", @@ -1695,9 +1695,9 @@ }, "branch": "master", "submodules": false, - "revision": "bc81f8d3440aede116f821114547a476b082b319", - "url": "https://github.com/rcarriga/nvim-dap-ui/archive/bc81f8d3440aede116f821114547a476b082b319.tar.gz", - "hash": "0hk34mfjxqiq82faf3q75ixpxd822vh8zbl1i5pvx6akn4v3mxk7" + "revision": "881a69e25bd6658864fab47450025490b74be878", + "url": "https://github.com/rcarriga/nvim-dap-ui/archive/881a69e25bd6658864fab47450025490b74be878.tar.gz", + "hash": "040xa1jg5591czydjsxf9rwk3g805nxgaaqn5zkgkxr3igc2rvsy" }, "nvim-docs-view": { "type": "Git", @@ -1734,9 +1734,9 @@ }, "branch": "master", "submodules": false, - "revision": "5b1bdf306bd3e565908145279e8bbfc594dac3b3", - "url": "https://github.com/mfussenegger/nvim-lint/archive/5b1bdf306bd3e565908145279e8bbfc594dac3b3.tar.gz", - "hash": "0kwdb9wggkgzg9msrvnf15njqm9a8acljdak9fxnfh9al1ks8cav" + "revision": "d698d3b6fd7b1b85657d05a2a31d843ddb682c63", + "url": "https://github.com/mfussenegger/nvim-lint/archive/d698d3b6fd7b1b85657d05a2a31d843ddb682c63.tar.gz", + "hash": "0m4hj1yc0s6cb3icshcr3qkd5wknksnnw97axjbacsan5vc6831z" }, "nvim-lspconfig": { "type": "Git", @@ -1747,9 +1747,9 @@ }, "branch": "master", "submodules": false, - "revision": "6ac17e69a353fea377b30a35a672a30f04e887a1", - "url": "https://github.com/neovim/nvim-lspconfig/archive/6ac17e69a353fea377b30a35a672a30f04e887a1.tar.gz", - "hash": "0s1hb7fkjvccycwdzq10lrycs8xmdlk9n4pjafgwgmnhnmgb3sfr" + "revision": "32b6a6449aaba11461fffbb596dd6310af79eea4", + "url": "https://github.com/neovim/nvim-lspconfig/archive/32b6a6449aaba11461fffbb596dd6310af79eea4.tar.gz", + "hash": "0rbqg3xdsdfklcsadzbbphzrgwa2c54lsipfqd67jq2p4baxsgxn" }, "nvim-metals": { "type": "Git", @@ -1760,9 +1760,9 @@ }, "branch": "main", "submodules": false, - "revision": "bc896458ac639dea568e8dc06862074f8cba7fa3", - "url": "https://github.com/scalameta/nvim-metals/archive/bc896458ac639dea568e8dc06862074f8cba7fa3.tar.gz", - "hash": "0k7c300rf62f50vqzxxdgh7pqpb61im6xbz230fysvdjdx1ddglh" + "revision": "04d8ce24638412a2c93dd79fecca4b2c7b9c07f9", + "url": "https://github.com/scalameta/nvim-metals/archive/04d8ce24638412a2c93dd79fecca4b2c7b9c07f9.tar.gz", + "hash": "19mdfn5ni35ldjmwdg25cwiy9cvkg2cxrdhcjr9xplx7ln6zsld9" }, "nvim-navbuddy": { "type": "Git", @@ -1786,9 +1786,9 @@ }, "branch": "master", "submodules": false, - "revision": "8649f694d3e76ee10c19255dece6411c29206a54", - "url": "https://github.com/SmiteshP/nvim-navic/archive/8649f694d3e76ee10c19255dece6411c29206a54.tar.gz", - "hash": "0964wgwh6i4nm637vx36bshkpd5i63ipwzqmrdbkz5h9bzyng7nj" + "revision": "39231352aec0d1e09cebbffdd9dc20a5dc691ffe", + "url": "https://github.com/SmiteshP/nvim-navic/archive/39231352aec0d1e09cebbffdd9dc20a5dc691ffe.tar.gz", + "hash": "1xj2bzax8hynm2x9zbvsaxv1j22chklyygzm1kbqxxs077qn45ws" }, "nvim-neoclip-lua": { "type": "Git", @@ -1825,9 +1825,9 @@ }, "branch": "master", "submodules": false, - "revision": "22f29093eae7785773ee9d543f8750348b1a195c", - "url": "https://github.com/rcarriga/nvim-notify/archive/22f29093eae7785773ee9d543f8750348b1a195c.tar.gz", - "hash": "0nnxmi65ppmn8dzwh38vx2w7w6piq0i28mw0s32wa31xn5rmzwza" + "revision": "b5825cf9ee881dd8e43309c93374ed5b87b7a896", + "url": "https://github.com/rcarriga/nvim-notify/archive/b5825cf9ee881dd8e43309c93374ed5b87b7a896.tar.gz", + "hash": "13qlkncpmjvmkpcx5sv366i7scsh90wjvcqy8qlv31ccmgq511wv" }, "nvim-scrollbar": { "type": "Git", @@ -1851,9 +1851,9 @@ }, "branch": "main", "submodules": false, - "revision": "caf6f633d4d77a29b6e265b560c5a035d171a913", - "url": "https://github.com/kylechui/nvim-surround/archive/caf6f633d4d77a29b6e265b560c5a035d171a913.tar.gz", - "hash": "130y0b2f69y5rzm64ss34a9zyqkpkybr2d1s4p0pcvvaq1ngq0r0" + "revision": "0e62500b98f4513feaaf7425c135472457ea5b7d", + "url": "https://github.com/kylechui/nvim-surround/archive/0e62500b98f4513feaaf7425c135472457ea5b7d.tar.gz", + "hash": "0rwzz98n8gyx2bffxg7ga7vxxxcc4crbwimvglx6bxkdg2abwyrn" }, "nvim-tree-lua": { "type": "Git", @@ -1864,9 +1864,9 @@ }, "branch": "master", "submodules": false, - "revision": "5bea2b37523a31288e0fcab42f3be5c1bd4516bb", - "url": "https://github.com/nvim-tree/nvim-tree.lua/archive/5bea2b37523a31288e0fcab42f3be5c1bd4516bb.tar.gz", - "hash": "1mizgknbbjqv7a8fqc0n7glgabl0fq660nrqwq6w04qqynp0z1ax" + "revision": "3a63717d3d332d8f39aaf65be7a0e4c2265af021", + "url": "https://github.com/nvim-tree/nvim-tree.lua/archive/3a63717d3d332d8f39aaf65be7a0e4c2265af021.tar.gz", + "hash": "1w5m090wwhbsdif0w2fhg8qvdjni0g95b13h0kh5kdm3a7avwsm0" }, "nvim-treesitter-context": { "type": "Git", @@ -1877,9 +1877,9 @@ }, "branch": "master", "submodules": false, - "revision": "439789a9a8df9639ecd749bb3286b77117024a6f", - "url": "https://github.com/nvim-treesitter/nvim-treesitter-context/archive/439789a9a8df9639ecd749bb3286b77117024a6f.tar.gz", - "hash": "04x9nza48d2vz262myhhfnmjzcc2fkdjb21mdqvlmnzkhh7ysyz2" + "revision": "6daca3ad780f045550b820f262002f35175a6c04", + "url": "https://github.com/nvim-treesitter/nvim-treesitter-context/archive/6daca3ad780f045550b820f262002f35175a6c04.tar.gz", + "hash": "0qprwd44hw9sz0vh14p6lpvs9vxrick462pfkradmal6ak1kfwn3" }, "nvim-ts-autotag": { "type": "Git", @@ -1903,9 +1903,9 @@ }, "branch": "main", "submodules": false, - "revision": "a026364df62e88037b26d37c9f14c17c006fd577", - "url": "https://github.com/kevinhwang91/nvim-ufo/archive/a026364df62e88037b26d37c9f14c17c006fd577.tar.gz", - "hash": "02mqjwc4h29i9s9l8lsfwrx4ac69n3mpr9hw2vg7ji3c20mbh413" + "revision": "17aa9cec9081351946743a7094c0c883b24ebe64", + "url": "https://github.com/kevinhwang91/nvim-ufo/archive/17aa9cec9081351946743a7094c0c883b24ebe64.tar.gz", + "hash": "14lz7bnwkv3gjpkh8zi9ki9xlxc979gfy3ii396fpa1l3jpys18q" }, "nvim-web-devicons": { "type": "Git", @@ -1916,9 +1916,9 @@ }, "branch": "master", "submodules": false, - "revision": "c90dee4e930ab9f49fa6d77f289bff335b49e972", - "url": "https://github.com/nvim-tree/nvim-web-devicons/archive/c90dee4e930ab9f49fa6d77f289bff335b49e972.tar.gz", - "hash": "0i41df2cafrpc49cfbimajwbiyhd31q95d1s3rh40g6zgz0gm8sc" + "revision": "855c97005c8eebcdd19846f2e54706bffd40ee96", + "url": "https://github.com/nvim-tree/nvim-web-devicons/archive/855c97005c8eebcdd19846f2e54706bffd40ee96.tar.gz", + "hash": "1rxpc5k6jbz7078dmjyjg8kgs67q2815bs8fz0srfqwyhvkgi15s" }, "obsidian-nvim": { "type": "Git", @@ -1981,9 +1981,9 @@ }, "branch": "master", "submodules": false, - "revision": "e66a64183e211842c195f34fd6dcb97d7b534812", - "url": "https://github.com/nvim-orgmode/orgmode/archive/e66a64183e211842c195f34fd6dcb97d7b534812.tar.gz", - "hash": "0cm3xiqjxxxcrrmjnpfrr7k6xy94ixz55wcrfxgsa8cm2xjzx52m" + "revision": "8c17ffeb2d08f77a6fd098634f5f85034d88caf8", + "url": "https://github.com/nvim-orgmode/orgmode/archive/8c17ffeb2d08f77a6fd098634f5f85034d88caf8.tar.gz", + "hash": "1rx20i6y666n8a593b2fqw2gdxs96qhzgwrza6m8zfcavzkwh0r0" }, "otter-nvim": { "type": "Git", @@ -2085,9 +2085,9 @@ }, "branch": "master", "submodules": false, - "revision": "351e449683070a2bb946bbd603555faf5a195e9a", - "url": "https://github.com/HiPhish/rainbow-delimiters.nvim/archive/351e449683070a2bb946bbd603555faf5a195e9a.tar.gz", - "hash": "12qj32zfyjbxs3qjp283fnc8sfa8w4blfx3skgvhkifv0vi7r3bf" + "revision": "55ad4fb76ab68460f700599b7449385f0c4e858e", + "url": "https://github.com/HiPhish/rainbow-delimiters.nvim/archive/55ad4fb76ab68460f700599b7449385f0c4e858e.tar.gz", + "hash": "1wb18hp5yz4vhw9ajm50006n4d1mp1krri6kidxh8rkhs0d6zqhi" }, "registers-nvim": { "type": "Git", @@ -2111,9 +2111,9 @@ }, "branch": "main", "submodules": false, - "revision": "8bb0d4725cc4909a603158d44ff28b6158ad9278", - "url": "https://github.com/MeanderingProgrammer/render-markdown.nvim/archive/8bb0d4725cc4909a603158d44ff28b6158ad9278.tar.gz", - "hash": "18yqhy2y36rydyqs9z3s1h6rghd02bd9kb3rkxs88spm18wvq41z" + "revision": "dfc1299d9f32b53b34b7ac6c3a7553b5fd29977f", + "url": "https://github.com/MeanderingProgrammer/render-markdown.nvim/archive/dfc1299d9f32b53b34b7ac6c3a7553b5fd29977f.tar.gz", + "hash": "1r636cyjflhpybjwfi01blbwkrxwi4lvykffrjclwfaf4l4gwddd" }, "rose-pine": { "type": "Git", @@ -2163,9 +2163,9 @@ }, "branch": "master", "submodules": false, - "revision": "3f327d15a3c1ed48b1e1087e16873a28a39768c2", - "url": "https://github.com/mrcjkb/rustaceanvim/archive/3f327d15a3c1ed48b1e1087e16873a28a39768c2.tar.gz", - "hash": "09wrfmzbk81xax5p4wzczsvv1x28nv54mayi12fvzv6c3bmcsbvj" + "revision": "69636cedf0d6aabf0eac3dfbce24883fe1051a3d", + "url": "https://github.com/mrcjkb/rustaceanvim/archive/69636cedf0d6aabf0eac3dfbce24883fe1051a3d.tar.gz", + "hash": "0g40qj67pazf428wdgzijvf1a4xr2l1nimxisyka52fpwi1rah4y" }, "smartcolumn-nvim": { "type": "Git", @@ -2361,9 +2361,9 @@ }, "branch": "master", "submodules": false, - "revision": "08aa184f1bd508f6a59371b52cba26be07bc016d", - "url": "https://github.com/RRethy/vim-illuminate/archive/08aa184f1bd508f6a59371b52cba26be07bc016d.tar.gz", - "hash": "0sqs4q2qk9hfkh5vn08y664568pl15b88yyvb9za0f5k7v3z1bcw" + "revision": "1fa4b23409e22a03823648e344c77f260e2572cb", + "url": "https://github.com/RRethy/vim-illuminate/archive/1fa4b23409e22a03823648e344c77f260e2572cb.tar.gz", + "hash": "1z27z6mpj4jazmifyz5scrniqr7sgh9hbkqx4g27yk0dnn9cm9ff" }, "vim-markdown": { "type": "Git", @@ -2426,9 +2426,9 @@ }, "branch": "main", "submodules": false, - "revision": "98b9c21d3c06d79f68fd9d471dcc28fc6d2d72ef", - "url": "https://github.com/gbprod/yanky.nvim/archive/98b9c21d3c06d79f68fd9d471dcc28fc6d2d72ef.tar.gz", - "hash": "1bdplxlhsc72kmbzmi7x4p378f3dyjdm3ncikkjs3qwxkvjl1bxw" + "revision": "04775cc6e10ef038c397c407bc17f00a2f52b378", + "url": "https://github.com/gbprod/yanky.nvim/archive/04775cc6e10ef038c397c407bc17f00a2f52b378.tar.gz", + "hash": "024dw52ji4691ndkaz3k12fx6qyvhdpd2r69r9d2isy81fbs2fjm" } }, "version": 5 From 6bf57573f1e370487c049a2826b2976c8c485c05 Mon Sep 17 00:00:00 2001 From: Noah765 Date: Mon, 21 Apr 2025 08:41:41 +0200 Subject: [PATCH 19/19] autocmds: improve autocommand descriptions --- modules/neovim/init/autocmds.nix | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/modules/neovim/init/autocmds.nix b/modules/neovim/init/autocmds.nix index 5da7bc55..81580e6b 100644 --- a/modules/neovim/init/autocmds.nix +++ b/modules/neovim/init/autocmds.nix @@ -17,7 +17,7 @@ mkEnableOption "" // { default = true; - description = "Whether to enable this autocommand"; + description = "Whether to enable this autocommand."; }; event = mkOption { @@ -31,7 +31,7 @@ type = nullOr (listOf str); default = null; example = ["*.lua" "*.vim"]; - description = "The file pattern(s) that determine when the autocommand applies)."; + description = "The file pattern(s) that determine when the autocommand applies."; }; callback = mkOption { @@ -44,13 +44,16 @@ end '''' ''; - description = "The file pattern(s) that determine when the autocommand applies."; + description = "Lua function to be called when the event(s) are triggered."; }; command = mkOption { type = nullOr str; default = null; - description = "Vim command string instead of a Lua function."; + description = '' + Vim command to be executed when the event(s) are triggered. + Cannot be defined if the `callback` option is already defined. + ''; }; group = mkOption { @@ -70,7 +73,7 @@ once = mkOption { type = bool; default = false; - description = "Whether autocommand run only once."; + description = "Whether to run the autocommand only once."; }; nested = mkOption { @@ -87,7 +90,7 @@ mkEnableOption "" // { default = true; - description = "Whether to enable this autogroup"; + description = "Whether to enable this autocommand group."; }; name = mkOption { @@ -118,8 +121,8 @@ in { autocommands together. Groups allow multiple autocommands to be cleared or redefined collectively, preventing duplicate definitions. - Each autogroup consists of a name, a boolean indicating whether to clear - existing autocommands, and a list of associated autocommands. + Each autogroup consists of a name and a boolean indicating whether to clear + existing autocommands. ''; }; @@ -129,8 +132,8 @@ in { description = '' A list of Neovim autocommands to be registered. - Each entry defines an autocommand, specifying events, patterns, optional - callbacks, commands, groups, and execution settings. + Each entry defines an autocommand, specifying events, patterns, a callback or Vim + command, an optional group, a description, and execution settings. ''; }; };