Repository navigation
Escape temp file cpp markers in a consistent way on windows - #5148
Merged
Merged
Conversation
For cpp modules open in an editor we rewrite the cpp file markers with the actual file path before parsing. The previous implementation used forward slashes to delimit path segments, which differs from how the non-open cpp module outputs paths. This causes an inconsistency in the SrcSpan where some spans contain forward slash delimited paths and others with backslash delimited paths. Running the path through the existing escape function produces the correct output.
simonhorlick
force-pushed
the
fix-cpp-path-escaping
branch
from
October 21, 2026 14:28
5d6b087 to
ca9a3d6
Compare
fendor
enabled auto-merge (squash)
October 21, 2026 16:47
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.
For cpp modules open in an editor we rewrite the cpp file markers with the actual file path before parsing. The previous implementation used forward slashes to delimit path segments, which differs from how the non-open cpp module outputs paths. This causes an inconsistency in the SrcSpan where some spans contain forward slash delimited paths and others with backslash delimited paths.
Running the path through the existing escape function produces the correct output.
Note that this PR is essentially the same thing as #5010 but doesn't attempt to escape unicode characters. Also see the discussion in #4889.
This is also needed for #5147 which hits the same issue because of span equality failing only on windows.
Tested on a windows 10 machine.