Use more of the Whippet Fantomas client lib (#284)

This commit is contained in:
Patrick Stevens
2024-10-06 22:22:24 +01:00
committed by GitHub
parent 5319a33b7b
commit d59ebdfccb
6 changed files with 33 additions and 48 deletions

View File

@@ -291,14 +291,14 @@ type InterfaceMockGenerator () =
let ast, _ =
Ast.fromFilename context.InputFilename |> Async.RunSynchronously |> Array.head
let types = Ast.extractTypeDefn ast
let types = Ast.getTypes ast
let namespaceAndInterfaces =
types
|> List.choose (fun (ns, types) ->
types
|> List.choose (fun typeDef ->
match Ast.getAttribute<GenerateMockAttribute> typeDef with
match SynTypeDefn.getAttribute typeof<GenerateMockAttribute>.Name typeDef with
| None ->
let name = SynTypeDefn.getName typeDef |> List.map _.idText |> String.concat "."