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

Recover from an unexpected exception during EnC document analysis (#29330)

上级 de17e32f
......@@ -61,7 +61,8 @@ public void ToDiagnostic()
RudeEditKind.ChangingCapturedVariableType,
RudeEditKind.AccessingCapturedVariableInLambda,
RudeEditKind.NotAccessingCapturedVariableInLambda,
RudeEditKind.RenamingCapturedVariable
RudeEditKind.RenamingCapturedVariable,
RudeEditKind.InternalError,
};
var arg3 = new HashSet<RudeEditKind>()
......
......@@ -508,7 +508,9 @@ private SyntaxNode FindStatement(SyntaxNode declarationBody, int position, out i
}
catch (Exception e) when (ReportFatalErrorAnalyzeDocumentAsync(baseActiveStatements, e))
{
throw ExceptionUtilities.Unreachable;
// The same behavior as if there was a syntax error - we are unable to analyze the document.
return DocumentAnalysisResults.SyntaxErrors(ImmutableArray.Create(
new RudeEditDiagnostic(RudeEditKind.InternalError, span: default, arguments: new[] { document.FilePath, e.ToString() })));
}
}
......@@ -523,7 +525,7 @@ private static bool ReportFatalErrorAnalyzeDocumentAsync(ImmutableArray<ActiveSt
s_fatalErrorBaseActiveStatements = baseActiveStatements.ToArray();
}
return FatalError.ReportUnlessCanceled(e);
return FatalError.ReportWithoutCrashUnlessCanceled(e);
}
internal Dictionary<SyntaxNode, EditKind> BuildEditMap(EditScript<SyntaxNode> editScript)
......
......@@ -80,9 +80,10 @@ internal static class RudeEditDiagnosticDescriptors
{ GetDescriptorPair(RudeEditKind.UpdatingStateMachineMethodAroundActiveStatement, FeaturesResources.Updating_async_or_iterator_modifier_around_an_active_statement_will_prevent_the_debug_session_from_continuing) },
{ GetDescriptorPair(RudeEditKind.UpdatingStateMachineMethodMissingAttribute, FeaturesResources.Attribute_0_is_missing_Updating_an_async_method_or_an_iterator_will_prevent_the_debug_session_from_continuing) },
{ GetDescriptorPair(RudeEditKind.SwitchBetweenLambdaAndLocalFunction, FeaturesResources.Switching_between_lambda_and_local_function_will_prevent_the_debug_session_from_continuing ) },
{ GetDescriptorPair(RudeEditKind.RefStruct, FeaturesResources.Using_ref_structs_will_prevent_the_debug_session_from_continuing) },
{ GetDescriptorPair(RudeEditKind.ReadOnlyStruct, FeaturesResources.Using_readonly_structs_will_prevent_the_debug_session_from_continuing) },
{ GetDescriptorPair(RudeEditKind.ReadOnlyReferences, FeaturesResources.Using_readonly_references_will_prevent_the_debug_session_from_continuing) },
{ GetDescriptorPair(RudeEditKind.RefStruct, FeaturesResources.Using_ref_structs_will_prevent_the_debug_session_from_continuing) },
{ GetDescriptorPair(RudeEditKind.ReadOnlyStruct, FeaturesResources.Using_readonly_structs_will_prevent_the_debug_session_from_continuing) },
{ GetDescriptorPair(RudeEditKind.ReadOnlyReferences, FeaturesResources.Using_readonly_references_will_prevent_the_debug_session_from_continuing) },
{ GetDescriptorPair(RudeEditKind.InternalError, FeaturesResources.Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error) },
{ GetDescriptorPair(RudeEditKind.RUDE_EDIT_COMPLEX_QUERY_EXPRESSION, FeaturesResources.Modifying_0_which_contains_an_Aggregate_Group_By_or_Join_query_clauses_will_prevent_the_debug_session_from_continuing) },
// VB specific,
......
......@@ -97,6 +97,8 @@ internal enum RudeEditKind : ushort
ReadOnlyStruct = 78,
ReadOnlyReferences = 79,
InternalError = 80,
// TODO: remove values below
RUDE_EDIT_COMPLEX_QUERY_EXPRESSION = 0x103,
}
......
......@@ -2222,6 +2222,16 @@ internal class FeaturesResources {
}
}
/// <summary>
/// Looks up a localized string similar to Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}..
/// </summary>
internal static string Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error {
get {
return ResourceManager.GetString("Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_inter" +
"nal_error", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Modifying source with experimental language features enabled will prevent the debug session from continuing..
/// </summary>
......
......@@ -1379,4 +1379,7 @@ This version used in: {2}</value>
<data name="Formatting_document" xml:space="preserve">
<value>Formatting document</value>
</data>
<data name="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error" xml:space="preserve">
<value>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</value>
</data>
</root>
\ No newline at end of file
......@@ -37,6 +37,11 @@
<target state="new">Formatting document</target>
<note />
</trans-unit>
<trans-unit id="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error">
<source>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</source>
<target state="new">Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</target>
<note />
</trans-unit>
<trans-unit id="Related_method_signatures_found_in_metadata_will_not_be_updated">
<source>Related method signatures found in metadata will not be updated.</source>
<target state="new">Related method signatures found in metadata will not be updated.</target>
......
......@@ -37,6 +37,11 @@
<target state="new">Formatting document</target>
<note />
</trans-unit>
<trans-unit id="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error">
<source>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</source>
<target state="new">Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</target>
<note />
</trans-unit>
<trans-unit id="Related_method_signatures_found_in_metadata_will_not_be_updated">
<source>Related method signatures found in metadata will not be updated.</source>
<target state="new">Related method signatures found in metadata will not be updated.</target>
......
......@@ -37,6 +37,11 @@
<target state="new">Formatting document</target>
<note />
</trans-unit>
<trans-unit id="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error">
<source>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</source>
<target state="new">Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</target>
<note />
</trans-unit>
<trans-unit id="Related_method_signatures_found_in_metadata_will_not_be_updated">
<source>Related method signatures found in metadata will not be updated.</source>
<target state="new">Related method signatures found in metadata will not be updated.</target>
......
......@@ -37,6 +37,11 @@
<target state="new">Formatting document</target>
<note />
</trans-unit>
<trans-unit id="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error">
<source>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</source>
<target state="new">Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</target>
<note />
</trans-unit>
<trans-unit id="Related_method_signatures_found_in_metadata_will_not_be_updated">
<source>Related method signatures found in metadata will not be updated.</source>
<target state="new">Related method signatures found in metadata will not be updated.</target>
......
......@@ -37,6 +37,11 @@
<target state="new">Formatting document</target>
<note />
</trans-unit>
<trans-unit id="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error">
<source>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</source>
<target state="new">Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</target>
<note />
</trans-unit>
<trans-unit id="Related_method_signatures_found_in_metadata_will_not_be_updated">
<source>Related method signatures found in metadata will not be updated.</source>
<target state="new">Related method signatures found in metadata will not be updated.</target>
......
......@@ -37,6 +37,11 @@
<target state="new">Formatting document</target>
<note />
</trans-unit>
<trans-unit id="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error">
<source>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</source>
<target state="new">Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</target>
<note />
</trans-unit>
<trans-unit id="Related_method_signatures_found_in_metadata_will_not_be_updated">
<source>Related method signatures found in metadata will not be updated.</source>
<target state="new">Related method signatures found in metadata will not be updated.</target>
......
......@@ -37,6 +37,11 @@
<target state="new">Formatting document</target>
<note />
</trans-unit>
<trans-unit id="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error">
<source>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</source>
<target state="new">Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</target>
<note />
</trans-unit>
<trans-unit id="Related_method_signatures_found_in_metadata_will_not_be_updated">
<source>Related method signatures found in metadata will not be updated.</source>
<target state="new">Related method signatures found in metadata will not be updated.</target>
......
......@@ -37,6 +37,11 @@
<target state="new">Formatting document</target>
<note />
</trans-unit>
<trans-unit id="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error">
<source>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</source>
<target state="new">Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</target>
<note />
</trans-unit>
<trans-unit id="Related_method_signatures_found_in_metadata_will_not_be_updated">
<source>Related method signatures found in metadata will not be updated.</source>
<target state="new">Related method signatures found in metadata will not be updated.</target>
......
......@@ -37,6 +37,11 @@
<target state="new">Formatting document</target>
<note />
</trans-unit>
<trans-unit id="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error">
<source>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</source>
<target state="new">Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</target>
<note />
</trans-unit>
<trans-unit id="Related_method_signatures_found_in_metadata_will_not_be_updated">
<source>Related method signatures found in metadata will not be updated.</source>
<target state="new">Related method signatures found in metadata will not be updated.</target>
......
......@@ -37,6 +37,11 @@
<target state="new">Formatting document</target>
<note />
</trans-unit>
<trans-unit id="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error">
<source>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</source>
<target state="new">Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</target>
<note />
</trans-unit>
<trans-unit id="Related_method_signatures_found_in_metadata_will_not_be_updated">
<source>Related method signatures found in metadata will not be updated.</source>
<target state="new">Related method signatures found in metadata will not be updated.</target>
......
......@@ -37,6 +37,11 @@
<target state="new">Formatting document</target>
<note />
</trans-unit>
<trans-unit id="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error">
<source>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</source>
<target state="new">Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</target>
<note />
</trans-unit>
<trans-unit id="Related_method_signatures_found_in_metadata_will_not_be_updated">
<source>Related method signatures found in metadata will not be updated.</source>
<target state="new">Related method signatures found in metadata will not be updated.</target>
......
......@@ -37,6 +37,11 @@
<target state="new">Formatting document</target>
<note />
</trans-unit>
<trans-unit id="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error">
<source>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</source>
<target state="new">Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</target>
<note />
</trans-unit>
<trans-unit id="Related_method_signatures_found_in_metadata_will_not_be_updated">
<source>Related method signatures found in metadata will not be updated.</source>
<target state="new">Related method signatures found in metadata will not be updated.</target>
......
......@@ -37,6 +37,11 @@
<target state="new">Formatting document</target>
<note />
</trans-unit>
<trans-unit id="Modifying_source_file_will_prevent_the_debug_session_from_continuing_due_to_internal_error">
<source>Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</source>
<target state="new">Modifying source file {0} will prevent the debug session from continuing due to internal error: {1}.</target>
<note />
</trans-unit>
<trans-unit id="Related_method_signatures_found_in_metadata_will_not_be_updated">
<source>Related method signatures found in metadata will not be updated.</source>
<target state="new">Related method signatures found in metadata will not be updated.</target>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册