mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 16:39:06 +02:00
fix(java): fix config_overrides
for tests (#3968)
## Description Problem In the default configuration `opts.test` is a boolean and the code tries to access `opts.test.config_overrides` which results in an error. Solution Use control flow to return nil in the case of `opts.test` being boolean. <!-- Describe the big picture of your changes to communicate to the maintainers why we should accept this pull request. --> ## Related Issue(s) - Fixes #3965. ## Checklist - [ x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.
This commit is contained in:
parent
8a34051177
commit
b481b644dd
1 changed files with 6 additions and 2 deletions
|
@ -227,13 +227,17 @@ return {
|
||||||
["<leader>t"] = { name = "+test" },
|
["<leader>t"] = { name = "+test" },
|
||||||
["<leader>tt"] = {
|
["<leader>tt"] = {
|
||||||
function()
|
function()
|
||||||
require("jdtls.dap").test_class({ config_overrides = opts.test.config_overrides })
|
require("jdtls.dap").test_class({
|
||||||
|
config_overrides = type(opts.test) ~= "boolean" and opts.test.config_overrides or nil,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
"Run All Test",
|
"Run All Test",
|
||||||
},
|
},
|
||||||
["<leader>tr"] = {
|
["<leader>tr"] = {
|
||||||
function()
|
function()
|
||||||
require("jdtls.dap").test_nearest_method({ config_overrides = opts.test.config_overrides })
|
require("jdtls.dap").test_nearest_method({
|
||||||
|
config_overrides = type(opts.test) ~= "boolean" and opts.test.config_overrides or nil,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
"Run Nearest Test",
|
"Run Nearest Test",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue