未验证 提交 5f86d25c 编写于 作者: T Tomáš Matoušek 提交者: GitHub

EnC: Tweak handling of out-of-sync documents to work around source file...

EnC: Tweak handling of out-of-sync documents to work around source file content inconsistencies (#40947)

* Do not block in presence of out-of-sync documents.

Instead, ignore any changes made to these documents while debugging until their content matches the source used to build the baseline DLL.

* Only check output PDB, not debugger SymReader, for document checksums.
Turns out SymReader does not support reading document checksums once EnC changes have been applied.

Better handle errors that might occur when validating checksums. Previously some of the errors were not reported as diagnostics.

We previously blocked EnC when we observed a source file that is out-of-sync (i.e. its current content does not match the checksum in the originally built PDB). We can however just ignore these files and report a warning that changes made to this file won’t be applied until the file content is reverted back to the state it was when the PDB was built (the file transitions to “matching” state). Once a file is in matching state it can’t change back to another state. We know that we have not applied any change to the code that was compiled from the file because we ignored the file while it was in out-of-sync state. Therefore we know that any changes made from now on can be safely applied to the debuggee.

If we can’t determine whether a file matches or not due to error reading the PDB or the source file content we can treat it similarly to out-of-sync file. That is, ignore any changes until we are able to confirm the file matches. That can happen if, e.g. the PDB is temporarily locked by another process and unlocked later.

Simplify implementation of GetStatusAsync.

Fixes VSO [1051496](https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1051496) ([VS feedback](https://developercommunity.visualstudio.com/content/problem/880533/edits-were-made-which-cannot-be-compiled-stop-debu.html))
上级 71028213
......@@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
......@@ -332,12 +333,14 @@ public static PathKind GetPathKind(string path)
return PathKind.Relative;
}
#nullable enable
/// <summary>
/// True if the path is an absolute path (rooted to drive or network share)
/// </summary>
public static bool IsAbsolute(string path)
public static bool IsAbsolute([NotNullWhen(true)]string? path)
{
if (string.IsNullOrEmpty(path))
if (RoslynString.IsNullOrEmpty(path))
{
return false;
}
......@@ -361,6 +364,8 @@ public static bool IsAbsolute(string path)
IsDirectorySeparator(path[1]);
}
#nullable restore
/// <summary>
/// Returns true if given path is absolute and starts with a drive specification ("C:\").
/// </summary>
......
......@@ -97,7 +97,7 @@ private sealed class Validator
ImmutableArray<ActiveStatementDebugInfo> activeStatements,
ImmutableDictionary<ActiveMethodId, ImmutableArray<NonRemappableRegion>> nonRemappableRegions = null,
Func<Solution, Solution> adjustSolution = null,
CommittedSolution.DocumentState initialState = CommittedSolution.DocumentState.MatchesDebuggee)
CommittedSolution.DocumentState initialState = CommittedSolution.DocumentState.MatchesBuildOutput)
{
var exportProviderFactory = ExportProviderCache.GetOrCreateExportProviderFactory(
TestExportProvider.MinimumCatalogWithCSharpAndVisualBasic.WithPart(typeof(CSharpEditAndContinueAnalyzer)).WithPart(typeof(DummyLanguageService)));
......@@ -544,7 +544,7 @@ static void M()
}, baseExceptionRegions.Select(r => r.Spans.IsDefault ? "out-of-sync" : "[" + string.Join(",", r.Spans) + "]"));
// document got synchronized:
validator.EditSession.DebuggingSession.LastCommittedSolution.Test_SetDocumentState(docs[0], CommittedSolution.DocumentState.MatchesDebuggee);
validator.EditSession.DebuggingSession.LastCommittedSolution.Test_SetDocumentState(docs[0], CommittedSolution.DocumentState.MatchesBuildOutput);
baseExceptionRegions = await validator.EditSession.GetBaseActiveExceptionRegionsAsync(CancellationToken.None).ConfigureAwait(false);
......
......@@ -186,7 +186,7 @@ public void CommitSolutionUpdate(PendingSolutionUpdate update)
}
}
LastCommittedSolution.CommitSolution(update.Solution, update.ChangedDocuments);
LastCommittedSolution.CommitSolution(update.Solution);
}
/// <summary>
......
......@@ -154,6 +154,7 @@ void AddGeneralDiagnostic(EditAndContinueErrorCode code, string resourceName, Di
AddGeneralDiagnostic(EditAndContinueErrorCode.ChangesDisallowedWhileStoppedAtException, nameof(FeaturesResources.ChangesDisallowedWhileStoppedAtException));
AddGeneralDiagnostic(EditAndContinueErrorCode.ChangesNotAppliedWhileRunning, nameof(FeaturesResources.ChangesNotAppliedWhileRunning), DiagnosticSeverity.Warning);
AddGeneralDiagnostic(EditAndContinueErrorCode.DocumentIsOutOfSyncWithDebuggee, nameof(FeaturesResources.DocumentIsOutOfSyncWithDebuggee), DiagnosticSeverity.Warning);
AddGeneralDiagnostic(EditAndContinueErrorCode.UnableToReadSourceFileOrPdb, nameof(FeaturesResources.UnableToReadSourceFileOrPdb), DiagnosticSeverity.Warning);
s_descriptors = builder.ToImmutable();
}
......
......@@ -9,5 +9,6 @@ internal enum EditAndContinueErrorCode
ChangesNotAppliedWhileRunning = 3,
ChangesDisallowedWhileStoppedAtException = 4,
DocumentIsOutOfSyncWithDebuggee = 5,
UnableToReadSourceFileOrPdb = 6,
}
}
......@@ -205,6 +205,7 @@ public async Task<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Docume
var (oldDocument, oldDocumentState) = await debuggingSession.LastCommittedSolution.GetDocumentAndStateAsync(document.Id, cancellationToken).ConfigureAwait(false);
if (oldDocumentState == CommittedSolution.DocumentState.OutOfSync ||
oldDocumentState == CommittedSolution.DocumentState.Indeterminate ||
oldDocumentState == CommittedSolution.DocumentState.DesignTimeOnly)
{
// Do not report diagnostics for existing out-of-sync documents or design-time-only documents.
......@@ -396,7 +397,7 @@ private void ClearReportedRunModeDiagnostics()
/// but does not provide a definitive answer. Only <see cref="EmitSolutionUpdateAsync"/> can definitively determine whether
/// the update is valid or not.
/// </returns>
public Task<SolutionUpdateStatus> GetSolutionUpdateStatusAsync(string sourceFilePath, CancellationToken cancellationToken)
public Task<bool> HasChangesAsync(string? sourceFilePath, CancellationToken cancellationToken)
{
// GetStatusAsync is called outside of edit session when the debugger is determining
// whether a source file checksum matches the one in PDB.
......@@ -404,10 +405,10 @@ public Task<SolutionUpdateStatus> GetSolutionUpdateStatusAsync(string sourceFile
var editSession = _editSession;
if (editSession == null)
{
return Task.FromResult(SolutionUpdateStatus.None);
return Task.FromResult(false);
}
return editSession.GetSolutionUpdateStatusAsync(_workspace.CurrentSolution, sourceFilePath, cancellationToken);
return editSession.HasChangesAsync(_workspace.CurrentSolution, sourceFilePath, cancellationToken);
}
public async Task<(SolutionUpdateStatus Summary, ImmutableArray<Deltas> Deltas)> EmitSolutionUpdateAsync(CancellationToken cancellationToken)
......@@ -428,8 +429,7 @@ public async Task<(SolutionUpdateStatus Summary, ImmutableArray<Deltas> Deltas)>
solution,
solutionUpdate.EmitBaselines,
solutionUpdate.Deltas,
solutionUpdate.ModuleReaders,
solutionUpdate.ChangedDocuments));
solutionUpdate.ModuleReaders));
// commit/discard was not called:
Contract.ThrowIfFalse(previousPendingUpdate == null);
......
......@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.EditAndContinue
internal interface IEditAndContinueWorkspaceService : IWorkspaceService
{
Task<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken);
Task<SolutionUpdateStatus> GetSolutionUpdateStatusAsync(string sourceFilePath, CancellationToken cancellationToken);
Task<bool> HasChangesAsync(string sourceFilePath, CancellationToken cancellationToken);
Task<(SolutionUpdateStatus Summary, ImmutableArray<Deltas> Deltas)> EmitSolutionUpdateAsync(CancellationToken cancellationToken);
void CommitSolutionUpdate();
......
......@@ -11,20 +11,17 @@ internal sealed class PendingSolutionUpdate
public readonly ImmutableArray<(ProjectId ProjectId, EmitBaseline Baseline)> EmitBaselines;
public readonly ImmutableArray<Deltas> Deltas;
public readonly ImmutableArray<IDisposable> ModuleReaders;
public readonly ImmutableArray<Document> ChangedDocuments;
public PendingSolutionUpdate(
Solution solution,
ImmutableArray<(ProjectId ProjectId, EmitBaseline Baseline)> emitBaselines,
ImmutableArray<Deltas> deltas,
ImmutableArray<IDisposable> moduleReaders,
ImmutableArray<Document> changedDocuments)
ImmutableArray<IDisposable> moduleReaders)
{
Solution = solution;
EmitBaselines = emitBaselines;
Deltas = deltas;
ModuleReaders = moduleReaders;
ChangedDocuments = changedDocuments;
}
}
}
......@@ -12,21 +12,18 @@ namespace Microsoft.CodeAnalysis.EditAndContinue
public readonly ImmutableArray<IDisposable> ModuleReaders;
public readonly ImmutableArray<(ProjectId ProjectId, EmitBaseline Baseline)> EmitBaselines;
public readonly ImmutableArray<(ProjectId ProjectId, ImmutableArray<Diagnostic> Diagnostic)> Diagnostics;
public readonly ImmutableArray<Document> ChangedDocuments;
public SolutionUpdate(
SolutionUpdateStatus summary,
ImmutableArray<Deltas> deltas,
ImmutableArray<IDisposable> moduleReaders,
ImmutableArray<(ProjectId, EmitBaseline)> emitBaselines,
ImmutableArray<Document> changedDocuments,
ImmutableArray<(ProjectId ProjectId, ImmutableArray<Diagnostic> Diagnostics)> diagnostics)
{
Summary = summary;
Deltas = deltas;
EmitBaselines = emitBaselines;
ModuleReaders = moduleReaders;
ChangedDocuments = changedDocuments;
Diagnostics = diagnostics;
}
......@@ -38,7 +35,6 @@ public static SolutionUpdate Blocked()
ImmutableArray<Deltas>.Empty,
ImmutableArray<IDisposable>.Empty,
ImmutableArray<(ProjectId, EmitBaseline)>.Empty,
ImmutableArray<Document>.Empty,
diagnostics);
}
}
......@@ -1347,7 +1347,7 @@ internal class FeaturesResources {
}
/// <summary>
/// Looks up a localized string similar to The current content of source file &apos;{0}&apos; does not match the built source. The debug session can&apos;t continue until the content of the source file is restored..
/// Looks up a localized string similar to The current content of source file &apos;{0}&apos; does not match the built source. Any changes made to this file while debugging won&apos;t be applied until its content matches the built source..
/// </summary>
internal static string DocumentIsOutOfSyncWithDebuggee {
get {
......@@ -4056,6 +4056,15 @@ internal class FeaturesResources {
}
}
/// <summary>
/// Looks up a localized string similar to Unable to read source file &apos;{0}&apos; or the PDB built for the containing project. Any changes made to this file while debugging won&apos;t be applied until its content matches the built source..
/// </summary>
internal static string UnableToReadSourceFileOrPdb {
get {
return ResourceManager.GetString("UnableToReadSourceFileOrPdb", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unexpected interface member kind: {0}.
/// </summary>
......
......@@ -1681,7 +1681,10 @@ This version used in: {2}</value>
<value>Changes made in project '{0}' will not be applied while the application is running</value>
</data>
<data name="DocumentIsOutOfSyncWithDebuggee" xml:space="preserve">
<value>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</value>
<value>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</value>
</data>
<data name="UnableToReadSourceFileOrPdb" xml:space="preserve">
<value>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</value>
</data>
<data name="ChangesDisallowedWhileStoppedAtException" xml:space="preserve">
<value>Changes are not allowed while stopped at exception</value>
......
......@@ -198,8 +198,8 @@
<note />
</trans-unit>
<trans-unit id="DocumentIsOutOfSyncWithDebuggee">
<source>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</source>
<target state="translated">Aktuální obsah zdrojového souboru {0} se neshoduje se sestaveným zdrojem. Relace ladění nemůže pokračovat, dokud se obsah zdrojového souboru neobnoví.</target>
<source>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="needs-review-translation">Aktuální obsah zdrojového souboru {0} se neshoduje se sestaveným zdrojem. Relace ladění nemůže pokračovat, dokud se obsah zdrojového souboru neobnoví.</target>
<note />
</trans-unit>
<trans-unit id="EditAndContinue">
......@@ -572,6 +572,11 @@
<target state="new">The selection contains a local function call without its declaration.</target>
<note />
</trans-unit>
<trans-unit id="UnableToReadSourceFileOrPdb">
<source>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="new">Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</target>
<note />
</trans-unit>
<trans-unit id="Unnecessary_assignment_of_a_value">
<source>Unnecessary assignment of a value</source>
<target state="translated">Nepotřebné přiřazení hodnoty</target>
......
......@@ -198,8 +198,8 @@
<note />
</trans-unit>
<trans-unit id="DocumentIsOutOfSyncWithDebuggee">
<source>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</source>
<target state="translated">Der aktuelle Inhalt der Quelldatei "{0}" stimmt nicht mit der erstellten Quelle überein. Die Debugsitzung kann erst fortgesetzt werden, wenn der Inhalt der Quelldatei wiederhergestellt wurde.</target>
<source>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="needs-review-translation">Der aktuelle Inhalt der Quelldatei "{0}" stimmt nicht mit der erstellten Quelle überein. Die Debugsitzung kann erst fortgesetzt werden, wenn der Inhalt der Quelldatei wiederhergestellt wurde.</target>
<note />
</trans-unit>
<trans-unit id="EditAndContinue">
......@@ -572,6 +572,11 @@
<target state="new">The selection contains a local function call without its declaration.</target>
<note />
</trans-unit>
<trans-unit id="UnableToReadSourceFileOrPdb">
<source>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="new">Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</target>
<note />
</trans-unit>
<trans-unit id="Unnecessary_assignment_of_a_value">
<source>Unnecessary assignment of a value</source>
<target state="translated">Unnötige Zuweisung eines Werts.</target>
......
......@@ -198,8 +198,8 @@
<note />
</trans-unit>
<trans-unit id="DocumentIsOutOfSyncWithDebuggee">
<source>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</source>
<target state="translated">El contenido actual del archivo de código fuente "{0}" no coincide con el del origen compilado. La sesión de depuración no puede continuar hasta que se restaure el contenido del archivo de código fuente.</target>
<source>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="needs-review-translation">El contenido actual del archivo de código fuente "{0}" no coincide con el del origen compilado. La sesión de depuración no puede continuar hasta que se restaure el contenido del archivo de código fuente.</target>
<note />
</trans-unit>
<trans-unit id="EditAndContinue">
......@@ -572,6 +572,11 @@
<target state="new">The selection contains a local function call without its declaration.</target>
<note />
</trans-unit>
<trans-unit id="UnableToReadSourceFileOrPdb">
<source>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="new">Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</target>
<note />
</trans-unit>
<trans-unit id="Unnecessary_assignment_of_a_value">
<source>Unnecessary assignment of a value</source>
<target state="translated">Asignación innecesaria de un valor</target>
......
......@@ -198,8 +198,8 @@
<note />
</trans-unit>
<trans-unit id="DocumentIsOutOfSyncWithDebuggee">
<source>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</source>
<target state="translated">Le contenu actuel du fichier source « {0} » ne correspond pas à la source générée. La session de débogage ne peut pas continuer tant que le contenu du fichier source n'est pas restauré.</target>
<source>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="needs-review-translation">Le contenu actuel du fichier source « {0} » ne correspond pas à la source générée. La session de débogage ne peut pas continuer tant que le contenu du fichier source n'est pas restauré.</target>
<note />
</trans-unit>
<trans-unit id="EditAndContinue">
......@@ -572,6 +572,11 @@
<target state="new">The selection contains a local function call without its declaration.</target>
<note />
</trans-unit>
<trans-unit id="UnableToReadSourceFileOrPdb">
<source>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="new">Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</target>
<note />
</trans-unit>
<trans-unit id="Unnecessary_assignment_of_a_value">
<source>Unnecessary assignment of a value</source>
<target state="translated">Assignation inutile d'une valeur</target>
......
......@@ -198,8 +198,8 @@
<note />
</trans-unit>
<trans-unit id="DocumentIsOutOfSyncWithDebuggee">
<source>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</source>
<target state="translated">Il contenuto corrente del file di origine '{0}' non corrisponde all'origine compilata. La sessione di debug non può continuare finché non viene ripristinato il contenuto del file di origine.</target>
<source>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="needs-review-translation">Il contenuto corrente del file di origine '{0}' non corrisponde all'origine compilata. La sessione di debug non può continuare finché non viene ripristinato il contenuto del file di origine.</target>
<note />
</trans-unit>
<trans-unit id="EditAndContinue">
......@@ -572,6 +572,11 @@
<target state="new">The selection contains a local function call without its declaration.</target>
<note />
</trans-unit>
<trans-unit id="UnableToReadSourceFileOrPdb">
<source>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="new">Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</target>
<note />
</trans-unit>
<trans-unit id="Unnecessary_assignment_of_a_value">
<source>Unnecessary assignment of a value</source>
<target state="translated">Assegnazione non necessaria di un valore</target>
......
......@@ -198,8 +198,8 @@
<note />
</trans-unit>
<trans-unit id="DocumentIsOutOfSyncWithDebuggee">
<source>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</source>
<target state="translated">ソース ファイル '{0}' の現在の内容はビルドされたソースと一致しません。ソース ファイルの内容が復元されるまで、デバッグ セッションを続行できません。</target>
<source>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="needs-review-translation">ソース ファイル '{0}' の現在の内容はビルドされたソースと一致しません。ソース ファイルの内容が復元されるまで、デバッグ セッションを続行できません。</target>
<note />
</trans-unit>
<trans-unit id="EditAndContinue">
......@@ -572,6 +572,11 @@
<target state="new">The selection contains a local function call without its declaration.</target>
<note />
</trans-unit>
<trans-unit id="UnableToReadSourceFileOrPdb">
<source>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="new">Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</target>
<note />
</trans-unit>
<trans-unit id="Unnecessary_assignment_of_a_value">
<source>Unnecessary assignment of a value</source>
<target state="translated">値の不必要な代入</target>
......
......@@ -198,8 +198,8 @@
<note />
</trans-unit>
<trans-unit id="DocumentIsOutOfSyncWithDebuggee">
<source>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</source>
<target state="translated">소스 파일 '{0}'의 현재 콘텐츠가 빌드된 소스와 일치하지 않습니다. 소스 파일의 콘텐츠가 복원될 때까지 디버그 세션을 계속할 수 없습니다.</target>
<source>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="needs-review-translation">소스 파일 '{0}'의 현재 콘텐츠가 빌드된 소스와 일치하지 않습니다. 소스 파일의 콘텐츠가 복원될 때까지 디버그 세션을 계속할 수 없습니다.</target>
<note />
</trans-unit>
<trans-unit id="EditAndContinue">
......@@ -572,6 +572,11 @@
<target state="new">The selection contains a local function call without its declaration.</target>
<note />
</trans-unit>
<trans-unit id="UnableToReadSourceFileOrPdb">
<source>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="new">Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</target>
<note />
</trans-unit>
<trans-unit id="Unnecessary_assignment_of_a_value">
<source>Unnecessary assignment of a value</source>
<target state="translated">불필요한 값 할당</target>
......
......@@ -198,8 +198,8 @@
<note />
</trans-unit>
<trans-unit id="DocumentIsOutOfSyncWithDebuggee">
<source>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</source>
<target state="translated">Bieżąca zawartość pliku źródłowego „{0}” nie pasuje do skompilowanego źródła. Nie można kontynuować sesji debugowania do czasu przywrócenia zawartości pliku źródłowego.</target>
<source>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="needs-review-translation">Bieżąca zawartość pliku źródłowego „{0}” nie pasuje do skompilowanego źródła. Nie można kontynuować sesji debugowania do czasu przywrócenia zawartości pliku źródłowego.</target>
<note />
</trans-unit>
<trans-unit id="EditAndContinue">
......@@ -572,6 +572,11 @@
<target state="new">The selection contains a local function call without its declaration.</target>
<note />
</trans-unit>
<trans-unit id="UnableToReadSourceFileOrPdb">
<source>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="new">Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</target>
<note />
</trans-unit>
<trans-unit id="Unnecessary_assignment_of_a_value">
<source>Unnecessary assignment of a value</source>
<target state="translated">Niepotrzebne przypisanie wartości</target>
......
......@@ -198,8 +198,8 @@
<note />
</trans-unit>
<trans-unit id="DocumentIsOutOfSyncWithDebuggee">
<source>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</source>
<target state="translated">O conteúdo atual do arquivo de origem '{0}' não corresponde à fonte compilada. A sessão de depuração não pode continuar até que o conteúdo do arquivo de origem seja restaurado.</target>
<source>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="needs-review-translation">O conteúdo atual do arquivo de origem '{0}' não corresponde à fonte compilada. A sessão de depuração não pode continuar até que o conteúdo do arquivo de origem seja restaurado.</target>
<note />
</trans-unit>
<trans-unit id="EditAndContinue">
......@@ -572,6 +572,11 @@
<target state="new">The selection contains a local function call without its declaration.</target>
<note />
</trans-unit>
<trans-unit id="UnableToReadSourceFileOrPdb">
<source>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="new">Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</target>
<note />
</trans-unit>
<trans-unit id="Unnecessary_assignment_of_a_value">
<source>Unnecessary assignment of a value</source>
<target state="translated">Atribuição desnecessária de um valor</target>
......
......@@ -198,8 +198,8 @@
<note />
</trans-unit>
<trans-unit id="DocumentIsOutOfSyncWithDebuggee">
<source>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</source>
<target state="translated">Текущее содержимое исходного файла "{0}" не соответствует созданному источнику. Сеанс отладки не может быть продолжен, пока не будет восстановлено содержимое исходного файла.</target>
<source>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="needs-review-translation">Текущее содержимое исходного файла "{0}" не соответствует созданному источнику. Сеанс отладки не может быть продолжен, пока не будет восстановлено содержимое исходного файла.</target>
<note />
</trans-unit>
<trans-unit id="EditAndContinue">
......@@ -572,6 +572,11 @@
<target state="new">The selection contains a local function call without its declaration.</target>
<note />
</trans-unit>
<trans-unit id="UnableToReadSourceFileOrPdb">
<source>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="new">Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</target>
<note />
</trans-unit>
<trans-unit id="Unnecessary_assignment_of_a_value">
<source>Unnecessary assignment of a value</source>
<target state="translated">Ненужное присваивание значения</target>
......
......@@ -198,8 +198,8 @@
<note />
</trans-unit>
<trans-unit id="DocumentIsOutOfSyncWithDebuggee">
<source>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</source>
<target state="translated">'{0}' kaynak dosyasının geçerli içeriği, oluşturulan kaynakla eşleşmiyor. Hata ayıklama oturumu, kaynak dosyanın içeriği geri yüklenene kadar devam edemez.</target>
<source>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="needs-review-translation">'{0}' kaynak dosyasının geçerli içeriği, oluşturulan kaynakla eşleşmiyor. Hata ayıklama oturumu, kaynak dosyanın içeriği geri yüklenene kadar devam edemez.</target>
<note />
</trans-unit>
<trans-unit id="EditAndContinue">
......@@ -572,6 +572,11 @@
<target state="new">The selection contains a local function call without its declaration.</target>
<note />
</trans-unit>
<trans-unit id="UnableToReadSourceFileOrPdb">
<source>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="new">Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</target>
<note />
</trans-unit>
<trans-unit id="Unnecessary_assignment_of_a_value">
<source>Unnecessary assignment of a value</source>
<target state="translated">Bir değerin gereksiz ataması</target>
......
......@@ -198,8 +198,8 @@
<note />
</trans-unit>
<trans-unit id="DocumentIsOutOfSyncWithDebuggee">
<source>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</source>
<target state="translated">源文件 "{0}" 的当前内容与生成的源不匹配。除非还原源文件的内容,否则调试会话将无法继续。</target>
<source>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="needs-review-translation">源文件 "{0}" 的当前内容与生成的源不匹配。除非还原源文件的内容,否则调试会话将无法继续。</target>
<note />
</trans-unit>
<trans-unit id="EditAndContinue">
......@@ -572,6 +572,11 @@
<target state="new">The selection contains a local function call without its declaration.</target>
<note />
</trans-unit>
<trans-unit id="UnableToReadSourceFileOrPdb">
<source>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="new">Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</target>
<note />
</trans-unit>
<trans-unit id="Unnecessary_assignment_of_a_value">
<source>Unnecessary assignment of a value</source>
<target state="translated">不需要赋值</target>
......
......@@ -198,8 +198,8 @@
<note />
</trans-unit>
<trans-unit id="DocumentIsOutOfSyncWithDebuggee">
<source>The current content of source file '{0}' does not match the built source. The debug session can't continue until the content of the source file is restored.</source>
<target state="translated">來源檔案 '{0}' 的目前內容與建立的來源不符。在還原來源檔案的內容之前,無法繼續進行偵錯工作階段。</target>
<source>The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="needs-review-translation">來源檔案 '{0}' 的目前內容與建立的來源不符。在還原來源檔案的內容之前,無法繼續進行偵錯工作階段。</target>
<note />
</trans-unit>
<trans-unit id="EditAndContinue">
......@@ -572,6 +572,11 @@
<target state="new">The selection contains a local function call without its declaration.</target>
<note />
</trans-unit>
<trans-unit id="UnableToReadSourceFileOrPdb">
<source>Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</source>
<target state="new">Unable to read source file '{0}' or the PDB built for the containing project. Any changes made to this file while debugging won't be applied until its content matches the built source.</target>
<note />
</trans-unit>
<trans-unit id="Unnecessary_assignment_of_a_value">
<source>Unnecessary assignment of a value</source>
<target state="translated">指派了不必要的值</target>
......
......@@ -50,6 +50,8 @@
<Compile Include="..\..\Compilers\Core\Portable\InternalUtilities\FatalError.cs" Link="Utilities\FatalError.cs" />
<Compile Include="..\..\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs" Link="Utilities\FileNameUtilities.cs" />
<Compile Include="..\..\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs" Link="Utilities\PlatformInformation.cs" />
<Compile Include="..\..\Compilers\Core\Portable\InternalUtilities\Debug.cs" Link="Utilities\Debug.cs" />
<Compile Include="..\..\Compilers\Core\Portable\InternalUtilities\RoslynString.cs" Link="Utilities\RoslynString.cs" />
<Compile Include="..\..\Compilers\Core\Portable\InternalUtilities\Hash.cs" Link="Utilities\Hash.cs" />
<Compile Include="..\..\Compilers\Core\Portable\FileSystem\FileUtilities.cs" Link="Utilities\FileUtilities.cs" />
<Compile Include="..\..\Compilers\Core\Portable\FileSystem\PathUtilities.cs" Link="Utilities\PathUtilities.cs" />
......
......@@ -33,12 +33,20 @@ public Task<ManagedModuleUpdateStatus> GetStatusAsync(CancellationToken cancella
/// Returns the state of the changes made to the source.
/// The EnC manager calls this to determine whether there are any changes to the source
/// and if so whether there are any rude edits.
///
/// TODO: Future work in the debugger https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1051385 will replace this with bool HasChangesAsync.
/// The debugger currently uses <see cref="SolutionUpdateStatus.Ready"/> as a signal to trigger emit of updates
/// (i.e. to call <see cref="GetManagedModuleUpdatesAsync(CancellationToken)"/>).
/// When <see cref="SolutionUpdateStatus.Blocked"/> is returned updates are not emitted.
/// Since <see cref="GetManagedModuleUpdatesAsync(CancellationToken)"/> already handles all validation and error reporting
/// we either return <see cref="SolutionUpdateStatus.None"/> if there are no changes or <see cref="SolutionUpdateStatus.Ready"/> if there are any changes.
/// </summary>
public async Task<ManagedModuleUpdateStatus> GetStatusAsync(string sourceFilePath, CancellationToken cancellationToken)
{
try
{
return (await _encService.GetSolutionUpdateStatusAsync(sourceFilePath, cancellationToken).ConfigureAwait(false)).ToModuleUpdateStatus();
return (await _encService.HasChangesAsync(sourceFilePath, cancellationToken).ConfigureAwait(false)) ?
ManagedModuleUpdateStatus.Ready : ManagedModuleUpdateStatus.None;
}
catch (Exception e) when (FatalError.ReportWithoutCrashUnlessCanceled(e))
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册