diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 2800789f..bd88ab7c 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -290,10 +290,8 @@ - `eslint_d` now checks for configuration files to load. - Fix an error where `eslint_d` fails to load. -- Add required files support for linters under - `vim.diagnostics.nvim-lint.linters.*.required_files`. -- Add global function `nvf_lint` under - `vim.diagnostics.nvim-lint.lint_function`. +- Add required files support for linters under `vim.diagnostics.nvim-lint.linters.*.required_files`. +- Add global function `nvf_lint` under `vim.diagnostics.nvim-lint.lint_function`. [Sc3l3t0n](https://github.com/Sc3l3t0n): @@ -336,9 +334,3 @@ [Noah765](https://github.com/Noah765): - Add missing `flutter-tools.nvim` dependency `plenary.nvim`. -- Add necessary dependency of `flutter-tools.nvim` on lsp. -- Add the `vim.languages.dart.flutter-tools.flutterPackage` option. - -[howird](https://github.com/howird): - -- Change python dap adapter name from `python` to commonly expected `debugpy`. diff --git a/modules/plugins/languages/dart.nix b/modules/plugins/languages/dart.nix index 7b9584b9..77d92d3b 100644 --- a/modules/plugins/languages/dart.nix +++ b/modules/plugins/languages/dart.nix @@ -13,7 +13,7 @@ inherit (lib.strings) optionalString; inherit (lib.nvim.lua) expToLua; inherit (lib.nvim.types) mkGrammarOption; - inherit (lib.nvim.dag) entryAfter; + inherit (lib.nvim.dag) entryAnywhere; cfg = config.vim.languages.dart; ftcfg = cfg.flutter-tools; @@ -81,25 +81,16 @@ in { description = "Enable flutter-tools for flutter support"; }; - flutterPackage = mkOption { - type = nullOr package; - default = pkgs.flutter; - description = "Flutter package, or null to detect the flutter path at runtime instead."; - }; - enableNoResolvePatch = mkOption { type = bool; - default = false; + default = true; description = '' Whether to patch flutter-tools so that it doesn't resolve symlinks when detecting flutter path. - ::: {.note} - This is required if `flutterPackage` is set to null and the flutter - package in your `PATH` was built with Nix. If you are using a flutter - SDK installed from a different source and encounter the error "`dart` - missing from `PATH`", leave this option disabled. - ::: + This is required if you want to use a flutter package built with nix. + If you are using a flutter SDK installed from a different source + and encounter the error "`dart` missing from PATH", disable this option. ''; }; @@ -131,21 +122,19 @@ in { }; }; - config.vim = mkIf cfg.enable (mkMerge [ + config = mkIf cfg.enable (mkMerge [ (mkIf cfg.treesitter.enable { - treesitter.enable = true; - treesitter.grammars = [cfg.treesitter.package]; + vim.treesitter.enable = true; + vim.treesitter.grammars = [cfg.treesitter.package]; }) (mkIf cfg.lsp.enable { - lsp.lspconfig.enable = true; - lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig; + vim.lsp.lspconfig.enable = true; + vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig; }) (mkIf ftcfg.enable { - lsp.enable = true; - - startPlugins = [ + vim.startPlugins = [ ( if ftcfg.enableNoResolvePatch then "flutter-tools-patched" @@ -154,9 +143,8 @@ in { "plenary-nvim" ]; - pluginRC.flutter-tools = entryAfter ["lsp-setup"] '' + vim.pluginRC.flutter-tools = entryAnywhere '' require('flutter-tools').setup { - ${optionalString (ftcfg.flutterPackage != null) "flutter_path = \"${ftcfg.flutterPackage}/bin/flutter\","} lsp = { color = { -- show the derived colours for dart variables enabled = ${boolToString ftcfg.color.enable}, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10 @@ -168,6 +156,7 @@ in { capabilities = capabilities, on_attach = default_on_attach; + flags = lsp_flags, }, ${optionalString cfg.dap.enable '' debugger = { diff --git a/modules/plugins/languages/go.nix b/modules/plugins/languages/go.nix index 3f232669..9f8bca3c 100644 --- a/modules/plugins/languages/go.nix +++ b/modules/plugins/languages/go.nix @@ -5,7 +5,7 @@ ... }: let inherit (builtins) attrNames; - inherit (lib.options) mkEnableOption mkOption literalMD; + inherit (lib.options) mkEnableOption mkOption; inherit (lib.modules) mkIf mkMerge; inherit (lib.meta) getExe; inherit (lib.lists) isList; @@ -84,14 +84,7 @@ in { }; format = { - enable = - mkEnableOption "Go formatting" - // { - default = !cfg.lsp.enable && config.vim.languages.enableFormat; - defaultText = literalMD '' - disabled if Go LSP is enabled, otherwise follows {option}`vim.languages.enableFormat` - ''; - }; + enable = mkEnableOption "Go formatting" // {default = config.vim.languages.enableFormat;}; type = mkOption { description = "Go formatter to use"; diff --git a/modules/plugins/languages/python.nix b/modules/plugins/languages/python.nix index d6dec1c2..476b56ef 100644 --- a/modules/plugins/languages/python.nix +++ b/modules/plugins/languages/python.nix @@ -99,7 +99,7 @@ # idk if this is the best way to install/run debugpy package = pkgs.python3.withPackages (ps: with ps; [debugpy]); dapConfig = '' - dap.adapters.debugpy = function(cb, config) + dap.adapters.python = function(cb, config) if config.request == 'attach' then ---@diagnostic disable-next-line: undefined-field local port = (config.connect or config).port @@ -125,10 +125,10 @@ end end - dap.configurations.debugpy = { + dap.configurations.python = { { -- The first three options are required by nvim-dap - type = 'debugpy'; -- the type here established the link to the adapter definition: `dap.adapters.debugpy` + type = 'python'; -- the type here established the link to the adapter definition: `dap.adapters.python` request = 'launch'; name = "Launch file";