Skip to content

Only report designer attributes for the primary project of a multi-project config.#44270

Merged
CyrusNajmabadi merged 6 commits intodotnet:masterfrom
CyrusNajmabadi:primaryProjUpdate
May 16, 2020
Merged

Only report designer attributes for the primary project of a multi-project config.#44270
CyrusNajmabadi merged 6 commits intodotnet:masterfrom
CyrusNajmabadi:primaryProjUpdate

Conversation

@CyrusNajmabadi
Copy link
Contributor

Roslyn part of https://devdiv.visualstudio.com/DevDiv/_queries/edit/961596/?triage=true

Project system still needs to do work once this is in.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 14, 2020 21:14
@jasonmalinowski jasonmalinowski self-requested a review May 14, 2020 23:23
Copy link
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

Structure is fine but I admit I'm really confused about the tri-state handling...

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Auto-approval

@CyrusNajmabadi CyrusNajmabadi merged commit 551071c into dotnet:master May 16, 2020
@ghost ghost added this to the Next milestone May 16, 2020
@JoeRobich JoeRobich modified the milestones: Next, 16.7.P2 May 18, 2020
@CyrusNajmabadi CyrusNajmabadi deleted the primaryProjUpdate branch May 20, 2020 20:56
davkean added a commit to davkean/project-system that referenced this pull request Sep 1, 2020
Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/961596

Roslyn is responsible for applying SubType to Forms, Components and other types. In multi-targeted projects, the same file can have conflicting "sub types":

#if NET45
    class MyComponent : Form
#else
    class MyComponent : Component
#endif

This results Roslyn pushing "Form" when it encounters scans the first definition and "Component" when it encounters the second definition.
There is no guaranteed order to which one of these get scanned first, so this can result in the same time having a different sub type every time Roslyn does analysis. Sub Type affects the designer and icon that a type gets, so this results in a type that flickers between two different icons.

This was worse before dotnet#5880 as we'd see the sub type change and go back to Roslyn to add/remove the file, resulting in a constant churn. This longer occurs, but we still have the fighting sub type dance whenver the file content changes.

To fix this, Roslyn will now only scan the the primary context: dotnet/roslyn#44270.

This change plumbs through this property by finding the context that lives in the "active configuration" and passing this through to Roslyn.
@davkean
Copy link
Member

davkean commented Sep 1, 2020

Note, our counter change is here: dotnet/project-system#6567.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants