Skip to content

Add CodeFix and Refactoring Name to Razor ExternalAccess#51917

Merged
JoeRobich merged 8 commits intodotnet:mainfrom
JoeRobich:add-providernames-for-razor
Mar 26, 2021
Merged

Add CodeFix and Refactoring Name to Razor ExternalAccess#51917
JoeRobich merged 8 commits intodotnet:mainfrom
JoeRobich:add-providernames-for-razor

Conversation

@JoeRobich
Copy link
Member

@JoeRobich JoeRobich commented Mar 16, 2021

Based on the changes in #51456 since provider names were added. Changes for this PR are in last three commits.

@JoeRobich JoeRobich requested review from a team as code owners March 16, 2021 21:14
@ghost ghost added the Area-IDE label Mar 16, 2021
@JoeRobich
Copy link
Member Author

@TanayParikh I kept the external access changes separate.

@TanayParikh
Copy link
Contributor

@TanayParikh I kept the external access changes separate.

Thanks @JoeRobich!

@JoeRobich JoeRobich force-pushed the add-providernames-for-razor branch from ac2ead6 to fd34ce9 Compare March 24, 2021 00:54

namespace Microsoft.CodeAnalysis.ExternalAccess.Razor
{
internal static class RazorPredefinedCodeFixProviderNames
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Only include the ones Razor needs to use. Otherwise, any change to the internal name of any code fix means we have to coordinate with another project.

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no issue with leaving Names in the Razor class that are no longer in the Roslyn class.


namespace Microsoft.CodeAnalysis.ExternalAccess.Razor
{
internal static class RazorPredefinedCodeRefactoringProviderNames
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Only include the ones Razor needs to use. Otherwise, any change to the internal name of any refactoring means we have to coordinate with another project.

Copy link
Contributor

Choose a reason for hiding this comment

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

Otherwise, any change to the internal name of any refactoring means we have to coordinate with another project.

If the internal name change is for a refactoring not supported by razor, would we still need to co-ordinate?

I'd prefer to have all these accessible if possible to simplify the process of adding support for new razor C# code fix/refactoring providers. Without these in place we'd have to make Roslyn changes / package upgrades for every time we'd like to add a code fix/refactoring.

Comment on lines +30 to +31
// Validates that all names from Roslyn's PredefinedCode*ProviderNames class exist in the RazorPredefinedCode*ProviderNames class
// and that they have the same value. It does not fail if the Razor class contains names no longer in the Roslyn class as they may
Copy link
Contributor

Choose a reason for hiding this comment

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

Validates that all names from Roslyn's PredefinedCode*ProviderNames class exist in the RazorPredefinedCode*ProviderNames

This is not a desirable characteristic (see prior comments).

and that they have the same value

This is not a desirable characteristic. The property definitions explicitly allow these to decouple if/when necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is not a desirable characteristic (see prior comments).

I feel like the PR when a name is added is a good time to ensure Razor will be able to consume it. Razor still gets to choose when they make use of the new Name.

This is not a desirable characteristic. The property definitions explicitly allow these to decouple if/when necessary.

I think it is useful to help Razor reason about which Provider is which.

@JoeRobich JoeRobich dismissed sharwell’s stale review March 25, 2021 22:16

Talked with Sam offline and he believes we can address any issue with the Tests when they come up.

Copy link
Member

@davidwengier davidwengier left a comment

Choose a reason for hiding this comment

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

If only there was a "linked file but with different namespace" feature of somethingorother.

@JoeRobich JoeRobich merged commit 211c516 into dotnet:main Mar 26, 2021
@ghost ghost added this to the Next milestone Mar 26, 2021
@allisonchou allisonchou modified the milestones: Next, 16.10.P2 Mar 29, 2021
@JoeRobich JoeRobich deleted the add-providernames-for-razor branch March 14, 2025 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants