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

Include projects to restart/rebuild in ManagedHotReloadUpdates #75918

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,13 @@ public async ValueTask<ManagedHotReloadUpdates> GetUpdatesAsync(ImmutableArray<s

UpdateApplyChangesDiagnostics(result.Diagnostics);

return new ManagedHotReloadUpdates(result.ModuleUpdates.Updates.FromContract(), result.GetAllDiagnostics().FromContract());
return new ManagedHotReloadUpdates(
result.ModuleUpdates.Updates.FromContract(),
result.GetAllDiagnostics().FromContract(),
GetProjectPaths(result.ProjectsToRebuild),
GetProjectPaths(result.ProjectsToRestart));

ImmutableArray<string> GetProjectPaths(ImmutableArray<ProjectId> ids)
=> ids.SelectAsArray(static (id, solution) => solution.GetRequiredProject(id).FilePath!, solution);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void EndDebuggingSession()
public async ValueTask<ManagedHotReloadUpdates> GetUpdatesAsync(Solution solution, CancellationToken cancellationToken)
{
var results = (await _encService.EmitSolutionUpdateAsync(GetSessionId(), solution, runningProjects: [], s_noActiveStatementSpanProvider, cancellationToken).ConfigureAwait(false)).Dehydrate();
return new ManagedHotReloadUpdates(results.ModuleUpdates.Updates.FromContract(), results.GetAllDiagnostics().FromContract());
return new ManagedHotReloadUpdates(results.ModuleUpdates.Updates.FromContract(), results.GetAllDiagnostics().FromContract(), [], []);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ public abstract class EditAndContinueWorkspaceTestBase : TestBase, IDisposable
/// <summary>
/// Streams that are verified to be disposed at the end of the debug session (by default).
/// </summary>
public List<(Guid mvid, Stream stream)> DisposalVerifiedStreams = [];
private ImmutableList<Stream> _disposalVerifiedStreams = [];

public override void Dispose()
{
base.Dispose();

foreach (var (_, stream) in DisposalVerifiedStreams)
foreach (var stream in _disposalVerifiedStreams)
{
Assert.False(stream.CanRead);
}
Expand Down Expand Up @@ -314,15 +314,15 @@ internal Guid EmitLibrary(Compilation compilation, DebugInformationFormat pdbFor
OpenAssemblyStreamImpl = () =>
{
var stream = new MemoryStream();
DisposalVerifiedStreams.Add((moduleId, stream));
ImmutableInterlocked.Update(ref _disposalVerifiedStreams, s => s.Add(stream));
peImage.WriteToStream(stream);
stream.Position = 0;
return stream;
},
OpenPdbStreamImpl = () =>
{
var stream = new MemoryStream();
DisposalVerifiedStreams.Add((moduleId, stream));
ImmutableInterlocked.Update(ref _disposalVerifiedStreams, s => s.Add(stream));
pdbImage.WriteToStream(stream);
stream.Position = 0;
return stream;
Expand Down
Loading