File tree Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -468,6 +468,7 @@ let rec startCompilation (changes: Set<string>) (state: State) = async {
468468 logs, deps
469469 | Error e ->
470470 let log = Log.MakeError( e.Exception.Message, fileName= e.File, tag= " EXCEPTION" )
471+ Log.verbose( lazy e.Exception.StackTrace)
471472 Array.append logs [| log|], deps)
472473
473474 return logs, watchDependencies, { state with FableCompilationMs = ms }
Original file line number Diff line number Diff line change @@ -138,6 +138,8 @@ type FsEnt(ent: FSharpEntity) =
138138 match ent.Namespace with
139139 | Some ns -> ns + " ." + ent.CompiledName
140140 | None -> ent.CompiledName
141+ | None when ent.IsProvided ->
142+ ent.LogicalName
141143 | None ->
142144 match ent.TryFullName with
143145 | Some n -> n
Original file line number Diff line number Diff line change 1010 <ItemGroup >
1111 <PackageReference Include =" Expecto" Version =" 5.1.2" />
1212 <PackageReference Include =" AltCover" Version =" 5.3.675" />
13+ <PackageReference Include =" Fable.JsonProvider" Version =" 1.0.1" />
1314 <PackageReference Include =" FSharp.Core" Version =" 5.0.0" />
1415 <PackageReference Include =" FSharp.Data.Adaptive" Version =" 1.0.1" />
1516 <PackageReference Include =" FSharp.UMX" Version =" 1.0.0" />
Original file line number Diff line number Diff line change @@ -5,6 +5,45 @@ open Fable.Core
55open Util.Testing
66open Util2.Extensions
77
8+ let [<Literal>] LITERAL_JSON = """ {
9+ "widget": {
10+ "debug": true,
11+ "window": {
12+ "title": "Sample Konfabulator Widget",
13+ "name": "main_window",
14+ "width": 500,
15+ "height": 500
16+ },
17+ "image": {
18+ "src": "Images/Sun.png",
19+ "name": "sun1",
20+ "hOffset": 250,
21+ "vOffset": 250,
22+ "alignment": "center"
23+ },
24+ "text": {
25+ "data": "Click Here",
26+ "size": [{ "width": 36, "height": 40 }],
27+ "style": "bold",
28+ "name": "text1",
29+ "vOffset": 100,
30+ "alignment": "center",
31+ "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
32+ }
33+ }
34+ }"""
35+
36+ let ANOTHER_JSON = """ {
37+ "widget": {
38+ "debug": false,
39+ "text": {
40+ "data": "lots of",
41+ "size": [{"width": 5}, { "height": 80 }],
42+ "vOffset": 500
43+ }
44+ }
45+ }"""
46+
847// We can have aliases with same name in same file #1662
948module One =
1049 type Id = System.Guid
@@ -388,10 +427,23 @@ type Order =
388427 quantity : int < kg >
389428 }
390429
430+ #if ! FABLE_ COMPILER_ JS
431+ type LiteralJson = Fable.JsonProvider.Generator< LITERAL_ JSON>
432+ #endif
433+
391434let tests =
392435 testList " Miscellaneous" [
393436
394437#if FABLE_ COMPILER
438+ #if ! FABLE_ COMPILER_ JS
439+ testCase " Fable.JsonProvider works" <| fun _ ->
440+ let parsed = LiteralJson( ANOTHER_ JSON)
441+ parsed.widget.debug |> equal false
442+ parsed.widget.text.data |> equal " lots of"
443+ parsed.widget.text.size.[ 1 ]. height |> equal 80.
444+ parsed.widget.text.vOffset |> equal 500.
445+ #endif
446+
395447 testCase " Can check compiler version with constant" <| fun _ ->
396448 let mutable x = 0
397449 #if FABLE_ COMPILER
You can’t perform that action at this time.
0 commit comments