diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 23381e4e..34c11ffe 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -1,5 +1,4 @@ name: "Build and deploy documentation" - on: workflow_dispatch: push: @@ -8,7 +7,6 @@ on: paths: # build the manuals only when docs directory is updated - docs/** - - modules/** # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: @@ -22,34 +20,23 @@ concurrency: cancel-in-progress: true jobs: - check_date: - runs-on: ubuntu-latest - name: Check latest commit - outputs: - should_run: ${{ steps.should_run.outputs.should_run }} - steps: - - uses: actions/checkout@v4.1.7 - - name: print latest_commit - run: echo ${{ github.sha }} - - - id: should_run - continue-on-error: true - name: check latest commit is less than a day - if: ${{ github.event_name == 'schedule' }} - run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" - publish: - needs: check_date - if: ${{ needs.check_date.outputs.should_run != 'false' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.1.7 - - uses: DeterminateSystems/nix-installer-action@main + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/magic-nix-cache-action@main - - run: | - nix build .#docs + + - name: Build + run: | + nix build '.#docs' cp -r result/share/doc/nvf public - - uses: peaceiris/actions-gh-pages@v4 + + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public diff --git a/configuration.nix b/configuration.nix index 74790128..b0c613b2 100644 --- a/configuration.nix +++ b/configuration.nix @@ -17,6 +17,7 @@ isMaximal: { lspkind.enable = false; lightbulb.enable = true; lspsaga.enable = false; + nvimCodeActionMenu.enable = isMaximal; trouble.enable = true; lspSignature.enable = true; lsplines.enable = isMaximal; @@ -203,7 +204,6 @@ isMaximal: { go = ["90" "130"]; }; }; - fastaction.enable = true; }; assistant = { diff --git a/docs/default.nix b/docs/default.nix index cce02b1d..b48daf5b 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -2,131 +2,131 @@ inputs, pkgs, lib, + manpageUrls ? pkgs.path + "/doc/manpage-urls.json", + ... }: let - inherit ((lib.importJSON ../release.json)) release; + inherit (lib.modules) mkForce evalModules; + inherit (lib.strings) hasPrefix removePrefix; + inherit (lib.attrsets) isAttrs mapAttrs optionalAttrs recursiveUpdate isDerivation; + inherit (builtins) fromJSON readFile; - nvimModuleDocs = pkgs.nixosOptionsDoc { - variablelistId = "nvf-options"; - warningsAreErrors = true; + # release data + release-config = fromJSON (readFile ../release.json); + revision = release-config.release; - inherit - ( - (lib.evalModules { - modules = - import ../modules/modules.nix { - inherit lib pkgs; - } - ++ [ - ( - let - # From nixpkgs: - # - # Recursively replace each derivation in the given attribute set - # with the same derivation but with the `outPath` attribute set to - # the string `"\${pkgs.attribute.path}"`. This allows the - # documentation to refer to derivations through their values without - # establishing an actual dependency on the derivation output. - # - # This is not perfect, but it seems to cover a vast majority of use - # cases. - # - # Caveat: even if the package is reached by a different means, the - # path above will be shown and not e.g. - # `${config.services.foo.package}`. - scrubDerivations = namePrefix: pkgSet: - builtins.mapAttrs ( - name: value: let - wholeName = "${namePrefix}.${name}"; - in - if builtins.isAttrs value - then - scrubDerivations wholeName value - // lib.optionalAttrs (lib.isDerivation value) { - inherit (value) drvPath; - outPath = "\${${wholeName}}"; - } - else value - ) - pkgSet; - in { - _module = { - check = false; - args.pkgs = lib.mkForce (scrubDerivations "pkgs" pkgs); - }; - } - ) - ]; - }) - ) - options - ; + # From home-manager: + # + # Recursively replace each derivation in the given attribute set + # with the same derivation but with the `outPath` attribute set to + # the string `"\${pkgs.attribute.path}"`. This allows the + # documentation to refer to derivations through their values without + # establishing an actual dependency on the derivation output. + # + # This is not perfect, but it seems to cover a vast majority of use + # cases. + # + # Caveat: even if the package is reached by a different means, the + # path above will be shown and not e.g. + # `${config.services.foo.package}`. + scrubDerivations = prefixPath: attrs: let + scrubDerivation = name: value: let + pkgAttrName = prefixPath + "." + name; + in + if isAttrs value + then + scrubDerivations pkgAttrName value + // optionalAttrs (isDerivation value) { + outPath = "\${${pkgAttrName}}"; + } + else value; + in + mapAttrs scrubDerivation attrs; - transformOptions = opt: - opt - // { - declarations = - map ( - decl: - if lib.hasPrefix (toString ../.) (toString decl) + # Make sure the used package is scrubbed to avoid actually + # instantiating derivations. + scrubbedPkgsModule = { + imports = [ + { + _module.args = { + pkgs = mkForce (scrubDerivations "pkgs" pkgs); + pkgs_i686 = mkForce {}; + }; + } + ]; + }; + + # Specify the path to the module entrypoint + nvimPath = toString ./..; + buildOptionsDocs = args @ { + modules, + includeModuleSystemOptions ? true, + warningsAreErrors ? true, + ... + }: let + inherit ((evalModules {inherit modules;})) options; + + # Declaration of the Github site URL. + # Takes a user, repo, and subpath, and returns a declaration site + # as a string. + githubDeclaration = user: repo: subpath: let + urlRef = "github.com"; + branch = "main"; + in { + url = "https://${urlRef}/${user}/${repo}/blob/${branch}/${subpath}"; + name = "<${repo}/${subpath}>"; + }; + in + pkgs.buildPackages.nixosOptionsDoc ({ + inherit warningsAreErrors; + + options = + if includeModuleSystemOptions + then options + else builtins.removeAttrs options ["_module"]; + + transformOptions = opt: + recursiveUpdate opt { + # Clean up declaration sites to not refer to the nvf + # source tree. + declarations = map (decl: + if hasPrefix nvimPath (toString decl) then - lib.pipe decl [ - toString - (lib.removePrefix (toString ../.)) - (lib.removePrefix "/") - (x: { - url = "https://github.com/NotAShelf/nvf/blob/main/${decl}"; - name = ""; - }) - ] + githubDeclaration "notashelf" "nvf" + (removePrefix "/" (removePrefix nvimPath (toString decl))) else if decl == "lib/modules.nix" - then { - url = "https://github.com/NixOS/nixpkgs/blob/master/${decl}"; - name = ""; - } - else decl - ) - opt.declarations; - }; - }; + then + # TODO: handle this in a better way (may require upstream + # changes to nixpkgs) + githubDeclaration "NixOS" "nixpkgs" decl + else decl) + opt.declarations; + }; + } + // builtins.removeAttrs args ["modules" "includeModuleSystemOptions"]); - # Generate the HTML manual pages - html = pkgs.callPackage ./manual.nix { - inherit release; - inherit (nvimModuleDocs) optionsJSON; - }; -in { - inherit (inputs) nmd; + nvimModuleDocs = buildOptionsDocs { + variablelistId = "nvf-options"; - # TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream - # `nixosOptionsDoc` is more customizable. - options.json = - pkgs.runCommand "options.json" { - meta.description = "List of nvf options in JSON format"; - } '' - mkdir -p $out/{share/doc,nix-support} - cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/nvf - substitute \ - ${nvimModuleDocs.optionsJSON}/nix-support/hydra-build-products \ - $out/nix-support/hydra-build-products \ - --replace \ - '${nvimModuleDocs.optionsJSON}/share/doc/nixos' \ - "$out/share/doc/nvf" - ''; + modules = + import ../modules/modules.nix { + inherit lib pkgs; + check = false; + } + ++ [scrubbedPkgsModule]; + }; # Generate the `man home-configuration.nix` package - manPages = + nvf-configuration-manual = pkgs.runCommand "nvf-reference-manpage" { - nativeBuildInputs = [ - pkgs.buildPackages.installShellFiles - pkgs.nixos-render-docs - ]; + nativeBuildInputs = [pkgs.buildPackages.installShellFiles pkgs.nixos-render-docs]; allowedReferences = ["out"]; } '' # Generate manpages. - mkdir -p $out/share/man/{man5,man1} + mkdir -p $out/share/man/man5 + mkdir -p $out/share/man/man1 nixos-render-docs -j $NIX_BUILD_CORES options manpage \ - --revision ${release} \ + --revision ${revision} \ --header ${./man/header.5} \ --footer ${./man/footer.5} \ ${nvimModuleDocs.optionsJSON}/share/doc/nixos/options.json \ @@ -135,8 +135,38 @@ in { cp ${./man/nvf.1} $out/share/man/man1/nvf.1 ''; - manual = { - inherit html; - htmlOpenTool = pkgs.callPackage ./html-open-tool.nix {inherit html;}; + # Generate the HTML manual pages + nvf-manual = pkgs.callPackage ./manual.nix { + inherit revision manpageUrls; + outputPath = "share/doc/nvf"; + options = { + nvf = nvimModuleDocs.optionsJSON; + }; }; + + html = nvf-manual; + htmlOpenTool = pkgs.callPackage ./html-open-tool.nix {} {inherit html;}; +in { + inherit (inputs) nmd; + + options = { + # TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream + # `nixosOptionsDoc` is more customizable. + json = + pkgs.runCommand "options.json" { + meta.description = "List of nvf options in JSON format"; + } '' + mkdir -p $out/{share/doc,nix-support} + cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/nvf + substitute \ + ${nvimModuleDocs.optionsJSON}/nix-support/hydra-build-products \ + $out/nix-support/hydra-build-products \ + --replace \ + '${nvimModuleDocs.optionsJSON}/share/doc/nixos' \ + "$out/share/doc/nvf" + ''; + }; + + manPages = nvf-configuration-manual; + manual = {inherit html htmlOpenTool;}; } diff --git a/docs/html-open-tool.nix b/docs/html-open-tool.nix index d430d24b..756feba1 100644 --- a/docs/html-open-tool.nix +++ b/docs/html-open-tool.nix @@ -2,9 +2,13 @@ writeShellScriptBin, makeDesktopItem, symlinkJoin, +}: { html, + pathName ? "nvf", + projectName ? pathName, + name ? "${pathName}-help", }: let - helpScript = writeShellScriptBin "nvf-help" '' + helpScript = writeShellScriptBin name '' set -euo pipefail if [[ ! -v BROWSER || -z $BROWSER ]]; then @@ -20,23 +24,20 @@ echo "$0: unable to start a web browser; please set \$BROWSER" exit 1 else - exec "$BROWSER" "${html}/share/doc/nvf/index.xhtml" + exec "$BROWSER" "${html}/share/doc/${pathName}/index.xhtml" fi ''; desktopItem = makeDesktopItem { - name = "nvf-manual"; - desktopName = "nvf Manual"; - genericName = "View nvf documentation in a web browser"; + name = "${pathName}-manual"; + desktopName = "${projectName} Manual"; + genericName = "View ${projectName} documentation in a web browser"; icon = "nix-snowflake"; - exec = "${helpScript}/bin/nvf-help"; + exec = "${helpScript}/bin/${name}"; categories = ["System"]; }; in symlinkJoin { - name = "nvf-help"; - paths = [ - helpScript - desktopItem - ]; + inherit name; + paths = [helpScript desktopItem]; } diff --git a/docs/manual.nix b/docs/manual.nix index f5b23d04..14e8ae27 100644 --- a/docs/manual.nix +++ b/docs/manual.nix @@ -4,10 +4,11 @@ # build inputs nixos-render-docs, documentation-highlighter, - path, # nrd configuration - release, - optionsJSON, + manpageUrls, + revision, + options, + outputPath ? "share/doc/nvf", }: stdenvNoCC.mkDerivation { name = "nvf-manual"; @@ -19,11 +20,9 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [nixos-render-docs]; buildPhase = '' - dest="$out/share/doc/nvf" - mkdir -p "$(dirname "$dest")" - mkdir -p $dest/{highlightjs,media} + mkdir -p out/{highlightjs,media} - cp -vt $dest/highlightjs \ + cp -vt out/highlightjs \ ${documentation-highlighter}/highlight.pack.js \ ${documentation-highlighter}/LICENSE \ ${documentation-highlighter}/mono-blue.css \ @@ -32,32 +31,38 @@ stdenvNoCC.mkDerivation { substituteInPlace ./options.md \ --subst-var-by \ OPTIONS_JSON \ - ${optionsJSON}/share/doc/nixos/options.json + ${options.nvf}/share/doc/nixos/options.json substituteInPlace ./manual.md \ --subst-var-by \ NVF_VERSION \ - ${release} + ${revision} # copy stylesheet - cp ${./static/style.css} "$dest/style.css" + cp ${./static/style.css} out/style.css # copy release notes cp -vr ${./release-notes} release-notes # generate manual from nixos-render-docs manual html \ - --manpage-urls ${path + "/doc/manpage-urls.json"} \ - --revision ${lib.trivial.revisionWithDefault release} \ + --manpage-urls ${manpageUrls} \ + --revision ${lib.trivial.revisionWithDefault revision} \ --stylesheet style.css \ --script highlightjs/highlight.pack.js \ --script highlightjs/loader.js \ --toc-depth 2 \ --section-toc-depth 1 \ manual.md \ - "$dest/index.xhtml" + out/index.xhtml + ''; - mkdir -p $out/nix-support/ - echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products + installPhase = '' + dest="$out/${outputPath}" + mkdir -p "$(dirname "$dest")" + mv out "$dest" + + mkdir -p $out/nix-support/ + echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products ''; } diff --git a/docs/manual/configuring/custom-plugins.md b/docs/manual/configuring/custom-plugins.md index c58c4973..3bcd324d 100644 --- a/docs/manual/configuring/custom-plugins.md +++ b/docs/manual/configuring/custom-plugins.md @@ -1,7 +1,7 @@ # Custom Plugins {#ch-custom-plugins} **nvf**, by default, exposes a wide variety of plugins as module options -for your convenience and bundles necessary dependencies into **nvf**'s runtime. +for your convience and bundles necessary dependencies into **nvf**'s runtime. In case a plugin is not available in **nvf**, you may consider making a pull request to **nvf** to include it as a module or you may add it to your configuration locally. diff --git a/docs/manual/configuring/dag-entries.md b/docs/manual/configuring/dag-entries.md index d5afa9b6..5f4f4f6a 100644 --- a/docs/manual/configuring/dag-entries.md +++ b/docs/manual/configuring/dag-entries.md @@ -11,7 +11,7 @@ entries in nvf: inserted before the rest of the DAG 2. `globalsScript` - used to set globals defined in `vim.globals` 3. `basic` - used to set basic configuration options -4. `theme` (this is simply placed before `pluginConfigs`, meaning that surrounding entries don't depend on it) - used to set up the theme, which has to be done before other plugins +4. `theme` - used to set up the theme, which has to be done before other plugins 5. `pluginConfigs` - the result of the nested `vim.pluginRC` (internal option, see the [Custom Plugins](/index.xhtml#ch-custom-plugins) page for adding your own plugins) DAG, used to set up internal plugins diff --git a/docs/release-notes/rl-0.7.md b/docs/release-notes/rl-0.7.md index 8852066a..51e05c9e 100644 --- a/docs/release-notes/rl-0.7.md +++ b/docs/release-notes/rl-0.7.md @@ -48,18 +48,6 @@ vim.maps."m" = { }; ``` -### `vim.lsp.nvimCodeActionMenu` removed in favor of `vim.ui.fastaction` {#sec-nvim-code-action-menu-deprecation} - -The nvim-code-action-menu plugin has been archived and broken for a long time, -so it's being replaced with a young, but better alternative called -fastaction.nvim. Simply remove everything set under -`vim.lsp.nvimCodeActionMenu`, and set `vim.ui.fastaction.enable` to `true`. - -Note that we are looking to add more alternatives in the future like -dressing.nvim and actions-preview.nvim, in case fastaction doesn't work for -everyone. - - ## Changelog {#sec-release-0.7-changelog} [ItsSorae](https://github.com/ItsSorae): @@ -89,7 +77,6 @@ everyone. longer filtered and thus should be used instead. - Add dap-go for better dap configurations - Make noice.nvim customizable -- Standardize border style options and add custom borders [rust-tools.nvim]: https://github.com/simrat39/rust-tools.nvim [rustaceanvim]: https://github.com/mrcjkb/rustaceanvim @@ -108,8 +95,7 @@ everyone. - Fix "Emac" typo -- Add [new-file-template.nvim] to automatically fill new file contents using - templates. +- Add [new-file-template.nvim] to automatically fill new file contents using templates. [diniamo](https://github.com/diniamo): @@ -131,6 +117,7 @@ everyone. plugin's options can now be found under `indentBlankline.setupOpts`, the previous iteration of the module also included out of place/broken options, which have been removed for the time being. These are: + - `listChar` - this was already unused - `fillChar` - this had nothing to do with the plugin, please configure it yourself by adding `vim.opt.listchars:append({ space = '' })` to your @@ -139,9 +126,6 @@ everyone. yourself by adding `vim.opt.listchars:append({ eol = '' })` to your lua configuration -- Replace `vim.lsp.nvimCodeActionMenu` with `vim.ui.fastaction`, see the - breaking changes section above for more details - [Neovim documentation on `vim.cmd`]: https://neovim.io/doc/user/lua.html#vim.cmd() - Make Neovim's configuration file entirely Lua based. This comes with a few @@ -188,31 +172,7 @@ everyone. - Add `nvf-print-config` & `nvf-print-config-path` helper scripts to Neovim closure. Both of those scripts have been automatically added to your PATH upon using neovimConfig or `programs.nvf.enable`. - - `nvf-print-config` will display your `init.lua`, in full. - `nvf-print-config-path` will display the path to _a clone_ of your `init.lua`. This is not the path used by the Neovim wrapper, but an identical clone. - -- Add `vim.ui.breadcrumbs.lualine` to allow fine-tuning breadcrumbs behaviour on - Lualine. Only `vim.ui.breadcrumbs.lualine.winbar` is supported for the time - being. - - - [](#opt-vim.ui.breadcrumbs.lualine.winbar.enable) has been added to allow - controlling the default behaviour of the `nvim-navic` component on Lualine, - which used to occupy `winbar.lualine_c` as long as breadcrumbs are enabled. - - `vim.ui.breadcrumbs.alwaysRender` has been renamed to - [](#opt-vim.ui.breadcrumbs.lualine.winbar.alwaysRender) to be conform to the - new format. - -- Add [basedpyright](https://github.com/detachhead/basedpyright) as a Python LSP - server and make it default. - -- Add [python-lsp-server](https://github.com/python-lsp/python-lsp-server) as an - additional Python LSP server. - -[ppenguin](https://github.com/ppenguin): - -- Telescope: - - Fixed `project-nvim` command and keybinding - - Added default ikeybind/command for `Telescope resume` (`fr`) diff --git a/flake.lock b/flake.lock index 377c0847..3fcb3874 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -36,13 +52,28 @@ "type": "github" } }, + "flake-utils_2": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "mnw": { "locked": { - "lastModified": 1726188505, - "narHash": "sha256-3dkxJo6y/aKfwkAg6YnpdiQAoZKgHhWHz7ilGJHCoVU=", + "lastModified": 1724456641, + "narHash": "sha256-SMgnviF6ofBPbyV3+rljPGcX0Hn9HBOhgXE10Cyjaic=", "owner": "Gerg-L", "repo": "mnw", - "rev": "ea00b3d2162d85dd085a6ba6d49aa2a186e588e7", + "rev": "c261925dbbf02f523af0e8add844df64fddf0359", "type": "github" }, "original": { @@ -98,11 +129,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1726871744, - "narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=", + "lastModified": 1722141560, + "narHash": "sha256-Ul3rIdesWaiW56PS/Ak3UlJdkwBrD4UcagCmXZR9Z7Y=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a1d92660c6b3b7c26fb883500a80ea9d33321be2", + "rev": "038fb464fcfa79b4f08131b07f2d8c9a6bcc4160", "type": "github" }, "original": { @@ -140,6 +171,22 @@ "type": "github" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1702350026, + "narHash": "sha256-A+GNZFZdfl4JdDphYKBJ5Ef1HOiFsP18vQe9mqjmUis=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9463103069725474698139ab10f17a9d125da859", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nmd": { "flake": false, "locked": { @@ -524,22 +571,6 @@ "type": "github" } }, - "plugin-fastaction-nvim": { - "flake": false, - "locked": { - "lastModified": 1721396662, - "narHash": "sha256-L7na78FsE+QHlEwxMpiwQcoOPhtmrknvdTZfzUoDANI=", - "owner": "Chaitanyabsprip", - "repo": "fastaction.nvim", - "rev": "2384dea7ba81d2709d0bee0e4bc7a8831ff13a9d", - "type": "github" - }, - "original": { - "owner": "Chaitanyabsprip", - "repo": "fastaction.nvim", - "type": "github" - } - }, "plugin-fidget-nvim": { "flake": false, "locked": { @@ -1021,6 +1052,22 @@ "type": "github" } }, + "plugin-nvim-code-action-menu": { + "flake": false, + "locked": { + "lastModified": 1702287297, + "narHash": "sha256-pY+aP9iBuJhvDZzVEsOHZmnfaq3vUP7TfKEEQrj+Mo8=", + "owner": "weilbith", + "repo": "nvim-code-action-menu", + "rev": "8c7672a4b04d3cc4edd2c484d05b660a9cb34a1b", + "type": "github" + }, + "original": { + "owner": "weilbith", + "repo": "nvim-code-action-menu", + "type": "github" + } + }, "plugin-nvim-colorizer-lua": { "flake": false, "locked": { @@ -1136,11 +1183,11 @@ "plugin-nvim-lspconfig": { "flake": false, "locked": { - "lastModified": 1727085470, - "narHash": "sha256-IPpUZEMIL7+4mmqQLy9JeT0cW15/SH3Hx8kyksVcqC0=", + "lastModified": 1716498901, + "narHash": "sha256-PMMqPDnq4Q8gWeKQ2WPE+pOf1R1G61wJ+bAWkHpQlzE=", "owner": "neovim", "repo": "nvim-lspconfig", - "rev": "dd329912c8d446240584a2dbcd3802af3a19105a", + "rev": "b972e7154bc94ab4ecdbb38c8edbccac36f83996", "type": "github" }, "original": { @@ -1808,7 +1855,6 @@ "plugin-dracula": "plugin-dracula", "plugin-dressing-nvim": "plugin-dressing-nvim", "plugin-elixir-tools": "plugin-elixir-tools", - "plugin-fastaction-nvim": "plugin-fastaction-nvim", "plugin-fidget-nvim": "plugin-fidget-nvim", "plugin-flutter-tools": "plugin-flutter-tools", "plugin-gesture-nvim": "plugin-gesture-nvim", @@ -1839,6 +1885,7 @@ "plugin-nvim-autopairs": "plugin-nvim-autopairs", "plugin-nvim-bufferline-lua": "plugin-nvim-bufferline-lua", "plugin-nvim-cmp": "plugin-nvim-cmp", + "plugin-nvim-code-action-menu": "plugin-nvim-code-action-menu", "plugin-nvim-colorizer-lua": "plugin-nvim-colorizer-lua", "plugin-nvim-cursorline": "plugin-nvim-cursorline", "plugin-nvim-dap": "plugin-nvim-dap", @@ -1886,7 +1933,8 @@ "plugin-vim-vsnip": "plugin-vim-vsnip", "plugin-which-key": "plugin-which-key", "rnix-lsp": "rnix-lsp", - "systems": "systems_2" + "systems": "systems_2", + "zig": "zig" } }, "rust-overlay": { @@ -1958,6 +2006,26 @@ "repo": "flake-utils", "type": "github" } + }, + "zig": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1716725305, + "narHash": "sha256-LIz08gALt2wlutGXAEhNroEoIuPV5ePQB8LI4WzXcy8=", + "owner": "mitchellh", + "repo": "zig-overlay", + "rev": "93b02a697561ecd438cfa5779727b5a1c300cb4c", + "type": "github" + }, + "original": { + "owner": "mitchellh", + "repo": "zig-overlay", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index c4996fcf..c00e9b8b 100644 --- a/flake.nix +++ b/flake.nix @@ -90,7 +90,10 @@ flake = false; }; - # Language servers (use master instead of nixpkgs) + # TODO: get zig from the zig overlay instead of nixpkgs + zig.url = "github:mitchellh/zig-overlay"; + + # Langauge server (use master instead of nixpkgs) rnix-lsp.url = "github:nix-community/rnix-lsp"; nil = { url = "github:oxalica/nil"; @@ -130,8 +133,8 @@ flake = false; }; - plugin-fastaction-nvim = { - url = "github:Chaitanyabsprip/fastaction.nvim"; + plugin-nvim-code-action-menu = { + url = "github:weilbith/nvim-code-action-menu"; flake = false; }; @@ -156,7 +159,7 @@ flake = false; }; - # Language support + # language support plugin-sqls-nvim = { url = "github:nanotee/sqls.nvim"; flake = false; diff --git a/flake/modules/home-manager.nix b/flake/modules/home-manager.nix index 77b8448c..66a35521 100644 --- a/flake/modules/home-manager.nix +++ b/flake/modules/home-manager.nix @@ -67,6 +67,7 @@ in { formatOnSave = true; lightbulb.enable = true; lspsaga.enable = false; + nvimCodeActionMenu.enable = true; trouble.enable = true; lspSignature.enable = true; rust.enable = false; diff --git a/flake/modules/nixos.nix b/flake/modules/nixos.nix index 022b3d94..e1e81f13 100644 --- a/flake/modules/nixos.nix +++ b/flake/modules/nixos.nix @@ -67,6 +67,7 @@ in { formatOnSave = true; lightbulb.enable = true; lspsaga.enable = false; + nvimCodeActionMenu.enable = true; trouble.enable = true; lspSignature.enable = true; rust.enable = false; diff --git a/flake/packages.nix b/flake/packages.nix index 84514a26..f8ad3c25 100644 --- a/flake/packages.nix +++ b/flake/packages.nix @@ -8,7 +8,6 @@ docs = import ../docs {inherit pkgs inputs lib;}; in { packages = { - inherit (docs.manual) htmlOpenTool; # Documentation docs = docs.manual.html; docs-html = docs.manual.html; diff --git a/lib/configuration.nix b/lib/configuration.nix new file mode 100644 index 00000000..1f3c59ac --- /dev/null +++ b/lib/configuration.nix @@ -0,0 +1,18 @@ +{ + inputs, + lib, +}: let + modulesWithInputs = import ../modules inputs; +in + { + modules ? [], + pkgs, + check ? true, + extraSpecialArgs ? {}, + extraModules ? [], + ... + }: + modulesWithInputs { + inherit pkgs lib check extraSpecialArgs extraModules; + configuration.imports = modules; + } diff --git a/lib/default.nix b/lib/default.nix index a418cff8..2e4b7f85 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -11,5 +11,5 @@ languages = import ./languages.nix {inherit lib;}; lists = import ./lists.nix {inherit lib;}; lua = import ./lua.nix {inherit lib;}; - neovimConfiguration = import ../modules {inherit inputs lib;}; + neovimConfiguration = import ./configuration.nix {inherit inputs lib;}; } diff --git a/lib/types/default.nix b/lib/types/default.nix index 6751229c..928bbaed 100644 --- a/lib/types/default.nix +++ b/lib/types/default.nix @@ -9,7 +9,7 @@ typesCustom = import ./custom.nix {inherit lib;}; in { inherit (typesDag) dagOf; - inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType; + inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType; inherit (typesLanguage) diagnostics mkGrammarOption; inherit (typesCustom) anythingConcatLists char; } diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index 7d24163e..c0e89d66 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -51,13 +51,9 @@ }; }; }; - - borderPresets = ["none" "single" "double" "rounded" "solid" "shadow"]; in { inherit extraPluginType fromInputs pluginType; - borderType = either (enum borderPresets) (listOf (either str (listOf str))); - pluginsOpt = { description, example, diff --git a/modules/default.nix b/modules/default.nix index 6a950802..1ae3b034 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,13 +1,10 @@ -{ - inputs, - lib, -}: { +inputs: { + configuration, pkgs, + lib, + check ? true, extraSpecialArgs ? {}, - modules ? [], - # deprecated extraModules ? [], - configuration ? {}, }: let inherit (pkgs) vimPlugins; inherit (lib.strings) isString toString; @@ -16,25 +13,13 @@ # import modules.nix with `check`, `pkgs` and `lib` as arguments # check can be disabled while calling this file is called # to avoid checking in all modules - nvimModules = import ./modules.nix {inherit pkgs lib;}; + nvimModules = import ./modules.nix {inherit pkgs check lib;}; # evaluate the extended library with the modules # optionally with any additional modules passed by the user module = lib.evalModules { specialArgs = extraSpecialArgs // {modulesPath = toString ./.;}; - modules = concatLists [ - nvimModules - modules - (lib.optional (configuration != {}) (lib.warn '' - nvf: passing 'configuration' to lib.neovimConfiguration is deprecated. - '' - configuration)) - - (lib.optionals (extraModules != []) (lib.warn '' - nvf: passing 'extraModules' to lib.neovimConfiguration is deprecated, use 'modules' instead. - '' - extraModules)) - ]; + modules = concatLists [[configuration] nvimModules extraModules]; }; # alias to the internal configuration diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix index 388913a7..cb063800 100644 --- a/modules/extra/deprecations.nix +++ b/modules/extra/deprecations.nix @@ -7,12 +7,5 @@ in { Tidalcycles language support has been removed as of 2024-06-06 as it was long unmaintained. If you depended on this functionality, please open an issue. '') - - # 2024-07-20 - (mkRemovedOptionModule ["vim" "lsp" "nvimCodeActionMenu"] '' - nvimCodeActionMenu has been deprecated and removed upstream. As of 0.7, fastaction will be - available under `vim.ui.fastaction` as a replacement. Simply remove everything under - `vim.lsp.nvimCodeActionMenu`, and set `vim.ui.fastaction.enable` to `true`. - '') ]; } diff --git a/modules/modules.nix b/modules/modules.nix index 195652df..a00cea69 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -1,72 +1,77 @@ { + check ? true, pkgs, lib, }: let inherit (lib.modules) mkDefault; inherit (lib.lists) concatLists; - allModules = let - # The core neovim modules. - # Contains configuration for core neovim features - # such as spellchecking, mappings, and the init script (init.vim). - neovim = map (p: "${./neovim}/${p}") [ - "init" - "mappings" - ]; - # Individual plugin modules, separated by the type of plugin. - # While adding a new type, you must make sure your type is - # included in the list below. - plugins = map (p: "${./plugins}/${p}") [ - "assistant" - "autopairs" - "comments" - "completion" - "dashboard" - "debugger" - "filetree" - "git" - "languages" - "lsp" - "minimap" - "notes" - "projects" - "rich-presence" - "session" - "snippets" - # "spellcheck" # FIXME: see neovim/init/spellcheck.nix - "statusline" - "tabline" - "terminal" - "theme" - "treesitter" - "ui" - "utility" - "visuals" - ]; + # The core neovim modules. + # Contains configuration for core neovim features + # such as spellchecking, mappings, and the init script (init.vim). + neovim = map (p: ./neovim + "/${p}") [ + "init" + "mappings" + ]; - # The neovim wrapper, used to build a wrapped neovim package - # using the configuration passed in `neovim` and `plugins` modules. - wrapper = map (p: "${./wrapper}/${p}") [ - "build" - "rc" - "warnings" - ]; + # Individual plugin modules, separated by the type of plugin. + # While adding a new type, you must make sure your type is + # included in the list below. + plugins = map (p: ./plugins + "/${p}") [ + "assistant" + "autopairs" + "comments" + "completion" + "dashboard" + "debugger" + "filetree" + "git" + "languages" + "lsp" + "minimap" + "notes" + "projects" + "rich-presence" + "session" + "snippets" + # "spellcheck" # FIXME: see neovim/init/spellcheck.nix + "statusline" + "tabline" + "terminal" + "theme" + "treesitter" + "ui" + "utility" + "visuals" + ]; - # Extra modules, such as deprecation warnings - # or renames in one place. - extra = map (p: "${./extra}/${p}") [ - "deprecations.nix" - ]; - in - concatLists [neovim plugins wrapper extra]; -in - allModules - ++ [ - { - _module.args = { - baseModules = allModules; - pkgsPath = mkDefault pkgs.path; - pkgs = mkDefault pkgs; + # The neovim wrapper, used to build a wrapped neovim package + # using the configuration passed in `neovim` and `plugins` modules. + wrapper = map (p: ./wrapper + "/${p}") [ + "build" + "rc" + "warnings" + ]; + + # Extra modules, such as deprecation warnings + # or renames in one place. + extra = map (p: ./extra + "/${p}") [ + "deprecations.nix" + ]; + + allModules = concatLists [neovim plugins wrapper extra]; + + pkgsModule = {config, ...}: { + config = { + _module = { + inherit check; + args = { + baseModules = allModules; + pkgsPath = mkDefault pkgs.path; + pkgs = mkDefault pkgs; + }; }; - } - ] + }; + }; +in + allModules ++ [pkgsModule] diff --git a/modules/neovim/init/basic.nix b/modules/neovim/init/basic.nix index 2114dcb8..07bb70d1 100644 --- a/modules/neovim/init/basic.nix +++ b/modules/neovim/init/basic.nix @@ -3,13 +3,11 @@ lib, ... }: let - inherit (lib.options) mkOption mkEnableOption literalExpression literalMD; + inherit (lib.options) mkOption literalExpression; inherit (lib.strings) optionalString; - inherit (lib.types) enum bool str int either; - inherit (lib.generators) mkLuaInline; + inherit (lib.types) enum bool str int; inherit (lib.nvim.dag) entryAfter; inherit (lib.nvim.lua) toLuaObject; - inherit (lib.nvim.types) luaInline; cfg = config.vim; in { @@ -160,138 +158,112 @@ in { default = "sensitive"; description = "Set the case sensitivity of search"; }; - - undoFile = { - enable = mkEnableOption "undofile for persistent undo behaviour"; - path = mkOption { - type = either str luaInline; - default = mkLuaInline "vim.fn.stdpath('state') .. '/undo'"; - defaultText = literalMD '' - ```nix - mkLuaInline "vim.fn.stdpath('state') .. '/undo'" - ``` - ''; - example = literalMD '' - ```nix - mkLuaInline "os.getenv('XDG_DATA_HOME') .. '/nvf/undo'" - ``` - ''; - description = "Path to the directory in which undo history will be stored"; - }; - }; }; - config = { - vim.luaConfigRC.basic = entryAfter ["globalsScript"] '' - -- Settings that are set for everything - vim.o.encoding = "utf-8" - vim.o.hidden = true - vim.opt.shortmess:append("c") - vim.o.expandtab = true - vim.o.mouse = ${toLuaObject cfg.mouseSupport} - vim.o.tabstop = ${toLuaObject cfg.tabWidth} - vim.o.shiftwidth = ${toLuaObject cfg.tabWidth} - vim.o.softtabstop = ${toLuaObject cfg.tabWidth} - vim.o.cmdheight = ${toLuaObject cfg.cmdHeight} - vim.o.updatetime = ${toLuaObject cfg.updateTime} - vim.o.tm = ${toLuaObject cfg.mapTimeout} - vim.o.cursorlineopt = ${toLuaObject cfg.cursorlineOpt} - vim.o.scrolloff = ${toLuaObject cfg.scrollOffset} - vim.g.mapleader = ${toLuaObject cfg.leaderKey} - vim.g.maplocalleader = ${toLuaObject cfg.leaderKey} + config.vim.luaConfigRC.basic = entryAfter ["globalsScript"] '' + -- Settings that are set for everything + vim.o.encoding = "utf-8" + vim.o.hidden = true + vim.opt.shortmess:append("c") + vim.o.expandtab = true + vim.o.mouse = ${toLuaObject cfg.mouseSupport} + vim.o.tabstop = ${toLuaObject cfg.tabWidth} + vim.o.shiftwidth = ${toLuaObject cfg.tabWidth} + vim.o.softtabstop = ${toLuaObject cfg.tabWidth} + vim.o.cmdheight = ${toLuaObject cfg.cmdHeight} + vim.o.updatetime = ${toLuaObject cfg.updateTime} + vim.o.tm = ${toLuaObject cfg.mapTimeout} + vim.o.cursorlineopt = ${toLuaObject cfg.cursorlineOpt} + vim.o.scrolloff = ${toLuaObject cfg.scrollOffset} + vim.g.mapleader = ${toLuaObject cfg.leaderKey} + vim.g.maplocalleader = ${toLuaObject cfg.leaderKey} - ${optionalString cfg.undoFile.enable '' - vim.o.undofile = true - vim.o.undodir = ${toLuaObject cfg.undoFile.path} - ''} + ${optionalString cfg.splitBelow '' + vim.o.splitbelow = true + ''} - ${optionalString cfg.splitBelow '' - vim.o.splitbelow = true - ''} + ${optionalString cfg.splitRight '' + vim.o.splitright = true + ''} - ${optionalString cfg.splitRight '' - vim.o.splitright = true - ''} + ${optionalString cfg.showSignColumn '' + vim.o.signcolumn = "yes" + ''} - ${optionalString cfg.showSignColumn '' - vim.o.signcolumn = "yes" - ''} + ${optionalString cfg.autoIndent '' + vim.o.autoindent = true + ''} - ${optionalString cfg.autoIndent '' - vim.o.autoindent = true - ''} + ${optionalString cfg.preventJunkFiles '' + vim.o.swapfile = false + vim.o.backup = false + vim.o.writebackup = false + ''} - ${optionalString cfg.preventJunkFiles '' - vim.o.swapfile = false - vim.o.backup = false - vim.o.writebackup = false - ''} + ${optionalString (cfg.bell == "none") '' + vim.o.errorbells = false + vim.o.visualbell = false + ''} - ${optionalString (cfg.bell == "none") '' - vim.o.errorbells = false - vim.o.visualbell = false - ''} + ${optionalString (cfg.bell == "on") '' + vim.o.visualbell = false + ''} - ${optionalString (cfg.bell == "on") '' - vim.o.visualbell = false - ''} + ${optionalString (cfg.bell == "visual") '' + vim.o.errorbells = false + ''} - ${optionalString (cfg.bell == "visual") '' - vim.o.errorbells = false - ''} + ${optionalString (cfg.lineNumberMode == "relative") '' + vim.o.relativenumber = true + ''} - ${optionalString (cfg.lineNumberMode == "relative") '' - vim.o.relativenumber = true - ''} + ${optionalString (cfg.lineNumberMode == "number") '' + vim.o.number = true + ''} - ${optionalString (cfg.lineNumberMode == "number") '' - vim.o.number = true - ''} + ${optionalString (cfg.lineNumberMode == "relNumber") '' + vim.o.number = true + vim.o.relativenumber = true + ''} - ${optionalString (cfg.lineNumberMode == "relNumber") '' - vim.o.number = true - vim.o.relativenumber = true - ''} + ${optionalString cfg.useSystemClipboard '' + vim.opt.clipboard:append("unnamedplus") + ''} - ${optionalString cfg.useSystemClipboard '' - vim.opt.clipboard:append("unnamedplus") - ''} + ${optionalString cfg.syntaxHighlighting '' + vim.cmd("syntax on") + ''} - ${optionalString cfg.syntaxHighlighting '' - vim.cmd("syntax on") - ''} + ${optionalString (!cfg.wordWrap) '' + vim.o.wrap = false + ''} - ${optionalString (!cfg.wordWrap) '' - vim.o.wrap = false - ''} + ${optionalString cfg.hideSearchHighlight '' + vim.o.hlsearch = false + vim.o.incsearch = true + ''} - ${optionalString cfg.hideSearchHighlight '' - vim.o.hlsearch = false - vim.o.incsearch = true - ''} + ${optionalString cfg.colourTerm '' + vim.o.termguicolors = true + ''} - ${optionalString cfg.colourTerm '' - vim.o.termguicolors = true - ''} + ${optionalString (!cfg.enableEditorconfig) '' + vim.g.editorconfig = false + ''} - ${optionalString (!cfg.enableEditorconfig) '' - vim.g.editorconfig = false - ''} + ${optionalString (cfg.searchCase == "ignore") '' + vim.o.smartcase = false + vim.o.ignorecase = true + ''} - ${optionalString (cfg.searchCase == "ignore") '' - vim.o.smartcase = false - vim.o.ignorecase = true - ''} + ${optionalString (cfg.searchCase == "smart") '' + vim.o.smartcase = true + vim.o.ignorecase = true + ''} - ${optionalString (cfg.searchCase == "smart") '' - vim.o.smartcase = true - vim.o.ignorecase = true - ''} - - ${optionalString (cfg.searchCase == "sensitive") '' - vim.o.smartcase = false - vim.o.ignorecase = false - ''} - ''; - }; + ${optionalString (cfg.searchCase == "sensitive") '' + vim.o.smartcase = false + vim.o.ignorecase = false + ''} + ''; } diff --git a/modules/plugins/languages/clang.nix b/modules/plugins/languages/clang.nix index bb30cc95..0b3ffcf9 100644 --- a/modules/plugins/languages/clang.nix +++ b/modules/plugins/languages/clang.nix @@ -57,7 +57,7 @@ dapConfig = '' dap.adapters.lldb = { type = 'executable', - command = '${cfg.dap.package}/bin/lldb-dap', + command = '${cfg.dap.package}/bin/lldb-vscode', name = 'lldb' } dap.configurations.cpp = { diff --git a/modules/plugins/languages/python.nix b/modules/plugins/languages/python.nix index 61aedcee..a113a6c6 100644 --- a/modules/plugins/languages/python.nix +++ b/modules/plugins/languages/python.nix @@ -14,7 +14,7 @@ cfg = config.vim.languages.python; - defaultServer = "basedpyright"; + defaultServer = "pyright"; servers = { pyright = { package = pkgs.pyright; @@ -30,36 +30,6 @@ } ''; }; - - basedpyright = { - package = pkgs.basedpyright; - lspConfig = '' - lspconfig.basedpyright.setup{ - capabilities = capabilities; - on_attach = default_on_attach; - cmd = ${ - if isList cfg.lsp.package - then expToLua cfg.lsp.package - else ''{"${cfg.lsp.package}/bin/basedpyright-langserver", "--stdio"}'' - } - } - ''; - }; - - python-lsp-server = { - package = pkgs.python-lsp-server; - lspConfig = '' - lspconfig.pylsp.setup{ - capabilities = capabilities; - on_attach = default_on_attach; - cmd = ${ - if isList cfg.lsp.package - then expToLua cfg.lsp.package - else ''{"${cfg.lsp.package}/bin/pylsp"}'' - } - } - ''; - }; }; defaultFormat = "black"; @@ -91,12 +61,11 @@ black-and-isort = { package = pkgs.writeShellApplication { name = "black"; - runtimeInputs = [pkgs.black pkgs.isort]; text = '' black --quiet - "$@" | isort --profile black - ''; + runtimeInputs = [pkgs.black pkgs.isort]; }; - nullConfig = '' table.insert( ls_sources, diff --git a/modules/plugins/languages/rust.nix b/modules/plugins/languages/rust.nix index 0f595761..39a8c361 100644 --- a/modules/plugins/languages/rust.nix +++ b/modules/plugins/languages/rust.nix @@ -173,7 +173,7 @@ in { dap = { adapter = { type = "executable", - command = "${cfg.dap.package}/bin/lldb-dap", + command = "${cfg.dap.package}/bin/lldb-vscode", name = "rustacean_lldb", }, }, diff --git a/modules/plugins/languages/ts.nix b/modules/plugins/languages/ts.nix index e6e718ed..dd1bde69 100644 --- a/modules/plugins/languages/ts.nix +++ b/modules/plugins/languages/ts.nix @@ -17,12 +17,12 @@ cfg = config.vim.languages.ts; - defaultServer = "ts_ls"; + defaultServer = "tsserver"; servers = { - ts_ls = { + tsserver = { package = pkgs.typescript-language-server; lspConfig = '' - lspconfig.ts_ls.setup { + lspconfig.tsserver.setup { capabilities = capabilities; on_attach = attach_keymaps, cmd = ${ @@ -49,24 +49,6 @@ } ''; }; - - # Here for backwards compatibility. Still consider tsserver a valid - # configuration in the enum, but assert if it's set to *properly* - # redirect the user to the correct server. - tsserver = { - package = pkgs.typescript-language-server; - lspConfig = '' - lspconfig.ts_ls.setup { - capabilities = capabilities; - on_attach = attach_keymaps, - cmd = ${ - if isList cfg.lsp.package - then expToLua cfg.lsp.package - else ''{"${cfg.lsp.package}/bin/typescript-language-server", "--stdio"}'' - } - } - ''; - }; }; # TODO: specify packages @@ -83,7 +65,6 @@ ) ''; }; - prettierd = { package = pkgs.prettierd; nullConfig = '' @@ -113,7 +94,6 @@ }; }; in { - _file = ./ts.nix; options.vim.languages.ts = { enable = mkEnableOption "Typescript/Javascript language support"; @@ -210,32 +190,11 @@ in { }; }) - # Extensions (mkIf cfg.extensions."ts-error-translator".enable { vim.startPlugins = ["ts-error-translator"]; vim.pluginRC.ts-error-translator = entryAnywhere '' require("ts-error-translator").setup(${toLuaObject cfg.extensions.ts-error-translator.setupOpts}) ''; }) - - # Warn the user if they have set the default server name to tsserver to match upstream (us) - # The name "tsserver" has been deprecated in lspconfig, and now should be called ts_ls. This - # is a purely cosmetic change, but emits a warning if not accounted for. - { - assertions = [ - { - assertion = cfg.lsp.enable -> cfg.lsp.server != "tsserver"; - message = '' - As of a recent lspconfig update, he `tsserver` configuration has been renamed - to `ts_ls` to match upstream behaviour of `lspconfig`, and the name `tsserver` - is no longer considered valid by nvf. Please set `vim.languages.ts.lsp.server` - to `"ts_ls"` instead of to `${cfg.lsp.server}` - - Please see for more details - about this change. - ''; - } - ]; - } ]); } diff --git a/modules/plugins/lsp/default.nix b/modules/plugins/lsp/default.nix index a5d5163d..f8408aab 100644 --- a/modules/plugins/lsp/default.nix +++ b/modules/plugins/lsp/default.nix @@ -10,6 +10,7 @@ # lsp plugins ./lspsaga + ./nvim-code-action-menu ./trouble ./lsp-signature ./lightbulb diff --git a/modules/plugins/lsp/lspconfig/config.nix b/modules/plugins/lsp/lspconfig/config.nix index 1c1f0a0a..15d42fdc 100644 --- a/modules/plugins/lsp/lspconfig/config.nix +++ b/modules/plugins/lsp/lspconfig/config.nix @@ -7,7 +7,6 @@ inherit (lib.strings) optionalString; inherit (lib.attrsets) mapAttrs; inherit (lib.nvim.dag) entryAfter; - inherit (lib.nvim.lua) toLuaObject; cfg = config.vim.lsp; in { @@ -23,7 +22,7 @@ in { ${ optionalString config.vim.ui.borders.enable '' - require('lspconfig.ui.windows').default_options.border = ${toLuaObject config.vim.ui.borders.globalStyle} + require('lspconfig.ui.windows').default_options.border = '${config.vim.ui.borders.globalStyle}' '' } ''; diff --git a/modules/plugins/lsp/lspsaga/config.nix b/modules/plugins/lsp/lspsaga/config.nix index 66050877..71c9025f 100644 --- a/modules/plugins/lsp/lspsaga/config.nix +++ b/modules/plugins/lsp/lspsaga/config.nix @@ -36,7 +36,7 @@ in { (mkSetLuaBinding mappings.nextDiagnostic "require('lspsaga.diagnostic').navigate('next')") (mkSetLuaBinding mappings.previousDiagnostic "require('lspsaga.diagnostic').navigate('prev')") - (mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').code_action") + (mkIf (!cfg.nvimCodeActionMenu.enable) (mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').code_action")) (mkIf (!cfg.lspSignature.enable) (mkSetLuaBinding mappings.signatureHelp "require('lspsaga.signaturehelp').signature_help")) ]; }; diff --git a/modules/plugins/lsp/nvim-code-action-menu/config.nix b/modules/plugins/lsp/nvim-code-action-menu/config.nix new file mode 100644 index 00000000..9acc34d9 --- /dev/null +++ b/modules/plugins/lsp/nvim-code-action-menu/config.nix @@ -0,0 +1,37 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf; + inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.binds) mkSetBinding addDescriptionsToMappings pushDownDefault; + + cfg = config.vim.lsp; + + self = import ./nvim-code-action-menu.nix {inherit lib;}; + mappingDefinitions = self.options.vim.lsp.nvimCodeActionMenu.mappings; + mappings = addDescriptionsToMappings cfg.nvimCodeActionMenu.mappings mappingDefinitions; +in { + config = mkIf (cfg.enable && cfg.nvimCodeActionMenu.enable) { + vim = { + startPlugins = ["nvim-code-action-menu"]; + + maps.normal = mkSetBinding mappings.open ":CodeActionMenu"; + + binds.whichKey.register = pushDownDefault { + "c" = "+CodeAction"; + }; + + pluginRC.code-action-menu = entryAnywhere '' + -- border configuration + vim.g.code_action_menu_window_border = '${config.vim.ui.borders.plugins.code-action-menu.style}' + + -- show individual sections of the code action menu + ${lib.optionalString cfg.nvimCodeActionMenu.show.details "vim.g.code_action_menu_show_details = true"} + ${lib.optionalString cfg.nvimCodeActionMenu.show.diff "vim.g.code_action_menu_show_diff = true"} + ${lib.optionalString cfg.nvimCodeActionMenu.show.actionKind "vim.g.code_action_menu_show_action_kind = true"} + ''; + }; + }; +} diff --git a/modules/plugins/ui/fastaction/default.nix b/modules/plugins/lsp/nvim-code-action-menu/default.nix similarity index 55% rename from modules/plugins/ui/fastaction/default.nix rename to modules/plugins/lsp/nvim-code-action-menu/default.nix index ef5c2bc9..f94dd221 100644 --- a/modules/plugins/ui/fastaction/default.nix +++ b/modules/plugins/lsp/nvim-code-action-menu/default.nix @@ -1,6 +1,6 @@ { imports = [ - ./fastaction-nvim.nix + ./nvim-code-action-menu.nix ./config.nix ]; } diff --git a/modules/plugins/lsp/nvim-code-action-menu/nvim-code-action-menu.nix b/modules/plugins/lsp/nvim-code-action-menu/nvim-code-action-menu.nix new file mode 100644 index 00000000..c303f7c7 --- /dev/null +++ b/modules/plugins/lsp/nvim-code-action-menu/nvim-code-action-menu.nix @@ -0,0 +1,20 @@ +{lib, ...}: let + inherit (lib.options) mkEnableOption; + inherit (lib.nvim.binds) mkMappingOption; +in { + options.vim.lsp = { + nvimCodeActionMenu = { + enable = mkEnableOption "nvim code action menu"; + + show = { + details = mkEnableOption "Show details" // {default = true;}; + diff = mkEnableOption "Show diff" // {default = true;}; + actionKind = mkEnableOption "Show action kind" // {default = true;}; + }; + + mappings = { + open = mkMappingOption "Open code action menu [nvim-code-action-menu]" "ca"; + }; + }; + }; +} diff --git a/modules/plugins/statusline/lualine/config.nix b/modules/plugins/statusline/lualine/config.nix index ac587c03..d5191994 100644 --- a/modules/plugins/statusline/lualine/config.nix +++ b/modules/plugins/statusline/lualine/config.nix @@ -11,7 +11,7 @@ inherit (lib.generators) mkLuaInline; cfg = config.vim.statusline.lualine; - bCfg = config.vim.ui.breadcrumbs; + breadcrumbsCfg = config.vim.ui.breadcrumbs; in { config = mkMerge [ # TODO: move into nvim-tree file @@ -20,14 +20,13 @@ in { extensions = ["nvim-tree"]; }; }) - - (mkIf (bCfg.enable && bCfg.lualine.winbar.enable && bCfg.source == "nvim-navic") { + (mkIf (breadcrumbsCfg.enable && breadcrumbsCfg.source == "nvim-navic") { vim.statusline.lualine.setupOpts = { # TODO: rewrite in new syntax winbar.lualine_c = mkDefault [ [ "navic" - (mkLuaInline "draw_empty = ${boolToString bCfg.lualine.winbar.alwaysRender}") + (mkLuaInline "draw_empty = ${boolToString config.vim.ui.breadcrumbs.alwaysRender}") ] ]; }; @@ -35,6 +34,7 @@ in { (mkIf cfg.enable { vim = { startPlugins = ["lualine"]; + pluginRC.lualine = entryAnywhere '' local lualine = require('lualine') lualine.setup ${toLuaObject cfg.setupOpts} diff --git a/modules/plugins/theme/theme.nix b/modules/plugins/theme/theme.nix index 85f8430f..bcc476bc 100644 --- a/modules/plugins/theme/theme.nix +++ b/modules/plugins/theme/theme.nix @@ -7,7 +7,7 @@ inherit (lib.attrsets) attrNames; inherit (lib.types) bool lines enum; inherit (lib.modules) mkIf; - inherit (lib.nvim.dag) entryBefore; + inherit (lib.nvim.dag) entryAfter; cfg = config.vim.theme; supportedThemes = import ./supported-themes.nix { @@ -45,7 +45,7 @@ in { config = mkIf cfg.enable { vim = { startPlugins = [cfg.name]; - luaConfigRC.theme = entryBefore ["pluginConfigs"] '' + luaConfigRC.theme = entryAfter ["basic"] '' ${cfg.extraConfig} ${supportedThemes.${cfg.name}.setup {inherit (cfg) style transparent;}} ''; diff --git a/modules/plugins/ui/borders/borders.nix b/modules/plugins/ui/borders/borders.nix index cf19d38b..37589dca 100644 --- a/modules/plugins/ui/borders/borders.nix +++ b/modules/plugins/ui/borders/borders.nix @@ -4,34 +4,31 @@ ... }: let inherit (lib.options) mkOption mkEnableOption; - inherit (lib.nvim.types) borderType; + inherit (lib.lists) optionals; + inherit (lib.types) enum; cfg = config.vim.ui.borders; + + defaultStyles = ["none" "single" "double" "rounded"]; in { options.vim.ui.borders = { enable = mkEnableOption "visible borders for most windows"; globalStyle = mkOption { - type = borderType; + type = enum defaultStyles; default = "rounded"; description = '' The global border style to use. - - If a list is given, it should have a length of eight or any divisor of - eight. The array will specify the eight chars building up the border in - a clockwise fashion starting with the top-left corner. You can specify - a different highlight group for each character by passing a - [char, "YourHighlightGroup"] instead ''; - example = ["╔" "═" "╗" "║" "╝" "═" "╚" "║"]; }; + # TODO: make per-plugin borders configurable plugins = let mkPluginStyleOption = name: { enable = mkEnableOption "borders for the ${name} plugin" // {default = cfg.enable;}; style = mkOption { - type = borderType; + type = enum (defaultStyles ++ optionals (name != "which-key") ["shadow"]); default = cfg.globalStyle; description = "The border style to use for the ${name} plugin"; }; @@ -43,7 +40,7 @@ in { lspsaga = mkPluginStyleOption "lspsaga"; nvim-cmp = mkPluginStyleOption "nvim-cmp"; lsp-signature = mkPluginStyleOption "lsp-signature"; - fastaction = mkPluginStyleOption "fastaction"; + code-action-menu = mkPluginStyleOption "code-actions-menu"; }; }; } diff --git a/modules/plugins/ui/breadcrumbs/breadcrumbs.nix b/modules/plugins/ui/breadcrumbs/breadcrumbs.nix index 2faee6c8..18df8c05 100644 --- a/modules/plugins/ui/breadcrumbs/breadcrumbs.nix +++ b/modules/plugins/ui/breadcrumbs/breadcrumbs.nix @@ -4,9 +4,9 @@ ... }: let inherit (lib.options) mkOption mkEnableOption; - inherit (lib.types) nullOr listOf enum bool str int either; + inherit (lib.types) nullOr listOf enum bool str int; inherit (lib.modules) mkRenamedOptionModule; - inherit (lib.nvim.types) mkPluginSetupOption borderType; + inherit (lib.nvim.types) mkPluginSetupOption; mkSimpleIconOption = default: mkOption { inherit default; @@ -31,8 +31,6 @@ in { (renameSetupOpt ["sourceBuffer" "scrolloff"] ["source_buffer" "scrolloff"]) # TODO: every option under icon is renamed to first letter capitalized (renameSetupOpt ["icon"] ["icon"]) - - (mkRenamedOptionModule ["vim" "ui" "breadcrumbs" "alwaysRender"] ["vim" "ui" "breadcrumbs" "lualine" "winbar" "alwaysRender"]) ]; options.vim.ui.breadcrumbs = { @@ -45,43 +43,17 @@ in { ''; }; - # Options for configuring Lualine integration of nvim-navic - lualine.winbar = { - enable = mkOption { - type = bool; - default = true; # for retaining previous behaviour - example = false; - description = '' - Whether to automatically configure a winbar component for - Lualine on the Winbar section. - - ::: {.note} - This is **set to `true` by default**, which means nvim-navic - will occupy `winbar.lualine_c` for the breadcrumbs feature - unless this option is set to `false`. - ::: - ''; - }; - - alwaysRender = mkOption { - type = bool; - default = true; - example = false; - description = '' - Whether to always display the breadcrumbs component - on winbar. - - ::: {.note} - This will pass `draw_empty` to the `nvim_navic` winbar - component, which causes the component to be drawn even - if it's empty - ::: - ''; - }; + # maybe this should be an option to *disable* alwaysRender optionally but oh well + # too late + alwaysRender = mkOption { + type = bool; + default = true; + description = "Whether to always display the breadcrumbs component on winbar (always renders winbar)"; }; navbuddy = { enable = mkEnableOption "navbuddy LSP helper UI. Enabling this option automatically loads and enables nvim-navic"; + mappings = { close = mkOption { type = str; @@ -240,7 +212,8 @@ in { # position = {} border = mkOption { - type = borderType; + # TODO: let this type accept a custom string + type = enum ["single" "rounded" "double" "solid" "none"]; default = config.vim.ui.borders.globalStyle; description = "border style to use"; }; @@ -263,7 +236,8 @@ in { */ border = mkOption { - type = borderType; + # TODO: let this type accept a custom string + type = nullOr (enum ["single" "rounded" "double" "solid" "none"]); default = config.vim.ui.borders.globalStyle; description = "border style to use for the left section of Navbuddy UI"; }; @@ -280,7 +254,8 @@ in { */ border = mkOption { - type = borderType; + # TODO: let this type accept a custom string + type = nullOr (enum ["single" "rounded" "double" "solid" "none"]); default = config.vim.ui.borders.globalStyle; description = "border style to use for the middle section of Navbuddy UI"; }; @@ -290,7 +265,8 @@ in { # there is no size option for the right section, it fills the remaining space right = { border = mkOption { - type = borderType; + # TODO: let this type accept a custom string + type = nullOr (enum ["single" "rounded" "double" "solid" "none"]); default = config.vim.ui.borders.globalStyle; description = "border style to use for the right section of Navbuddy UI"; }; diff --git a/modules/plugins/ui/default.nix b/modules/plugins/ui/default.nix index 34076600..262cdbbf 100644 --- a/modules/plugins/ui/default.nix +++ b/modules/plugins/ui/default.nix @@ -8,6 +8,5 @@ ./illuminate ./breadcrumbs ./borders - ./fastaction ]; } diff --git a/modules/plugins/ui/fastaction/config.nix b/modules/plugins/ui/fastaction/config.nix deleted file mode 100644 index 79c3e252..00000000 --- a/modules/plugins/ui/fastaction/config.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (lib.modules) mkIf mkDefault; - inherit (lib.nvim.dag) entryAnywhere; - inherit (lib.nvim.lua) toLuaObject; - - cfg = config.vim.ui.fastaction; - borderCfg = config.vim.ui.borders.plugins.fastaction; -in { - config = mkIf cfg.enable { - vim = { - ui.fastaction.setupOpts = { - register_ui_select = mkDefault true; - popup.border = mkIf borderCfg.enable borderCfg.style; - }; - - startPlugins = ["fastaction-nvim"]; - pluginRC.fastaction = entryAnywhere "require('fastaction').setup(${toLuaObject cfg.setupOpts})"; - }; - }; -} diff --git a/modules/plugins/ui/fastaction/fastaction-nvim.nix b/modules/plugins/ui/fastaction/fastaction-nvim.nix deleted file mode 100644 index 52ac59a9..00000000 --- a/modules/plugins/ui/fastaction/fastaction-nvim.nix +++ /dev/null @@ -1,9 +0,0 @@ -{lib, ...}: let - inherit (lib.options) mkEnableOption; - inherit (lib.nvim.types) mkPluginSetupOption; -in { - options.vim.ui.fastaction = { - enable = mkEnableOption "overriding vim.ui.select with fastaction.nvim"; - setupOpts = mkPluginSetupOption "fastaction" {}; - }; -} diff --git a/modules/plugins/utility/binds/which-key/config.nix b/modules/plugins/utility/binds/which-key/config.nix index d7296880..03c85b4f 100644 --- a/modules/plugins/utility/binds/which-key/config.nix +++ b/modules/plugins/utility/binds/which-key/config.nix @@ -25,7 +25,7 @@ in { ${optionalString config.vim.ui.borders.plugins.which-key.enable '' window = { - border = ${toLuaObject config.vim.ui.borders.plugins.which-key.style}, + border = "${config.vim.ui.borders.plugins.which-key.style}", }, ''} }) diff --git a/modules/plugins/utility/telescope/config.nix b/modules/plugins/utility/telescope/config.nix index 68af9645..2ec7d3dc 100644 --- a/modules/plugins/utility/telescope/config.nix +++ b/modules/plugins/utility/telescope/config.nix @@ -17,78 +17,75 @@ mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; in { config = mkIf cfg.enable { - vim = { - startPlugins = [ - "telescope" - "plenary-nvim" - ]; + vim.startPlugins = [ + "telescope" + "plenary-nvim" + ]; - maps.normal = mkMerge [ - (mkSetBinding mappings.findFiles " Telescope find_files") - (mkSetBinding mappings.liveGrep " Telescope live_grep") - (mkSetBinding mappings.buffers " Telescope buffers") - (mkSetBinding mappings.helpTags " Telescope help_tags") - (mkSetBinding mappings.open " Telescope") - (mkSetBinding mappings.resume " Telescope resume") + vim.maps.normal = mkMerge [ + (mkSetBinding mappings.findFiles " Telescope find_files") + (mkSetBinding mappings.liveGrep " Telescope live_grep") + (mkSetBinding mappings.buffers " Telescope buffers") + (mkSetBinding mappings.helpTags " Telescope help_tags") + (mkSetBinding mappings.open " Telescope") - (mkSetBinding mappings.gitCommits " Telescope git_commits") - (mkSetBinding mappings.gitBufferCommits " Telescope git_bcommits") - (mkSetBinding mappings.gitBranches " Telescope git_branches") - (mkSetBinding mappings.gitStatus " Telescope git_status") - (mkSetBinding mappings.gitStash " Telescope git_stash") + (mkSetBinding mappings.gitCommits " Telescope git_commits") + (mkSetBinding mappings.gitBufferCommits " Telescope git_bcommits") + (mkSetBinding mappings.gitBranches " Telescope git_branches") + (mkSetBinding mappings.gitStatus " Telescope git_status") + (mkSetBinding mappings.gitStash " Telescope git_stash") - (mkIf config.vim.lsp.enable (mkMerge [ - (mkSetBinding mappings.lspDocumentSymbols " Telescope lsp_document_symbols") - (mkSetBinding mappings.lspWorkspaceSymbols " Telescope lsp_workspace_symbols") + (mkIf config.vim.lsp.enable (mkMerge [ + (mkSetBinding mappings.lspDocumentSymbols " Telescope lsp_document_symbols") + (mkSetBinding mappings.lspWorkspaceSymbols " Telescope lsp_workspace_symbols") - (mkSetBinding mappings.lspReferences " Telescope lsp_references") - (mkSetBinding mappings.lspImplementations " Telescope lsp_implementations") - (mkSetBinding mappings.lspDefinitions " Telescope lsp_definitions") - (mkSetBinding mappings.lspTypeDefinitions " Telescope lsp_type_definitions") - (mkSetBinding mappings.diagnostics " Telescope diagnostics") - ])) + (mkSetBinding mappings.lspReferences " Telescope lsp_references") + (mkSetBinding mappings.lspImplementations " Telescope lsp_implementations") + (mkSetBinding mappings.lspDefinitions " Telescope lsp_definitions") + (mkSetBinding mappings.lspTypeDefinitions " Telescope lsp_type_definitions") + (mkSetBinding mappings.diagnostics " Telescope diagnostics") + ])) - ( - mkIf config.vim.treesitter.enable - (mkSetBinding mappings.treesitter " Telescope treesitter") - ) + ( + mkIf config.vim.treesitter.enable + (mkSetBinding mappings.treesitter " Telescope treesitter") + ) - ( - mkIf config.vim.projects.project-nvim.enable - (mkSetBinding mappings.findProjects " Telescope projects") - ) - ]; + ( + mkIf config.vim.projects.project-nvim.enable + (mkSetBinding mappings.findProjects "") + ) + ]; - binds.whichKey.register = pushDownDefault { - "f" = "+Telescope"; - "fl" = "Telescope LSP"; - "fm" = "Cellular Automaton"; - "fv" = "Telescope Git"; - "fvc" = "Commits"; - }; - - pluginRC.telescope = entryAnywhere '' - local telescope = require('telescope') - telescope.setup(${toLuaObject cfg.setupOpts}) - - ${ - if config.vim.ui.noice.enable - then "telescope.load_extension('noice')" - else "" - } - - ${ - if config.vim.notify.nvim-notify.enable - then "telescope.load_extension('notify')" - else "" - } - - ${ - if config.vim.projects.project-nvim.enable - then "telescope.load_extension('projects')" - else "" - } - ''; + vim.binds.whichKey.register = pushDownDefault { + "f" = "+Telescope"; + "fl" = "Telescope LSP"; + "fm" = "Cellular Automaton"; + "fv" = "Telescope Git"; + "fvc" = "Commits"; }; + + vim.pluginRC.telescope = entryAnywhere '' + local telescope = require('telescope') + telescope.setup(${toLuaObject cfg.setupOpts}) + + ${ + if config.vim.ui.noice.enable + then "telescope.load_extension('noice')" + else "" + } + + ${ + if config.vim.notify.nvim-notify.enable + then "telescope.load_extension('notify')" + else "" + } + + ${ + if config.vim.projects.project-nvim.enable + then "telescope.load_extension('projects')" + else "" + } + ''; }; } diff --git a/modules/plugins/utility/telescope/telescope.nix b/modules/plugins/utility/telescope/telescope.nix index 031f00dd..bebe6c81 100644 --- a/modules/plugins/utility/telescope/telescope.nix +++ b/modules/plugins/utility/telescope/telescope.nix @@ -150,13 +150,13 @@ in { options.vim.telescope = { mappings = { - findProjects = mkMappingOption "Find projects [Telescope]" "fp"; + findProjects = mkMappingOption "Find files [Telescope]" "fp"; + findFiles = mkMappingOption "Find files [Telescope]" "ff"; liveGrep = mkMappingOption "Live grep [Telescope]" "fg"; buffers = mkMappingOption "Buffers [Telescope]" "fb"; helpTags = mkMappingOption "Help tags [Telescope]" "fh"; open = mkMappingOption "Open [Telescope]" "ft"; - resume = mkMappingOption "Resume (previous search) [Telescope]" "fr"; gitCommits = mkMappingOption "Git commits [Telescope]" "fvcw"; gitBufferCommits = mkMappingOption "Git buffer commits [Telescope]" "fvcb"; diff --git a/modules/plugins/visuals/config.nix b/modules/plugins/visuals/config.nix index 1457ff3a..1dfc6618 100644 --- a/modules/plugins/visuals/config.nix +++ b/modules/plugins/visuals/config.nix @@ -45,6 +45,8 @@ in { 'noice', 'NvimTree', 'alpha', + 'code-action-menu-menu', + 'code-action-menu-warning-message', 'notify', 'Navbuddy' }, diff --git a/modules/plugins/visuals/fidget/fidget.nix b/modules/plugins/visuals/fidget/fidget.nix index 79974bd1..c5f4eb66 100644 --- a/modules/plugins/visuals/fidget/fidget.nix +++ b/modules/plugins/visuals/fidget/fidget.nix @@ -7,7 +7,7 @@ inherit (lib.options) mkEnableOption mkOption literalExpression; inherit (lib.strings) toUpper; inherit (lib.types) int float bool str enum listOf attrsOf oneOf nullOr submodule; - inherit (lib.nvim.types) mkPluginSetupOption luaInline borderType; + inherit (lib.nvim.types) mkPluginSetupOption luaInline; inherit (lib.generators) mkLuaInline; in { imports = [ @@ -453,7 +453,7 @@ in { }; border = mkOption { description = "Border style of the notification window"; - type = borderType; + type = enum ["none" "single" "double" "rounded" "solid" "shadow"]; default = if config.vim.ui.borders.enable then config.vim.ui.borders.globalStyle diff --git a/modules/wrapper/rc/config.nix b/modules/wrapper/rc/config.nix index 7baaed28..b3fd2e48 100644 --- a/modules/wrapper/rc/config.nix +++ b/modules/wrapper/rc/config.nix @@ -78,8 +78,8 @@ in { vim = { luaConfigRC = { globalsScript = entryAnywhere (concatLines globalsScript); - # basic - pluginConfigs = entryAfter ["basic"] pluginConfigs; + # basic, theme + pluginConfigs = entryAfter ["theme"] pluginConfigs; extraPluginConfigs = entryAfter ["pluginConfigs"] extraPluginConfigs; mappings = entryAfter ["extraPluginConfigs"] keymaps; };