plugins/easy-dotnet: init

This commit is contained in:
Gaetan Lepage 2025-01-29 11:39:27 +01:00
parent 13341a4c12
commit 78b6f8e1e5
2 changed files with 240 additions and 0 deletions

View file

@ -0,0 +1,54 @@
{ lib, config, ... }:
lib.nixvim.plugins.mkNeovimPlugin {
name = "easy-dotnet";
packPathName = "easy-dotnet.nvim";
package = "easy-dotnet-nvim";
maintainers = [ lib.maintainers.GaetanLepage ];
settingsExample = lib.literalExpression ''
{
test_runner = {
enable_buffer_test_execution = true;
viewmode = "float";
};
auto_bootstrap_namespace = true;
terminal.__raw = '''
function(path, action, args)
local commands = {
run = function()
return string.format("dotnet run --project %s %s", path, args)
end,
test = function()
return string.format("dotnet test %s %s", path, args)
end,
restore = function()
return string.format("dotnet restore %s %s", path, args)
end,
build = function()
return string.format("dotnet build %s %s", path, args)
end,
}
local command = commands[action]() .. "\r"
require("toggleterm").exec(command, nil, nil, nil, "float")
end
''';
picker = "fzf";
}
'';
extraConfig = cfg: {
warnings = lib.nixvim.mkWarnings "plugins.easy-dotnet" (
lib.mapAttrsToList
(pickerName: pluginName: {
when = (cfg.settings.picker or null == pickerName) && (!config.plugins.${pluginName}.enable);
message = "You have chosen to use '${pickerName}' as a picker but 'plugins.${pluginName}' is not enabled.";
})
{
fzf = "fzf-lua";
telescope = "telescope";
}
);
};
}