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