@@ -3,7 +3,6 @@ using CSTParser
33handle (" gotosymbol" ) do data
44 @destruct [
55 word,
6- fullWord,
76 path || nothing ,
87 # local context
98 column || 1 ,
@@ -16,30 +15,29 @@ handle("gotosymbol") do data
1615 text || " " ,
1716 ] = data
1817 gotosymbol (
19- word, fullWord, path,
18+ word, path,
2019 column, row, startRow, context, onlyGlobal,
2120 mod, text
2221 )
2322end
2423
2524function gotosymbol (
26- word, fullword, path = nothing ,
25+ word, path = nothing ,
2726 column = 1 , row = 1 , startrow = 0 , context = " " , onlyglobal = false ,
2827 mod = " Main" , text = " "
2928)
3029 try
3130 # local goto
3231 if ! onlyglobal
33- localitems = localgotoitem (fullword , path, column, row, startrow, context)
32+ localitems = localgotoitem (word , path, column, row, startrow, context)
3433 isempty (localitems) || return Dict (
3534 :error => false ,
36- :items => map (Dict, localitems),
37- :local => true
35+ :items => map (Dict, localitems)
3836 )
3937 end
4038
4139 # global goto
42- globalitems = globalgotoitems (word, fullword, mod, text, path)
40+ globalitems = globalgotoitems (word, mod, text, path)
4341 isempty (globalitems) || return Dict (
4442 :error => false ,
4543 :items => map (Dict, globalitems),
@@ -67,8 +65,8 @@ Dict(gotoitem::GotoItem) = Dict(
6765
6866# ## local goto
6967
70- function localgotoitem (fullword , path, column, row, startrow, context)
71- word = first (split (fullword , ' .' )) # always ignore dot accessors
68+ function localgotoitem (word , path, column, row, startrow, context)
69+ word = first (split (word , ' .' )) # always ignore dot accessors
7270 position = row - startrow
7371 ls = locals (context, position, column)
7472 filter! (ls) do l
@@ -85,14 +83,12 @@ localgotoitem(word, ::Nothing, column, row, startrow, context) = [] # when `path
8583
8684# ## global goto - bundles toplevel gotos & method gotos
8785
88- function globalgotoitems (word, fullword, mod, text, path)
86+ function globalgotoitems (word, mod, text, path)
8987 mod = getmodule (mod)
9088
9189 moduleitems = modulegotoitems (word, mod)
9290 isempty (moduleitems) || return moduleitems
9391
94- word = striptrailingdots (word, fullword)
95-
9692 toplevelitems = toplevelgotoitems (word, mod, text, path)
9793
9894 # only append methods that are not caught by `toplevelgotoitems`
@@ -126,12 +122,11 @@ const SYMBOLSCACHE = Dict{String, PathItemsMaps}()
126122function toplevelgotoitems (word, mod, text, path)
127123 # strip a dot-accessed module if exists
128124 identifiers = split (word, ' .' )
129- head = identifiers[1 ]
130- if head ≠ word && (val = getfield′ (mod, string ( head)) ) isa Module
125+ head = string ( identifiers[1 ])
126+ if head ≠ word && getfield′ (mod, head) isa Module
131127 # if `head` is a module, update `word` and `mod`
132128 nextword = join (identifiers[2 : end ], ' .' )
133- nextmod = val
134- return toplevelgotoitems (nextword, nextmod, text, path)
129+ return globalgotoitems (nextword, head, text, path)
135130 end
136131
137132 key = string (mod)
0 commit comments