-
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
Add weak heuristics in our designer scanning code to improve experience during things like configuration switch. #74130
Conversation
759abe8
to
94a4793
Compare
Update tests Add test NRT
ebd838b
to
8e155e1
Compare
{ | ||
foreach (var wellKnownNamespace in s_wellKnownDesignerNamespaces) | ||
{ | ||
var wellKnownType = compilation.GetTypeByMetadataName($"{wellKnownNamespace}.{errorType.Name}"); |
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.
🤔When will this happen to user? Namespace misspelling, why the namespace in SemanticModel is wrong?
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.
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.
Approach is Ok, but I am curious about what's the affected secnario? |
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.