-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Allow Razor cohosting to hook into configuration change notifications #78364
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
Conversation
{ | ||
public ILspService CreateILspService(LspServices lspServices, WellKnownLspServerKinds serverKind) | ||
{ | ||
return new RazorConfigurationChangedService(cohostConfigurationChangedService); |
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.
You might be teaching me something here. When exporting via the factory, does the service get registered for each of the interfaces that it implements? Or does something else tie this to IOnConfigurationChanged?
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.
Yes, but its not specific to factories. The magic is here I believe:
roslyn/src/LanguageServer/Protocol/LspServices/AbstractExportLspServiceAttribute.cs
Line 75 in 624361d
InterfaceNames = Array.ConvertAll(serviceType.GetInterfaces(), t => t.AssemblyQualifiedName!); |
if (lazyService.Metadata.InterfaceNames.Contains(typeof(T).AssemblyQualifiedName!)) |
src/Tools/ExternalAccess/Razor/Features/Cohost/RazorConfigurationChangedServiceFactory.cs
Outdated
Show resolved
Hide resolved
…ionChangedServiceFactory.cs Co-authored-by: David Barbet <[email protected]>
#11800) Part of #11759 This cleans up `IClientSettingsManager` and puts it back to its previous state, removing `IClientSettingsReader` at the same time, and also implements a hook for VS Code to get notified when the VS Code configuration changes, and to read the settings as appropriate. Needs a bump to dotnet/roslyn#78364 before it will build
Since Roslyn uses dynamic registration for configuration change requests, Razor can't. Even if we could, as a document-less request, it couldn't be routed to us anyway. So this exposes a hook for us through our EA.
Razor side is at dotnet/razor#11800
Part of dotnet/razor#11759