Skip to content

Expand workspace variables in include-what-you-use and mapping_file settings#33

Merged
helly25 merged 1 commit into
mainfrom
fix/issue-32-workspace-vars
May 30, 2026
Merged

Expand workspace variables in include-what-you-use and mapping_file settings#33
helly25 merged 1 commit into
mainfrom
fix/issue-32-workspace-vars

Conversation

@helly25
Copy link
Copy Markdown
Owner

@helly25 helly25 commented May 30, 2026

Summary

Fixes #32.

${workspaceFolder}, ${workspaceRoot} and ${fileWorkspaceFolder} were only expanded for the iwyu.compile_commands setting. The iwyu.include-what-you-use and iwyu.iwyu.mapping_file settings were passed to the shell verbatim, so these variables were never substituted.

Changes

  • Apply replaceWorkspaceVars to the iwyu.iwyu.mapping_file and iwyu.include-what-you-use settings in src/extension.ts.
  • Make replaceWorkspaceVars expand all occurrences rather than just the first (using split/join to stay ES2020-compatible).
  • Document the supported variables for both settings in package.json, README.md, and CHANGELOG.md.

Testing

  • npm run compile passes. There are no existing unit tests covering replaceWorkspaceVars, so this was verified via the type checker only.

🤖 Generated with Claude Code

…ettings

`${workspaceFolder}`, `${workspaceRoot}` and `${fileWorkspaceFolder}` were
only expanded for the `iwyu.compile_commands` setting. Apply the same
expansion to `iwyu.include-what-you-use` and `iwyu.iwyu.mapping_file`.

Also make `replaceWorkspaceVars` expand all occurrences rather than just
the first.

Fixes #32

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@helly25 helly25 requested a review from Fab-Cat May 30, 2026 17:34
@helly25 helly25 merged commit 5bec078 into main May 30, 2026
2 checks passed
@helly25 helly25 deleted the fix/issue-32-workspace-vars branch May 30, 2026 17:36
Copy link
Copy Markdown
Owner Author

@helly25 helly25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll attempt to release a new version.

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.

${workspaceFolder} not supported

2 participants