Skip to content

feat: resolve VS Code variable placeholders in launch configurations#399

Merged
simonrw merged 3 commits into
mainfrom
feat/launch-config-variable-resolution
Apr 7, 2026
Merged

feat: resolve VS Code variable placeholders in launch configurations#399
simonrw merged 3 commits into
mainfrom
feat/launch-config-variable-resolution

Conversation

@simonrw
Copy link
Copy Markdown
Owner

@simonrw simonrw commented Apr 7, 2026

Summary

  • Parse workspace folders array from .code-workspace files and resolve ${workspaceFolder:name} to the correct absolute paths (previously just appended the name as a subpath)
  • Resolve ${workspaceFolder}, ${workspaceFolder:name}, and ${env:VARNAME} across all config fields (pathMappings, cwd, program, env, envFile, args) — previously only pathMappings.localRoot was handled
  • Resolution happens automatically in load_from_path/load_all_from_path so callers receive fully resolved absolute paths
  • Extract a Resolve trait implemented by Debugpy, LLDB, and the new Delve (Go) config type
  • Add Delve launch configuration struct for VS Code Go debug adapter ("type": "go") with substitutePath support

Test plan

  • Existing tests updated to assert resolved absolute paths instead of raw ${workspaceFolder:...} strings
  • New tests for workspace folder sub-path resolution, ${env:VARNAME}, cwd/env/envFile resolution, unsupported variables left as-is
  • cargo check --all-targets --all-features passes
  • cargo xtask test && cargo xtask doctest — all 400 tests pass

🤖 Generated with Claude Code

simonrw and others added 3 commits April 7, 2026 17:29
Parse workspace folders array from .code-workspace files and use it to
correctly resolve ${workspaceFolder:name} variables. Resolve
${workspaceFolder}, ${workspaceFolder:name}, and ${env:VARNAME} across
all config fields (pathMappings, cwd, program, env, envFile, args).
Resolution happens automatically in load_from_path/load_all_from_path
so callers receive fully resolved absolute paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…olution

Replace inherent resolve() methods on Debugpy, LLDB, and
LaunchConfiguration with implementations of a shared Resolve trait.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a Delve struct for VS Code Go debug adapter configs ("type": "go")
with fields for program, args, env, envFile, cwd, host, port,
buildFlags, mode, and substitutePath. Implements the Resolve trait to
resolve VS Code variable placeholders across all string fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@simonrw simonrw enabled auto-merge (squash) April 7, 2026 16:34
@simonrw simonrw merged commit 0766d77 into main Apr 7, 2026
14 checks passed
@simonrw simonrw deleted the feat/launch-config-variable-resolution branch April 7, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant