mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 00:25:47 +02:00
enc: simplify neotest adaptor for java
This commit is contained in:
parent
d186be6aec
commit
e0a4367eb0
1 changed files with 6 additions and 19 deletions
|
@ -30,28 +30,15 @@ M = {
|
|||
"andy-bell101/neotest-java",
|
||||
},
|
||||
config = function()
|
||||
local project_type = "maven"
|
||||
local gradle_file = vim.fn.findfile("build.gradle", vim.fn.getcwd())
|
||||
if gradle_file then
|
||||
project_type = "gradle"
|
||||
end
|
||||
-- local project_type = "maven"
|
||||
-- local gradle_file = vim.fn.findfile("build.gradle", vim.fn.getcwd())
|
||||
-- if gradle_file then
|
||||
-- project_type = "gradle"
|
||||
-- end
|
||||
|
||||
require("neotest").setup({
|
||||
adapters = {
|
||||
require("neotest-java")({
|
||||
-- function to determine which runner to use based on project path
|
||||
determine_runner = function(project_root_path)
|
||||
-- return should be "maven" or "gradle"
|
||||
return project_type
|
||||
end,
|
||||
-- override the builtin runner discovery behaviour to always use given
|
||||
-- tool. Default is "nil", so no override
|
||||
force_runner = nil,
|
||||
-- if the automatic runner discovery can't uniquely determine whether
|
||||
-- to use Gradle or Maven, fallback to using this runner. Default is
|
||||
-- "gradle or maven"
|
||||
fallback_runner = project_type,
|
||||
}),
|
||||
require("neotest-java"),
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue