Skip to content

Commit

Permalink
Merge pull request #23 from mr146/main
Browse files Browse the repository at this point in the history
Added IgnoreSpellingAndGrammarErrorsAttribute and AspMinimalApiImplic…
  • Loading branch information
controlflow committed Oct 20, 2023
2 parents 53cd720 + 6565d31 commit 0dea5ba
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
33 changes: 33 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,29 @@ 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
2 changes: 2 additions & 0 deletions src/JetBrains.Annotations.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ All usages of JetBrains.Annotations attributes are erased from metadata by defau
<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 0dea5ba

Please sign in to comment.