-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Set the default namespace for the project and proper folders for documents #77787
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
Conversation
| 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(); |
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.
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 [""].
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.
Can we have a test for this one?
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
| using System.Xml.Linq; | ||
| using Microsoft.CodeAnalysis.CSharp; |
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.
Reordered usings
Resolves dotnet/vscode-csharp#8091