Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/java-core/dap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function M.dap_run(config)
---@type uv_tcp_t
local server

require('dap').run(config, {
require('dap').run(config --[[@as Configuration]], {
before = function(conf)
log.debug('running before dap callback')

Expand Down
21 changes: 20 additions & 1 deletion lua/java-core/ls/adapters/test-adapter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,26 @@ local JavaTestClient = require('java-core.ls.clients.java-test-client')

local M = {}

---@class JavaTestLauncherConfig
---@class JavaTestLauncherConfigOverridable: JavaDapConfiguration
---@field name? string
---@field type? string
---@field request? string
---@field mainClass? string
---@field projectName? string
---@field cwd? string
---@field classPaths? string[]
---@field modulePaths? string[]
---@field vmArgs? string
---@field noDebug? boolean
---@field javaExec? string
---@field args? string
---@field env? { [string]: string; }
---@field envFile? string
---@field sourcePaths? string[]
---@field preLaunchTask? string
---@field postDebugTask? string

---@class JavaTestLauncherConfig: JavaDapConfiguration
---@field name string
---@field type string
---@field request string
Expand Down
6 changes: 5 additions & 1 deletion lua/java-core/ls/helpers/test-helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ end

---Run the given test
---@param tests JavaTestFindJavaProjectsResponse
---@param config? JavaTestLauncherConfigOverridable config to override the default values in test launcher config
---@return Promise
function M:run_test(tests)
function M:run_test(tests, config)
---@type JavaTestJunitLaunchArguments
local launch_args

Expand Down Expand Up @@ -129,6 +130,9 @@ function M:run_test(tests)

log.debug('dap launcher config is: ', dap_launcher_config)

dap_launcher_config =
vim.tbl_deep_extend('force', dap_launcher_config, config or {})

return JavaDap.dap_run(dap_launcher_config)
end
)
Expand Down