Expand workspace variables in include-what-you-use and mapping_file settings#33
Merged
Conversation
…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>
Fab-Cat
approved these changes
May 30, 2026
helly25
commented
May 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #32.
${workspaceFolder},${workspaceRoot}and${fileWorkspaceFolder}were only expanded for theiwyu.compile_commandssetting. Theiwyu.include-what-you-useandiwyu.iwyu.mapping_filesettings were passed to the shell verbatim, so these variables were never substituted.Changes
replaceWorkspaceVarsto theiwyu.iwyu.mapping_fileandiwyu.include-what-you-usesettings insrc/extension.ts.replaceWorkspaceVarsexpand all occurrences rather than just the first (usingsplit/jointo stay ES2020-compatible).package.json,README.md, andCHANGELOG.md.Testing
npm run compilepasses. There are no existing unit tests coveringreplaceWorkspaceVars, so this was verified via the type checker only.🤖 Generated with Claude Code