Skip to content

Commit

Permalink
use filter_dir to exlude target dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshurst committed Feb 11, 2024
1 parent 84224a1 commit 5f849ea
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lua/rustaceanvim/neotest/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,19 @@ NeotestAdapter.root = function(file_name)
return cargo.get_root_dir(file_name)
end

---@param name string Name of directory
---@param rel_path string Path to directory, relative to root
---@param root string Root directory of project
---@return boolean
---@diagnostic disable-next-line: unused-local
NeotestAdapter.filter_dir = function(name, rel_path, root)
return rel_path ~= 'target'
end

---@param file_path string
---@return boolean
NeotestAdapter.is_test_file = function(file_path)
if file_path:find('target/%a+/build') or not vim.endswith(file_path, '.rs') then
if not vim.endswith(file_path, '.rs') then
return false
end

Expand Down

0 comments on commit 5f849ea

Please sign in to comment.