-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathImplicitNotNullElementCannotOverrideCanBeNullHighlighting.cs
More file actions
38 lines (33 loc) · 1.55 KB
/
ImplicitNotNullElementCannotOverrideCanBeNullHighlighting.cs
File metadata and controls
38 lines (33 loc) · 1.55 KB
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
36
37
38
using JetBrains.ReSharper.Feature.Services.Daemon;
using JetBrains.ReSharper.Psi.CSharp;
using JetBrains.ReSharper.Psi.Tree;
namespace ImplicitNullability.Plugin.Highlighting
{
[RegisterConfigurableSeverity(
SeverityId,
CompoundItemName: null,
Group: HighlightingGroupIds.CodeSmell,
Title: Message,
Description: Description,
DefaultSeverity: Severity.WARNING)]
[ConfigurableSeverityHighlighting(
SeverityId,
CSharpLanguage.Name,
OverlapResolve = OverlapResolveKind.WARNING,
OverloadResolvePriority = OutputWarningPriority,
ToolTipFormatString = Message)]
public class ImplicitNotNullElementCannotOverrideCanBeNullHighlighting : ImplicitNullabilityHighlightingBase
{
public const string SeverityId = "ImplicitNotNullElementCannotOverrideCanBeNull";
public const string Message = "Implicit NotNull element cannot override CanBeNull in base type, nullability should be explicit";
public const string Description =
"Warns about implicit [NotNull] results or out parameters with a corresponding [CanBeNull] element in a base member. " +
"It's better to explicitly annotate these occurrences with [NotNull] or [CanBeNull] " +
"because the implicit [NotNull] doesn't have any effect (ReSharper inherits the base's [CanBeNull]). " +
NeedsSettingNoteText;
public ImplicitNotNullElementCannotOverrideCanBeNullHighlighting(ITreeNode treeNode)
: base(treeNode, Message)
{
}
}
}