@@ -7,25 +7,26 @@ Once we can come to handle links within datatips, we may want to append method t
77handle (" datatip" ) do data
88 @destruct [
99 word,
10+ fullWord,
1011 mod || " Main" ,
1112 path || " " ,
1213 column || 1 ,
1314 row || 1 ,
1415 startRow || 0 ,
1516 context || " "
1617 ] = data
17- datatip (word, mod, path, column, row, startRow, context)
18+ datatip (word, fullWord, mod, path, column, row, startRow, context)
1819end
1920
20- function datatip (word, mod, path, column = 1 , row = 1 , startrow = 0 , context = " " )
21+ function datatip (word, fullword, mod, path, column = 1 , row = 1 , startrow = 0 , context = " " )
2122 if isdebugging () && (ddt = JunoDebugger. datatip (word, path, row, column)) != = nothing
2223 return Dict (:error => false , :strings => ddt)
2324 end
2425
25- ldt = localdatatip (word , column, row, startrow, context)
26- isempty (ldt) || return datatip (ldt)
26+ ldt = localdatatip (fullword , column, row, startrow, context)
27+ isempty (ldt) || return push! ( datatip (ldt), :local => true )
2728
28- tdt = topleveldatatip (mod, word)
29+ tdt = globaldatatip (mod, word, fullword )
2930 tdt != = nothing && return Dict (:error => false , :strings => tdt)
3031
3132 return Dict (:error => true ) # nothing hits
@@ -35,8 +36,8 @@ datatip(dt::Vector{Dict{Symbol, Any}}) = Dict(:error => false, :strings => dt)
3536datatip (dt:: Int ) = Dict (:error => false , :line => dt)
3637datatip (dt:: Vector{Int} ) = datatip (dt[1 ])
3738
38- function localdatatip (word , column, row, startrow, context)
39- word = first (split (word , ' .' )) # ignore dot accessors
39+ function localdatatip (fullword , column, row, startrow, context)
40+ word = first (split (fullword , ' .' )) # always ignore dot accessors
4041 position = row - startrow
4142 ls = locals (context, position, column)
4243 filter! (ls) do l
@@ -56,7 +57,9 @@ function localdatatip(l, word, startrow)
5657 end
5758end
5859
59- function topleveldatatip (mod, word)
60+ function globaldatatip (mod, word, fullword)
61+ word = striptrailingdots (word, fullword)
62+
6063 docs = @errs getdocs (mod, word)
6164 docs isa EvalError && return nothing
6265
0 commit comments