mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-10-06 04:28:42 +00:00
This reverts commit 8d275f0047
.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
namespace WoofWare.Myriad.Plugins
|
||||
|
||||
open System.IO
|
||||
open System.Net.Http
|
||||
open Fantomas.FCS.Syntax
|
||||
open WoofWare.Whippet.Fantomas
|
||||
@@ -13,6 +14,17 @@ type internal HttpClientGeneratorOutputSpec =
|
||||
module internal HttpClientGenerator =
|
||||
open Fantomas.FCS.Text.Range
|
||||
|
||||
let outputFile = FileInfo "/tmp/output.txt"
|
||||
|
||||
// do
|
||||
// use _ = File.Create outputFile.FullName
|
||||
// ()
|
||||
|
||||
let log (line : string) =
|
||||
// use w = outputFile.AppendText ()
|
||||
// w.WriteLine line
|
||||
()
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
type PathSpec =
|
||||
| Verbatim of string
|
||||
@@ -556,9 +568,6 @@ module internal HttpClientGenerator =
|
||||
)
|
||||
)
|
||||
|
||||
let jsonNodeNotNull =
|
||||
Let ("jsonNode", AstHelper.raiseIfNull (Ident.create "jsonNode"))
|
||||
|
||||
let setVariableHeaders =
|
||||
variableHeaders
|
||||
|> List.map (fun (headerName, callToGetValue) ->
|
||||
@@ -633,7 +642,6 @@ module internal HttpClientGenerator =
|
||||
yield responseString
|
||||
yield responseStream
|
||||
yield jsonNode
|
||||
yield jsonNodeNotNull
|
||||
| String -> yield responseString
|
||||
| Stream -> yield responseStream
|
||||
| UnitType ->
|
||||
@@ -642,7 +650,6 @@ module internal HttpClientGenerator =
|
||||
| _ ->
|
||||
yield responseStream
|
||||
yield jsonNode
|
||||
yield jsonNodeNotNull
|
||||
]
|
||||
|> SynExpr.createCompExpr "async" returnExpr
|
||||
|> SynExpr.startAsTask cancellationTokenArg
|
||||
@@ -907,6 +914,10 @@ module internal HttpClientGenerator =
|
||||
"Create a REST client. The input functions will be re-evaluated on every HTTP request to obtain the required values for the corresponding header properties."
|
||||
|> PreXmlDoc.create
|
||||
|
||||
let functionName = Ident.create "client"
|
||||
|
||||
let pattern = SynLongIdent.createS "make"
|
||||
|
||||
let returnInfo = SynType.createLongIdent interfaceType.Name
|
||||
|
||||
let nameWithoutLeadingI =
|
||||
|
Reference in New Issue
Block a user