plugins/rustaceanvim: update options

This commit is contained in:
Wester de Cocq 2024-05-15 23:49:15 +02:00 committed by traxys
parent d844ac1a06
commit 53697141b5

View file

@ -27,16 +27,48 @@ in
example = null;
};
tools = {
executor = helpers.defaultNullOpts.mkNullable (
with helpers.nixvimTypes;
either strLuaFn (enum [
tools =
let
executors = [
"termopen"
"quickfix"
"toggleterm"
"vimux"
])
) "termopen" "How to execute terminal commands.";
"neotest"
];
testExecutors = executors ++ [ "background" ];
in
{
executor = helpers.defaultNullOpts.mkEnum executors "termopen" ''
`{execute_command} (fun(cmd:string,args:string[],cwd:string|nil,opts?:RustaceanExecutorOpts))`
The executor to use for runnables/debuggables.
Example:
```lua
{
execute_command = function(command, args, cwd, _)
require('toggleterm.terminal').Terminal
:new({
dir = cwd,
cmd = require('rustaceanvim.shell').make_command_from_args(command, args),
close_on_exit = false,
direction = 'vertical',
})
:toggle()
end
}
```
'';
testExecutor = helpers.defaultNullOpts.mkEnum testExecutors "termopen" ''
`{execute_command} (fun(cmd:string,args:string[],cwd:string|nil,opts?:RustaceanExecutorOpts))`
The executor to use for runnables that are tests/testables
'';
crateTestExecutor = helpers.defaultNullOpts.mkEnum testExecutors "termopen" ''
`{execute_command} (fun(cmd:string,args:string[],cwd:string|nil,opts?:RustaceanExecutorOpts))`
The executor to use for runnables that are crate test suites (--all-targets)
'';
onInitialized = helpers.mkNullOrLuaFn ''
`fun(health:RustAnalyzerInitializedStatus)`
@ -238,6 +270,8 @@ in
{
tools = with tools; {
inherit executor;
test_executor = testExecutor;
crate_test_executor = crateTestExecutor;
on_initialized = onInitialized;
reload_workspace_from_cargo_toml = reloadWorkspaceFromCargoToml;
hover_actions = {