Skip to content

Conversation

@JoeRobich
Copy link
Member

@JoeRobich JoeRobich requested a review from a team as a code owner March 24, 2025 23:55
@ghost ghost added Area-Infrastructure untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 24, 2025
var filePath = documentItem.ItemSpec;
var relativePath = PathUtilities.GetDirectoryName(PathUtilities.GetRelativePath(_projectDirectory, filePath));
var folders = relativePath == null ? [] : relativePath.Split(PathUtilities.DirectorySeparatorChar, PathUtilities.AltDirectorySeparatorChar).ToImmutableArray();
var folders = relativePath == null ? [] : relativePath.Split([PathUtilities.DirectorySeparatorChar, PathUtilities.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
Copy link
Member Author

Choose a reason for hiding this comment

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

For files in the same folder as the project file, PathUtilities.GetRelativePath(_projectDirectory, filePath) would always return filePath. Meaning PathUtilities.GetDirectoryName(...) would return "". Since we were not removing empty entries the resultant return would be [""].

Copy link
Member

Choose a reason for hiding this comment

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

Can we have a test for this one?

@JoeRobich JoeRobich enabled auto-merge March 25, 2025 00:45
using System.Threading;
using System.Threading.Tasks;
using System.Xml.Linq;
using Microsoft.CodeAnalysis.CSharp;
Copy link
Member Author

Choose a reason for hiding this comment

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

Reordered usings

@JoeRobich JoeRobich merged commit b7f166d into main Mar 25, 2025
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Mar 25, 2025
@jjonescz jjonescz modified the milestones: Next, 17.14 P3 Apr 1, 2025
@JoeRobich JoeRobich deleted the dev/jorobich/fix-change-namespace branch July 15, 2025 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Infrastructure untriaged Issues and PRs which have not yet been triaged by a lead VSCode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code Action to Sync Namespace not working when C# Dev Kit is disabled

5 participants