Skip to content

Commit

Permalink
plugins/neotest: init
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Nov 22, 2023
1 parent 0883bab commit ad54f0f
Show file tree
Hide file tree
Showing 5 changed files with 468 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
./completion/nvim-cmp
./completion/nvim-cmp/sources

./dap

./filetrees/chadtree.nix
./filetrees/neo-tree.nix
./filetrees/nvim-tree.nix
Expand Down Expand Up @@ -76,9 +78,9 @@
./lsp/nvim-lightbulb.nix
./lsp/trouble.nix

./none-ls
./neotest

./dap
./none-ls

./pluginmanagers/packer.nix

Expand Down
5 changes: 5 additions & 0 deletions plugins/neotest/adapters/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
imports = [
./neotest-python.nix
];
}
35 changes: 35 additions & 0 deletions plugins/neotest/adapters/neotest-python.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.neotest.adapters.python;
in {
options.plugins.neotest.adapters.python = {
enable = mkEnableOption "neotest-python";

package = helpers.mkPackageOption "neotest-python" pkgs.vimPlugins.neotest-python;
};

config = mkIf cfg.enable {
extraPlugins = [cfg.package];
plugins.neotest.enabledAdapters = let
adapterOptions = with cfg; {
};

adapterOptionsString = helpers.toLuaObject adapterOptions;
in [
(
"require('neotest-python')"
+ (
optional
(adapterOptionsString != "")
"(${adapterOptionsString})"
)
)
];
};
}
Loading

0 comments on commit ad54f0f

Please sign in to comment.