Skip to content

Commit

Permalink
Added IgnoreSpellingAndGrammarErrorsAttribute and AspMinimalApiImplic…
Browse files Browse the repository at this point in the history
…itEndpointDeclarationAttribute
  • Loading branch information
mr146 committed Oct 19, 2023
1 parent 53cd720 commit a328420
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
30 changes: 30 additions & 0 deletions src/Annotations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,16 @@ public CodeTemplateAttribute(string searchTemplate)
public string SuppressionKey { get; set; }
}

/// <summary>
/// Indicates that the string literal, passed as an argument matching this parameter,
/// should not be checked on spelling or grammar errors.
/// </summary>
[AttributeUsage(AttributeTargets.Parameter)]
[Conditional("JETBRAINS_ANNOTATIONS")]
public sealed class IgnoreSpellingAndGrammarErrorsAttribute : Attribute
{
}

#region ASP.NET

[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
Expand Down Expand Up @@ -1738,6 +1748,26 @@ public sealed class AspMinimalApiGroupAttribute : Attribute { }
[Conditional("JETBRAINS_ANNOTATIONS")]
public sealed class AspMinimalApiHandlerAttribute : Attribute { }

/// <summary>
/// Indicates that the marked method contains Minimal API endpoint declaration.
/// </summary>
/// <remarks>
/// The IDE will analyze all usages of methods marked with this attribute,
/// and will add all declared in attributes routes to completion, navigation and other features over URI strings.
/// </remarks>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
[Conditional("JETBRAINS_ANNOTATIONS")]
public sealed class AspMinimalApiImplicitEndpointDeclarationAttribute : Attribute
{
public string HttpVerb { get; set; }
public string RouteTemplate { get; set; }
public Type BodyType { get; set; }
/// <summary>
/// Comma-separated list of query parameters defined for endpoint
/// </summary>
public string QueryParameters { get; set; }
}

#endregion

#region Razor
Expand Down
2 changes: 1 addition & 1 deletion src/JetBrains.Annotations.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
MAJOR and MINOR version numbers should match latest ReSharper version (to avoid confusion),
PATCH version may vary during development and EAPs -->
<VersionPrefix>2023.3.0</VersionPrefix>
<VersionSuffix>eap2</VersionSuffix>
<VersionSuffix>eap3</VersionSuffix>

<!-- versioning -->
<Version Condition=" '$(VersionSuffix)' != '' ">$(VersionPrefix)-$(VersionSuffix)</Version>
Expand Down
4 changes: 2 additions & 2 deletions src/JetBrains.Annotations.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ JetBrains.Annotations help reduce false positive warnings, explicitly declare pu
All usages of JetBrains.Annotations attributes are erased from metadata by default, which means no actual binary reference to 'JetBrains.Annotations.dll' assembly is produced. If you need to preserve these attributes in metadata, just define 'JETBRAINS_ANNOTATIONS' conditional compilation symbol in your projects.
</description>
<releaseNotes>
&#8226; Added MustDisposeResourceAttribute and HandlesResourceDisposalAttribute attributes for resource disposal analysis.
&#8226; Added SourceTemplateAttribute.Target property to provide a way to specify expression source template must be applied to.
&#8226; Added IgnoreSpellingAndGrammarErrorsAttribute to allow ignore grammar and spelling errors in literals passed to marked parameters.
&#8226; Added AspMinimalApiImplicitEndpointDeclarationAttribute to make IDE aware of Minimal API endpoints from third-party libraries.
</releaseNotes>
<tags>jetbrains resharper rider annotations canbenull notnull</tags>
<dependencies>
Expand Down

0 comments on commit a328420

Please sign in to comment.