|
31 | 31 | @test localgotoitem("l", 8)[:line] === 7 |
32 | 32 | end |
33 | 33 |
|
34 | | - # remove dot accessors |
| 34 | + # ignore dot accessors |
35 | 35 | let str = """ |
36 | 36 | function withdots(expr::CSTParser.EXPR) |
37 | 37 | bind = CSTParser.bindingof(expr.args[1]) |
|
245 | 245 | end |
246 | 246 | end |
247 | 247 |
|
248 | | - @testset "goto global symbols" begin # toplevel symbol goto & method goto |
| 248 | + # bundles `modulegotoitems`, `toplevelgotoitems` and `methodgotoitems` |
| 249 | + @testset "goto global symbols" begin |
249 | 250 | # both the original methods and the toplevel bindings that are overloaded |
250 | 251 | # in a context module should be shown |
251 | | - let items = globalgotoitems("isconst", "Main.Junk", "", nothing) |
| 252 | + let items = globalgotoitems("isconst", "isconst", "Main.Junk", "", nothing) |
252 | 253 | @test length(items) === 2 |
253 | 254 | @test "isconst(m::Module, s::Symbol)" ∈ map(item -> item.text, items) # from Base |
254 | 255 | @test "Base.isconst(::JunkType)" ∈ map(item -> item.text, items) # from Junk |
255 | 256 | end |
| 257 | + |
| 258 | + # strips trailing dots |
| 259 | + let item = globalgotoitems("isconst", "isconst", "Main.Junk", "", nothing) |
| 260 | + @test item == globalgotoitems("isconst", "Junk.isconst", "Main.Junk", "", nothing) |
| 261 | + @test item == globalgotoitems("isconst", "Main.Junk.isconst", "Main.Junk", "", nothing) |
| 262 | + end |
| 263 | + let item = globalgotoitems("Junk", "Junk", "Main.Junk", "", nothing) |
| 264 | + @test item == globalgotoitems("Junk", "Main.Junk", "Main.Junk", "", nothing) |
| 265 | + @test item == globalgotoitems("Junk", "Junk.isconst", "Main.Junk", "", nothing) |
| 266 | + @test item == globalgotoitems("Junk", "Main.Junk.isconst", "Main.Junk", "", nothing) |
| 267 | + end |
256 | 268 | end |
257 | 269 | end |
0 commit comments