Add another UI context to control Razor cohost pre-init#79875
Merged
davidwengier merged 2 commits intodotnet:mainfrom Aug 26, 2025
Merged
Add another UI context to control Razor cohost pre-init#79875davidwengier merged 2 commits intodotnet:mainfrom
davidwengier merged 2 commits intodotnet:mainfrom
Conversation
fc7466d to
540014c
Compare
Open
3 tasks
540014c to
e260767
Compare
JoeRobich
reviewed
Aug 26, 2025
| public const string RazorLanguageName = LanguageInfoProvider.RazorLanguageName; | ||
|
|
||
| // The UI context is provided by Razor, so this guid must match the one in https://github.com/dotnet/razor/blob/main/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/RazorConstants.cs | ||
| // These UI contexts are provided by Razor, so must match https://github.com/dotnet/razor/blob/main/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/RazorConstants.cs |
Member
There was a problem hiding this comment.
Should Razor simply use these values from the EA?
Member
Author
There was a problem hiding this comment.
I already think it's a bit weird that a UI context defined in Razor is only used in Roslyn. Making it so that a UI context defined in Razor, and used in Roslyn, has a Guid defined in Roslyn, is not really any weirder, though it would mean our RazorPackage would need IVT to the EA. I don't know at what point any of this feels too weird to be worth doing.
Member
There was a problem hiding this comment.
Yeah maybe not worth the trouble then. Is there a unit test in razor to ensure these are in sync?
Member
Author
There was a problem hiding this comment.
No, but thats a great idea! Will add that to the Razor side of things
JoeRobich
approved these changes
Aug 26, 2025
This was referenced Aug 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.