Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

Fixes #74395

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner July 24, 2024 21:13
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 24, 2024
[ContentType(ContentTypeNames.RoslynContentType)]
[ContentType(ContentTypeNames.XamlContentType)]
[Name(PredefinedCommandHandlerNames.SourceGeneratorSave)]
[ContentType(StandardContentTypeNames.Text)]
Copy link
Contributor

Choose a reason for hiding this comment

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

[ContentType(StandardContentTypeNames.Text)]

I don't have any suggestions here, but won't this cause roslyn to load when opening txt files?

Copy link
Member Author

Choose a reason for hiding this comment

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

bleagh.

@jasonmalinowski @sharwell any ideas on this?

Copy link
Member Author

Choose a reason for hiding this comment

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

@olegtk for thoughts as well. We only want to listen to saves when roslyn is actually loaded. but we do need to know about saves to files that aren't roslyn content type (like saving an xml file inside a roslyn project that will then have an impact on generators).

Copy link
Contributor

Choose a reason for hiding this comment

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

Is RDT or another vs api a possibility here?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah listening to the RDT or some other VS would probably be what we need to do here.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jasonmalinowski anything i can look into?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@dibarbet dibarbet left a comment

Choose a reason for hiding this comment

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

Definitely needs an RPS validation to make sure its not loading roslyn everywhere now.

[ContentType(ContentTypeNames.RoslynContentType)]
[ContentType(ContentTypeNames.XamlContentType)]
[Name(PredefinedCommandHandlerNames.SourceGeneratorSave)]
[ContentType(StandardContentTypeNames.Text)]
Copy link
Member

Choose a reason for hiding this comment

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

This feels like its going to cause a lot of RPS regressions as this will now run on any content type. Can you do an RPS validation to check?

@CyrusNajmabadi CyrusNajmabadi requested a review from dibarbet July 25, 2024 01:17
@CyrusNajmabadi
Copy link
Member Author

Thanks all. switched to RDT.

internal sealed class SaveCommandHandler() : IChainedCommandHandler<SaveCommandArgs>
public sealed partial class OpenFileTracker
{
public string DisplayName => ServicesVSResources.Roslyn_save_command_handler;
Copy link
Contributor

Choose a reason for hiding this comment

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

ServicesVSResources.Roslyn_save_command_handler

delete?

Copy link
Member Author

Choose a reason for hiding this comment

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

will do in followup.

[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[ContentType(ContentTypeNames.XamlContentType)]
[Name(PredefinedCommandHandlerNames.SourceGeneratorSave)]
Copy link
Contributor

Choose a reason for hiding this comment

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

SourceGeneratorSave

delete?

Copy link
Member Author

Choose a reason for hiding this comment

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

will do in followup.

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Saving an AdditionalFiles document in Balanced mode fails to trigger source generator

5 participants