unsubscribe event on exittree
This commit is contained in:
@@ -10,7 +10,7 @@ namespace SharpIDE.Application.Features.Analysis.ProjectLoader;
|
||||
// My attempts to provide a custom IAnalyzerService to the MEF composition were in vain.
|
||||
// I think this will only be temporary, as I think a more sophisticated ProjectLoader mechanism is going to be necessary.
|
||||
// see roslyn LanguageServerProjectLoader, LanguageServerProjectSystem, ProjectSystemProjectFactory
|
||||
// https://github.com/dotnet/roslyn/blob/main/src/Workspaces/MSBuild/Core/MSBuild/MSBuildProjectLoader.cs
|
||||
// https://github.com/dotnet/roslyn/blob/52d073ff6f1c668e858bed838712467afcf83876/src/Workspaces/MSBuild/Core/MSBuild/MSBuildProjectLoader.cs
|
||||
public partial class CustomMsBuildProjectLoader(Workspace workspace, ImmutableDictionary<string, string>? properties = null) : MSBuildProjectLoader(workspace, properties)
|
||||
{
|
||||
public async Task<(ImmutableArray<ProjectInfo>, Dictionary<ProjectId, ProjectFileInfo>)> LoadProjectInfosAsync(
|
||||
|
||||
@@ -8,18 +8,18 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Publicize Include="ObservableCollections" />
|
||||
<Publicize Include="Microsoft.CodeAnalysis.Remote.Razor" />
|
||||
<Publicize Include="Microsoft.CodeAnalysis.Razor.Workspaces" />
|
||||
<Publicize Include="Microsoft.CodeAnalysis.Razor.Compiler" />
|
||||
<Publicize Include="Microsoft.VisualStudioCode.RazorExtension" />
|
||||
<Publicize Include="Microsoft.CodeAnalysis.LanguageServer.Protocol" />
|
||||
<Publicize Include="Microsoft.CodeAnalysis.ExternalAccess.Razor.Features" />
|
||||
<Publicize Include="Microsoft.CodeAnalysis.Razor.SemanticTokens" />
|
||||
<Publicize Include="Microsoft.CodeAnalysis.Workspaces" />
|
||||
<Publicize Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" />
|
||||
<Publicize Include="Microsoft.VisualStudio.Shared.VSCodeDebugProtocol" IncludeCompilerGeneratedMembers="false" />
|
||||
<Publicize Include="Microsoft.Build" MemberPattern="^Microsoft\.Build\.Logging\.(TerminalLogger|Terminal)\..*" />
|
||||
<Publicize IncludeCompilerGeneratedMembers="false" Include="ObservableCollections" />
|
||||
<Publicize IncludeCompilerGeneratedMembers="false" Include="Microsoft.CodeAnalysis.Remote.Razor" />
|
||||
<Publicize IncludeCompilerGeneratedMembers="false" Include="Microsoft.CodeAnalysis.Razor.Workspaces" />
|
||||
<Publicize IncludeCompilerGeneratedMembers="false" Include="Microsoft.CodeAnalysis.Razor.Compiler" />
|
||||
<Publicize IncludeCompilerGeneratedMembers="false" Include="Microsoft.VisualStudioCode.RazorExtension" />
|
||||
<Publicize IncludeCompilerGeneratedMembers="false" Include="Microsoft.CodeAnalysis.LanguageServer.Protocol" />
|
||||
<Publicize IncludeCompilerGeneratedMembers="false" Include="Microsoft.CodeAnalysis.ExternalAccess.Razor.Features" />
|
||||
<Publicize IncludeCompilerGeneratedMembers="false" Include="Microsoft.CodeAnalysis.Razor.SemanticTokens" />
|
||||
<Publicize IncludeCompilerGeneratedMembers="false" Include="Microsoft.CodeAnalysis.Workspaces" />
|
||||
<Publicize IncludeCompilerGeneratedMembers="false" Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" />
|
||||
<Publicize IncludeCompilerGeneratedMembers="false" Include="Microsoft.VisualStudio.Shared.VSCodeDebugProtocol" />
|
||||
<Publicize IncludeCompilerGeneratedMembers="false" Include="Microsoft.Build" MemberPattern="^Microsoft\.Build\.Logging\.(TerminalLogger|Terminal)\..*" />
|
||||
<DoNotPublicize Include="Microsoft.CodeAnalysis.Workspaces:System.Linq.RoslynEnumerableExtensions" />
|
||||
<DoNotPublicize Include="Microsoft.Build:Microsoft.CodeAnalysis.ICollectionExtensions" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -30,6 +30,8 @@ public partial class RunningTasksDisplay : HBoxContainer
|
||||
public override void _ExitTree()
|
||||
{
|
||||
_activityMonitor.ActivityStarted.Unsubscribe(OnActivityStarted);
|
||||
_activityMonitor.ActivityStarted.Unsubscribe(OnActivityStopped);
|
||||
|
||||
}
|
||||
|
||||
private async Task OnActivityStarted(Activity activity) => await OnActivityChanged(activity, true);
|
||||
|
||||
Reference in New Issue
Block a user