mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +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
|
@ -47,10 +47,11 @@ in {
|
||||||
mkIf cfg.enable {
|
mkIf cfg.enable {
|
||||||
extraPlugins = [cfg.package];
|
extraPlugins = [cfg.package];
|
||||||
|
|
||||||
plugins.dap.enable = true;
|
plugins.dap = {
|
||||||
|
enable = true;
|
||||||
extraConfigLua = ''
|
extensionConfigLua = ''
|
||||||
require("dap-go").setup(${helpers.toLuaObject options})
|
require("dap-go").setup(${helpers.toLuaObject options})
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,9 +55,10 @@ in {
|
||||||
mkIf cfg.enable {
|
mkIf cfg.enable {
|
||||||
extraPlugins = [cfg.package];
|
extraPlugins = [cfg.package];
|
||||||
|
|
||||||
plugins.dap.enable = true;
|
plugins.dap = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
extraConfigLua = with helpers;
|
extensionConfigLua = with helpers;
|
||||||
''
|
''
|
||||||
require("dap-python").setup("${cfg.adapterPythonPath}", ${toLuaObject options})
|
require("dap-python").setup("${cfg.adapterPythonPath}", ${toLuaObject options})
|
||||||
''
|
''
|
||||||
|
@ -80,4 +81,5 @@ in {
|
||||||
require("dap-python").test_runner = ${toLuaObject cfg.testRunner};
|
require("dap-python").test_runner = ${toLuaObject cfg.testRunner};
|
||||||
'');
|
'');
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,10 +219,12 @@ in {
|
||||||
mkIf cfg.enable {
|
mkIf cfg.enable {
|
||||||
extraPlugins = [cfg.package];
|
extraPlugins = [cfg.package];
|
||||||
|
|
||||||
plugins.dap.enable = true;
|
plugins.dap = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
extraConfigLua = ''
|
extensionConfigLua = ''
|
||||||
require("dapui").setup(${helpers.toLuaObject options});
|
require("dapui").setup(${helpers.toLuaObject options});
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,10 +82,12 @@ in {
|
||||||
mkIf cfg.enable {
|
mkIf cfg.enable {
|
||||||
extraPlugins = [cfg.package];
|
extraPlugins = [cfg.package];
|
||||||
|
|
||||||
plugins.dap.enable = true;
|
plugins.dap = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
extraConfigLua = ''
|
extensionConfigLua = ''
|
||||||
require("nvim-dap-virtual-text").setup(${helpers.toLuaObject options});
|
require("nvim-dap-virtual-text").setup(${helpers.toLuaObject options});
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,15 @@ in
|
||||||
|
|
||||||
dapBreakpointRejected = mkSignOption "R" "Sign to indicate breakpoints rejected by the debug adapter.";
|
dapBreakpointRejected = mkSignOption "R" "Sign to indicate breakpoints rejected by the debug adapter.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extensionConfigLua = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
description = ''
|
||||||
|
Extension configuration for dap. Don't use this directly !
|
||||||
|
'';
|
||||||
|
default = "";
|
||||||
|
internal = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config = let
|
||||||
|
@ -86,6 +95,7 @@ in
|
||||||
for sign_name, sign in pairs(__dap_signs) do
|
for sign_name, sign in pairs(__dap_signs) do
|
||||||
vim.fn.sign_define(sign_name, sign)
|
vim.fn.sign_define(sign_name, sign)
|
||||||
end
|
end
|
||||||
'');
|
'')
|
||||||
|
+ cfg.extensionConfigLua;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue