1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-28 13:11:04 +01:00

plugins/dap-python: require dap to be explicitly enabled

Instead of automatically enabling `plugins.dap`, require users to
explicitly enable it. This prevents silent re-enabling of dap when
a user has explicitly disabled it.
This commit is contained in:
Austin Horstman 2025-11-25 23:16:37 -06:00 committed by Gaétan Lepage
parent 8117ab9770
commit 5f74bfcc11
2 changed files with 26 additions and 19 deletions

View file

@ -1,4 +1,5 @@
{
config,
lib,
pkgs,
...
@ -76,10 +77,14 @@ lib.nixvim.plugins.mkNeovimPlugin {
# Manually supplied to nvim-dap config module
callSetup = false;
extraConfig = cfg: {
plugins.dap = {
enable = true;
assertions = lib.nixvim.mkAssertions "plugins.dap-python" {
assertion = config.plugins.dap.enable;
message = ''
You have to enable `plugins.dap` to use `plugins.dap-python`.
'';
};
extensionConfigLua = ''
plugins.dap.extensionConfigLua = ''
require("dap-python").setup("${cfg.adapterPythonPath}", ${toLuaObject cfg.settings})
''
+ (optionalString (cfg.testRunners != null) ''
@ -96,7 +101,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
require("dap-python").test_runner = ${toLuaObject cfg.testRunner};
'');
};
};
# NOTE: Renames added in https://github.com/nix-community/nixvim/pull/2897 (2025-01-26)
imports = [ ./deprecations.nix ];

View file

@ -1,9 +1,11 @@
{
empty = {
plugins.dap.enable = true;
plugins.dap-python.enable = true;
};
example = {
plugins.dap.enable = true;
plugins.dap-python = {
enable = true;
@ -34,6 +36,7 @@
};
default = {
plugins.dap.enable = true;
plugins.dap-python = {
enable = true;