Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix up docs #4062

Merged
merged 3 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ namespace Microsoft.Extensions.ExtraAnalyzers.Utilities;
internal static class SyntaxNodeExtensions
{
/// <summary>
/// Finds closest ancestor by syntax kind.
/// Finds the closest ancestor by syntax kind.
/// </summary>
/// <param name="node">Start node.</param>
/// <param name="kind">Kind to search by.</param>
/// <returns>Found node or null.</returns>
/// <param name="node">The start node.</param>
/// <param name="kind">The kind to search by.</param>
/// <returns>The found node or <see langword="null" />.</returns>
public static SyntaxNode? GetFirstAncestorOfSyntaxKind(this SyntaxNode node, SyntaxKind kind)
{
var n = node.Parent;
Expand Down Expand Up @@ -98,7 +98,7 @@ public static bool NodeHasSpecifiedMethod(
/// <param name="semanticModel">The semantic model.</param>
/// <param name="expectedFullMethodNames">Expected full method names.</param>
/// <param name="typesToStopTraversing">Root node types.</param>
/// <returns>Found invocation node or null.</returns>
/// <returns>Found invocation node or <see langword="null" />.</returns>
public static SyntaxNode? FindNodeInTreeUpToSpecifiedParentByMethodName(
this SyntaxNode nodeToStart,
SemanticModel semanticModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public JsonValue this[string key]
}

/// <summary>
/// Adds a key with a null value to this collection.
/// Adds a key with a <see langword="null" /> value to this collection.
/// </summary>
/// <param name="key">The key of the property to be added.</param>
/// <remarks><para>Returns this JsonObject.</para></remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Microsoft.Extensions.LocalAnalyzers.Json;
internal readonly struct JsonValue : IEquatable<JsonValue>
{
/// <summary>
/// Represents a null JsonValue.
/// Represents a <see langword="null" /> JsonValue.
/// </summary>
public static readonly JsonValue Null = new(JsonValueType.Null, default, null);
private readonly object? _reference;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.Extensions.LocalAnalyzers.Json;
internal enum JsonValueType
{
/// <summary>
/// A null value.
/// A <see langword="null" /> value.
/// </summary>
Null = 0,

Expand Down
8 changes: 4 additions & 4 deletions src/LegacySupport/DiagnosticAttributes/NullableAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal sealed class MaybeNullWhenAttribute : Attribute
{
/// <summary>Initializes the attribute with the specified return value condition.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter may be null.
/// The return value condition. If the method returns this value, the associated parameter may be <see langword="null" />.
/// </param>
public MaybeNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;

Expand All @@ -70,7 +70,7 @@ internal sealed class NotNullWhenAttribute : Attribute
{
/// <summary>Initializes the attribute with the specified return value condition.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter will not be null.
/// The return value condition. If the method returns this value, the associated parameter will not be <see langword="null" />.
/// </param>
public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;

Expand Down Expand Up @@ -145,7 +145,7 @@ internal sealed class MemberNotNullWhenAttribute : Attribute
{
/// <summary>Initializes the attribute with the specified return value condition and a field or property member.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter will not be null.
/// The return value condition. If the method returns this value, the associated parameter will not be <see langword="null" />.
/// </param>
/// <param name="member">
/// The field or property member that is promised to be not-null.
Expand All @@ -158,7 +158,7 @@ public MemberNotNullWhenAttribute(bool returnValue, string member)

/// <summary>Initializes the attribute with the specified return value condition and list of field and property members.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter will not be null.
/// The return value condition. If the method returns this value, the associated parameter will not be <see langword="null" />.
/// </param>
/// <param name="members">
/// The list of field and property members that are promised to be not-null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ internal static class DictionaryExtensions
/// <typeparam name="TValue">The type of the values in the dictionary.</typeparam>
/// <param name="dictionary">The dictionary to operate on.</param>
/// <param name="key">The key of the value to query or add.</param>
/// <param name="value">When this method returns true, the removed value; when this method returns false, the default value for TValue.</param>
/// <param name="value">When this method returns true, the removed value; when this method returns false, the default value for <typeparamref name="TValue" />.</param>
/// <returns>true when a value is found in the dictionary with the specified key; false when the dictionary cannot find a value associated with the specified key.</returns>
/// <exception cref="ArgumentNullException">If the dictionary or key are <see langword="null"/>.</exception>
/// <exception cref="ArgumentNullException">The dictionary or key is <see langword="null"/>.</exception>
[ExcludeFromCodeCoverage]
public static bool Remove<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, [MaybeNullWhen(false)] out TValue value)
{
Expand Down
2 changes: 1 addition & 1 deletion src/LegacySupport/GetOrAdd/GetOrAddExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal static class GetOrAddExtensions
/// <param name="valueFactory">A function that returns a value to insert into the dictionary if it is not already present.</param>
/// <param name="factoryArgument">The state to pass to the value factory.</param>
/// <returns>The value for the key. This will be either the existing value for the key if the key is already in the dictionary, or the new value if the key was not in the dictionary.</returns>
/// <exception cref="ArgumentNullException">If the dictionary, key, or value factory are <see langword="null"/>.</exception>
/// <exception cref="ArgumentNullException">The dictionary, key, or value factory is <see langword="null"/>.</exception>
[ExcludeFromCodeCoverage]
public static TValue GetOrAdd<TKey, TValue, TArg>(this ConcurrentDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public UnconditionalSuppressMessageAttribute(string category, string checkId)
/// Gets or sets an optional argument expanding on exclusion criteria.
/// </summary>
/// <remarks>
/// The <see cref="MessageId "/> property is an optional argument that specifies additional
/// The <see cref="MessageId"/> property is an optional argument that specifies additional
/// exclusion where the literal metadata target is not sufficiently precise. For example,
/// the <see cref="UnconditionalSuppressMessageAttribute"/> cannot be applied within a method,
/// and it may be desirable to suppress a violation against a statement in the method that will
Expand Down
4 changes: 2 additions & 2 deletions src/LegacySupport/xxH3/XxHash3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ public XxHash3(long seed)
/// <summary>Computes the XXH3 hash of the provided <paramref name="source"/> data.</summary>
/// <param name="source">The data to hash.</param>
/// <returns>The XXH3 64-bit hash code of the provided data.</returns>
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
/// <exception cref="ArgumentNullException"><paramref name="source"/> is <see langword="null"/>.</exception>
public static byte[] Hash(byte[] source) => Hash(source, seed: 0);

/// <summary>Computes the XXH3 hash of the provided data using the provided seed.</summary>
/// <param name="source">The data to hash.</param>
/// <param name="seed">The seed value for this hash computation.</param>
/// <returns>The XXH3 64-bit hash code of the provided data.</returns>
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
/// <exception cref="ArgumentNullException"><paramref name="source"/> is <see langword="null"/>.</exception>
public static byte[] Hash(byte[] source, long seed)
{
#if NET6_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static class AsyncStateHttpContextExtensions
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> to add the service to.</param>
/// <returns>The value of <paramref name="services"/>.</returns>
/// <exception cref="ArgumentNullException">If <paramref name="services"/> is <see langword="null" />.</exception>
/// <exception cref="ArgumentNullException"><paramref name="services"/> is <see langword="null" />.</exception>
public static IServiceCollection AddAsyncStateHttpContext(this IServiceCollection services)
{
_ = Throw.IfNull(services);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public class ConnectionTimeoutOptions
/// <summary>
/// Gets or sets the time after which a connection will be shut down.
/// </summary>
/// <remarks>
/// Default set to 5 minutes.
/// </remarks>
/// <value>
/// The default value is 5 minutes.
/// </value>
[TimeSpan(0, Exclusive = true)]
public TimeSpan Timeout { get; set; } = _defaultTimeout;
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static class CommonHeaders
public static HeaderSetup<RangeHeaderValue> Range => new(HeaderNames.Range, RangeHeaderValueParser.Instance);

/// <summary>
/// Gets Referer header setup.
/// Gets Referrer header setup.
/// </summary>
public static HeaderSetup<Uri> Referer => new(HeaderNames.Referer, Parsers.UriParser.Instance, cacheable: true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ public class HeaderSetup<THeader>
/// <summary>
/// Gets the type of the parser to parse header values.
/// </summary>
/// <remarks>Not null when <see cref="ParserInstance" /> is <see langword="null"/> and vice versa.</remarks>
/// <remarks>Not <see langword="null"/> when <see cref="ParserInstance" /> is <see langword="null"/> and vice versa.</remarks>
public Type? ParserType { get; }

/// <summary>
/// Gets the parser to parse header values.
/// </summary>
/// <remarks>Not null when <see cref="ParserType" /> is <see langword="null"/> and vice versa.</remarks>
/// <remarks>Not <see langword="null"/> when <see cref="ParserType" /> is <see langword="null"/> and vice versa.</remarks>
public HeaderParser<THeader>? ParserInstance { get; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public HostHeaderValue(string host, int? port)
/// </summary>
/// <param name="left">First value.</param>
/// <param name="right">Second value.</param>
/// <returns><see langword="true" />, if its operands are equal, <see langword="false" /> otherwise.</returns>
/// <returns><see langword="true" /> if the operands are equal, <see langword="false" /> otherwise.</returns>
public static bool operator ==(HostHeaderValue left, HostHeaderValue right)
{
return left.Equals(right);
Expand All @@ -56,7 +56,7 @@ public HostHeaderValue(string host, int? port)
/// </summary>
/// <param name="left">First value.</param>
/// <param name="right">Second value.</param>
/// <returns><see langword="true" />, if its operands are inequal, <see langword="false" /> otherwise.</returns>
/// <returns><see langword="true" /> if the operands are unequal, <see langword="false" /> otherwise.</returns>
public static bool operator !=(HostHeaderValue left, HostHeaderValue right)
{
return !(left == right);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static class RequestLatencyTelemetryExtensions
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> to add to.</param>
/// <returns>Provided service collection with request latency telemetry middleware added.</returns>
/// <exception cref="ArgumentNullException">When <paramref name="services"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="services"/> is <see langword="null"/>.</exception>
public static IServiceCollection AddRequestLatencyTelemetry(this IServiceCollection services)
{
_ = Throw.IfNull(services);
Expand All @@ -43,7 +43,7 @@ public static IServiceCollection AddRequestLatencyTelemetry(this IServiceCollect
/// <param name="services">The <see cref="IServiceCollection"/> to add to.</param>
/// <param name="configure">Configuration of <see cref="RequestLatencyTelemetryOptions"/>.</param>
/// <returns>Provided service collection with request latency telemetry middleware added.</returns>
/// <exception cref="ArgumentNullException">When either <paramref name="services"/> or <paramref name="configure"/> is <see langword="null" />.</exception>
/// <exception cref="ArgumentNullException">Either <paramref name="services"/> or <paramref name="configure"/> is <see langword="null" />.</exception>
public static IServiceCollection AddRequestLatencyTelemetry(this IServiceCollection services, Action<RequestLatencyTelemetryOptions> configure)
{
_ = Throw.IfNull(services);
Expand All @@ -61,7 +61,7 @@ public static IServiceCollection AddRequestLatencyTelemetry(this IServiceCollect
/// <param name="services">The <see cref="IServiceCollection"/> to add to.</param>
/// <param name="section">Configuration of <see cref="RequestLatencyTelemetryOptions"/>.</param>
/// <returns>Provided service collection with request latency telemetry middleware added.</returns>
/// <exception cref="ArgumentNullException">When either <paramref name="services"/> or <paramref name="section"/> is <see langword="null" />.</exception>
/// <exception cref="ArgumentNullException">Either <paramref name="services"/> or <paramref name="section"/> is <see langword="null" />.</exception>
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicParameterlessConstructor, type: typeof(RequestLatencyTelemetryOptions))]
[UnconditionalSuppressMessage(
"Trimming",
Expand All @@ -83,7 +83,7 @@ public static IServiceCollection AddRequestLatencyTelemetry(this IServiceCollect
/// </summary>
/// <param name="builder">The <see cref="IApplicationBuilder"/>.</param>
/// <returns>The <see cref="IApplicationBuilder"/> so that additional calls can be chained.</returns>
/// <exception cref="ArgumentNullException">When <paramref name="builder"/> is <see langword="null" />.</exception>
/// <exception cref="ArgumentNullException"><paramref name="builder"/> is <see langword="null" />.</exception>
public static IApplicationBuilder UseRequestLatencyTelemetry(this IApplicationBuilder builder)
{
_ = Throw.IfNull(builder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public class RequestLatencyTelemetryOptions
/// <summary>
/// Gets or sets the amount of time to wait for export of latency data.
/// </summary>
/// <remarks>
/// Default set to 5 seconds.
/// </remarks>
/// <value>
/// The default value is 5 seconds.
/// </value>
[TimeSpan(RequestLatencyTelemetryOptionsValidator.MinimumTimeoutInMs)]
public TimeSpan LatencyDataExportTimeout { get; set; } = _defaultTimeout;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static class HttpLoggingServiceExtensions
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> to add the service to.</param>
/// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
/// <exception cref="ArgumentNullException">The <paramref name="services"/> is <see langword="null" />.</exception>
/// <exception cref="ArgumentNullException"><paramref name="services"/> is <see langword="null" />.</exception>
public static IServiceCollection AddHttpLogging(this IServiceCollection services)
{
_ = Throw.IfNull(services);
Expand Down Expand Up @@ -81,7 +81,7 @@ public static IServiceCollection AddHttpLogging(this IServiceCollection services
/// <typeparam name="T">Type of enricher.</typeparam>
/// <param name="services">The <see cref="IServiceCollection"/> to add the instance of <typeparamref name="T"/> to.</param>
/// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
/// <exception cref="ArgumentNullException">The <paramref name="services"/> is <see langword="null" />.</exception>
/// <exception cref="ArgumentNullException"><paramref name="services"/> is <see langword="null" />.</exception>
public static IServiceCollection AddHttpLogEnricher<T>(this IServiceCollection services)
where T : class, IHttpLogEnricher
{
Expand All @@ -98,7 +98,7 @@ public static IServiceCollection AddHttpLogEnricher<T>(this IServiceCollection s
/// </remarks>
/// <param name="builder">An application's request pipeline builder.</param>
/// <returns>The <see cref="IApplicationBuilder"/> so that additional calls can be chained.</returns>
/// <exception cref="ArgumentNullException">The <paramref name="builder"/> is <see langword="null" />.</exception>
/// <exception cref="ArgumentNullException"><paramref name="builder"/> is <see langword="null" />.</exception>
public static IApplicationBuilder UseHttpLoggingMiddleware(this IApplicationBuilder builder)
{
_ = Throw.IfNull(builder);
Expand Down
Loading