-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Handle folders in source-generated file paths #68494
Conversation
src/VisualStudio/Core/Def/Workspace/SourceGeneratedFileManager.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio/Core/Def/Workspace/SourceGeneratedFileManager.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio/Core/Def/Workspace/SourceGeneratedFileManager.cs
Outdated
Show resolved
Hide resolved
|
||
await TestServices.Editor.PlaceCaretAsync(HelloWorldGenerator.GeneratedFolderClassName, charsOffset: 0, HangMitigatingCancellationToken); | ||
await TestServices.Editor.GoToDefinitionAsync(HangMitigatingCancellationToken); | ||
Assert.Equal($"{HelloWorldGenerator.GeneratedFolderName}/{HelloWorldGenerator.GeneratedFolderClassName}.cs {ServicesVSResources.generated_suffix}", await TestServices.Shell.GetActiveWindowCaptionAsync(HangMitigatingCancellationToken)); |
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.
This would seem a bit strange to me to have the relative path in the caption like this since that's not something we do in other parts of VS. Should we be setting the caption to be just the final portion of the path here?
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.
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.
I guess this is better than it being broken, but not sure if this will break things...
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.
I can change the title to only include filename if you prefer, but I don't know how to make the solution explorer to display folder tree. I hope this is fine for now and can be improved in a follow up PR if needed.
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.
My concern mostly is if something or somebody will break seeing slashes in the tab name, but if something breaks we'll probably discover it soon enough. The solution explorer doing a folder tree would indeed require some significant rework of that area.
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.
I haven't looked closely at this pr , but I assume that this is similar to the workspace apis, and one can pass an array of folder names along?
If that's the case @jasonmalinowski , I would assume we could represent this pretty easily in the workspace and present it nicely.
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.
@CyrusNajmabadi The workspace representation isn't the problem here but simply how the APIs work for adding things to solution explorer. Maybe it's not "significant" work, as much as "slightly irritating" since the model involves a bunch of MEF and things having to return nodes one level at a time.
src/VisualStudio/Core/Def/Workspace/SourceGeneratedFileManager.cs
Outdated
Show resolved
Hide resolved
|
||
await TestServices.Editor.PlaceCaretAsync(HelloWorldGenerator.GeneratedFolderClassName, charsOffset: 0, HangMitigatingCancellationToken); | ||
await TestServices.Editor.GoToDefinitionAsync(HangMitigatingCancellationToken); | ||
Assert.Equal($"{HelloWorldGenerator.GeneratedFolderName}/{HelloWorldGenerator.GeneratedFolderClassName}.cs {ServicesVSResources.generated_suffix}", await TestServices.Shell.GetActiveWindowCaptionAsync(HangMitigatingCancellationToken)); |
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.
I guess this is better than it being broken, but not sure if this will break things...
Fixes #68489.