From 8b2eacb6ac2a8df3c9eaba69fbce34abc3666ec1 Mon Sep 17 00:00:00 2001 From: kezhenxu94 Date: Mon, 8 Jul 2024 02:50:13 +0800 Subject: [PATCH] feat(java): allow overriding test config (#3891) ## What is this PR for? Allow overriding java test config ## Does this PR fix an existing issue? NO ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/java.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index 7a47c905..7d667338 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -225,8 +225,18 @@ return { -- custom keymaps for Java test runner (not yet compatible with neotest) wk.register({ ["t"] = { name = "+test" }, - ["tt"] = { require("jdtls.dap").test_class, "Run All Test" }, - ["tr"] = { require("jdtls.dap").test_nearest_method, "Run Nearest Test" }, + ["tt"] = { + function() + require("jdtls.dap").test_class({ config_overrides = opts.test.config_overrides }) + end, + "Run All Test", + }, + ["tr"] = { + function() + require("jdtls.dap").test_nearest_method({ config_overrides = opts.test.config_overrides }) + end, + "Run Nearest Test", + }, ["tT"] = { require("jdtls.dap").pick_test, "Run Test" }, }, { mode = "n", buffer = args.buf }) end