Skip to content

Commit cf72fd2

Browse files
authored
Merge branch 'release/10.0.1xx' into darc-release/10.0.1xx-e47952ab-9edc-4a1d-a4e4-82a632d3d2a2
2 parents 7e4df22 + d031a8f commit cf72fd2

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/BuiltInTools/dotnet-watch/HotReload/CompilationHandler.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,23 @@ public async ValueTask StartSessionAsync(CancellationToken cancellationToken)
7777
{
7878
_logger.Log(MessageDescriptor.HotReloadSessionStarting);
7979

80-
await _hotReloadService.StartSessionAsync(Workspace.CurrentSolution, cancellationToken);
80+
var solution = Workspace.CurrentSolution;
81+
82+
await _hotReloadService.StartSessionAsync(solution, cancellationToken);
83+
84+
// TODO: StartSessionAsync should do this: https://github.com/dotnet/roslyn/issues/80687
85+
foreach (var project in solution.Projects)
86+
{
87+
foreach (var document in project.AdditionalDocuments)
88+
{
89+
await document.GetTextAsync(cancellationToken);
90+
}
91+
92+
foreach (var document in project.AnalyzerConfigDocuments)
93+
{
94+
await document.GetTextAsync(cancellationToken);
95+
}
96+
}
8197

8298
_logger.Log(MessageDescriptor.HotReloadSessionStarted);
8399
}

src/BuiltInTools/dotnet-watch/HotReload/IncrementalMSBuildWorkspace.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ private static async ValueTask<SourceText> GetSourceTextAsync(string filePath, E
219219

220220
public async Task ReportSolutionFilesAsync(Solution solution, CancellationToken cancellationToken)
221221
{
222+
#if DEBUG
222223
_logger.LogDebug("Solution: {Path}", solution.FilePath);
223224
foreach (var project in solution.Projects)
224225
{
@@ -245,5 +246,8 @@ async ValueTask InspectDocumentAsync(TextDocument document, string kind)
245246
var text = await document.GetTextAsync(cancellationToken);
246247
_logger.LogDebug(" {Kind}: {FilePath} [{Checksum}]", kind, document.FilePath, Convert.ToBase64String(text.GetChecksum().ToArray()));
247248
}
249+
#else
250+
await Task.CompletedTask;
251+
#endif
248252
}
249253
}

0 commit comments

Comments
 (0)