Repository navigation
fix(plugin): preserve declarations around C++ raw strings - #1279
Merged
Merged
Conversation
mldangelo-oai
approved these changes
Oct 5, 2026
mldangelo-oai
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for finding this. I reproduced the missing declarations, and reusing the existing raw-string handling keeps the fix small.
I added one boundary correction: a macro such as ERROR followed immediately by a string was being mistaken for a raw-string opener, hiding the next function. The regression tests now cover that, including Unicode identifiers, and I removed a redundant assertion.
The 212 focused tests and all portable source checks pass. This is a useful correction to the previews and looks good to merge once CI is green.
Merged
3 tasks done
3 tasks done
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
C++ raw strings can contain quotes and braces that currently confuse source previews, hiding real declarations or showing functions written inside strings. Recognize these literals so previews retain the surrounding code.
Changes
ERRORimmediately before a quoted string is not mistaken for a raw literal. Cover ASCII and Unicode macro names.Testing
python -m pytest -q plugins/codex-security/tests/test_rank_preview.py plugins/codex-security/tests/test_generate_rank_input.py: 212 passed.pnpm --dir sdk/typescript run build:cipassed.git diff --checkpassed. Source-checker tests usedNODE_NO_WARNINGS=1to suppress the local Node proxy warning.Risk and rollout
Limited to source-preview masking for C++ and Objective-C++ file suffixes, including shared headers. Uses the existing masking state and preserves line positions. No public CLI changes.
Public disclosure review