Commit ccd76f9
fix(dap): skip enrich_config for attach mode (#494)
Setup:enrich_config asserts that mainClass is present, but attach
configs don't have one and don't need one — the JVM is already running
and chose its own main class, classpath, and java executable. The
assert fires before any check on request type, making every attach
config in nvim-dap fail unless callers pre-populate dummy values for
the five fields the early-return checks.
Adding an early return for `request == 'attach'` skips the
launch-specific enrichment (build_workspace, classpath resolution,
java executable resolution) which are all meaningless for an already-
running JVM.
Reproduction: register a Java attach config in dap.configurations.java
with type='java', request='attach', hostName='127.0.0.1', port=5005,
then :DapContinue. Today it errors with:
To enrich the config, mainClass should already be present
.../java-dap/setup.lua:54
After this fix, the attach proceeds and dap-ui opens against the
running JVM as expected.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 602a5f7 commit ccd76f9
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
| |||
0 commit comments