Split attributes into their own assembly (#86)

This commit is contained in:
Patrick Stevens
2024-02-07 01:27:57 +00:00
committed by GitHub
parent 4e18e8b1bf
commit 7ef393a28d
22 changed files with 296 additions and 88 deletions

View File

@@ -7,23 +7,6 @@ open Fantomas.FCS.SyntaxTrivia
open Fantomas.FCS.Xml
open Myriad.Core
/// Attribute indicating a record type to which the "Add JSON parse" Myriad
/// generator should apply during build.
/// The purpose of this generator is to create methods (possibly extension methods) of the form
/// `{TypeName}.jsonParse : System.Text.Json.Nodes.JsonNode -> {TypeName}`.
///
/// If you supply isExtensionMethod = true, you will get extension methods.
/// These can only be consumed from F#, but the benefit is that they don't use up the module name
/// (since by default we create a module called "{TypeName}").
type JsonParseAttribute (isExtensionMethod : bool) =
inherit Attribute ()
/// If changing this, *adjust the documentation strings*
static member internal DefaultIsExtensionMethod = false
/// Shorthand for the "isExtensionMethod = false" constructor; see documentation there for details.
new () = JsonParseAttribute JsonParseAttribute.DefaultIsExtensionMethod
type internal JsonParseOutputSpec =
{
ExtensionMethods : bool