Skip to content

Initialize feature flags in OOP early#12079

Merged
davidwengier merged 19 commits intodotnet:mainfrom
davidwengier:CohostInitFeatureFlags
Sep 14, 2025
Merged

Initialize feature flags in OOP early#12079
davidwengier merged 19 commits intodotnet:mainfrom
davidwengier:CohostInitFeatureFlags

Conversation

@davidwengier
Copy link
Member

@davidwengier davidwengier commented Aug 6, 2025

@davidwengier davidwengier force-pushed the CohostInitFeatureFlags branch from 6913f2f to 6d1885d Compare August 25, 2025 03:21
davidwengier added a commit to dotnet/roslyn that referenced this pull request Aug 26, 2025
~Putting this up as draft for now, gonna see if I can do a dual test
insertion to confirm this makes RPS happy. The UI context is defined in
dotnet/razor#12079 so its a little bit painful
to validate everything together :)~

This PR does two things:
1. Makes the lifetime service Lazy, which it should have always been but
I forgot. Not being lazy means Razor can't move to it, as just MEF
construction causes RPS regressions. Oops!
2. Adds a ui context to control pre-initialization. This allows Razor to
control whether that occurs, when, and whether it actually does
anything.

Until Razor is in this won't do anything, but runs in the dual test
insertion
(https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/664449) look
good so far.
@davidwengier davidwengier force-pushed the CohostInitFeatureFlags branch from 3513853 to 667b24b Compare August 26, 2025 07:18
@davidwengier davidwengier force-pushed the CohostInitFeatureFlags branch from 667b24b to 805c73b Compare August 28, 2025 23:40
Copy link
Member

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

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

Please take a closer look at the RemoteServiceInvoker changes.

# Conflicts:
#	Directory.Packages.props
#	eng/Version.Details.props
#	eng/Version.Details.xml
#	src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Completion/RemoteCompletionService.cs
#	src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/InlayHints/RemoteInlayHintService.cs
@davidwengier
Copy link
Member Author

Ended up reverting a lot of this, in particular the bad bits because we don't need them anymore. Do need to wait for dotnet/roslyn#80229 to be inserted though. Swings and roundabouts :)

@davidwengier davidwengier merged commit 90c12b1 into dotnet:main Sep 14, 2025
11 checks passed
@davidwengier davidwengier deleted the CohostInitFeatureFlags branch September 14, 2025 23:31
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Sep 14, 2025
@akhera99 akhera99 modified the milestones: Next, 18.0 P1, 18.0 P2 Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Cohost] Razor source generator doesn't produce outputs on first load

3 participants