Skip to content

Commit

Permalink
fix(client): discover dirs under root
Browse files Browse the repository at this point in the history
  • Loading branch information
rcarriga committed Jul 15, 2022
1 parent c6f80b9 commit ee97820
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions lua/neotest/client/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,21 @@ function NeotestClient:_get_adapter(position_id, adapter_id, refresh)
end
end
end
for _, adapter in ipairs(self._adapters) do
if
self._state:positions(adapter.name, position_id)
or (not lib.files.is_dir(position_id) and adapter.is_test_file(position_id))
then
return adapter.name, adapter
if not lib.files.is_dir(position_id) then
for _, adapter in ipairs(self._adapters) do
if
self._state:positions(adapter.name, position_id)
or (not lib.files.is_dir(position_id) and adapter.is_test_file(position_id))
then
return adapter.name, adapter
end
end
else
for _, adapter in ipairs(self._adapters) do
local root = self._state:positions(adapter.name)
if vim.startswith(position_id, root:data().path) then
return adapter.name, adapter
end
end
end

Expand Down

0 comments on commit ee97820

Please sign in to comment.