Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lua/neotest/client/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ function neotest.Client:get_adapter(file_path)
return self:_get_adapter(file_path, nil)
end

local path_cache = {}

---@async
---@param path string
---@private
Expand Down Expand Up @@ -276,7 +278,21 @@ function neotest.Client:_update_positions(path, args)
return
end
end
if path_cache[path] == nil then
path_cache[path] = true
vim.defer_fn(function()
path_cache[path] = nil
end, 2000)
else
logger.debug(
"Skipping search in",
path,
"for test files, because it has recently been searched"
)
return
end
logger.info("Searching", path, "for test files")

local root_path = existing_root and existing_root:data().path or path
local files = lib.func_util.filter_list(
adapter.is_test_file,
Expand Down