-
Notifications
You must be signed in to change notification settings - Fork 45
/
SampleInlayHintBase.cs
35 lines (28 loc) · 1.13 KB
/
SampleInlayHintBase.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using JetBrains.DocumentModel;
using JetBrains.ReSharper.Feature.Services.InlayHints;
using JetBrains.ReSharper.Psi.Tree;
using JetBrains.UI.RichText;
namespace ReSharperPlugin.InlayHints;
public abstract class SampleInlayHintBase : IInlayHintWithDescriptionHighlighting
{
public const string HighlightAttributeIdBase = nameof(SampleInlayHintBase);
public const string HighlightAttributeGroupId = HighlightAttributeIdBase + "Group";
private readonly DocumentOffset _offset;
private readonly ITreeNode _node;
protected SampleInlayHintBase(ITreeNode node, DocumentOffset offset)
{
_node = node;
_offset = offset;
}
public bool IsValid()
{
return _node.IsValid();
}
public DocumentRange CalculateRange()
{
return new DocumentRange(_offset);
}
public RichText Description => $"ReSharper SDK: {nameof(SampleInlayHintBase)}.{nameof(Description)}";
public string ToolTip => $"ReSharper SDK: {nameof(SampleInlayHintBase)}.{nameof(ToolTip)}";
public string ErrorStripeToolTip => $"ReSharper SDK: {nameof(SampleInlayHintBase)}.{nameof(ErrorStripeToolTip)}";
}