mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-23 01:08:53 +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",
|
"andy-bell101/neotest-java",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local project_type = "maven"
|
-- local project_type = "maven"
|
||||||
local gradle_file = vim.fn.findfile("build.gradle", vim.fn.getcwd())
|
-- local gradle_file = vim.fn.findfile("build.gradle", vim.fn.getcwd())
|
||||||
if gradle_file then
|
-- if gradle_file then
|
||||||
project_type = "gradle"
|
-- project_type = "gradle"
|
||||||
end
|
-- end
|
||||||
|
|
||||||
require("neotest").setup({
|
require("neotest").setup({
|
||||||
adapters = {
|
adapters = {
|
||||||
require("neotest-java")({
|
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,
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue