diff --git a/src/extensions/extensions.jl b/src/extensions/extensions.jl index de959176..bb744bdb 100644 --- a/src/extensions/extensions.jl +++ b/src/extensions/extensions.jl @@ -10,24 +10,24 @@ end id::String label::String range::Range - code::Union{Nothing,String} - code_range::Union{Nothing,Range} - option_default_imports::Union{Nothing,Bool} - option_tags::Union{Nothing,Vector{String}} - option_setup::Union{Nothing,Vector{String}} + code::String + codeRange::Range + optionDefaultImports::Bool + optionTags::Vector{String} + optionSetup::Vector{String} end @dict_readable struct TestSetupDetail <: Outbound name::String kind::String range::Range - code::Union{Nothing,String} - code_range::Union{Nothing,Range} + code::String + codeRange::Range end @dict_readable struct TestErrorDetail <: Outbound id::String - label::Union{Nothing,String} + label::String range::Range error::String end @@ -35,9 +35,9 @@ end struct PublishTestsParams <: Outbound uri::DocumentUri version::Union{Int,Missing} - testitemdetails::Vector{TestItemDetail} - testsetupdetails::Vector{TestSetupDetail} - testerrordetails::Vector{TestErrorDetail} + testItemDetails::Vector{TestItemDetail} + testSetupDetails::Vector{TestSetupDetail} + testErrorDetails::Vector{TestErrorDetail} end @dict_readable struct GetTestEnvRequestParams <: Outbound @@ -45,10 +45,10 @@ end end @dict_readable struct GetTestEnvRequestParamsReturn <: Outbound - package_name::String - package_uri::Union{URI,Nothing} - project_uri::Union{URI,Nothing} - env_content_hash::Union{UInt,Nothing} + packageName::String + packageUri::Union{URI,Missing} + projectUri::Union{URI,Missing} + envContentHash::Union{UInt,Missing} end include("messagedefs.jl") diff --git a/src/requests/testing.jl b/src/requests/testing.jl index b1eebbb6..9347e380 100644 --- a/src/requests/testing.jl +++ b/src/requests/testing.jl @@ -3,8 +3,8 @@ function julia_get_test_env_request(params::GetTestEnvRequestParams, server::Lan return GetTestEnvRequestParamsReturn( r.package_name, - r.package_uri, - r.project_uri, - r.env_content_hash + something(r.package_uri, missing), + something(r.project_uri, missing), + something(r.env_content_hash, missing) ) end diff --git a/src/requests/textdocument.jl b/src/requests/textdocument.jl index c3c016ff..f9c37ab4 100644 --- a/src/requests/textdocument.jl +++ b/src/requests/textdocument.jl @@ -471,9 +471,35 @@ function publish_tests(server::LanguageServerInstance) testitems_results = JuliaWorkspaces.get_test_items(server.workspace, uri) st = JuliaWorkspaces.get_text_file(server.workspace, uri).content - testitems = TestItemDetail[TestItemDetail(i.id, i.name, Range(st, i.range), st.content[i.code_range], Range(st, i.code_range), i.option_default_imports, string.(i.option_tags), string.(i.option_setup)) for i in testitems_results.testitems] - testsetups= TestSetupDetail[TestSetupDetail(string(i.name), string(i.kind), Range(st, i.range), st.content[i.code_range], Range(st, i.code_range), ) for i in testitems_results.testsetups] - testerrors = TestErrorDetail[TestErrorDetail(te.id, te.name, Range(st, te.range), te.message) for te in testitems_results.testerrors] + testitems = TestItemDetail[ + TestItemDetail( + id = i.id, + label = i.name, + range = Range(st, i.range), + code = st.content[i.code_range], + codeRange = Range(st, i.code_range), + optionDefaultImports = i.option_default_imports, + optionTags = string.(i.option_tags), + optionSetup = string.(i.option_setup) + ) for i in testitems_results.testitems + ] + testsetups= TestSetupDetail[ + TestSetupDetail( + name = string(i.name), + kind = string(i.kind), + range = Range(st, i.range), + code = st.content[i.code_range], + codeRange = Range(st, i.code_range) + ) for i in testitems_results.testsetups + ] + testerrors = TestErrorDetail[ + TestErrorDetail( + id = te.id, + label = te.name, + range = Range(st, te.range), + error = te.message + ) for te in testitems_results.testerrors + ] version = get(server._open_file_versions, uri, missing)