From a3284206c739eb5b2373b37733182f8ea3a7c920 Mon Sep 17 00:00:00 2001 From: Den Mukhametianov Date: Thu, 19 Oct 2023 17:24:19 +0400 Subject: [PATCH] Added IgnoreSpellingAndGrammarErrorsAttribute and AspMinimalApiImplicitEndpointDeclarationAttribute --- src/Annotations.cs | 30 ++++++++++++++++++++++++++++++ src/JetBrains.Annotations.csproj | 2 +- src/JetBrains.Annotations.nuspec | 4 ++-- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/Annotations.cs b/src/Annotations.cs index f9d82bf..628f373 100644 --- a/src/Annotations.cs +++ b/src/Annotations.cs @@ -1275,6 +1275,16 @@ public CodeTemplateAttribute(string searchTemplate) public string SuppressionKey { get; set; } } + /// + /// Indicates that the string literal, passed as an argument matching this parameter, + /// should not be checked on spelling or grammar errors. + /// + [AttributeUsage(AttributeTargets.Parameter)] + [Conditional("JETBRAINS_ANNOTATIONS")] + public sealed class IgnoreSpellingAndGrammarErrorsAttribute : Attribute + { + } + #region ASP.NET [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] @@ -1738,6 +1748,26 @@ public sealed class AspMinimalApiGroupAttribute : Attribute { } [Conditional("JETBRAINS_ANNOTATIONS")] public sealed class AspMinimalApiHandlerAttribute : Attribute { } + /// + /// Indicates that the marked method contains Minimal API endpoint declaration. + /// + /// + /// 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. + /// + [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; } + /// + /// Comma-separated list of query parameters defined for endpoint + /// + public string QueryParameters { get; set; } + } + #endregion #region Razor diff --git a/src/JetBrains.Annotations.csproj b/src/JetBrains.Annotations.csproj index bc42fb2..6a8c94f 100644 --- a/src/JetBrains.Annotations.csproj +++ b/src/JetBrains.Annotations.csproj @@ -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 --> 2023.3.0 - eap2 + eap3 $(VersionPrefix)-$(VersionSuffix) diff --git a/src/JetBrains.Annotations.nuspec b/src/JetBrains.Annotations.nuspec index 757ef33..63113f1 100644 --- a/src/JetBrains.Annotations.nuspec +++ b/src/JetBrains.Annotations.nuspec @@ -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. -• Added MustDisposeResourceAttribute and HandlesResourceDisposalAttribute attributes for resource disposal analysis. -• Added SourceTemplateAttribute.Target property to provide a way to specify expression source template must be applied to. +• Added IgnoreSpellingAndGrammarErrorsAttribute to allow ignore grammar and spelling errors in literals passed to marked parameters. +• Added AspMinimalApiImplicitEndpointDeclarationAttribute to make IDE aware of Minimal API endpoints from third-party libraries. jetbrains resharper rider annotations canbenull notnull