refactor: rename types

This commit is contained in:
Rónán Carrigan
2022-03-13 15:16:23 +00:00
parent ca177b4c8a
commit ff70ffac75

View File

@@ -12,7 +12,7 @@ local python_script = (Path.new(script_path()):parent():parent() / "neotest.py")
local dap_args local dap_args
local function get_strategy_config(strategy, python, python_script, args) local function get_strategy_config(strategy, python, program, args)
local config = { local config = {
dap = function() dap = function()
return vim.tbl_extend("keep", { return vim.tbl_extend("keep", {
@@ -20,7 +20,7 @@ local function get_strategy_config(strategy, python, python_script, args)
name = "Neotest Debugger", name = "Neotest Debugger",
request = "launch", request = "launch",
python = python, python = python,
program = python_script, program = program,
cwd = async.fn.getcwd(), cwd = async.fn.getcwd(),
args = args, args = args,
}, dap_args or {}) }, dap_args or {})
@@ -57,7 +57,7 @@ local get_runner = function(python_command)
return runner return runner
end end
---@type NeotestAdapter ---@type neotest.Adapter
local PythonNeotestAdapter = { name = "neotest-python" } local PythonNeotestAdapter = { name = "neotest-python" }
PythonNeotestAdapter.root = lib.files.match_root_pattern( PythonNeotestAdapter.root = lib.files.match_root_pattern(
@@ -94,8 +94,8 @@ function PythonNeotestAdapter.discover_positions(path)
end end
---@async ---@async
---@param args NeotestRunArgs ---@param args neotest.RunArgs
---@return NeotestRunSpec ---@return neotest.RunSpec
function PythonNeotestAdapter.build_spec(args) function PythonNeotestAdapter.build_spec(args)
local position = args.tree:data() local position = args.tree:data()
local results_path = async.fn.tempname() local results_path = async.fn.tempname()
@@ -134,9 +134,9 @@ function PythonNeotestAdapter.build_spec(args)
end end
---@async ---@async
---@param spec NeotestRunSpec ---@param spec neotest.RunSpec
---@param result NeotestStrategyResult ---@param result neotest.StrategyResult
---@return NeotestResult[] ---@return neotest.Result[]
function PythonNeotestAdapter.results(spec, result) function PythonNeotestAdapter.results(spec, result)
local success, data = pcall(lib.files.read, spec.context.results_path) local success, data = pcall(lib.files.read, spec.context.results_path)
if not success then if not success then