Skip to content

Commit 79aba40

Browse files
committed
add error handling for missing client
1 parent 6b57329 commit 79aba40

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lua/neotest-vstest/init.lua

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -503,11 +503,6 @@ local function create_adapter(config)
503503
local utilities = require("neotest-vstest.utilities")
504504
local client_discovery = require("neotest-vstest.client")
505505

506-
local tree = args.tree
507-
if not tree then
508-
return
509-
end
510-
511506
local projects = {}
512507

513508
for _, position in tree:iter() do
@@ -517,6 +512,15 @@ local function create_adapter(config)
517512
if client then
518513
local tests = projects[client] or {}
519514
projects[client] = vim.list_extend(tests, { position.id })
515+
else
516+
vim.notify_once(
517+
string.format(
518+
"neotest-vstest: could not find adapter client for test '%s' in project '%s'",
519+
position.name,
520+
vim.inspect(position.project)
521+
),
522+
vim.log.levels.ERROR
523+
)
520524
end
521525
end
522526
end

0 commit comments

Comments
 (0)