Skip to content
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

Implement IManagedHotReloadAgent2 and IManagedHotReloadAgent4 for ProjectHotReloadSession #9555

Merged
merged 27 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
81826bd
implement IManagedHotReloadAgent2
LittleLittleCloud Oct 10, 2024
c93988e
return project full path
LittleLittleCloud Oct 11, 2024
fd6a529
update
LittleLittleCloud Oct 14, 2024
4a9c235
update
LittleLittleCloud Oct 14, 2024
1166c77
implement RestartProject
LittleLittleCloud Oct 17, 2024
5b0435e
Merge branch 'u/implementV2' of https://github.com/LittleLittleCloud/…
LittleLittleCloud Oct 17, 2024
0deb4cb
update debug contract version
LittleLittleCloud Oct 17, 2024
1cc524d
update
LittleLittleCloud Oct 17, 2024
a262c58
bump debugger contract version
LittleLittleCloud Oct 18, 2024
682b3af
revert setup/ProjectSystemSetup/ProjectSystemSetup.csproj
LittleLittleCloud Oct 18, 2024
4d35fc8
add ISolutionBuildManager mock to test
LittleLittleCloud Oct 21, 2024
1026620
return _sessionManager._project
LittleLittleCloud Oct 21, 2024
6910c67
update
LittleLittleCloud Oct 30, 2024
7c4f9cf
dispose event listenr when stop project
LittleLittleCloud Oct 30, 2024
86a6bc3
update
LittleLittleCloud Oct 31, 2024
fea82ec
remove restarting seesion from project system side
LittleLittleCloud Nov 1, 2024
dc2f0d5
Merge branch 'main' into u/implementV2
LittleLittleCloud Nov 11, 2024
e622839
clean up
LittleLittleCloud Nov 12, 2024
07809e9
Merge branch 'u/implementV2' of https://github.com/LittleLittleCloud/…
LittleLittleCloud Nov 12, 2024
cad337f
fix comment
LittleLittleCloud Nov 12, 2024
240c2a5
remove unused subscription listener
LittleLittleCloud Nov 13, 2024
135231a
revert change in solution build manager
LittleLittleCloud Nov 13, 2024
c8bbcbc
make HotReloadState back to private again
LittleLittleCloud Nov 13, 2024
299f64e
fix build error
LittleLittleCloud Nov 13, 2024
54b93b9
Update src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSys…
LittleLittleCloud Nov 14, 2024
31c664e
fix comment
LittleLittleCloud Nov 14, 2024
e89e342
Update src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSys…
LittleLittleCloud Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<VSDebuggerVersion>17.12.3-dev</VSDebuggerVersion>
</PropertyGroup>

<!--
Expand Down Expand Up @@ -48,8 +49,8 @@
<PackageVersion Include="Microsoft.VisualStudio.Data.Services" Version="17.0.0-preview-2-31223-026" />
<PackageVersion Include="Microsoft.VisualStudio.DataDesign.Common" Version="17.0.0-preview-2-31223-026" />
<PackageVersion Include="Microsoft.VisualStudio.DataTools.Interop" Version="17.0.0-preview-2-31223-026" />
<PackageVersion Include="Microsoft.VisualStudio.Debugger.Contracts" Version="17.4.0-beta.22470.1" />
<PackageVersion Include="Microsoft.VisualStudio.Debugger.UI.Interfaces" Version="17.4.0-beta.22470.1" />
<PackageVersion Include="Microsoft.VisualStudio.Debugger.Contracts" Version="$(VSDebuggerVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Debugger.UI.Interfaces" Version="$(VSDebuggerVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Designer.Interfaces" Version="17.11.38822-preview.1" />
<PackageVersion Include="Microsoft.VisualStudio.ImageCatalog" Version="17.11.38822-preview.1" />
<PackageVersion Include="Microsoft.VisualStudio.Interop" Version="17.11.38822-preview.1" />
Expand Down
1 change: 1 addition & 0 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<configuration>
<packageSources>
<clear />
<add key="local" value="C:\Users\xiaoyuz\source\repos\VSDebugCore\artifacts\packages\Debug\Shipping\" />
LittleLittleCloud marked this conversation as resolved.
Show resolved Hide resolved
<add key="dotnet-project-system-public-packages" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/dotnet-project-system-public-packages/nuget/v3/index.json" />
</packageSources>
</configuration>
1 change: 1 addition & 0 deletions setup/ProjectSystemSetup/ProjectSystemSetup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<!-- Note: No idea why ProjectSystem is the AssemblyName instead of using the MSBuildProjectName of ProjectSystemSetup. -->
<AssemblyName>ProjectSystem</AssemblyName>
<TargetFramework>net472</TargetFramework>
<VSSDKTargetPlatformRegRootSuffix>RoslynDev</VSSDKTargetPlatformRegRootSuffix>
LittleLittleCloud marked this conversation as resolved.
Show resolved Hide resolved

<!-- VSIX -->
<ExtensionInstallationRoot>Extensions</ExtensionInstallationRoot>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.

using Microsoft.VisualStudio.Debugger.Contracts.EditAndContinue;
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, IManagedHotReloadAgent4, IProjectHotReloadSession, IProjectHotReloadSessionInternal
{
private readonly string _variant;
private readonly string _runtimeVersion;
Expand Down Expand Up @@ -288,5 +290,25 @@ 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?>();
}

public ValueTask<string?> GetProjectFullPathAsync(CancellationToken cancellationToken)
{
if (_callback is HotReloadState hrs)
{
return new ValueTask<string?>(hrs.Project?.FullPath);
}

return new ValueTask<string?>();
}
}
}
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 All @@ -459,9 +459,12 @@ private class HotReloadState : IProjectHotReloadSessionCallback
// TODO: Support restarting the session.
public bool SupportsRestart => false;
LittleLittleCloud marked this conversation as resolved.
Show resolved Hide resolved

public UnconfiguredProject? Project { get; }

public HotReloadState(ProjectHotReloadSessionManager sessionManager)
{
_sessionManager = sessionManager;
Project = _sessionManager._project;
LittleLittleCloud marked this conversation as resolved.
Show resolved Hide resolved
}

internal void OnProcessExited(object sender, EventArgs e)
Expand Down
Loading