Skip to content

Add configurable clang-tidy Include Cleaner provider mappings - #14788

Open
Sean McManus (sean-mcmanus) wants to merge 3 commits into
mainfrom
seanmcm/devbox2-wsl/agent164/clang-tidy-include-mappings
Open

Sean McManus (sean-mcmanus) wants to merge 3 commits into
mainfrom
seanmcm/devbox2-wsl/agent164/clang-tidy-include-mappings

Conversation

@sean-mcmanus

@sean-mcmanus Sean McManus (sean-mcmanus) commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Add the opt-in, resource-scoped C_Cpp.codeAnalysis.clangTidy.includeCleanerMappings setting for mapping exact Include Cleaner diagnostic symbol names to public include spellings.

This PR was investigated and created by GitHub Copilot (in VS Code). Any message starting with ✨Copilot: was sent by Copilot.

The setting defaults to an empty object and is forwarded with workspace-folder configuration. Its schema and runtime validation reject empty or control-containing symbol names and malformed header spellings while preserving valid entries, Unicode, and literal operator names. Mapping keys and values are excluded from settings telemetry.

Example:

"C_Cpp.codeAnalysis.clangTidy.includeCleanerMappings": {
    "example::widget": "<widget.h>"
}

Validation

Unit tests cover resource scope, schema/runtime agreement, invalid input, exact names, Unicode and prototype-sensitive keys, and telemetry redaction. TypeScript compilation, lint, and all 223 unit tests pass.

Note

Theoretically this could also be implemented on the LLVM/clang-tidy side later on...not sure why they haven't done this yet and/or if they are likely to accept such a change and/or how much work would be involved.

@github-project-automation github-project-automation Bot moved this to Pull Request in cpptools Sep 18, 2026
@sean-mcmanus
Sean McManus (sean-mcmanus) marked this pull request as ready for review September 21, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The setting is consistently defined, validated, forwarded, redacted, and thoroughly tested.

Review effort: Balanced
Findings: None

What changed in this PR

Adds an opt-in, resource-scoped mapping from Include Cleaner symbols to public headers.

Changes:

  • Adds schema, localization, validation, and workspace forwarding.
  • Redacts mapping contents from telemetry.
  • Adds comprehensive unit coverage.
File Description
Extension/​package.json Defines the setting schema.
Extension/​package.nls.json Documents the setting.
Extension/​src/​LanguageServer/​settings.ts Validates mappings.
Extension/​src/​LanguageServer/​client.ts Forwards mappings to the language server.
Extension/​src/​LanguageServer/​settingsTracker.ts Redacts telemetry values.
Extension/​test/​unit/​settings.test.ts Tests schema, validation, scope, and redaction.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sean-mcmanus

Copy link
Copy Markdown
Contributor Author

The cpptools side needs approval still...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pull Request

Development

Successfully merging this pull request may close these issues.

3 participants