Skip to content
Merged
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
10 changes: 8 additions & 2 deletions lua/java-dap/setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,17 @@ end
function Setup:enrich_config(config)
config = vim.deepcopy(config)

-- skip enriching if already enriched
if config.mainClass and config.projectName and config.modulePaths and config.classPaths and config.javaExec then
return config
end

local main = config.mainClass
local project = config.projectName
-- when we set it to empty string, it will create a project with some random
-- string as name
local project = config.projectName or ''

assert(main, 'To enrich the config, mainClass should already be present')
assert(project, 'To enrich the config, projectName should already be present')

if config.request == 'launch' then
self.java_debug:build_workspace(main, project, nil, false)
Expand Down