From 7cc1685eafdcf04cf1058949647ea2c7560f2d65 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 11 Jun 2024 23:54:00 +0200 Subject: [PATCH] plugins/neotest: add assertion to ensure that neotest is enabled if an adapter is --- plugins/neotest/adapters.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/neotest/adapters.nix b/plugins/neotest/adapters.nix index ffeb0546..3bfadbdb 100644 --- a/plugins/neotest/adapters.nix +++ b/plugins/neotest/adapters.nix @@ -32,6 +32,13 @@ let mkIf cfg.enable { extraPlugins = [ cfg.package ]; + assertions = [ + { + assertion = config.plugins.neotest.enable; + message = "Nixvim: you have enabled `plugins.neotest.adapters.${name}` but `plugins.neotest.enable` is `false`."; + } + ]; + warnings = optional (!config.plugins.treesitter.enable) '' Nixvim (plugins.neotest.adapters.${name}): This adapter requires `treesitter` to be enabled. You might want to set `plugins.treesitter.enable = true` and ensure that the `${props.treesitter-parser}` parser is enabled.