-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Allow VS extensions to participate in Roslyn OOP MEF: #79219
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
base: main
Are you sure you want to change the base?
Conversation
- Allow extensions to supply a set of RoslynOopMefComponent - Load those from extensions and pass them over to the OOP process at init - Add the passed assembly paths into the OOP MEF catalog construction
@@ -15,5 +16,5 @@ internal interface IRemoteInitializationService | |||
/// Called as soon as the remote process is created. | |||
/// </summary> | |||
/// <returns>Process ID of the remote process and an error message if the server encountered initialization issues.</returns> | |||
ValueTask<(int processId, string? errorMessage)> InitializeAsync(WorkspaceConfigurationOptions options, string localSettingsDirectory, CancellationToken cancellationToken); | |||
ValueTask<(int processId, string? errorMessage)> InitializeAsync(WorkspaceConfigurationOptions options, string localSettingsDirectory, ImmutableArray<string> oopMefComponentPaths, CancellationToken cancellationToken); |
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.
Should probably rename this something like RemoteMefComponentAssemblyPaths
@dibarbet to make sure this aligns with the gladstone experiment to load extensions. |
@@ -23,7 +23,7 @@ internal sealed partial class VisualStudioDiagnosticAnalyzerProvider | |||
{ | |||
private const string AnalyzerContentTypeName = "Microsoft.VisualStudio.Analyzer"; | |||
|
|||
internal const string RazorContentTypeName = "Microsoft.VisualStudio.RazorAssembly"; | |||
internal const string RoslynOopMefContentName = "Microsoft.VisualStudio.RoslynOopMefComponent"; |
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.
internal const string RoslynOopMefContentName = "Microsoft.VisualStudio.RoslynOopMefComponent"; | |
internal const string RoslynOopMefContentName = "Microsoft.VisualStudio.RoslynOopMefComponent"; |
Nit: maybe call it RoslynServiceHubMefComponent. Only because I agree that you correctly applied .NET casing rules to the "OOP" but anybody seeing it might be confused.
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.
Obviously when you undraft this we should rename this type.
// If that fails, try and load it from the codeBasePath if present | ||
var selfAlc = System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly())!; | ||
return selfAlc.LoadFromAssemblyPath(codeBasePath); |
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.
We'd have to think about what this means for dependnecies though of your MEF component. Should we put you generally into an ALC? We do similar things in VS Code.
Fixes #71510