@@ -24,14 +24,19 @@ namespace Microsoft.CodeAnalysis.Editor.InlineHints;
2424
2525internal partial class InlineHintsTaggerProvider
2626{
27- private sealed class AdornmentTagInformation (
28- bool Classified ,
29- TextFormattingRunProperties Format ,
30- TagSpan < IntraTextAdornmentTag > AdornmentTagSpan )
27+ /// <param name="classified">Whether or not the adornment tag was classified. If the option for this changes, this
28+ /// cached tag should not be reused.</param>
29+ /// <param name="format">The text formatting used to create the hint. If this format no longer matches the current
30+ /// formatting, this should not be reused.</param>
31+ /// <param name="adornmentTagSpan">The actual adornment tag to render.</param>
32+ private sealed class CachedAdornmentTagSpan (
33+ bool classified ,
34+ TextFormattingRunProperties format ,
35+ TagSpan < IntraTextAdornmentTag > adornmentTagSpan )
3136 {
32- public bool Classified { get ; } = Classified ;
33- public TextFormattingRunProperties Format { get ; } = Format ;
34- public TagSpan < IntraTextAdornmentTag > AdornmentTagSpan { get ; } = AdornmentTagSpan ;
37+ public bool Classified { get ; } = classified ;
38+ public TextFormattingRunProperties Format { get ; } = format ;
39+ public TagSpan < IntraTextAdornmentTag > AdornmentTagSpan { get ; } = adornmentTagSpan ;
3540 }
3641
3742 /// <summary>
@@ -160,7 +165,7 @@ private TagSpan<IntraTextAdornmentTag> GetOrCreateAdornmentTagsSpan(
160165 TagSpan < InlineHintDataTag > dataTagSpan , bool classify , TextFormattingRunProperties format )
161166 {
162167 // If we've never computed the adornment info, or options have changed, then compute and cache the new information.
163- var cachedTagInformation = ( AdornmentTagInformation ? ) dataTagSpan . Tag . AdditionalData ;
168+ var cachedTagInformation = ( CachedAdornmentTagSpan ? ) dataTagSpan . Tag . AdditionalData ;
164169 if ( cachedTagInformation is null || cachedTagInformation . Classified != classify || cachedTagInformation . Format != format )
165170 {
166171 var adornmentSpan = dataTagSpan . Span ;
0 commit comments