Usage of obsolete backing field should be highlighted
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
**Version Used**: latest main
**Steps to Reproduce**:
Test from `FieldKeywordTests.ObsoleteAttribute`, [sharplab](https://sharplab.io/#v2:CYLg1APgAgTAjAWAFBQAwAIpwHQCUCmAZgDb4DGALgJYD2AdgNzKzoDCyA3suj+gNoB5AEYBnGqQr4Aur1mYAzJjgA2dDSEArchXQAFOOg7oA5vh0BeAHzpCVfMWAN0Is4fQBfD9159b90OjCYhLSCkqq6lqUejBuphbWfg5OLjpGnu7ePIKi4mahcjxQipHaeopG8ehWNnbJzq7pXkiyvnUBQXmSMsVqmmW6ACxxrjVJjg1pHs3uQA=):
```
class C
{
[Obsolete] public static object P1 { get => field; set { } }
[field: Obsolete] public static object P2 { get => field; set { } }
[Obsolete] public object P3 { get => field; set { } }
[field: Obsolete] public object P4 { get => field; set { } }
}
```
**Diagnostic Id**: CS0612 `ErrorCode.WRN_DeprecatedSymbol`
**Expected Behavior**:
Usages of `field` in `P2` and `P4` are highlighted as soon as they are obsolete by `[field: Obsolete]` and we confirm that in test `ObsoleteAttribute` by outputting
```
C.k__BackingField: System.Runtime.CompilerServices.CompilerGeneratedAttribute,
C.k__BackingField: System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.ObsoleteAttribute,
C.k__BackingField: System.Runtime.CompilerServices.CompilerGeneratedAttribute,
C.k__BackingField: System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.ObsoleteAttribute,
```
**Actual Behavior**:
No highlighting
**Commentary**:
For some reason this behavior is fixed with test, but is it correct one? @cston
Contributor guide
Assessment
This issue has not been assessed yet.