mirror of
https://github.com/kristoferssolo/runner.nvim.git
synced 2026-02-04 14:12:02 +00:00
Lint
This commit is contained in:
@@ -2,45 +2,45 @@ local helpers = require('runner.handlers.helpers')
|
||||
local utils = require('runner.handlers.utils')
|
||||
|
||||
return function(buffer)
|
||||
utils.run_command(utils.script_path() .. "get-bins.sh", function(output)
|
||||
local bins = {}
|
||||
utils.run_command(utils.script_path() .. 'get-bins.sh', function(output)
|
||||
local bins = {}
|
||||
|
||||
for _, line in pairs(output) do
|
||||
for _, data in pairs(line) do
|
||||
if vim.trim(data) ~= "" then
|
||||
bins[#bins + 1] = data
|
||||
end
|
||||
end
|
||||
end
|
||||
for _, line in pairs(output) do
|
||||
for _, data in pairs(line) do
|
||||
if vim.trim(data) ~= '' then
|
||||
bins[#bins + 1] = data
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local run_handlers = {}
|
||||
local run_handlers = {}
|
||||
|
||||
for _, bin in pairs(bins) do
|
||||
run_handlers['Run "' .. bin .. '"'] = helpers.shell_handler("cargo run --bin " .. bin)
|
||||
end
|
||||
for _, bin in pairs(bins) do
|
||||
run_handlers['Run "' .. bin .. '"'] = helpers.shell_handler('cargo run --bin ' .. bin)
|
||||
end
|
||||
|
||||
utils.run_command(utils.script_path() .. "get-tests.sh", function(output)
|
||||
local bins = {}
|
||||
utils.run_command(utils.script_path() .. 'get-tests.sh', function(output)
|
||||
local bins = {}
|
||||
|
||||
for _, line in pairs(output) do
|
||||
for _, data in pairs(line) do
|
||||
if vim.trim(data) ~= "" then
|
||||
bins[#bins + 1] = data
|
||||
end
|
||||
end
|
||||
end
|
||||
for _, line in pairs(output) do
|
||||
for _, data in pairs(line) do
|
||||
if vim.trim(data) ~= '' then
|
||||
bins[#bins + 1] = data
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local handlers = {
|
||||
unpack(run_handlers),
|
||||
["Custom"] = helpers.shell_handler("cargo ", true),
|
||||
["Test all"] = helpers.shell_handler("cargo test"),
|
||||
}
|
||||
local handlers = {
|
||||
unpack(run_handlers),
|
||||
['Custom'] = helpers.shell_handler('cargo ', true),
|
||||
['Test all'] = helpers.shell_handler('cargo test'),
|
||||
}
|
||||
|
||||
for _, bin in pairs(bins) do
|
||||
handlers['Test "' .. bin .. '"'] = helpers.shell_handler("cargo test --test " .. bin)
|
||||
end
|
||||
for _, bin in pairs(bins) do
|
||||
handlers['Test "' .. bin .. '"'] = helpers.shell_handler('cargo test --test ' .. bin)
|
||||
end
|
||||
|
||||
helpers.choice(handlers)(buffer)
|
||||
end)
|
||||
end)
|
||||
helpers.choice(handlers)(buffer)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user