Skip to content

Commit 04f5382

Browse files
committed
Adapt the attributes to the codebase's standards.
1 parent 2e115f6 commit 04f5382

3 files changed

Lines changed: 46 additions & 18 deletions

File tree

src/PolySharp.SourceGenerators/EmbeddedResources/LanguageSupport/System.Runtime.CompilerServices.CompilerLoweringPreserveAttribute.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// <auto-generated/>
2+
#pragma warning disable
3+
#nullable enable annotations
4+
15
// Licensed to the .NET Foundation under one or more agreements.
26
// The .NET Foundation licenses this file to you under the MIT license.
37

@@ -9,19 +13,16 @@ namespace System.Runtime.CompilerServices
913
/// </summary>
1014
/// <remarks>
1115
/// One example where this attribute applies is in C# primary constructor parameters. If an attribute
12-
/// marked with <see cref="CompilerLoweringPreserveAttribute"/> gets applied to a primary constructor
16+
/// marked with <see cref="global::System.Runtime.CompilerServices.CompilerLoweringPreserveAttribute"/> gets applied to a primary constructor
1317
/// parameter, the attribute will also be applied to any compiler-generated fields storing that parameter.
1418
/// </remarks>
15-
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
16-
#if SYSTEM_PRIVATE_CORELIB
17-
public
18-
#else
19-
internal
20-
#endif
21-
sealed class CompilerLoweringPreserveAttribute : Attribute
19+
[global::System.AttributeUsage(global::System.AttributeTargets.Class, Inherited = false)]
20+
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
21+
[global::Microsoft.CodeAnalysis.Embedded]
22+
internal sealed class CompilerLoweringPreserveAttribute : global::System.Attribute
2223
{
2324
/// <summary>
24-
/// Initializes a new instance of the <see cref="CompilerLoweringPreserveAttribute"/> class.
25+
/// Initializes a new instance of the <see cref="global::System.Runtime.CompilerServices.CompilerLoweringPreserveAttribute"/> class.
2526
/// </summary>
2627
public CompilerLoweringPreserveAttribute() { }
2728
}

src/PolySharp.SourceGenerators/EmbeddedResources/LanguageSupport/System.Runtime.CompilerServices.ExtensionMarkerAttribute.cs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// <auto-generated/>
2+
#pragma warning disable
3+
#nullable enable annotations
4+
15
// Licensed to the .NET Foundation under one or more agreements.
26
// The .NET Foundation licenses this file to you under the MIT license.
37

@@ -9,11 +13,23 @@ namespace System.Runtime.CompilerServices
913
/// This attribute is used to mark extension members and associate them with a specific marker type (which provides detailed information about an extension block and its receiver parameter).
1014
/// This attribute should not be used by developers in source code.
1115
/// </summary>
12-
[EditorBrowsable(EditorBrowsableState.Never)]
13-
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
14-
public sealed class ExtensionMarkerAttribute : Attribute
16+
[global::System.ComponentModel.EditorBrowsable(EditorBrowsableState.Never)]
17+
[global::System.AttributeUsage(
18+
global::System.AttributeTargets.Class |
19+
global::System.AttributeTargets.Struct |
20+
global::System.AttributeTargets.Enum |
21+
global::System.AttributeTargets.Method |
22+
global::System.AttributeTargets.Property |
23+
global::System.AttributeTargets.Field |
24+
global::System.AttributeTargets.Event |
25+
global::System.AttributeTargets.Interface |
26+
global::System.AttributeTargets.Delegate,
27+
Inherited = false)]
28+
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
29+
[global::Microsoft.CodeAnalysis.Embedded]
30+
internal sealed class ExtensionMarkerAttribute : global::System.Attribute
1531
{
16-
/// <summary>Initializes a new instance of the <see cref="ExtensionMarkerAttribute"/> class.</summary>
32+
/// <summary>Initializes a new instance of the <see cref="global::System.Runtime.CompilerServices.ExtensionMarkerAttribute"/> class.</summary>
1733
/// <param name="name">The name of the marker type this extension member is associated with.</param>
1834
public ExtensionMarkerAttribute(string name)
1935
=> Name = name;

src/PolySharp.SourceGenerators/EmbeddedResources/RuntimeSupported/System.Diagnostics.CodeAnalysis.UnsafeAccessorTypeAttribute.cs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// <auto-generated/>
2+
#pragma warning disable
3+
#nullable enable annotations
4+
15
// Licensed to the .NET Foundation under one or more agreements.
26
// The .NET Foundation licenses this file to you under the MIT license.
37

@@ -6,23 +10,30 @@ namespace System.Runtime.CompilerServices
610
/// <summary>
711
/// Provides access to an inaccessible type.
812
/// </summary>
9-
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = false, Inherited = false)]
10-
public sealed class UnsafeAccessorTypeAttribute : Attribute
13+
[global::System.AttributeUsage(
14+
global::System.AttributeTargets.Parameter |
15+
global::System.AttributeTargets.ReturnValue,
16+
AllowMultiple = false,
17+
Inherited = false)]
18+
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
19+
[global::Microsoft.CodeAnalysis.Embedded]
20+
[global::System.Diagnostics.Conditional("MULTI_TARGETING_SUPPORT_ATTRIBUTES")]
21+
internal sealed class UnsafeAccessorTypeAttribute : global::System.Attribute
1122
{
1223
/// <summary>
1324
/// Instantiates an <see cref="UnsafeAccessorTypeAttribute"/> providing access to a type supplied by <paramref name="typeName"/>.
1425
/// </summary>
1526
/// <param name="typeName">A fully qualified or partially qualified type name.</param>
1627
/// <remarks>
1728
/// <paramref name="typeName"/> is expected to follow the same rules as if it were being
18-
/// passed to <see name="Type.GetType(String)"/>. When unbound generics are involved they
29+
/// passed to <see name="global::System.Type.GetType(global::System.String)"/>. When unbound generics are involved they
1930
/// should follow the IL syntax of referencing a type or method generic variables using
2031
/// the syntax of <c>!N</c> or <c>!!N</c> respectively, where N is the zero-based index of the
21-
/// generic parameters. The generic rules defined for <see cref="UnsafeAccessorAttribute"/>
32+
/// generic parameters. The generic rules defined for <see cref="global::System.Diagnostics.CodeAnalysis.UnsafeAccessorAttribute"/>
2233
/// apply to this attribute as well, meaning the arity and type of generic parameter must match
2334
/// the target type.
2435
///
25-
/// This attribute only has behavior on parameters or return values of methods marked with <see cref="UnsafeAccessorAttribute"/>.
36+
/// This attribute only has behavior on parameters or return values of methods marked with <see cref="global::System.Diagnostics.CodeAnalysis.UnsafeAccessorAttribute"/>.
2637
///
2738
/// This attribute should only be applied to parameters or return types of methods that are
2839
/// typed as follows:

0 commit comments

Comments
 (0)