Skip to content
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

Add weak heuristics in our designer scanning code to improve experience during things like configuration switch. #74130

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

CyrusNajmabadi
Copy link
Member

Current approach leads to projects changing their designability, which can break the designer, even though it actually works in these scenarios. By adding a couple of weak heuristics (that we discussed with WinForms designer team) we can be much more robust.

We will likely backport this to 17.10 as well. But getting review in Main first.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner June 24, 2024 21:59
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 24, 2024
@CyrusNajmabadi CyrusNajmabadi requested review from genlu and Cosifne June 24, 2024 22:04
@CyrusNajmabadi
Copy link
Member Author

@Cosifne @genlu ptal.

Update tests

Add test

NRT
@CyrusNajmabadi
Copy link
Member Author

@genlu @Cosifne ptal

{
foreach (var wellKnownNamespace in s_wellKnownDesignerNamespaces)
{
var wellKnownType = compilation.GetTypeByMetadataName($"{wellKnownNamespace}.{errorType.Name}");
Copy link
Member

Choose a reason for hiding this comment

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

🤔When will this happen to user? Namespace misspelling, why the namespace in SemanticModel is wrong?

Copy link
Member Author

Choose a reason for hiding this comment

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

Basically, as a restore happens, we can lose and then get references again. Also, generators may not run again until we know about them again, so we lost global usings.

This keeps everything still looking good (and usable for the designer side) while we get back into a good state again.

@Cosifne
Copy link
Member

Cosifne commented Jun 25, 2024

Approach is Ok, but I am curious about what's the affected secnario?

@CyrusNajmabadi CyrusNajmabadi merged commit 3a3c108 into dotnet:main Jun 26, 2024
25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the designerAttribute branch June 26, 2024 05:56
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jun 26, 2024
@RikkiGibson RikkiGibson modified the milestones: Next, 17.12 P1 Jul 29, 2024
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.

3 participants