mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-22 08:53:28 +02:00
plugins/dap: ensure extensions load after the main plugin (#526)
* plugins/dap: ensure extensions load after the main plugin * plugins/dap: change extensionConfigLua to use mkOption Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com> * plugins/dap: remove redundant null check for extensionConfigLua Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com> --------- Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com>
This commit is contained in:
parent
9f8ce75653
commit
ad3598cada
5 changed files with 54 additions and 37 deletions
|
@ -55,29 +55,31 @@ in {
|
|||
mkIf cfg.enable {
|
||||
extraPlugins = [cfg.package];
|
||||
|
||||
plugins.dap.enable = true;
|
||||
plugins.dap = {
|
||||
enable = true;
|
||||
|
||||
extraConfigLua = with helpers;
|
||||
''
|
||||
require("dap-python").setup("${cfg.adapterPythonPath}", ${toLuaObject options})
|
||||
''
|
||||
+ (optionalString (cfg.testRunners != null) ''
|
||||
table.insert(require("dap-python").test_runners,
|
||||
${
|
||||
toLuaObject
|
||||
(
|
||||
builtins.mapAttrs (_: mkRaw) cfg.testRunners
|
||||
)
|
||||
})
|
||||
'')
|
||||
+ (optionalString (cfg.customConfigurations != null) ''
|
||||
table.insert(require("dap").configurations.python, ${toLuaObject cfg.customConfigurations})
|
||||
'')
|
||||
+ (optionalString (cfg.resolvePython != null) ''
|
||||
require("dap-python").resolve_python = ${toLuaObject (mkRaw cfg.resolvePython)}
|
||||
'')
|
||||
+ (optionalString (cfg.testRunner != null) ''
|
||||
require("dap-python").test_runner = ${toLuaObject cfg.testRunner};
|
||||
'');
|
||||
extensionConfigLua = with helpers;
|
||||
''
|
||||
require("dap-python").setup("${cfg.adapterPythonPath}", ${toLuaObject options})
|
||||
''
|
||||
+ (optionalString (cfg.testRunners != null) ''
|
||||
table.insert(require("dap-python").test_runners,
|
||||
${
|
||||
toLuaObject
|
||||
(
|
||||
builtins.mapAttrs (_: mkRaw) cfg.testRunners
|
||||
)
|
||||
})
|
||||
'')
|
||||
+ (optionalString (cfg.customConfigurations != null) ''
|
||||
table.insert(require("dap").configurations.python, ${toLuaObject cfg.customConfigurations})
|
||||
'')
|
||||
+ (optionalString (cfg.resolvePython != null) ''
|
||||
require("dap-python").resolve_python = ${toLuaObject (mkRaw cfg.resolvePython)}
|
||||
'')
|
||||
+ (optionalString (cfg.testRunner != null) ''
|
||||
require("dap-python").test_runner = ${toLuaObject cfg.testRunner};
|
||||
'');
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue