-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Allow AnalyzerAssemblyLoader to be collectible #79997
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,7 +54,7 @@ private sealed class DefaultExtensionAssemblyLoaderProvider(HostWorkspaceService | |
| // These lines should always succeed. If they don't, they indicate a bug in our code that we want | ||
| // to bubble out as it must be fixed. | ||
| var analyzerAssemblyLoaderProvider = _workspaceServices.GetRequiredService<IAnalyzerAssemblyLoaderProvider>(); | ||
| var analyzerAssemblyLoader = analyzerAssemblyLoaderProvider.CreateNewShadowCopyLoader(); | ||
| var analyzerAssemblyLoader = analyzerAssemblyLoaderProvider.CreateNewShadowCopyLoader(collectOnDispose: true); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was there another place where we need to set this to true, e.g. for analyzers and generators in the OOP process? cc @CyrusNajmabadi
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can imagine we would want those analyzers and generators to run with R2R when possible. Also, are we certain that these assemblies are ever actually unloaded? |
||
|
|
||
| // Catch exceptions here related to working with the file system. If we can't properly enumerate, | ||
| // we want to report that back to the client, while not blocking the entire extension service. | ||
|
|
||
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.
Don't we want to collect here?
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.
Maybe collecting will free memory, assuming nothing has somehow pinned the ALC. But collecting will definitely disable R2R leading to performance issues down the road as more analyzers and generators shipped in the SDK are crossgen'd.
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.
What is R2R and why does collecting cause a payment for them.
The purpose of us making this collectible is for the important scenario of someone developing their own generators/analyzers and continually recompiling them and wanting them reloaded in OOP without having to restart VS.