Skip to content

Commit

Permalink
implement IManagedHotReloadAgent2
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleLittleCloud committed Oct 10, 2024
1 parent cfd2daa commit 81826bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

using Microsoft.VisualStudio.Debugger.Contracts.HotReload;
using Microsoft.VisualStudio.HotReload.Components.DeltaApplier;
using static Microsoft.VisualStudio.ProjectSystem.VS.HotReload.ProjectHotReloadSessionManager;

namespace Microsoft.VisualStudio.ProjectSystem.VS.HotReload
{
internal class ProjectHotReloadSession : IManagedHotReloadAgent, IProjectHotReloadSession, IProjectHotReloadSessionInternal
internal class ProjectHotReloadSession : IManagedHotReloadAgent, IManagedHotReloadAgent2, IProjectHotReloadSession, IProjectHotReloadSessionInternal
{
private readonly string _variant;
private readonly string _runtimeVersion;
Expand Down Expand Up @@ -288,5 +289,15 @@ private void EnsureDeltaApplierforSession()
?? _deltaApplierCreator.Value.CreateManagedDeltaApplier(_runtimeVersion);
}
}

public ValueTask<int?> GetTargetLocalProcessIdAsync(CancellationToken cancellationToken)
{
if (_callback is HotReloadState hotReloadState)
{
return new ValueTask<int?>(hotReloadState.Process?.Id);
}

return new ValueTask<int?>();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ async Task ApplyHotReloadUpdateInternalAsync()
}
}

private class HotReloadState : IProjectHotReloadSessionCallback
internal class HotReloadState : IProjectHotReloadSessionCallback
{
private readonly ProjectHotReloadSessionManager _sessionManager;

Expand Down

0 comments on commit 81826bd

Please sign in to comment.