Skip to content

Commit

Permalink
Fix documentation and include it in the nuget package
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveDunn committed Nov 2, 2024
1 parent 9f3981b commit a4eb561
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/Vogen.Pack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

<None Include="$(MSBuildThisFileDirectory)\Vogen\bin\$(Configuration)\netstandard2.0\Vogen.SharedTypes.dll" Pack="true" PackagePath="lib\netstandard2.0" Visible="true" />
<None Include="$(MSBuildThisFileDirectory)\Vogen\bin\$(Configuration)\net8.0\Vogen.SharedTypes.dll" Pack="true" PackagePath="lib\net8.0" Visible="true" />
<None Include="$(MSBuildThisFileDirectory)\Vogen\bin\$(Configuration)\net8.0\Vogen.SharedTypes.xml" Pack="true" PackagePath="lib\net8.0" Visible="true" />
</ItemGroup>

</Project>
19 changes: 13 additions & 6 deletions src/Vogen.SharedTypes/ValueObjectAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
// ReSharper disable UnusedParameter.Local
// ReSharper disable NullableWarningSuppressionIsUsed
// ReSharper disable UnusedType.Global

// NOTE:
// the documentation for this doesn't show up in recent (November 2024) versions of Visual Studio.
// they do show up in versions of Rider for the same period, but for the generic attribute,
// the cursor has to hover near the right bracket of the attribute! Bug filed at https://youtrack.jetbrains.com/issue/RIDER-119448/Rider-does-not-show-XML-comments-for-generic-attributes

namespace Vogen
{
using System;

// Generic attributes were introduced in C# 11
/// <summary>
/// Marks a type as a Value Object. The type should be partial so that the
/// source generator can augment the type with equality and validation.
/// </summary>
/// <inheritdoc/>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false)]
public class ValueObjectAttribute<T> : ValueObjectAttribute
{
// keep this signature in-line with `VogenConfiguration`
// as the syntax/semantics are read in the generator
// using parameter indexes (i.e. it expected param 0 to be the underlying type etc.

/// <summary>
/// Configures aspects of this individual value object.
/// </summary>
Expand All @@ -31,7 +35,8 @@ public class ValueObjectAttribute<T> : ValueObjectAttribute
/// See <see href="https://github.com/SteveDunn/Vogen/wiki/Casting"/> for more information.</param>
/// <param name="fromPrimitiveCasting">Controls how cast operators are generated for casting from the primitive to the Value Object.
/// Options are implicit or explicit or none. Explicit is preferred over implicit if you really need them, but isn't recommended.
/// See &lt;see href="https://github.com/SteveDunn/Vogen/wiki/Casting"/&gt; for more information.</param>
/// See <see href="https://github.com/SteveDunn/Vogen/wiki/Casting"/> for more information.
/// </param>
/// <param name="parsableForStrings">Specifies what is generated for IParsable types for strings - defaults to <see cref="ParsableForStrings.GenerateMethodsAndInterface"/>.</param>
/// <param name="parsableForPrimitives">Specifies what is generated for Parse and TryParse methods - defaults to <see cref="ParsableForPrimitives.HoistMethodsAndInterfaces"/>.</param>
/// <param name="tryFromGeneration">Specifies what to write for TryFrom methods—defaults to <see cref="TryFromGeneration.GenerateBoolAndErrorOrMethods"/>.</param>
Expand Down Expand Up @@ -83,7 +88,7 @@ public ValueObjectAttribute(
}

/// <summary>
/// MMMarks a type as a Value Object. The type that this is applied to should be partial so that the
/// Marks a type as a Value Object. The type that this is applied to should be partial so that the
/// source generator can augment it with equality, creation barriers, and any conversions.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false)]
Expand All @@ -92,7 +97,9 @@ public class ValueObjectAttribute : Attribute
// keep this signature in-line with `VogenConfiguration`
// as the syntax/semantics are read in the generator
// using parameter indexes (i.e. it expected param 0 to be the underlying type etc).

// ReSharper disable once MemberCanBeProtected.Global

/// <summary>
/// Configures aspects of this individual value object.
/// </summary>
Expand Down
3 changes: 2 additions & 1 deletion tests/Testbench/Folder.DotSettings
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CheckNamespace/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedType_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=testbench/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/UserDictionary/Words/=testbench/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=vogen/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

0 comments on commit a4eb561

Please sign in to comment.