提交 fab958dc 编写于 作者: T Tomáš Matoušek

Improve and localize EnC error message (#11381)

上级 2d797bb9
...@@ -3517,6 +3517,15 @@ internal class CSharpResources { ...@@ -3517,6 +3517,15 @@ internal class CSharpResources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Cannot update &apos;{0}&apos;; attribute &apos;{1}&apos; is missing..
/// </summary>
internal static string ERR_EncUpdateFailedMissingAttribute {
get {
return ResourceManager.GetString("ERR_EncUpdateFailedMissingAttribute", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to #endif directive expected. /// Looks up a localized string similar to #endif directive expected.
/// </summary> /// </summary>
......
...@@ -3833,6 +3833,9 @@ You should consider suppressing the warning only if you're sure that you don't w ...@@ -3833,6 +3833,9 @@ You should consider suppressing the warning only if you're sure that you don't w
<data name="ERR_FixedLocalInLambda" xml:space="preserve"> <data name="ERR_FixedLocalInLambda" xml:space="preserve">
<value>Cannot use fixed local '{0}' inside an anonymous method, lambda expression, or query expression</value> <value>Cannot use fixed local '{0}' inside an anonymous method, lambda expression, or query expression</value>
</data> </data>
<data name="ERR_EncUpdateFailedMissingAttribute" xml:space="preserve">
<value>Cannot update '{0}'; attribute '{1}' is missing.</value>
</data>
<data name="ERR_ExpressionTreeContainsNamedArgument" xml:space="preserve"> <data name="ERR_ExpressionTreeContainsNamedArgument" xml:space="preserve">
<value>An expression tree may not contain a named argument specification</value> <value>An expression tree may not contain a named argument specification</value>
</data> </data>
......
...@@ -1174,6 +1174,7 @@ internal enum ErrorCode ...@@ -1174,6 +1174,7 @@ internal enum ErrorCode
// ERR_NameIllegallyOverrides3 = 7040, // Not used anymore due to 'Single Meaning' relaxation changes // ERR_NameIllegallyOverrides3 = 7040, // Not used anymore due to 'Single Meaning' relaxation changes
ERR_ResourceFileNameNotUnique = 7041, ERR_ResourceFileNameNotUnique = 7041,
ERR_DllImportOnGenericMethod = 7042, ERR_DllImportOnGenericMethod = 7042,
ERR_EncUpdateFailedMissingAttribute = 7043,
ERR_ParameterNotValidForType = 7045, ERR_ParameterNotValidForType = 7045,
ERR_AttributeParameterRequired1 = 7046, ERR_AttributeParameterRequired1 = 7046,
......
...@@ -95,7 +95,7 @@ public override Diagnostic CreateDiagnostic(int code, Location location, params ...@@ -95,7 +95,7 @@ public override Diagnostic CreateDiagnostic(int code, Location location, params
return new CSDiagnostic(info, location); return new CSDiagnostic(info, location);
} }
public override string ConvertSymbolToString(int errorCode, ISymbol symbol) public override string GetErrorDisplayString(ISymbol symbol)
{ {
// show extra info for assembly if possible such as version, public key token etc. // show extra info for assembly if possible such as version, public key token etc.
if (symbol.Kind == SymbolKind.Assembly || symbol.Kind == SymbolKind.Namespace) if (symbol.Kind == SymbolKind.Assembly || symbol.Kind == SymbolKind.Namespace)
...@@ -205,6 +205,7 @@ public override void ReportDuplicateMetadataReferenceWeak(DiagnosticBag diagnost ...@@ -205,6 +205,7 @@ public override void ReportDuplicateMetadataReferenceWeak(DiagnosticBag diagnost
public override int ERR_TooManyUserStrings { get { return (int)ErrorCode.ERR_TooManyUserStrings; } } public override int ERR_TooManyUserStrings { get { return (int)ErrorCode.ERR_TooManyUserStrings; } }
public override int ERR_PeWritingFailure { get { return (int)ErrorCode.ERR_PeWritingFailure; } } public override int ERR_PeWritingFailure { get { return (int)ErrorCode.ERR_PeWritingFailure; } }
public override int ERR_ModuleEmitFailure { get { return (int)ErrorCode.ERR_ModuleEmitFailure; } } public override int ERR_ModuleEmitFailure { get { return (int)ErrorCode.ERR_ModuleEmitFailure; } }
public override int ERR_EncUpdateFailedMissingAttribute { get { return (int)ErrorCode.ERR_EncUpdateFailedMissingAttribute; } }
public override void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute) public override void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute)
{ {
......
...@@ -4756,8 +4756,8 @@ public IEnumerable<int> F() ...@@ -4756,8 +4756,8 @@ public IEnumerable<int> F()
new SemanticEdit(SemanticEditKind.Update, f0, f1, GetSyntaxMapFromMarkers(source0, source1), preserveLocalVariables: true))); new SemanticEdit(SemanticEditKind.Update, f0, f1, GetSyntaxMapFromMarkers(source0, source1), preserveLocalVariables: true)));
diff1.EmitResult.Diagnostics.Verify( diff1.EmitResult.Diagnostics.Verify(
// error CS7038: Failed to emit module '{0}'. // error CS7043: Cannot update 'C.F()'; attribute 'System.Runtime.CompilerServices.IteratorStateMachineAttribute' is missing.
Diagnostic(ErrorCode.ERR_ModuleEmitFailure).WithArguments(compilation0.SourceModule.Name)); Diagnostic(ErrorCode.ERR_EncUpdateFailedMissingAttribute).WithArguments("C.F()", "System.Runtime.CompilerServices.IteratorStateMachineAttribute"));
} }
[Fact, WorkItem(9119, "https://github.com/dotnet/roslyn/issues/9119")] [Fact, WorkItem(9119, "https://github.com/dotnet/roslyn/issues/9119")]
...@@ -4811,10 +4811,10 @@ public async Task<int> F() ...@@ -4811,10 +4811,10 @@ public async Task<int> F()
new SemanticEdit(SemanticEditKind.Update, f0, f1, GetSyntaxMapFromMarkers(source0, source1), preserveLocalVariables: true))); new SemanticEdit(SemanticEditKind.Update, f0, f1, GetSyntaxMapFromMarkers(source0, source1), preserveLocalVariables: true)));
diff1.EmitResult.Diagnostics.Verify( diff1.EmitResult.Diagnostics.Verify(
// error CS7038: Failed to emit module '{0}'. // error CS7043: Cannot update 'C.F()'; attribute 'System.Runtime.CompilerServices.AsyncStateMachineAttribute' is missing.
Diagnostic(ErrorCode.ERR_ModuleEmitFailure).WithArguments(compilation0.SourceModule.Name), Diagnostic(ErrorCode.ERR_EncUpdateFailedMissingAttribute).WithArguments("C.F()", "System.Runtime.CompilerServices.AsyncStateMachineAttribute"),
// error CS7038: Failed to emit module '{0}'. // error CS7043: Cannot update 'C.F()'; attribute 'System.Runtime.CompilerServices.AsyncStateMachineAttribute' is missing.
Diagnostic(ErrorCode.ERR_ModuleEmitFailure).WithArguments(compilation0.SourceModule.Name)); Diagnostic(ErrorCode.ERR_EncUpdateFailedMissingAttribute).WithArguments("C.F()", "System.Runtime.CompilerServices.AsyncStateMachineAttribute"));
} }
} }
} }
...@@ -2226,9 +2226,9 @@ public override int GetWarningLevel(int code) ...@@ -2226,9 +2226,9 @@ public override int GetWarningLevel(int code)
} }
} }
public override string ConvertSymbolToString(int errorCode, ISymbol symbol) public override string GetErrorDisplayString(ISymbol symbol)
{ {
return MessageProvider.Instance.ConvertSymbolToString(errorCode, symbol); return MessageProvider.Instance.GetErrorDisplayString(symbol);
} }
} }
......
...@@ -314,6 +314,15 @@ internal class CodeAnalysisResources { ...@@ -314,6 +314,15 @@ internal class CodeAnalysisResources {
} }
} }
/// <summary>
/// Looks up a localized string similar to The compilation references multiple assemblies whose versions only differ in auto-generated build and/or revision numbers..
/// </summary>
internal static string CompilationReferencesAssembliesWithDifferentAutoGeneratedVersion {
get {
return ResourceManager.GetString("CompilationReferencesAssembliesWithDifferentAutoGeneratedVersion", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Analyzer Failure. /// Looks up a localized string similar to Analyzer Failure.
/// </summary> /// </summary>
......
...@@ -516,4 +516,7 @@ ...@@ -516,4 +516,7 @@
<data name="IOperationFeatureDisabled" xml:space="preserve"> <data name="IOperationFeatureDisabled" xml:space="preserve">
<value>Feature 'IOperation' is disabled.</value> <value>Feature 'IOperation' is disabled.</value>
</data> </data>
<data name="CompilationReferencesAssembliesWithDifferentAutoGeneratedVersion" xml:space="preserve">
<value>The compilation references multiple assemblies whose versions only differ in auto-generated build and/or revision numbers.</value>
</data>
</root> </root>
\ No newline at end of file
...@@ -86,9 +86,9 @@ public Diagnostic CreateDiagnostic(int code, Location location) ...@@ -86,9 +86,9 @@ public Diagnostic CreateDiagnostic(int code, Location location)
public abstract string GetMessagePrefix(string id, DiagnosticSeverity severity, bool isWarningAsError, CultureInfo culture); public abstract string GetMessagePrefix(string id, DiagnosticSeverity severity, bool isWarningAsError, CultureInfo culture);
/// <summary> /// <summary>
/// convert given symbol to string representation based on given error code /// Convert given symbol to string representation.
/// </summary> /// </summary>
public abstract string ConvertSymbolToString(int errorCode, ISymbol symbol); public abstract string GetErrorDisplayString(ISymbol symbol);
/// <summary> /// <summary>
/// Given an error code (like 1234) return the identifier (CS1234 or BC1234). /// Given an error code (like 1234) return the identifier (CS1234 or BC1234).
...@@ -206,6 +206,7 @@ public DiagnosticInfo FilterDiagnosticInfo(DiagnosticInfo diagnosticInfo, Compil ...@@ -206,6 +206,7 @@ public DiagnosticInfo FilterDiagnosticInfo(DiagnosticInfo diagnosticInfo, Compil
public abstract int ERR_TooManyUserStrings { get; } public abstract int ERR_TooManyUserStrings { get; }
public abstract int ERR_PeWritingFailure { get; } public abstract int ERR_PeWritingFailure { get; }
public abstract int ERR_ModuleEmitFailure { get; } public abstract int ERR_ModuleEmitFailure { get; }
public abstract int ERR_EncUpdateFailedMissingAttribute { get; }
public abstract void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute); public abstract void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute);
public abstract void ReportInvalidNamedArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex, ITypeSymbol attributeClass, string parameterName); public abstract void ReportInvalidNamedArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex, ITypeSymbol attributeClass, string parameterName);
......
...@@ -356,7 +356,7 @@ protected object[] GetArgumentsToUse(IFormatProvider formatProvider) ...@@ -356,7 +356,7 @@ protected object[] GetArgumentsToUse(IFormatProvider formatProvider)
if (symbol != null) if (symbol != null)
{ {
argumentsToUse = InitializeArgumentListIfNeeded(argumentsToUse); argumentsToUse = InitializeArgumentListIfNeeded(argumentsToUse);
argumentsToUse[i] = _messageProvider.ConvertSymbolToString(_errorCode, symbol); argumentsToUse[i] = _messageProvider.GetErrorDisplayString(symbol);
} }
} }
......
...@@ -194,8 +194,7 @@ private bool TryGetPreviousLocalId(SyntaxNode currentDeclarator, LocalDebugId cu ...@@ -194,8 +194,7 @@ private bool TryGetPreviousLocalId(SyntaxNode currentDeclarator, LocalDebugId cu
// Should rarely happen since the IDE reports a rude edit if the attribute type doesn't exist. // Should rarely happen since the IDE reports a rude edit if the attribute type doesn't exist.
if (_hoistedLocalSlotsOpt == null) if (_hoistedLocalSlotsOpt == null)
{ {
// TODO: better error message https://github.com/dotnet/roslyn/issues/9196 ReportMissingStateMachineAttribute(diagnostics);
diagnostics.Add(_messageProvider.CreateDiagnostic(_messageProvider.ERR_ModuleEmitFailure, NoLocation.Singleton, _previousTopLevelMethod.ContainingModule.Name));
slotIndex = -1; slotIndex = -1;
return false; return false;
} }
...@@ -230,8 +229,7 @@ public override bool TryGetPreviousAwaiterSlotIndex(Cci.ITypeReference currentTy ...@@ -230,8 +229,7 @@ public override bool TryGetPreviousAwaiterSlotIndex(Cci.ITypeReference currentTy
// Should rarely happen since the IDE reports a rude edit if the attribute type doesn't exist. // Should rarely happen since the IDE reports a rude edit if the attribute type doesn't exist.
if (_awaiterMapOpt == null) if (_awaiterMapOpt == null)
{ {
// TODO: better error message https://github.com/dotnet/roslyn/issues/9196 ReportMissingStateMachineAttribute(diagnostics);
diagnostics.Add(_messageProvider.CreateDiagnostic(_messageProvider.ERR_ModuleEmitFailure, NoLocation.Singleton, _previousTopLevelMethod.ContainingModule.Name));
slotIndex = -1; slotIndex = -1;
return false; return false;
} }
...@@ -239,6 +237,16 @@ public override bool TryGetPreviousAwaiterSlotIndex(Cci.ITypeReference currentTy ...@@ -239,6 +237,16 @@ public override bool TryGetPreviousAwaiterSlotIndex(Cci.ITypeReference currentTy
return _awaiterMapOpt.TryGetValue(_symbolMap.MapReference(currentType), out slotIndex); return _awaiterMapOpt.TryGetValue(_symbolMap.MapReference(currentType), out slotIndex);
} }
private void ReportMissingStateMachineAttribute(DiagnosticBag diagnostics)
{
diagnostics.Add(_messageProvider.CreateDiagnostic(
_messageProvider.ERR_EncUpdateFailedMissingAttribute,
NoLocation.Singleton,
_messageProvider.GetErrorDisplayString(_previousTopLevelMethod),
(_previousTopLevelMethod.IsAsync ? AttributeDescription.AsyncStateMachineAttribute : AttributeDescription.IteratorStateMachineAttribute).FullName));
}
private bool TryGetPreviousSyntaxOffset(SyntaxNode currentSyntax, out int previousSyntaxOffset) private bool TryGetPreviousSyntaxOffset(SyntaxNode currentSyntax, out int previousSyntaxOffset)
{ {
// no syntax map // no syntax map
......
...@@ -177,9 +177,7 @@ private static string ResolveRelativePath(PathKind kind, string path, string bas ...@@ -177,9 +177,7 @@ private static string ResolveRelativePath(PathKind kind, string path, string bas
return path; return path;
default: default:
// EDMAURER this is not using ExceptionUtilities.UnexpectedValue() because this file throw ExceptionUtilities.UnexpectedValue(kind);
// is shared via linking with other code that doesn't have the ExceptionUtilities.
throw new InvalidOperationException(string.Format("Unexpected PathKind {0}.", kind));
} }
} }
......
...@@ -514,8 +514,8 @@ internal bool IsBound ...@@ -514,8 +514,8 @@ internal bool IsBound
if (lazyBuilder.ContainsKey(sourceIdentity)) if (lazyBuilder.ContainsKey(sourceIdentity))
{ {
// TODO: localize message, report as diagnostic (https://github.com/dotnet/roslyn/issues/8910) // The compilation references multiple assemblies whose versions only differ in auto-generated build and/or revision numbers.
throw new NotSupportedException("The compilation references multiple assemblies whose versions only differ in auto-generated build and/or revision numbers."); throw new NotSupportedException(CodeAnalysisResources.CompilationReferencesAssembliesWithDifferentAutoGeneratedVersion);
} }
lazyBuilder.Add(sourceIdentity, originalIdentity); lazyBuilder.Add(sourceIdentity, originalIdentity);
......
...@@ -1605,6 +1605,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic ...@@ -1605,6 +1605,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
ERR_PublicKeyContainerFailure = 36981 ERR_PublicKeyContainerFailure = 36981
ERR_InvalidAssemblyCulture = 36982 ERR_InvalidAssemblyCulture = 36982
ERR_EncUpdateFailedMissingAttribute = 36983
ERR_CantAwaitAsyncSub1 = 37001 ERR_CantAwaitAsyncSub1 = 37001
ERR_ResumableLambdaInExpressionTree = 37050 ERR_ResumableLambdaInExpressionTree = 37050
......
...@@ -95,7 +95,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic ...@@ -95,7 +95,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return New VBDiagnostic(ErrorFactory.ErrorInfo(CType(code, ERRID), args), location) Return New VBDiagnostic(ErrorFactory.ErrorInfo(CType(code, ERRID), args), location)
End Function End Function
Public Overrides Function ConvertSymbolToString(errorCode As Integer, symbol As ISymbol) As String Public Overrides Function GetErrorDisplayString(symbol As ISymbol) As String
' show extra info for assembly if possible such as version, public key token etc. ' show extra info for assembly if possible such as version, public key token etc.
If symbol.Kind = SymbolKind.Assembly OrElse symbol.Kind = SymbolKind.Namespace Then If symbol.Kind = SymbolKind.Assembly OrElse symbol.Kind = SymbolKind.Namespace Then
Return symbol.ToString() Return symbol.ToString()
...@@ -498,6 +498,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic ...@@ -498,6 +498,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return ERRID.ERR_ModuleEmitFailure Return ERRID.ERR_ModuleEmitFailure
End Get End Get
End Property End Property
Public Overrides ReadOnly Property ERR_EncUpdateFailedMissingAttribute As Integer
Get
Return ERRID.ERR_EncUpdateFailedMissingAttribute
End Get
End Property
End Class End Class
End Namespace End Namespace
...@@ -3296,6 +3296,15 @@ Namespace Microsoft.CodeAnalysis.VisualBasic ...@@ -3296,6 +3296,15 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to Cannot update &apos;{0}&apos;; attribute &apos;{1}&apos; is missing..
'''</summary>
Friend ReadOnly Property ERR_EncUpdateFailedMissingAttribute() As String
Get
Return ResourceManager.GetString("ERR_EncUpdateFailedMissingAttribute", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to &apos;End Class&apos; must be preceded by a matching &apos;Class&apos;.. ''' Looks up a localized string similar to &apos;End Class&apos; must be preceded by a matching &apos;Class&apos;..
'''</summary> '''</summary>
......
...@@ -818,6 +818,9 @@ ...@@ -818,6 +818,9 @@
<data name="ERR_ModuleEmitFailure" xml:space="preserve"> <data name="ERR_ModuleEmitFailure" xml:space="preserve">
<value>Failed to emit module '{0}'.</value> <value>Failed to emit module '{0}'.</value>
</data> </data>
<data name="ERR_EncUpdateFailedMissingAttribute" xml:space="preserve">
<value>Cannot update '{0}'; attribute '{1}' is missing.</value>
</data>
<data name="ERR_OverrideNotNeeded3" xml:space="preserve"> <data name="ERR_OverrideNotNeeded3" xml:space="preserve">
<value>{0} '{1}' cannot be declared 'Overrides' because it does not override a {0} in a base class.</value> <value>{0} '{1}' cannot be declared 'Overrides' because it does not override a {0} in a base class.</value>
</data> </data>
......
...@@ -4447,7 +4447,7 @@ End Class ...@@ -4447,7 +4447,7 @@ End Class
ImmutableArray.Create(New SemanticEdit(SemanticEditKind.Update, f0, f1, GetSyntaxMapFromMarkers(source0, source1), preserveLocalVariables:=True))) ImmutableArray.Create(New SemanticEdit(SemanticEditKind.Update, f0, f1, GetSyntaxMapFromMarkers(source0, source1), preserveLocalVariables:=True)))
diff1.EmitResult.Diagnostics.Verify( diff1.EmitResult.Diagnostics.Verify(
Diagnostic(ERRID.ERR_ModuleEmitFailure).WithArguments(compilation0.SourceModule.Name)) Diagnostic(ERRID.ERR_EncUpdateFailedMissingAttribute).WithArguments("Public Function F() As IEnumerable(Of Integer)", "System.Runtime.CompilerServices.IteratorStateMachineAttribute"))
End Sub End Sub
<Fact, WorkItem(9119, "https://github.com/dotnet/roslyn/issues/9119")> <Fact, WorkItem(9119, "https://github.com/dotnet/roslyn/issues/9119")>
...@@ -4501,8 +4501,8 @@ End Class ...@@ -4501,8 +4501,8 @@ End Class
ImmutableArray.Create(New SemanticEdit(SemanticEditKind.Update, f0, f1, GetSyntaxMapFromMarkers(source0, source1), preserveLocalVariables:=True))) ImmutableArray.Create(New SemanticEdit(SemanticEditKind.Update, f0, f1, GetSyntaxMapFromMarkers(source0, source1), preserveLocalVariables:=True)))
diff1.EmitResult.Diagnostics.Verify( diff1.EmitResult.Diagnostics.Verify(
Diagnostic(ERRID.ERR_ModuleEmitFailure).WithArguments(compilation0.SourceModule.Name), Diagnostic(ERRID.ERR_EncUpdateFailedMissingAttribute).WithArguments("Public Function F() As Task(Of Integer)", "System.Runtime.CompilerServices.AsyncStateMachineAttribute"),
Diagnostic(ERRID.ERR_ModuleEmitFailure).WithArguments(compilation0.SourceModule.Name)) Diagnostic(ERRID.ERR_EncUpdateFailedMissingAttribute).WithArguments("Public Function F() As Task(Of Integer)", "System.Runtime.CompilerServices.AsyncStateMachineAttribute"))
End Sub End Sub
End Class End Class
End Namespace End Namespace
...@@ -81,8 +81,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests ...@@ -81,8 +81,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests
Return String.Empty Return String.Empty
End Function End Function
Public Overrides Function ConvertSymbolToString(errorCode As Integer, symbol As ISymbol) As String Public Overrides Function GetErrorDisplayString(symbol As ISymbol) As String
Return MessageProvider.Instance.ConvertSymbolToString(errorCode, symbol) Return MessageProvider.Instance.GetErrorDisplayString(symbol)
End Function End Function
End Class End Class
......
...@@ -1030,8 +1030,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests ...@@ -1030,8 +1030,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests
Return 0 Return 0
End Function End Function
Public Overrides Function ConvertSymbolToString(errorCode As Integer, symbol As ISymbol) As String Public Overrides Function GetErrorDisplayString(symbol As ISymbol) As String
Return MessageProvider.Instance.ConvertSymbolToString(errorCode, symbol) Return MessageProvider.Instance.GetErrorDisplayString(symbol)
End Function End Function
End Class End Class
......
...@@ -80,9 +80,7 @@ internal static class RudeEditDiagnosticDescriptors ...@@ -80,9 +80,7 @@ internal static class RudeEditDiagnosticDescriptors
{ GetDescriptorPair(RudeEditKind.PartiallyExecutedActiveStatementDelete, FeaturesResources.AnActiveStatementHasBeenRemoved) }, { GetDescriptorPair(RudeEditKind.PartiallyExecutedActiveStatementDelete, FeaturesResources.AnActiveStatementHasBeenRemoved) },
{ GetDescriptorPair(RudeEditKind.InsertFile, FeaturesResources.AddingANewFile) }, { GetDescriptorPair(RudeEditKind.InsertFile, FeaturesResources.AddingANewFile) },
{ GetDescriptorPair(RudeEditKind.UpdatingStateMachineMethodAroundActiveStatement, FeaturesResources.UpdatingStateMachineMethodAroundActive) }, { GetDescriptorPair(RudeEditKind.UpdatingStateMachineMethodAroundActiveStatement, FeaturesResources.UpdatingStateMachineMethodAroundActive) },
// TODO: move message to resources https://github.com/dotnet/roslyn/issues/9196 { GetDescriptorPair(RudeEditKind.UpdatingStateMachineMethodMissingAttribute, FeaturesResources.UpdatingStateMachineMethodMissingAttribute) },
{ GetDescriptorPair(RudeEditKind.UpdatingStateMachineMethodMissingAttribute, "Attribute '{0}' is missing. Updating an async method or an iterator will prevent the debug session from continuing.") },
{ GetDescriptorPair(RudeEditKind.RUDE_EDIT_COMPLEX_QUERY_EXPRESSION, FeaturesResources.ModifyingAWhichContainsComplexQuery) }, { GetDescriptorPair(RudeEditKind.RUDE_EDIT_COMPLEX_QUERY_EXPRESSION, FeaturesResources.ModifyingAWhichContainsComplexQuery) },
// VB specific, // VB specific,
......
...@@ -2322,6 +2322,15 @@ internal class FeaturesResources { ...@@ -2322,6 +2322,15 @@ internal class FeaturesResources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Attribute &apos;{0}&apos; is missing. Updating an async method or an iterator will prevent the debug session from continuing..
/// </summary>
internal static string UpdatingStateMachineMethodMissingAttribute {
get {
return ResourceManager.GetString("UpdatingStateMachineMethodMissingAttribute", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Updating the alias of Declare Statement will prevent the debug session from continuing.. /// Looks up a localized string similar to Updating the alias of Declare Statement will prevent the debug session from continuing..
/// </summary> /// </summary>
......
...@@ -574,6 +574,9 @@ ...@@ -574,6 +574,9 @@
<data name="AddingANewFile" xml:space="preserve"> <data name="AddingANewFile" xml:space="preserve">
<value>Adding a new file will prevent the debug session from continuing.</value> <value>Adding a new file will prevent the debug session from continuing.</value>
</data> </data>
<data name="UpdatingStateMachineMethodMissingAttribute" xml:space="preserve">
<value>Attribute '{0}' is missing. Updating an async method or an iterator will prevent the debug session from continuing.</value>
</data>
<data name="UnexpectedInterfaceMemberKind" xml:space="preserve"> <data name="UnexpectedInterfaceMemberKind" xml:space="preserve">
<value>Unexpected interface member kind: {0}</value> <value>Unexpected interface member kind: {0}</value>
</data> </data>
......
...@@ -386,5 +386,13 @@ public override int ERR_ModuleEmitFailure ...@@ -386,5 +386,13 @@ public override int ERR_ModuleEmitFailure
throw new NotImplementedException(); throw new NotImplementedException();
} }
} }
public override int ERR_EncUpdateFailedMissingAttribute
{
get
{
throw new NotImplementedException();
}
}
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册