Skip to content

Fix configuration path regex escaping - #14674

Merged
Sean McManus (sean-mcmanus) merged 1 commit into
mainfrom
seanmcm/devbox2-wsl/agent39/fix-configuration-path-escaping
Aug 13, 2026
Merged

Fix configuration path regex escaping#14674
Sean McManus (sean-mcmanus) merged 1 commit into
mainfrom
seanmcm/devbox2-wsl/agent39/fix-configuration-path-escaping

Conversation

@sean-mcmanus

Copy link
Copy Markdown
Contributor

Summary

  • Replace sequential configuration-path escaping with a single-pass helper while preserving literal matching against paths as written in JSON.
  • Add focused unit coverage for quotes, repeated backslashes, and regular-expression metacharacters.
  • Address the js/double-escaping and js/incomplete-sanitization CodeQL findings together.

Validation

  • TypeScript project build
  • Targeted ESLint validation
  • Extension unit tests (203 passing)

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

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.

Pull request overview

This PR refactors how configuration paths are escaped for use in regex-based matching within configuration squiggle handling, aiming to preserve literal matching against the path spelling in the JSON text while reducing the risk of incorrect/double escaping.

Changes:

  • Introduces a single-pass helper escapePathForSquiggles to escape configuration paths for literal regex matching.
  • Switches CppProperties squiggle path matching in configurations.ts to use the new helper.
  • Adds unit tests covering quotes, repeated backslashes, and regex metacharacters.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Extension/test/unit/escape.test.ts Adds focused unit coverage for path escaping behavior (quotes, backslashes, regex metacharacters).
Extension/src/Utility/Text/escape.ts Adds escapePathForSquiggles helper implementing the single-pass escaping logic.
Extension/src/LanguageServer/configurations.ts Replaces inline sequential escaping with the shared helper for squiggle path regex construction.

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

Comment thread Extension/src/LanguageServer/configurations.ts

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@sean-mcmanus
Sean McManus (sean-mcmanus) merged commit 98055e0 into main Aug 13, 2026
8 checks passed
@sean-mcmanus
Sean McManus (sean-mcmanus) deleted the seanmcm/devbox2-wsl/agent39/fix-configuration-path-escaping branch August 13, 2026 19:11
@github-project-automation github-project-automation Bot moved this from Pull Request to Done in cpptools Aug 13, 2026
Sean McManus (sean-mcmanus) added a commit that referenced this pull request Aug 13, 2026
…6fde5e50995b33fcddeca0d23e54fb

Fix configuration path regex escaping (#14674)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants