Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/requests/hover.jl
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,12 @@ function get_fcall_position(x::EXPR, documentation, visited=Set{EXPR}())
documentation = string("Datatype field `$(dts.fieldnames[arg_i])`", "\n", documentation)
end
else
documentation = string("Argument $arg_i of $(minargs) in call to `", CSTParser.str_value(fname), "`\n", documentation)
callname = if CSTParser.is_getfield(fname)
CSTParser.str_value(fname.args[1]) * "." * CSTParser.str_value(CSTParser.get_rhs_of_getfield(fname))
else
CSTParser.str_value(fname)
end
documentation = string("Argument $arg_i of $(minargs) in call to `", callname, "`\n", documentation)
end
return documentation
else
Expand Down
14 changes: 13 additions & 1 deletion test/requests/test_hover.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ end

@testitem "hover docs" begin
include("../test_shared_server.jl")

settestdoc("""
"I have a docstring"
Base.@kwdef struct SomeStruct
Expand All @@ -60,3 +60,15 @@ end
""")
@test startswith(hover_test(1, 20).contents.value, "I have a docstring")
end

@testitem "hover argument qualified function" begin
include("../test_shared_server.jl")

settestdoc("""
module M
f(a,b,c,d,e) = 1
end
M.f(1,2,3,4,5)
""")
@test hover_test(3, 5).contents.value == "Argument 1 of 5 in call to `M.f`\n"
end