From 42640364d5a71d07d301af5d627247d30f438102 Mon Sep 17 00:00:00 2001 From: Zentrik Date: Sun, 7 Jan 2024 00:49:12 +0000 Subject: [PATCH 1/9] Add x86 runner to TypedSyntax CI --- .github/workflows/TypedSyntaxCI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/TypedSyntaxCI.yml b/.github/workflows/TypedSyntaxCI.yml index 59a351a3..165ba4d0 100644 --- a/.github/workflows/TypedSyntaxCI.yml +++ b/.github/workflows/TypedSyntaxCI.yml @@ -18,6 +18,7 @@ jobs: - ubuntu-latest arch: - x64 + - x86 steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 From a19b5663ffea58bd0deae3a4ec78ce9bef1fd639 Mon Sep 17 00:00:00 2001 From: Zentrik Date: Sun, 7 Jan 2024 00:51:07 +0000 Subject: [PATCH 2/9] Add x86 runners to Cthulhu CI Exclude mac as x86 mac is tier 3 for Julia --- .github/workflows/CI.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 942eba8c..bcee9167 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -22,6 +22,10 @@ jobs: - windows-latest arch: - x64 + - x86 + exclude: + - os: macOS-latest + arch: x86 steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 From 326401e320decf5047b6e48c6f90c56dfd8c8832 Mon Sep 17 00:00:00 2001 From: Zentrik Date: Sun, 7 Jan 2024 01:32:00 +0000 Subject: [PATCH 3/9] Fix various tests for 32 bit Julia Choice on using Int64 or adapting tests to Int were based on smallness of change. --- TypedSyntax/test/runtests.jl | 6 +- test/test_codeview_vscode.jl | 118 +++++++++++++------------- test/test_vscode_example_functions.jl | 2 +- 3 files changed, 63 insertions(+), 63 deletions(-) diff --git a/TypedSyntax/test/runtests.jl b/TypedSyntax/test/runtests.jl index 74ffc0f5..d4faae4b 100644 --- a/TypedSyntax/test/runtests.jl +++ b/TypedSyntax/test/runtests.jl @@ -349,7 +349,7 @@ include("test_module.jl") tsn = TypedSyntaxNode(TSN.summer_iterate, (Vector{Float64},)) @test tsn.typ == Union{Int,Float64} sig, body = children(tsn) - @test has_name_typ(child(body, 2, 1), :ret, Union{Nothing, Tuple{Float64, Int64}}) + @test has_name_typ(child(body, 2, 1), :ret, Union{Nothing, Tuple{Float64, Int}}) @test has_name_typ(child(body, 3, 2, 1, 1, 1), :x, Float64) # `where`, unnamed arguments, and types-as-arguments @@ -552,7 +552,7 @@ include("test_module.jl") @test TypedSyntax.num_positional_args(tsn) == 2 # Display - tsn = TypedSyntaxNode(TSN.mysin, (Int,)) + tsn = TypedSyntaxNode(TSN.mysin, (Int64,)) str = sprint(tsn; context=:color=>false) do io, obj printstyled(io, obj; hide_type_stable=false) end @@ -602,7 +602,7 @@ include("test_module.jl") end @test occursin("[1]\e[36m::Float32\e[39m", str) @test occursin("[2]\e[36m::Float32\e[39m", str) - tsn = TypedSyntaxNode(TSN.simplef, (Int, Float64)) + tsn = TypedSyntaxNode(TSN.simplef, (Int64, Float64)) str = sprint(tsn; context=:color=>false) do io, obj printstyled(io, obj; hide_type_stable=false) end diff --git a/test/test_codeview_vscode.jl b/test/test_codeview_vscode.jl index c90033dd..8fdef635 100644 --- a/test/test_codeview_vscode.jl +++ b/test/test_codeview_vscode.jl @@ -36,7 +36,7 @@ include("test_vscode_example_functions.jl") fake_terminal() do term, in, out, _ t = @async begin - @test_nowarn descend(fib, (Int64,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) + @test_nowarn descend(fib, (Int,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) end write(in, 'q') wait(t) @@ -60,18 +60,18 @@ include("test_vscode_example_functions.jl") if !hide_type_stable && inlay_types_vscode @test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ - TypedSyntax.InlayHint(1, 14, "::Int64", 1) - TypedSyntax.InlayHint(1, 15, "::Int64", 1) + TypedSyntax.InlayHint(1, 14, "::$Int", 1) + TypedSyntax.InlayHint(1, 15, "::$Int", 1) TypedSyntax.InlayHint(3, 11, "(", 1) TypedSyntax.InlayHint(3, 15, "(", 1) - TypedSyntax.InlayHint(3, 16, "::Int64", 1) - TypedSyntax.InlayHint(3, 20, ")::Int64", 1) - TypedSyntax.InlayHint(3, 21, "::Int64", 1) + TypedSyntax.InlayHint(3, 16, "::$Int", 1) + TypedSyntax.InlayHint(3, 20, ")::$Int", 1) + TypedSyntax.InlayHint(3, 21, "::$Int", 1) TypedSyntax.InlayHint(3, 28, "(", 1) - TypedSyntax.InlayHint(3, 29, "::Int64", 1) - TypedSyntax.InlayHint(3, 33, ")::Int64", 1) - TypedSyntax.InlayHint(3, 34, "::Int64", 1) - TypedSyntax.InlayHint(3, 34, ")::Int64", 1) + TypedSyntax.InlayHint(3, 29, "::$Int", 1) + TypedSyntax.InlayHint(3, 33, ")::$Int", 1) + TypedSyntax.InlayHint(3, 34, "::$Int", 1) + TypedSyntax.InlayHint(3, 34, ")::$Int", 1) ]) elseif hide_type_stable && inlay_types_vscode @test isempty(VSCodeServer.inlay_hints[1]) @@ -85,7 +85,7 @@ include("test_vscode_example_functions.jl") fake_terminal() do term, in, out, _ t = @async begin - @test_nowarn descend(fVSCode, (Int64,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) + @test_nowarn descend(fVSCode, (Int,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) end write(in, 'q') wait(t) @@ -114,60 +114,60 @@ include("test_vscode_example_functions.jl") if !hide_type_stable && inlay_types_vscode if iswarn @test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ - TypedSyntax.InlayHint(7, 18, "::Int64", 1) - TypedSyntax.InlayHint(7, 19, "::Union{Float64, Int64}", nothing) - TypedSyntax.InlayHint(8, 5, "::Int64", 1) + TypedSyntax.InlayHint(7, 18, "::$Int", 1) + TypedSyntax.InlayHint(7, 19, "::Union{Float64, $Int}", nothing) + TypedSyntax.InlayHint(8, 5, "::$Int", 1) TypedSyntax.InlayHint(8, 8, "(", 1) - TypedSyntax.InlayHint(8, 9, "::Int64", 1) - TypedSyntax.InlayHint(8, 13, ")::Int64", 1) - TypedSyntax.InlayHint(9, 5, "::Int64", 1) + TypedSyntax.InlayHint(8, 9, "::$Int", 1) + TypedSyntax.InlayHint(8, 13, ")::$Int", 1) + TypedSyntax.InlayHint(9, 5, "::$Int", 1) TypedSyntax.InlayHint(9, 8, "(", 1) - TypedSyntax.InlayHint(9, 13, "::Int64", 1) - TypedSyntax.InlayHint(9, 13, ")::Int64", 1) + TypedSyntax.InlayHint(9, 13, "::$Int", 1) + TypedSyntax.InlayHint(9, 13, ")::$Int", 1) TypedSyntax.InlayHint(10, 11, "(", 1) - TypedSyntax.InlayHint(10, 12, "::Int64", 1) + TypedSyntax.InlayHint(10, 12, "::$Int", 1) TypedSyntax.InlayHint(10, 16, "(", 1) - TypedSyntax.InlayHint(10, 17, "::Int64", 1) + TypedSyntax.InlayHint(10, 17, "::$Int", 1) TypedSyntax.InlayHint(10, 21, ")::Bool", 1) - TypedSyntax.InlayHint(10, 26, "::Int64", 1) + TypedSyntax.InlayHint(10, 26, "::$Int", 1) TypedSyntax.InlayHint(10, 32, "::Float64", 1) - TypedSyntax.InlayHint(10, 33, ")::Union{Float64, Int64}", nothing) + TypedSyntax.InlayHint(10, 33, ")::Union{Float64, $Int}", nothing) ]) else @test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ - TypedSyntax.InlayHint(7, 18, "::Int64", 1) - TypedSyntax.InlayHint(7, 19, "::Union{Float64, Int64}", 1) - TypedSyntax.InlayHint(8, 5, "::Int64", 1) + TypedSyntax.InlayHint(7, 18, "::$Int", 1) + TypedSyntax.InlayHint(7, 19, "::Union{Float64, $Int}", 1) + TypedSyntax.InlayHint(8, 5, "::$Int", 1) TypedSyntax.InlayHint(8, 8, "(", 1) - TypedSyntax.InlayHint(8, 9, "::Int64", 1) - TypedSyntax.InlayHint(8, 13, ")::Int64", 1) - TypedSyntax.InlayHint(9, 5, "::Int64", 1) + TypedSyntax.InlayHint(8, 9, "::$Int", 1) + TypedSyntax.InlayHint(8, 13, ")::$Int", 1) + TypedSyntax.InlayHint(9, 5, "::$Int", 1) TypedSyntax.InlayHint(9, 8, "(", 1) - TypedSyntax.InlayHint(9, 13, "::Int64", 1) - TypedSyntax.InlayHint(9, 13, ")::Int64", 1) + TypedSyntax.InlayHint(9, 13, "::$Int", 1) + TypedSyntax.InlayHint(9, 13, ")::$Int", 1) TypedSyntax.InlayHint(10, 11, "(", 1) - TypedSyntax.InlayHint(10, 12, "::Int64", 1) + TypedSyntax.InlayHint(10, 12, "::$Int", 1) TypedSyntax.InlayHint(10, 16, "(", 1) - TypedSyntax.InlayHint(10, 17, "::Int64", 1) + TypedSyntax.InlayHint(10, 17, "::$Int", 1) TypedSyntax.InlayHint(10, 21, ")::Bool", 1) - TypedSyntax.InlayHint(10, 26, "::Int64", 1) + TypedSyntax.InlayHint(10, 26, "::$Int", 1) TypedSyntax.InlayHint(10, 32, "::Float64", 1) - TypedSyntax.InlayHint(10, 33, ")::Union{Float64, Int64}", 1) + TypedSyntax.InlayHint(10, 33, ")::Union{Float64, $Int}", 1) ]) end elseif hide_type_stable && inlay_types_vscode if iswarn @test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ - TypedSyntax.InlayHint(7, 19, "::Union{Float64, Int64}", nothing) + TypedSyntax.InlayHint(7, 19, "::Union{Float64, $Int}", nothing) TypedSyntax.InlayHint(10, 11, "(", 1) - TypedSyntax.InlayHint(10, 33, ")::Union{Float64, Int64}", nothing) + TypedSyntax.InlayHint(10, 33, ")::Union{Float64, $Int}", nothing) ]) else @test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ - TypedSyntax.InlayHint(7, 19, "::Union{Float64, Int64}", 1) + TypedSyntax.InlayHint(7, 19, "::Union{Float64, $Int}", 1) TypedSyntax.InlayHint(10, 11, "(", 1) - TypedSyntax.InlayHint(10, 33, ")::Union{Float64, Int64}", 1) + TypedSyntax.InlayHint(10, 33, ")::Union{Float64, $Int}", 1) ]) end end @@ -206,11 +206,11 @@ include("test_vscode_example_functions.jl") if !hide_type_stable && inlay_types_vscode @test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ TypedSyntax.InlayHint(14, 18, "::Float64", 1) - TypedSyntax.InlayHint(14, 19, "::Int64", 1) + TypedSyntax.InlayHint(14, 19, "::$Int", 1) TypedSyntax.InlayHint(15, 15, "::Float64", 1) - TypedSyntax.InlayHint(15, 16, "::Int64", 1) + TypedSyntax.InlayHint(15, 16, "::$Int", 1) TypedSyntax.InlayHint(16, 9, "::Float64", 1) - TypedSyntax.InlayHint(16, 10, "::Int64", 1) + TypedSyntax.InlayHint(16, 10, "::$Int", 1) ]) elseif hide_type_stable && inlay_types_vscode @test isempty(VSCodeServer.inlay_hints[1]) @@ -219,12 +219,12 @@ include("test_vscode_example_functions.jl") end for inlay_types_vscode in (true, false), diagnostics_vscode in (true, false), iswarn in (true, false), hide_type_stable in (true, false) - @testset "fibcall Int64 inlay_types_vscode=$inlay_types_vscode, diagnostics_vscode=$diagnostics_vscode, iswarn=$iswarn, hide_type_stable=$hide_type_stable" begin + @testset "fibcall $Int inlay_types_vscode=$inlay_types_vscode, diagnostics_vscode=$diagnostics_vscode, iswarn=$iswarn, hide_type_stable=$hide_type_stable" begin VSCodeServer.reset_test_containers() fake_terminal() do term, in, out, _ t = @async begin - @test_nowarn descend(fibcall, (Int64,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) + @test_nowarn descend(fibcall, (Int,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) end write(in, 'q') wait(t) @@ -248,24 +248,24 @@ include("test_vscode_example_functions.jl") if !hide_type_stable && inlay_types_vscode @test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ - TypedSyntax.InlayHint(14, 18, "::Int64", 1) - TypedSyntax.InlayHint(14, 19, "::Int64", 1) - TypedSyntax.InlayHint(15, 15, "::Int64", 1) - TypedSyntax.InlayHint(15, 16, "::Int64", 1) - TypedSyntax.InlayHint(16, 9, "::Int64", 1) - TypedSyntax.InlayHint(16, 10, "::Int64", 1) - TypedSyntax.InlayHint(1, 14, "::Int64", 1) - TypedSyntax.InlayHint(1, 15, "::Int64", 1) + TypedSyntax.InlayHint(14, 18, "::$Int", 1) + TypedSyntax.InlayHint(14, 19, "::$Int", 1) + TypedSyntax.InlayHint(15, 15, "::$Int", 1) + TypedSyntax.InlayHint(15, 16, "::$Int", 1) + TypedSyntax.InlayHint(16, 9, "::$Int", 1) + TypedSyntax.InlayHint(16, 10, "::$Int", 1) + TypedSyntax.InlayHint(1, 14, "::$Int", 1) + TypedSyntax.InlayHint(1, 15, "::$Int", 1) TypedSyntax.InlayHint(3, 11, "(", 1) TypedSyntax.InlayHint(3, 15, "(", 1) - TypedSyntax.InlayHint(3, 16, "::Int64", 1) - TypedSyntax.InlayHint(3, 20, ")::Int64", 1) - TypedSyntax.InlayHint(3, 21, "::Int64", 1) + TypedSyntax.InlayHint(3, 16, "::$Int", 1) + TypedSyntax.InlayHint(3, 20, ")::$Int", 1) + TypedSyntax.InlayHint(3, 21, "::$Int", 1) TypedSyntax.InlayHint(3, 28, "(", 1) - TypedSyntax.InlayHint(3, 29, "::Int64", 1) - TypedSyntax.InlayHint(3, 33, ")::Int64", 1) - TypedSyntax.InlayHint(3, 34, "::Int64", 1) - TypedSyntax.InlayHint(3, 34, ")::Int64", 1) + TypedSyntax.InlayHint(3, 29, "::$Int", 1) + TypedSyntax.InlayHint(3, 33, ")::$Int", 1) + TypedSyntax.InlayHint(3, 34, "::$Int", 1) + TypedSyntax.InlayHint(3, 34, ")::$Int", 1) ]) elseif hide_type_stable && inlay_types_vscode @test isempty(VSCodeServer.inlay_hints[1]) diff --git a/test/test_vscode_example_functions.jl b/test/test_vscode_example_functions.jl index 8de22280..8728ed8a 100644 --- a/test/test_vscode_example_functions.jl +++ b/test/test_vscode_example_functions.jl @@ -13,6 +13,6 @@ end # exact location in file matters function fibcall(n) - fib(Int64(n)) + fib(Int(n)) fib(n) end \ No newline at end of file From 92bffc362b560eecb7c0a84310f3581d371029b6 Mon Sep 17 00:00:00 2001 From: Zentrik Date: Sun, 7 Jan 2024 01:52:45 +0000 Subject: [PATCH 4/9] Fix test I think this is the right column offset to deal with changes to fibcall function defintion. Having trouble getting things running locally. --- test/test_codeview_vscode.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_codeview_vscode.jl b/test/test_codeview_vscode.jl index 8fdef635..cec12156 100644 --- a/test/test_codeview_vscode.jl +++ b/test/test_codeview_vscode.jl @@ -209,8 +209,8 @@ include("test_vscode_example_functions.jl") TypedSyntax.InlayHint(14, 19, "::$Int", 1) TypedSyntax.InlayHint(15, 15, "::Float64", 1) TypedSyntax.InlayHint(15, 16, "::$Int", 1) - TypedSyntax.InlayHint(16, 9, "::Float64", 1) - TypedSyntax.InlayHint(16, 10, "::$Int", 1) + TypedSyntax.InlayHint(16, 7, "::Float64", 1) + TypedSyntax.InlayHint(16, 8, "::$Int", 1) ]) elseif hide_type_stable && inlay_types_vscode @test isempty(VSCodeServer.inlay_hints[1]) @@ -219,7 +219,7 @@ include("test_vscode_example_functions.jl") end for inlay_types_vscode in (true, false), diagnostics_vscode in (true, false), iswarn in (true, false), hide_type_stable in (true, false) - @testset "fibcall $Int inlay_types_vscode=$inlay_types_vscode, diagnostics_vscode=$diagnostics_vscode, iswarn=$iswarn, hide_type_stable=$hide_type_stable" begin + @testset "fibcall Int inlay_types_vscode=$inlay_types_vscode, diagnostics_vscode=$diagnostics_vscode, iswarn=$iswarn, hide_type_stable=$hide_type_stable" begin VSCodeServer.reset_test_containers() fake_terminal() do term, in, out, _ @@ -252,8 +252,8 @@ include("test_vscode_example_functions.jl") TypedSyntax.InlayHint(14, 19, "::$Int", 1) TypedSyntax.InlayHint(15, 15, "::$Int", 1) TypedSyntax.InlayHint(15, 16, "::$Int", 1) - TypedSyntax.InlayHint(16, 9, "::$Int", 1) - TypedSyntax.InlayHint(16, 10, "::$Int", 1) + TypedSyntax.InlayHint(16, 7, "::$Int", 1) + TypedSyntax.InlayHint(16, 8, "::$Int", 1) TypedSyntax.InlayHint(1, 14, "::$Int", 1) TypedSyntax.InlayHint(1, 15, "::$Int", 1) TypedSyntax.InlayHint(3, 11, "(", 1) From 77de26c5df7c7cf64197d9843a86b2dd5baf0c19 Mon Sep 17 00:00:00 2001 From: Zentrik Date: Sun, 7 Jan 2024 02:03:47 +0000 Subject: [PATCH 5/9] Fix previous commit Got it working locally. --- test/test_codeview_vscode.jl | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/test_codeview_vscode.jl b/test/test_codeview_vscode.jl index cec12156..e14d6304 100644 --- a/test/test_codeview_vscode.jl +++ b/test/test_codeview_vscode.jl @@ -203,14 +203,15 @@ include("test_vscode_example_functions.jl") @test VSCodeServer.diagnostics[1][1].msg == "Cthulhu disabled: This function was called multiple times with different argument types" end + println(stdout, first(values(VSCodeServer.inlay_hints[1]))) if !hide_type_stable && inlay_types_vscode @test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ TypedSyntax.InlayHint(14, 18, "::Float64", 1) TypedSyntax.InlayHint(14, 19, "::$Int", 1) - TypedSyntax.InlayHint(15, 15, "::Float64", 1) - TypedSyntax.InlayHint(15, 16, "::$Int", 1) - TypedSyntax.InlayHint(16, 7, "::Float64", 1) - TypedSyntax.InlayHint(16, 8, "::$Int", 1) + TypedSyntax.InlayHint(15, 13, "::Float64", 1) + TypedSyntax.InlayHint(15, 14, "::$Int", 1) + TypedSyntax.InlayHint(16, 9, "::Float64", 1) + TypedSyntax.InlayHint(16, 10, "::$Int", 1) ]) elseif hide_type_stable && inlay_types_vscode @test isempty(VSCodeServer.inlay_hints[1]) @@ -250,10 +251,10 @@ include("test_vscode_example_functions.jl") @test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ TypedSyntax.InlayHint(14, 18, "::$Int", 1) TypedSyntax.InlayHint(14, 19, "::$Int", 1) - TypedSyntax.InlayHint(15, 15, "::$Int", 1) - TypedSyntax.InlayHint(15, 16, "::$Int", 1) - TypedSyntax.InlayHint(16, 7, "::$Int", 1) - TypedSyntax.InlayHint(16, 8, "::$Int", 1) + TypedSyntax.InlayHint(15, 13, "::$Int", 1) + TypedSyntax.InlayHint(15, 14, "::$Int", 1) + TypedSyntax.InlayHint(16, 9, "::$Int", 1) + TypedSyntax.InlayHint(16, 10, "::$Int", 1) TypedSyntax.InlayHint(1, 14, "::$Int", 1) TypedSyntax.InlayHint(1, 15, "::$Int", 1) TypedSyntax.InlayHint(3, 11, "(", 1) From f63ec8eb6d08ff978024189eb0f134485fa1a950 Mon Sep 17 00:00:00 2001 From: Zentrik Date: Sun, 7 Jan 2024 02:09:19 +0000 Subject: [PATCH 6/9] Remove debugging line --- test/test_codeview_vscode.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test_codeview_vscode.jl b/test/test_codeview_vscode.jl index e14d6304..55ba0035 100644 --- a/test/test_codeview_vscode.jl +++ b/test/test_codeview_vscode.jl @@ -203,7 +203,6 @@ include("test_vscode_example_functions.jl") @test VSCodeServer.diagnostics[1][1].msg == "Cthulhu disabled: This function was called multiple times with different argument types" end - println(stdout, first(values(VSCodeServer.inlay_hints[1]))) if !hide_type_stable && inlay_types_vscode @test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ TypedSyntax.InlayHint(14, 18, "::Float64", 1) @@ -275,4 +274,4 @@ include("test_vscode_example_functions.jl") end end -end \ No newline at end of file +end From 67fff92756759f2bbf74032891dd07e6642cbfa8 Mon Sep 17 00:00:00 2001 From: Zentrik Date: Mon, 8 Jan 2024 00:06:11 +0000 Subject: [PATCH 7/9] Fix test? There seems to be a weird bug on nightly, where Type{Int} doesn't get printed if `fibcall` is defined once. --- test/test_codeview_vscode.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_codeview_vscode.jl b/test/test_codeview_vscode.jl index 55ba0035..9278fd37 100644 --- a/test/test_codeview_vscode.jl +++ b/test/test_codeview_vscode.jl @@ -207,6 +207,7 @@ include("test_vscode_example_functions.jl") @test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ TypedSyntax.InlayHint(14, 18, "::Float64", 1) TypedSyntax.InlayHint(14, 19, "::$Int", 1) + TypedSyntax.InlayHint(15, 11, "::Type{$Int}", 1) TypedSyntax.InlayHint(15, 13, "::Float64", 1) TypedSyntax.InlayHint(15, 14, "::$Int", 1) TypedSyntax.InlayHint(16, 9, "::Float64", 1) @@ -250,6 +251,7 @@ include("test_vscode_example_functions.jl") @test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ TypedSyntax.InlayHint(14, 18, "::$Int", 1) TypedSyntax.InlayHint(14, 19, "::$Int", 1) + TypedSyntax.InlayHint(15, 11, "::Type{$Int}", 1) TypedSyntax.InlayHint(15, 13, "::$Int", 1) TypedSyntax.InlayHint(15, 14, "::$Int", 1) TypedSyntax.InlayHint(16, 9, "::$Int", 1) From 64aa86c66e897511d93d8a4cf0a49eda3a9ea292 Mon Sep 17 00:00:00 2001 From: Zentrik Date: Mon, 8 Jan 2024 00:12:41 +0000 Subject: [PATCH 8/9] Fix some more tests --- TypedSyntax/test/runtests.jl | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/TypedSyntax/test/runtests.jl b/TypedSyntax/test/runtests.jl index d4faae4b..52bf2d7e 100644 --- a/TypedSyntax/test/runtests.jl +++ b/TypedSyntax/test/runtests.jl @@ -695,32 +695,32 @@ using TypedSyntax: InlayHint, Diagnostic, InlayHintKinds @testset "test_vscode.jl" begin # VSCode - tsn = TypedSyntaxNode(TSN.fVSCode, (Int64,)) + tsn = TypedSyntaxNode(TSN.fVSCode, (Int,)) io = IOContext(devnull, :inlay_hints=>Dict{String, Vector{InlayHint}}(), :diagnostics=>Diagnostic[]) printstyled(io, tsn) - @test getproperty.(first(values(io[:inlay_hints])), :kind) == [InlayHintKinds.Nothing, InlayHintKinds.Type, InlayHintKinds.Nothing] && getproperty.(first(values(io[:inlay_hints])), :label) == ["::Union{Float64, Int64}", "(", ")::Union{Float64, Int64}"] + @test getproperty.(first(values(io[:inlay_hints])), :kind) == [InlayHintKinds.Nothing, InlayHintKinds.Type, InlayHintKinds.Nothing] && getproperty.(first(values(io[:inlay_hints])), :label) == ["::Union{Float64, $Int}", "(", ")::Union{Float64, $Int}"] @test length(io[:diagnostics]) == 2 io = IOContext(devnull, :inlay_hints=>Dict{String, Vector{InlayHint}}(), :diagnostics=>Diagnostic[]) printstyled(io, tsn; hide_type_stable=false) - @test getproperty.(first(values(io[:inlay_hints])), :kind) == vcat(InlayHintKinds.Type, InlayHintKinds.Nothing, repeat([InlayHintKinds.Type], 15), InlayHintKinds.Nothing) && getproperty.(first(values(io[:inlay_hints])), :label) == ["::Int64" - "::Union{Float64, Int64}" - "::Int64" + @test getproperty.(first(values(io[:inlay_hints])), :kind) == vcat(InlayHintKinds.Type, InlayHintKinds.Nothing, repeat([InlayHintKinds.Type], 15), InlayHintKinds.Nothing) && getproperty.(first(values(io[:inlay_hints])), :label) == ["::$Int" + "::Union{Float64, $Int}" + "::$Int" "(" - "::Int64" - ")::Int64" - "::Int64" + "::$Int" + ")::$Int" + "::$Int" "(" - "::Int64" - ")::Int64" + "::$Int" + ")::$Int" "(" - "::Int64" + "::$Int" "(" - "::Int64" + "::$Int" ")::Bool" - "::Int64" + "::$Int" "::Float64" - ")::Union{Float64, Int64}"] + ")::Union{Float64, $Int}"] @test length(io[:diagnostics]) == 2 end From 08912d54b7a4f86204e58d042a118da2af6199de Mon Sep 17 00:00:00 2001 From: Zentrik Date: Mon, 15 Jan 2024 11:14:26 +0000 Subject: [PATCH 9/9] Workaround Issue #530 --- test/test_codeview_vscode.jl | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/test/test_codeview_vscode.jl b/test/test_codeview_vscode.jl index 9278fd37..8ef87974 100644 --- a/test/test_codeview_vscode.jl +++ b/test/test_codeview_vscode.jl @@ -212,7 +212,14 @@ include("test_vscode_example_functions.jl") TypedSyntax.InlayHint(15, 14, "::$Int", 1) TypedSyntax.InlayHint(16, 9, "::Float64", 1) TypedSyntax.InlayHint(16, 10, "::$Int", 1) - ]) + ]) || equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ + TypedSyntax.InlayHint(14, 18, "::Float64", 1) + TypedSyntax.InlayHint(14, 19, "::$Int", 1) + TypedSyntax.InlayHint(15, 13, "::Float64", 1) + TypedSyntax.InlayHint(15, 14, "::$Int", 1) + TypedSyntax.InlayHint(16, 9, "::Float64", 1) + TypedSyntax.InlayHint(16, 10, "::$Int", 1) + ]) # Workaround for #530 elseif hide_type_stable && inlay_types_vscode @test isempty(VSCodeServer.inlay_hints[1]) end @@ -268,7 +275,26 @@ include("test_vscode_example_functions.jl") TypedSyntax.InlayHint(3, 33, ")::$Int", 1) TypedSyntax.InlayHint(3, 34, "::$Int", 1) TypedSyntax.InlayHint(3, 34, ")::$Int", 1) - ]) + ]) || equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [ + TypedSyntax.InlayHint(14, 18, "::$Int", 1) + TypedSyntax.InlayHint(14, 19, "::$Int", 1) + TypedSyntax.InlayHint(15, 13, "::$Int", 1) + TypedSyntax.InlayHint(15, 14, "::$Int", 1) + TypedSyntax.InlayHint(16, 9, "::$Int", 1) + TypedSyntax.InlayHint(16, 10, "::$Int", 1) + TypedSyntax.InlayHint(1, 14, "::$Int", 1) + TypedSyntax.InlayHint(1, 15, "::$Int", 1) + TypedSyntax.InlayHint(3, 11, "(", 1) + TypedSyntax.InlayHint(3, 15, "(", 1) + TypedSyntax.InlayHint(3, 16, "::$Int", 1) + TypedSyntax.InlayHint(3, 20, ")::$Int", 1) + TypedSyntax.InlayHint(3, 21, "::$Int", 1) + TypedSyntax.InlayHint(3, 28, "(", 1) + TypedSyntax.InlayHint(3, 29, "::$Int", 1) + TypedSyntax.InlayHint(3, 33, ")::$Int", 1) + TypedSyntax.InlayHint(3, 34, "::$Int", 1) + TypedSyntax.InlayHint(3, 34, ")::$Int", 1) + ]) # Workaround for #530 elseif hide_type_stable && inlay_types_vscode @test isempty(VSCodeServer.inlay_hints[1]) end