Skip to content

Commit b724568

Browse files
Extract type
1 parent 11822ce commit b724568

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using Microsoft.VisualStudio.Text.Editor;
6+
using Microsoft.VisualStudio.Text.Formatting;
7+
using Microsoft.VisualStudio.Text.Tagging;
8+
9+
namespace Microsoft.CodeAnalysis.Editor.InlineHints;
10+
11+
internal partial class InlineHintsTaggerProvider
12+
{
13+
/// <summary>The computed adornment tag for an inline hint, along with information needed to determine if it can be
14+
/// reused. This is created and cached on <see cref="InlineHintDataTag.AdditionalData"/> on demand so that we only
15+
/// create adornment tags once and reuse as long as possible.</summary>
16+
/// <param name="classified">Whether or not the adornment tag was classified. If the option for this changes, this
17+
/// cached tag should not be reused.</param>
18+
/// <param name="format">The text formatting used to create the hint. If this format no longer matches the current
19+
/// formatting, this should not be reused.</param>
20+
/// <param name="adornmentTagSpan">The actual adornment tag to render.</param>
21+
private sealed class CachedAdornmentTagSpan(
22+
bool classified,
23+
TextFormattingRunProperties format,
24+
TagSpan<IntraTextAdornmentTag> adornmentTagSpan)
25+
{
26+
public bool Classified { get; } = classified;
27+
public TextFormattingRunProperties Format { get; } = format;
28+
public TagSpan<IntraTextAdornmentTag> AdornmentTagSpan { get; } = adornmentTagSpan;
29+
}
30+
}

src/EditorFeatures/Core.Wpf/InlineHints/InlineHintsTagger.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,6 @@ namespace Microsoft.CodeAnalysis.Editor.InlineHints;
2424

2525
internal partial class InlineHintsTaggerProvider
2626
{
27-
/// <summary>The computed adornment tag for an inline hint, along with information needed to determine if it can be
28-
/// reused. This is created and cached on <see cref="InlineHintDataTag.AdditionalData"/> on demand so that we only
29-
/// create adornment tags once and reuse as long as possible.</summary>
30-
/// <param name="classified">Whether or not the adornment tag was classified. If the option for this changes, this
31-
/// cached tag should not be reused.</param>
32-
/// <param name="format">The text formatting used to create the hint. If this format no longer matches the current
33-
/// formatting, this should not be reused.</param>
34-
/// <param name="adornmentTagSpan">The actual adornment tag to render.</param>
35-
private sealed class CachedAdornmentTagSpan(
36-
bool classified,
37-
TextFormattingRunProperties format,
38-
TagSpan<IntraTextAdornmentTag> adornmentTagSpan)
39-
{
40-
public bool Classified { get; } = classified;
41-
public TextFormattingRunProperties Format { get; } = format;
42-
public TagSpan<IntraTextAdornmentTag> AdornmentTagSpan { get; } = adornmentTagSpan;
43-
}
44-
4527
/// <summary>
4628
/// The purpose of this tagger is to convert the <see cref="InlineHintDataTag"/> to the <see
4729
/// cref="InlineHintsTag"/>, which actually creates the UIElement. It reacts to tags changing and updates the

0 commit comments

Comments
 (0)