Skip to content

Initialize default capabilities before switching to the UI thread#60106

Merged
davidwengier merged 3 commits intodotnet:mainfrom
davidwengier:MEFOffUIThread
Mar 17, 2022
Merged

Initialize default capabilities before switching to the UI thread#60106
davidwengier merged 3 commits intodotnet:mainfrom
davidwengier:MEFOffUIThread

Conversation

@davidwengier
Copy link
Member

@davidwengier davidwengier commented Mar 11, 2022

Fixes AB#1468258

@davidwengier davidwengier requested a review from a team as a code owner March 11, 2022 05:59
@ghost ghost added the Area-IDE label Mar 11, 2022
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.

If the following comment is true, should we just do that?

// The correct fix for this is to fix the threading violations in the option persister code;
// asserting a MEF component is constructed on the foreground thread is never allowed, but alas it's
// done there. Fixing that isn't difficult but comes with some risk I don't want to take for 16.9;

@jasonmalinowski as best as I can tell this is the only persister that uses the UI thread
https://sourceroslyn.io/#Microsoft.VisualStudio.LanguageServices/Implementation/Options/LanguageSettingsPersister.cs,30

What were you thinking as the solution? To me it seems like the persister requires the UI thread to be functional at all, so I wanted to understand how you were thinking of removing that dependency.

@davidwengier
Copy link
Member Author

should we just do that?

That is blocked on platform work if the issue referenced in the comment is to be believed: #29602 (comment)

…er.cs

Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>
@jasonmalinowski
Copy link
Member

The idea I had was to bypass the platform API that gives us the language settings as a struct and instead use the settings API to read the underlying settings directly with the free-threaded settings API. That absolutely means we're baking in the implementation detail and leaking the abstraction, but should work?

@davidwengier
Copy link
Member Author

/azp run roslyn-integration-corehost

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@davidwengier davidwengier enabled auto-merge (squash) March 14, 2022 22:33
@CyrusNajmabadi
Copy link
Contributor

The idea I had was to bypass the platform API that gives us the language settings as a struct and instead use the settings API to read the underlying settings directly with the free-threaded settings API. That absolutely means we're baking in the implementation detail and leaking the abstraction, but should work?

Is there any way to frontload this soon? It would be fantastic if we can get the UI thread dep off of options.

@davidwengier
Copy link
Member Author

That is tracked by #29602 so might be good to discuss that there, so it doesn't get lost. This is just meant to be targeted to remove the UI delay

@davidwengier davidwengier disabled auto-merge March 16, 2022 21:02
@davidwengier
Copy link
Member Author

ping for review @jasonmalinowski @dibarbet @sharwell ?

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.

This works, but there might be a cleaner approach here. No matter what, I'd appreciate some updates on the comments as requested.

@davidwengier davidwengier enabled auto-merge (squash) March 17, 2022 03:35
@davidwengier davidwengier merged commit 9b879fb into dotnet:main Mar 17, 2022
@ghost ghost added this to the Next milestone Mar 17, 2022
@davidwengier davidwengier deleted the MEFOffUIThread branch March 17, 2022 06:02
allisonchou added a commit to allisonchou/roslyn that referenced this pull request Mar 17, 2022
allisonchou added a commit that referenced this pull request Mar 18, 2022
davidwengier added a commit that referenced this pull request Mar 20, 2022
@allisonchou allisonchou modified the milestones: Next, 17.2.P3 Mar 28, 2022
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.

6 participants