diff --git a/ILSpy/Languages/CSharpHighlightingTokenWriter.cs b/ILSpy/Languages/CSharpHighlightingTokenWriter.cs index 6d91a6a11..523a165d3 100644 --- a/ILSpy/Languages/CSharpHighlightingTokenWriter.cs +++ b/ILSpy/Languages/CSharpHighlightingTokenWriter.cs @@ -289,7 +289,7 @@ namespace ICSharpCode.ILSpy public override void WriteIdentifier(Identifier identifier) { HighlightingColor color = null; - if (identifier.Name == "value" && nodeStack.PeekOrDefault() is Accessor accessor && accessor.Role != PropertyDeclaration.GetterRole) + if (identifier.Name == "value" && identifier.Ancestors.OfType().FirstOrDefault() is Accessor accessor && accessor.Role != PropertyDeclaration.GetterRole) color = valueKeywordColor; switch (GetCurrentDefinition()) { case ITypeDefinition t: