mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 01:38:40 +02:00
plugins/rustaceanvim: update options
This commit is contained in:
parent
d844ac1a06
commit
53697141b5
1 changed files with 110 additions and 76 deletions
|
@ -27,16 +27,48 @@ in
|
||||||
example = null;
|
example = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
tools = {
|
tools =
|
||||||
executor = helpers.defaultNullOpts.mkNullable (
|
let
|
||||||
with helpers.nixvimTypes;
|
executors = [
|
||||||
either strLuaFn (enum [
|
|
||||||
"termopen"
|
"termopen"
|
||||||
"quickfix"
|
"quickfix"
|
||||||
"toggleterm"
|
"toggleterm"
|
||||||
"vimux"
|
"vimux"
|
||||||
])
|
"neotest"
|
||||||
) "termopen" "How to execute terminal commands.";
|
];
|
||||||
|
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 ''
|
onInitialized = helpers.mkNullOrLuaFn ''
|
||||||
`fun(health:RustAnalyzerInitializedStatus)`
|
`fun(health:RustAnalyzerInitializedStatus)`
|
||||||
|
@ -238,6 +270,8 @@ in
|
||||||
{
|
{
|
||||||
tools = with tools; {
|
tools = with tools; {
|
||||||
inherit executor;
|
inherit executor;
|
||||||
|
test_executor = testExecutor;
|
||||||
|
crate_test_executor = crateTestExecutor;
|
||||||
on_initialized = onInitialized;
|
on_initialized = onInitialized;
|
||||||
reload_workspace_from_cargo_toml = reloadWorkspaceFromCargoToml;
|
reload_workspace_from_cargo_toml = reloadWorkspaceFromCargoToml;
|
||||||
hover_actions = {
|
hover_actions = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue