-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Canonicalize SourceRoot paths in MapSourceRoots #82123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
- Added path canonicalization logic in MapSourceRoots.Execute() - Canonicalizes both ItemSpec and ContainingRoot metadata - Only canonicalizes rooted paths with relative components (.. or /.) - Preserves trailing directory separators - Added comprehensive tests for canonicalization behavior Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
- Extract duplication into CanonicalizePathPreservingTrailingSeparator helper - Remove redundant length check - Fix false positive detection for .. by checking path segment boundaries - Also fix false positive for /. by checking if it's a single dot Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
jjonescz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Simplify by removing ContainsRelativePathComponents method - Normalize all rooted paths unconditionally - Add CanonicalizeRelativePathPreservingTrailingSeparator for NestedRoot - Change PathCanonicalization_Deterministic to use CombinatorialData - Add test for ContainingRoot and NestedRoot canonicalization Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
- Improve comment explaining canonicalization for rooted paths - Use StringComparison.Ordinal for StartsWith check - Use verbatim string for dummy root path clarity Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@jjonescz the copilot implementation seems to be pretty gung-ho about not absolutizing relative paths passed in - but I think absolutizing paths is fine here. Better this explicit expansion than an implicit one at hand wave some point later on in the build. Do you have any thoughts? |
MapSourceRootstask andInitializeSourceRootMappedPathstargetInitializeSourceRootMappedPaths#82112All changes complete and tested. CI formatting issues resolved.
Original prompt
InitializeSourceRootMappedPaths#82112💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.