From 5ecb1a4172661a35218dec84e3462a7b206d34e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 11:44:49 +0000 Subject: [PATCH 01/20] build(deps): bump beatlabs/delete-old-branches-action (#729) Bumps [beatlabs/delete-old-branches-action](https://github.com/beatlabs/delete-old-branches-action) from 0.0.10 to 0.0.11. - [Release notes](https://github.com/beatlabs/delete-old-branches-action/releases) - [Commits](https://github.com/beatlabs/delete-old-branches-action/compare/v0.0.10...v0.0.11) --- updated-dependencies: - dependency-name: beatlabs/delete-old-branches-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/cleanup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index 204dcba7..fbc12bc1 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -13,7 +13,7 @@ jobs: uses: actions/checkout@v4 - name: "Delete old branches" - uses: beatlabs/delete-old-branches-action@v0.0.10 + uses: beatlabs/delete-old-branches-action@v0.0.11 with: repo_token: "${{ secrets.GITHUB_TOKEN }}" date: "1 months ago" From 89123024274cad5c771d1acbe812814192f0d90a Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 22 Mar 2025 17:57:21 +0100 Subject: [PATCH 02/20] nvim-lint: fix config syntax (#735) --- 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 49517f72..085140dc 100644 --- a/modules/plugins/diagnostics/nvim-lint/config.nix +++ b/modules/plugins/diagnostics/nvim-lint/config.nix @@ -13,7 +13,7 @@ in { vim = { startPlugins = ["nvim-lint"]; pluginRC.nvim-lint = entryAnywhere '' - require("lint").linters_by_ft(${toLuaObject cfg.linters_by_ft}) + require("lint").linters_by_ft = ${toLuaObject cfg.linters_by_ft} ''; }; }; From 297ac641eda7134b884ec80e0b07874db3c4ff8d Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sat, 22 Mar 2025 15:01:51 +0100 Subject: [PATCH 03/20] lazy: fix incomplete event type --- modules/wrapper/lazy/lazy.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/wrapper/lazy/lazy.nix b/modules/wrapper/lazy/lazy.nix index 5d67aa59..eb1f5cdf 100644 --- a/modules/wrapper/lazy/lazy.nix +++ b/modules/wrapper/lazy/lazy.nix @@ -126,7 +126,7 @@ }; event = mkOption { - type = nullOr (oneOf [str (listOf str) lznEvent]); + type = nullOr (oneOf [str lznEvent (listOf (either str lznEvent))]); default = null; description = "Lazy-load on event"; }; From e8dd47bbd03873865ce4957a1329dfdd4c7f3df7 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sat, 22 Mar 2025 15:02:13 +0100 Subject: [PATCH 04/20] lazy: create LazyFile user event --- modules/wrapper/lazy/config.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix index 3468d5ec..c1bd8829 100644 --- a/modules/wrapper/lazy/config.nix +++ b/modules/wrapper/lazy/config.nix @@ -134,6 +134,15 @@ in { startPlugins = ["lz-n" "lzn-auto-require"]; optPlugins = pluginPackages; + augroups = [{name = "nvf_lazy_file_hooks";}]; + autocmds = [ + { + event = ["BufReadPost" "BufNewFile" "BufWritePre"]; + group = "nvf_lazy_file_hooks"; + command = "doautocmd User LazyFile"; + once = true; + } + ]; lazy.builtLazyConfig = '' require('lz.n').load(${toLuaObject lznSpecs}) From e771f299c10aa52426077145c96ccb01e6eaab65 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sat, 22 Mar 2025 15:02:40 +0100 Subject: [PATCH 05/20] copilot: load on LazyFile --- modules/plugins/assistant/copilot/config.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/plugins/assistant/copilot/config.nix b/modules/plugins/assistant/copilot/config.nix index 37da046f..525fe3bd 100644 --- a/modules/plugins/assistant/copilot/config.nix +++ b/modules/plugins/assistant/copilot/config.nix @@ -37,6 +37,12 @@ in { inherit (cfg) setupOpts; after = mkIf cfg.cmp.enable "require('copilot_cmp').setup()"; + event = [ + { + event = "User"; + pattern = "LazyFile"; + } + ]; cmd = ["Copilot" "CopilotAuth" "CopilotDetach" "CopilotPanel" "CopilotStop"]; keys = [ (mkLuaKeymap ["n"] cfg.mappings.panel.accept (wrapPanelBinding ''require("copilot.panel").accept'' cfg.mappings.panel.accept) "[copilot] Accept suggestion" {}) From 11dd3752f8b1550ca9d23989222d84eefbf0dc7a Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sat, 22 Mar 2025 15:07:27 +0100 Subject: [PATCH 06/20] docs: update release notes --- docs/release-notes/rl-0.8.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index c84ef199..e1c1f38f 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -89,6 +89,7 @@ [blink.cmp]: https://github.com/saghen/blink.cmp - Add [blink.cmp] support. +- Add `LazyFile` user event. [diniamo](https://github.com/diniamo): @@ -244,8 +245,8 @@ syncing of nvim shell environment with direnv's. - Add [blink.cmp] source options and some default-disabled sources. - Add [blink.cmp] option to add - [friendly-snippets](https://github.com/rafamadriz/friendly-snippets) - so blink.cmp can source snippets from it. + [friendly-snippets](https://github.com/rafamadriz/friendly-snippets) so + blink.cmp can source snippets from it. - Fix [blink.cmp] breaking when built-in sources were modified. [TheColorman](https://github.com/TheColorman): From 68490f43ffde08fd91defbd50af469253f9335b1 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sat, 22 Mar 2025 15:13:44 +0100 Subject: [PATCH 07/20] docs: mention LazyFile --- .../configuring/custom-plugins/lazy-method.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/manual/configuring/custom-plugins/lazy-method.md b/docs/manual/configuring/custom-plugins/lazy-method.md index c6fd7106..ae766535 100644 --- a/docs/manual/configuring/custom-plugins/lazy-method.md +++ b/docs/manual/configuring/custom-plugins/lazy-method.md @@ -38,3 +38,22 @@ As of version **0.7**, we exposed an API for configuring lazy-loaded plugins via }; } ``` + +## LazyFile event {#sec-lazyfile-event} + +You can use the `LazyFile` user event to load a plugin when a file is opened: + +```nix +{ + config.vim.lazy.plugins = { + "aerial.nvim" = { + package = pkgs.vimPlugins.aerial-nvim; + event = [{event = "User"; pattern = "LazyFile";}]; + # ... + }; + }; +} +``` + +You can consider `LazyFile` as an alias to +`["BufReadPost" "BufNewFile" "BufWritePre"]` From e1a1a4e6f4b2f643a36d36959d489f9e6f9a9ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phan=20=C4=90=C4=83ng=20Khoa?= Date: Sun, 23 Mar 2025 22:57:38 +0700 Subject: [PATCH 08/20] eslint_d: added conditions for launching eslint_d (#737) * eslint_d: added conditions for launching eslint_d * eslint_d: documented changes to docs/release-notes/rl-0.8.md --------- Co-authored-by: raf --- docs/release-notes/rl-0.8.md | 4 ++++ modules/plugins/languages/astro.nix | 10 ++++++++++ modules/plugins/languages/svelte.nix | 10 ++++++++++ modules/plugins/languages/ts.nix | 10 ++++++++++ 4 files changed, 34 insertions(+) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index e1c1f38f..5e09bb35 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -272,3 +272,7 @@ [Butzist](https://github.com/butzist): - Add Helm chart support under `vim.languages.helm`. + +[rice-cracker-dev](https://github.com/rice-cracker-dev): + +- `eslint_d` now checks for configuration files to load. diff --git a/modules/plugins/languages/astro.nix b/modules/plugins/languages/astro.nix index f628ed53..5ccff14f 100644 --- a/modules/plugins/languages/astro.nix +++ b/modules/plugins/languages/astro.nix @@ -72,6 +72,16 @@ ls_sources, null_ls.builtins.diagnostics.eslint_d.with({ command = "${getExe pkg}", + condition = function(utils) + return utils.root_has_file({ + "eslint.config.js", + "eslint.config.mjs", + ".eslintrc", + ".eslintrc.json", + ".eslintrc.js", + ".eslintrc.yml", + }) + end, }) ) ''; diff --git a/modules/plugins/languages/svelte.nix b/modules/plugins/languages/svelte.nix index a3c55e10..4d96c20a 100644 --- a/modules/plugins/languages/svelte.nix +++ b/modules/plugins/languages/svelte.nix @@ -72,6 +72,16 @@ ls_sources, null_ls.builtins.diagnostics.eslint_d.with({ command = "${getExe pkg}", + condition = function(utils) + return utils.root_has_file({ + "eslint.config.js", + "eslint.config.mjs", + ".eslintrc", + ".eslintrc.json", + ".eslintrc.js", + ".eslintrc.yml", + }) + end, }) ) ''; diff --git a/modules/plugins/languages/ts.nix b/modules/plugins/languages/ts.nix index c9070554..790c235a 100644 --- a/modules/plugins/languages/ts.nix +++ b/modules/plugins/languages/ts.nix @@ -123,6 +123,16 @@ ls_sources, null_ls.builtins.diagnostics.eslint_d.with({ command = "${getExe pkg}", + condition = function(utils) + return utils.root_has_file({ + "eslint.config.js", + "eslint.config.mjs", + ".eslintrc", + ".eslintrc.json", + ".eslintrc.js", + ".eslintrc.yml", + }) + end, }) ) ''; From 73b09271897f47d1bcda8687edd3dbed66491fcd Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Mar 2025 08:43:04 +0300 Subject: [PATCH 09/20] treewide: remove `nmd` dependency --- docs/default.nix | 2 -- flake.lock | 17 ----------------- flake.nix | 6 ------ modules/plugins/statusline/lualine/lualine.nix | 2 -- 4 files changed, 27 deletions(-) diff --git a/docs/default.nix b/docs/default.nix index 48cff563..98b29db0 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -95,8 +95,6 @@ inherit (nvimModuleDocs) optionsJSON; }; in { - inherit (inputs) nmd; - # TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream # `nixosOptionsDoc` is more customizable. options.json = diff --git a/flake.lock b/flake.lock index 3ced812a..603d0f50 100644 --- a/flake.lock +++ b/flake.lock @@ -106,22 +106,6 @@ "type": "github" } }, - "nmd": { - "flake": false, - "locked": { - "lastModified": 1705050560, - "narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=", - "owner": "~rycee", - "repo": "nmd", - "rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3", - "type": "sourcehut" - }, - "original": { - "owner": "~rycee", - "repo": "nmd", - "type": "sourcehut" - } - }, "root": { "inputs": { "flake-parts": "flake-parts", @@ -129,7 +113,6 @@ "mnw": "mnw", "nil": "nil", "nixpkgs": "nixpkgs", - "nmd": "nmd", "systems": "systems_2" } }, diff --git a/flake.nix b/flake.nix index 30b71f80..6e716581 100644 --- a/flake.nix +++ b/flake.nix @@ -86,12 +86,6 @@ # Alternate neovim-wrapper mnw.url = "github:Gerg-L/mnw"; - # For generating documentation website - nmd = { - url = "sourcehut:~rycee/nmd"; - flake = false; - }; - # Language servers (use master instead of nixpkgs) nil = { url = "github:oxalica/nil"; diff --git a/modules/plugins/statusline/lualine/lualine.nix b/modules/plugins/statusline/lualine/lualine.nix index 9943f78e..bf070db7 100644 --- a/modules/plugins/statusline/lualine/lualine.nix +++ b/modules/plugins/statusline/lualine/lualine.nix @@ -124,8 +124,6 @@ in { mkOption { type = enum themesConcatted; default = "auto"; - # TODO: xml generation error if the closing '' is on a new line. - # issue: https://gitlab.com/rycee/nmd/-/issues/10 defaultText = ''`config.vim.theme.name` if theme supports lualine else "auto"''; description = "Theme for lualine"; }; From a70e9e5e2680f08c6dd0cfec47f555cf6d8a7b08 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Mar 2025 11:57:38 +0300 Subject: [PATCH 10/20] blink: v0.13.1 -> v0.14.1 --- flake/legacyPackages/blink-cmp.nix | 24 +++++------------------- npins/sources.json | 8 ++++---- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/flake/legacyPackages/blink-cmp.nix b/flake/legacyPackages/blink-cmp.nix index ba1d7424..477616aa 100644 --- a/flake/legacyPackages/blink-cmp.nix +++ b/flake/legacyPackages/blink-cmp.nix @@ -1,11 +1,11 @@ { + stdenv, rustPlatform, hostPlatform, vimUtils, git, src, version, - fetchpatch, }: let blink-fuzzy-lib = rustPlatform.buildRustPackage { pname = "blink-fuzzy-lib"; @@ -19,11 +19,6 @@ nativeBuildInputs = [git]; }; - - libExt = - if hostPlatform.isDarwin - then "dylib" - else "so"; in vimUtils.buildVimPlugin { pname = "blink-cmp"; @@ -31,22 +26,13 @@ in # blink references a repro.lua which is placed outside the lua/ directory doCheck = false; - preInstall = '' + preInstall = let + ext = stdenv.hostPlatform.extensions.sharedLibrary; + in '' mkdir -p target/release - ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.${libExt} target/release/libblink_cmp_fuzzy.${libExt} - echo -n "nix" > target/release/version + ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy${ext} target/release/libblink_cmp_fuzzy${ext} ''; - # Borrowed from nixpkgs - # TODO: Remove this patch when updating to next version - patches = [ - (fetchpatch { - name = "blink-add-bypass-for-nix.patch"; - url = "https://github.com/Saghen/blink.cmp/commit/6c83ef1ae34abd7ef9a32bfcd9595ac77b61037c.diff?full_index=1"; - hash = "sha256-304F1gDDKVI1nXRvvQ0T1xBN+kHr3jdmwMMp8CNl+GU="; - }) - ]; - # Module for reproducing issues nvimSkipModule = ["repro"]; } diff --git a/npins/sources.json b/npins/sources.json index 91c3f68e..53cb810e 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -46,10 +46,10 @@ "pre_releases": false, "version_upper_bound": null, "release_prefix": null, - "version": "v0.13.1", - "revision": "29861baf37bbb16f5dbf524a6edac5daaad6f4fc", - "url": "https://api.github.com/repos/saghen/blink.cmp/tarball/v0.13.1", - "hash": "1y5p7i6g884r65mhfsazx28g0qs37hc57jm37i7kch9kcf8m7sbq" + "version": "v0.14.1", + "revision": "7a91dc584f41f5aa2373a917faf8100b2e54d6c9", + "url": "https://api.github.com/repos/saghen/blink.cmp/tarball/v0.14.1", + "hash": "0zm6s3v9liimx28vs1g5yi7bcfrl691q81bvzmdpavcwrzcdb0c8" }, "blink-cmp-spell": { "type": "Git", From 6d0e58008598f7710640afa74859a30f6495b0ef Mon Sep 17 00:00:00 2001 From: Marlon Rosenberg Date: Mon, 24 Mar 2025 22:25:01 +0100 Subject: [PATCH 11/20] languages/fsharp: init --- docs/manual/configuring/languages.md | 1 + docs/release-notes/rl-0.8.md | 4 + modules/plugins/languages/default.nix | 1 + modules/plugins/languages/fsharp.nix | 108 ++++++++++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 modules/plugins/languages/fsharp.nix diff --git a/docs/manual/configuring/languages.md b/docs/manual/configuring/languages.md index 74714365..252163fb 100644 --- a/docs/manual/configuring/languages.md +++ b/docs/manual/configuring/languages.md @@ -19,6 +19,7 @@ formatting to diagnostics. The following languages have sections under the - Go: [vim.languages.go.enable](#opt-vim.languages.go.enable) - Lua: [vim.languages.lua.enable](#opt-vim.languages.lua.enable) - PHP: [vim.languages.php.enable](#opt-vim.languages.php.enable) +- F#: [vim.languages.fsharp.enable](#opt-vim.languages.fsharp.enable) Adding support for more languages, and improving support for existing ones are great places where you can contribute with a PR. diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 5e09bb35..afb5ccd3 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -276,3 +276,7 @@ [rice-cracker-dev](https://github.com/rice-cracker-dev): - `eslint_d` now checks for configuration files to load. + +[Sc3l3t0n](https://github.com/Sc3l3t0n) + +- Add F# support under `vim.languages.fsharp`. diff --git a/modules/plugins/languages/default.nix b/modules/plugins/languages/default.nix index 20acfb6c..c3312135 100644 --- a/modules/plugins/languages/default.nix +++ b/modules/plugins/languages/default.nix @@ -10,6 +10,7 @@ in { ./clang.nix ./css.nix ./elixir.nix + ./fsharp.nix ./gleam.nix ./go.nix ./hcl.nix diff --git a/modules/plugins/languages/fsharp.nix b/modules/plugins/languages/fsharp.nix new file mode 100644 index 00000000..2b80bf11 --- /dev/null +++ b/modules/plugins/languages/fsharp.nix @@ -0,0 +1,108 @@ +{ + lib, + pkgs, + config, + ... +}: let + inherit (builtins) attrNames; + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.types) either listOf package str enum; + inherit (lib.modules) mkIf mkMerge; + inherit (lib.lists) isList; + inherit (lib.nvim.types) mkGrammarOption; + inherit (lib.nvim.lua) expToLua; + + defaultServer = "fsautocomplete"; + servers = { + fsautocomplete = { + package = pkgs.fsautocomplete; + internalFormatter = false; + lspConfig = '' + lspconfig.fsautocomplete.setup { + capabilities = capabilities; + on_attach = default_on_attach; + cmd = ${ + if isList cfg.lsp.package + then expToLua cfg.lsp.package + else "{'${cfg.lsp.package}/bin/fsautocomplete'}" + }, + } + ''; + }; + }; + + defaultFormat = "fantomas"; + formats = { + fantomas = { + package = pkgs.fantomas; + nullConfig = '' + table.insert( + ls_sources, + null_ls.builtins.formatting.fantomas.with({ + command = "${cfg.format.package}/bin/fantomas", + }) + ) + ''; + }; + }; + + cfg = config.vim.languages.fsharp; +in { + options = { + vim.languages.fsharp = { + enable = mkEnableOption "F# language support"; + + treesitter = { + enable = mkEnableOption "F# treesitter" // {default = config.vim.languages.enableTreesitter;}; + package = mkGrammarOption pkgs "fsharp"; + }; + + lsp = { + enable = mkEnableOption "F# LSP support" // {default = config.vim.languages.enableLSP;}; + server = mkOption { + description = "F# LSP server to use"; + type = enum (attrNames servers); + default = defaultServer; + }; + + package = mkOption { + description = "F# LSP server package, or the command to run as a list of strings"; + type = either package (listOf str); + default = servers.${cfg.lsp.server}.package; + }; + }; + format = { + enable = mkEnableOption "F# formatting" // {default = config.vim.languages.enableFormat;}; + + type = mkOption { + description = "F# formatter to use"; + type = enum (attrNames formats); + default = defaultFormat; + }; + + package = mkOption { + description = "F# formatter package"; + type = package; + default = formats.${cfg.format.type}.package; + }; + }; + }; + }; + + config = mkIf cfg.enable (mkMerge [ + (mkIf cfg.treesitter.enable { + vim.treesitter.enable = true; + vim.treesitter.grammars = [cfg.treesitter.package]; + }) + + (mkIf cfg.lsp.enable { + vim.lsp.lspconfig.enable = true; + vim.lsp.lspconfig.sources.fsharp-lsp = servers.${cfg.lsp.server}.lspConfig; + }) + + (mkIf cfg.format.enable { + vim.lsp.null-ls.enable = true; + vim.lsp.null-ls.sources.fsharp-format = formats.${cfg.format.type}.nullConfig; + }) + ]); +} From d93d755989b02d30df80dc3c77ec8ccdf5a7ab1e Mon Sep 17 00:00:00 2001 From: Marlon Rosenberg Date: Tue, 25 Mar 2025 19:42:50 +0000 Subject: [PATCH 12/20] languages/fsharp: resolve comments --- configuration.nix | 1 + modules/plugins/languages/fsharp.nix | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configuration.nix b/configuration.nix index a243c970..78dad9c7 100644 --- a/configuration.nix +++ b/configuration.nix @@ -82,6 +82,7 @@ isMaximal: { elixir.enable = false; haskell.enable = false; ruby.enable = false; + fsharp.enable = false; tailwind.enable = false; svelte.enable = false; diff --git a/modules/plugins/languages/fsharp.nix b/modules/plugins/languages/fsharp.nix index 2b80bf11..ee728060 100644 --- a/modules/plugins/languages/fsharp.nix +++ b/modules/plugins/languages/fsharp.nix @@ -60,14 +60,14 @@ in { lsp = { enable = mkEnableOption "F# LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { - description = "F# LSP server to use"; type = enum (attrNames servers); + description = "F# LSP server to use"; default = defaultServer; }; package = mkOption { - description = "F# LSP server package, or the command to run as a list of strings"; type = either package (listOf str); + description = "F# LSP server package, or the command to run as a list of strings"; default = servers.${cfg.lsp.server}.package; }; }; @@ -75,14 +75,14 @@ in { enable = mkEnableOption "F# formatting" // {default = config.vim.languages.enableFormat;}; type = mkOption { - description = "F# formatter to use"; type = enum (attrNames formats); + description = "F# formatter to use"; default = defaultFormat; }; package = mkOption { - description = "F# formatter package"; type = package; + description = "F# formatter package"; default = formats.${cfg.format.type}.package; }; }; From f605bceeca21f94e68792eacdea93d084e9e314e Mon Sep 17 00:00:00 2001 From: raf Date: Tue, 25 Mar 2025 21:40:13 +0000 Subject: [PATCH 13/20] Update rl-0.8.md --- docs/release-notes/rl-0.8.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index afb5ccd3..7f6c6ffe 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -277,6 +277,6 @@ - `eslint_d` now checks for configuration files to load. -[Sc3l3t0n](https://github.com/Sc3l3t0n) +[Sc3l3t0n](https://github.com/Sc3l3t0n): - Add F# support under `vim.languages.fsharp`. From 05da6e3318ade42091a748bbd95666c938f41ae1 Mon Sep 17 00:00:00 2001 From: Marlon Rosenberg Date: Tue, 25 Mar 2025 22:16:20 +0000 Subject: [PATCH 14/20] correct ordering --- modules/plugins/languages/fsharp.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/plugins/languages/fsharp.nix b/modules/plugins/languages/fsharp.nix index ee728060..6ae1a5b1 100644 --- a/modules/plugins/languages/fsharp.nix +++ b/modules/plugins/languages/fsharp.nix @@ -61,14 +61,14 @@ in { enable = mkEnableOption "F# LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { type = enum (attrNames servers); - description = "F# LSP server to use"; default = defaultServer; + description = "F# LSP server to use"; }; package = mkOption { type = either package (listOf str); - description = "F# LSP server package, or the command to run as a list of strings"; default = servers.${cfg.lsp.server}.package; + description = "F# LSP server package, or the command to run as a list of strings"; }; }; format = { @@ -76,14 +76,14 @@ in { type = mkOption { type = enum (attrNames formats); - description = "F# formatter to use"; default = defaultFormat; + description = "F# formatter to use"; }; package = mkOption { type = package; - description = "F# formatter package"; default = formats.${cfg.format.type}.package; + description = "F# formatter package"; }; }; }; From 8b1e6080f60820891e1d5fa967045ea02005b5cc Mon Sep 17 00:00:00 2001 From: Marlon Rosenberg Date: Tue, 25 Mar 2025 22:28:08 +0000 Subject: [PATCH 15/20] add example to lsp package --- modules/plugins/languages/fsharp.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/plugins/languages/fsharp.nix b/modules/plugins/languages/fsharp.nix index 6ae1a5b1..86c08d39 100644 --- a/modules/plugins/languages/fsharp.nix +++ b/modules/plugins/languages/fsharp.nix @@ -68,6 +68,7 @@ in { package = mkOption { type = either package (listOf str); default = servers.${cfg.lsp.server}.package; + example = ''[lib.getExe pkgs.fsautocomplete "--state-directory" "~/.cache/fsautocomplete"]''; description = "F# LSP server package, or the command to run as a list of strings"; }; }; From 30ffe11cc06737badc1032490309279d3de8b983 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 25 Mar 2025 12:49:55 +0300 Subject: [PATCH 16/20] ci: consolidate 'check' type workflows into one --- .github/workflows/check-docs.yml | 56 ------------- .github/workflows/check.yml | 127 +++++++++++++++++++++++++++-- .github/workflows/cleanup.yml | 6 +- .github/workflows/docs-preview.yml | 4 +- .github/workflows/editorconfig.yml | 46 ----------- .github/workflows/typos.yml | 30 ------- 6 files changed, 128 insertions(+), 141 deletions(-) delete mode 100644 .github/workflows/check-docs.yml delete mode 100644 .github/workflows/editorconfig.yml delete mode 100644 .github/workflows/typos.yml diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml deleted file mode 100644 index 4d133ecd..00000000 --- a/.github/workflows/check-docs.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: "Validate flake & check documentation" -on: - pull_request: - workflow_dispatch: - push: - branches: - - main - paths: - - docs/** -jobs: - flake-docs-check: - name: Validate Flake Documentation - runs-on: ubuntu-latest - strategy: - matrix: - package: - - docs - - docs-html - - docs-manpages - - docs-json - steps: - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main - - - name: Checkout - uses: actions/checkout@v4 - - - name: Set default git branch (to reduce log spam) - run: git config --global init.defaultBranch main - - - name: Build documentation packages - run: nix build .#${{ matrix.package }} --print-build-logs - - - name: Get current date - id: get-date - # output format: 2023-12-22-120000 - run: echo "date=$(date +'%Y-%m-%d-%H%M%S')" >> ${GITHUB_OUTPUT} - - - name: Upload doc artifacts - uses: actions/upload-artifact@v4 - with: - name: "${{ matrix.package }}" - path: result/share/doc/nvf - - flake-docs-linkcheck: - name: Validate hyperlinks in documentation sources - runs-on: ubuntu-latest - steps: - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main - - - name: Checkout - uses: actions/checkout@v4 - - - name: Build documentation packages - run: nix build .#docs-linkcheck -Lv diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 7a7677eb..c6967f21 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,4 +1,6 @@ -name: "Validate flake & check formatting" +name: "Treewide Checks" +permissions: read-all + on: pull_request: workflow_dispatch: @@ -6,13 +8,13 @@ on: branches: - main paths-ignore: - - .github/** - assets/** - - .gitignore + jobs: nix-flake-check: - name: Validate Flake + name: "Validate flake" runs-on: ubuntu-latest + if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout uses: actions/checkout@v4 @@ -24,8 +26,9 @@ jobs: run: nix flake check format-with-alejandra: - name: Formatting via Alejandra + name: "Check formatting" runs-on: ubuntu-latest + if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout uses: actions/checkout@v4 @@ -33,4 +36,116 @@ jobs: - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - - run: nix run nixpkgs#alejandra -- -c . + - name: Check formatting via Alejandra + run: nix run nixpkgs#alejandra -- -c . + + check-typos: + name: "Check source tree for typos" + runs-on: ubuntu-latest + if: "!contains(github.event.pull_request.title, '[skip ci]')" + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Check for typos + uses: crate-ci/typos@master + with: + config: .github/typos.toml + + - if: ${{ failure() }} + shell: bash + run: | + echo "::error:: Current codebase contains typos that were caught by the CI!" + echo "If those typos were intentional, please add them to the ignored regexes in .github/typos.toml" + echo "[skip ci] label may be added to the PR title if this is a one-time issue and is safe to ignore" + exit 1 + + flake-docs-check: + name: "Validate documentation builds" + runs-on: ubuntu-latest + if: "!contains(github.event.pull_request.title, '[skip ci]')" + strategy: + matrix: + package: + - docs + - docs-html + - docs-manpages + - docs-json + steps: + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set default git branch (to reduce log spam) + run: git config --global init.defaultBranch main + + - name: Build documentation packages + run: nix build .#${{ matrix.package }} --print-build-logs + + - name: Get current date + id: get-date + # output format: 2023-12-22-120000 + run: echo "date=$(date +'%Y-%m-%d-%H%M%S')" >> ${GITHUB_OUTPUT} + + - name: Upload doc artifacts + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.package }}" + path: result/share/doc/nvf + + flake-docs-linkcheck: + name: "Validate hyperlinks in documentation sources" + runs-on: ubuntu-latest + if: "!contains(github.event.pull_request.title, '[skip ci]')" + steps: + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + + - name: Checkout + uses: actions/checkout@v4 + + - name: Build linkcheck package + run: nix build .#docs-linkcheck -Lv + + check-editorconfig: + name: "Validate Editorconfig conformance" + runs-on: ubuntu-latest + if: "!contains(github.event.pull_request.title, '[skip ci]')" + steps: + - name: Get list of changed files from PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh api \ + repos/${{ github.repository }}/pulls/${{github.event.number}}/files --paginate \ + | jq '.[] | select(.status != "removed") | .filename' \ + > "$HOME/changed_files" + + - name: Print list of changed files + run: | + cat "$HOME/changed_files" + + - name: Checkout + uses: actions/checkout@v4 + with: + ref: refs/pull/${{ github.event.pull_request.number }}/merge + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + + - name: Checking EditorConfig + shell: bash + run: | + cat "$HOME/changed_files" | nix-shell -p editorconfig-checker.out \ + --run 'xargs -r editorconfig-checker -disable-indentation -exclude flake.lock --verbose' + echo -n "Check status: $?" + + - if: ${{ failure() }} + shell: bash + run: | + echo "::error:: Current formatting does not fit convention provided by .editorconfig located in the project root." + echo "Please make sure your editor properly integrates editorconfig, Neovim does so by default." + echo "See https://editorconfig.org/#download on how to integrate Editorconfig to your editor." + exit 1 diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index fbc12bc1..aa8fb272 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -1,9 +1,13 @@ -name: Cleanup +name: Delete Stale Branches +permissions: + contents: write + on: workflow_dispatch: schedule: - cron: "0 4 1 * *" # 4AM on 1st of every month - cron: "0 4 15 * *" # 4AM on the 15th of every month + jobs: branches: name: Cleanup old branches diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index f8f45d05..9adaf5ef 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -9,7 +9,7 @@ on: - "modules/**" - "docs/**" -# Defining permissions here passes it to all workflows. +# Defining permissions here passes it to all jobs. # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token permissions: contents: write @@ -34,7 +34,7 @@ jobs: run: git config --global init.defaultBranch main - name: Build documentation packages - run: nix build .#docs-html --print-build-logs + run: nix build .#docs-html --print-build-logs || exit 1 - name: Deploy to GitHub Pages preview run: | diff --git a/.github/workflows/editorconfig.yml b/.github/workflows/editorconfig.yml deleted file mode 100644 index 3d8ca360..00000000 --- a/.github/workflows/editorconfig.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: "Check validity of .editorconfig" - -permissions: read-all - -on: - pull_request: - -jobs: - check-editorconfig: - runs-on: ubuntu-latest - if: "!contains(github.event.pull_request.title, '[skip ci]')" - steps: - - name: Get list of changed files from PR - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh api \ - repos/notashelf/nvf/pulls/${{github.event.number}}/files --paginate \ - | jq '.[] | select(.status != "removed") | .filename' \ - > "$HOME/changed_files" - - - name: Print list of changed files - run: | - cat "$HOME/changed_files" - - - name: Checkout - uses: actions/checkout@v4 - with: - ref: refs/pull/${{ github.event.pull_request.number }}/merge - - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main - - - name: Checking EditorConfig - shell: bash - run: | - cat "$HOME/changed_files" | nix-shell -p editorconfig-checker.out --run 'xargs -r editorconfig-checker -disable-indentation -exclude flake.lock --verbose' - echo -n "Check status: $?" - - - name: Fail Gracefully - if: ${{ failure() }} - shell: bash - run: | - echo "::error:: Current formatting does not fit convention provided by .editorconfig located in the project root." - echo "Please make sure your editor properly integrates editorconfig. See https://editorconfig.org/#download for more." - exit 1 diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml deleted file mode 100644 index d74ee5b7..00000000 --- a/.github/workflows/typos.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: "Check for typos in the source tree" - -permissions: read-all - -on: - pull_request: - workflow_dispatch: - push: - -jobs: - check-typos: - runs-on: ubuntu-latest - if: "!contains(github.event.pull_request.title, '[skip ci]')" - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Check for typos - uses: crate-ci/typos@master - with: - config: .github/typos.toml - - - name: Fail Gracefully - if: ${{ failure() }} - shell: bash - run: | - echo "::error:: Current codebase contains typos that were caught by the CI!" - echo "If those typos were intentional, please add them to the ignored regexes in .github/typos.toml" - echo "[skip ci] label may be used if this is a one-time issue" - exit 1 From 12706b81e2bc3c8ec1ee8a72df01e792f8d75c81 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 20 Mar 2025 14:39:53 +0300 Subject: [PATCH 17/20] meta: update CODEOWNERS with new maintainers --- .github/CODEOWNERS | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index de6ff5ef..2fb071ca 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,5 @@ -* @NotAShelf +# Codeowners should be used to distinguish the maintainers of the project +# and not contributors of specific modules to nvf. While adding a new module +# please consider adding yourself to 'meta.maintainers' in the module instead +# of CODEOWNERS here. +* @NotAShelf @horriblename @Soliprem From 95126f5da03dcf508add947642cd12d7f377e776 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Mar 2025 21:09:47 +0300 Subject: [PATCH 18/20] docs: update co-maintainers section --- .github/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/README.md b/.github/README.md index 7c0974c3..a6ef7a44 100644 --- a/.github/README.md +++ b/.github/README.md @@ -246,14 +246,15 @@ Neovim's behaviour with Nix. ### Co-Maintainers -Alongside myself, nvf is developed by those talented folk: +Alongside [myself](https://github.com/notashelf), nvf is developed by those +talented folk. nvf would not be what it is today without their invaluable +contributions. - [**@horriblename**](https://github.com/horriblename) ([Liberapay](https://liberapay.com/horriblename/))- For actively implementing planned features and quality of life updates. -- [**@Diniamo**](https://github.com/Diniamo) - ([Liberapay](https://en.liberapay.com/diniamo/)) - For actively submitting - pull requests, issues and assistance with maintenance of nvf. +- [**@Soliprem**](https://github.com/soliprem) - For rigorously implementing + missing features and excellent work on new language modules. Please do remember to extend your thanks (financially or otherwise) if this project has been helpful to you. @@ -270,14 +271,14 @@ heart-felt thanks to - [**@FlafyDev**](https://github.com/FlafyDev) - For getting Home-Manager module to work and Nix assistance. - [**@n3oney**](https://github.com/n3oney) - For making custom keybinds finally - possible, and other module additions. + possible, great ideas and module additions. - [**@Yavko**](https://github.com/Yavko) - For the amazing **nvf** logo - [**@FrothyMarrow**](https://github.com/FrothyMarrow) - For seeing mistakes - that I could not. + that I could not and contributing good ideas & code. - [**@Gerg-l**](https://github.com/gerg-l) 🐸 - For the modern Neovim wrapper, - [mnw], and occasional code improvements. -- [**@Soliprem**](https://github.com/soliprem) - Rigorously implementing missing - features and excellent work on new language modules. + [mnw], and occasional improvements to the codebase. +- [**@Diniamo**](https://github.com/Diniamo) - For actively submitting pull + requests, issues and assistance with co-maintenance of nvf. and everyone who has submitted issues or pull requests! @@ -301,7 +302,6 @@ including: I am grateful for their previous work and inspiration, and I wholeheartedly recommend checking their work out. -
## License From e57b7e289547e8478ca3f02cc0def112469c1009 Mon Sep 17 00:00:00 2001 From: Al Duncanson Date: Mon, 24 Mar 2025 19:04:23 -0400 Subject: [PATCH 19/20] docs: fix typo Add missing word in sentence: `let`. --- docs/manual/options.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/manual/options.md b/docs/manual/options.md index 61282dfa..beab4f16 100644 --- a/docs/manual/options.md +++ b/docs/manual/options.md @@ -5,8 +5,8 @@ options will include useful comments, warnings or setup tips on how a module option is meant to be used as well as examples in complex cases. An offline version of this page is bundled with nvf as a part of the manpages -which you can access with `man 5 nvf`. Please us know if you believe any of the -options below are missing useful examples. +which you can access with `man 5 nvf`. Please let us know if you believe any of +the options below are missing useful examples.