Skip to content

Commit 9b92fc5

Browse files
committed
minor code quality improvements
1 parent 84ec692 commit 9b92fc5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/CodeTracking.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ const method_lookup_callback = Ref{Any}(nothing)
6363

6464
# Callback for `signatures_at` (lookup by file/lineno). `lookupfunc = expressions_callback[]`
6565
# must have the form
66-
# mod, exsigs = lookupfunc(id, relpath)
66+
# mod, exs_infos = lookupfunc(id, relpath)
6767
# where
6868
# id is the PkgId of the corresponding package
6969
# relpath is the path of the file from the basedir of `id`
7070
# mod is the "active" module at that point in the source
71-
# exsigs is a `ex => mt_sigs` dictionary, where `ex` is the source expression and `mt_sigs`
71+
# exs_infos is a `ex => mt_sigs` dictionary, where `ex` is the source expression and `mt_sigs`
7272
# a list of `method_table => signature` pairs defined by that expression.
7373
const expressions_callback = Ref{Any}(nothing)
7474

@@ -209,8 +209,8 @@ function signatures_at(id::PkgId, relpath::AbstractString, line::Integer)
209209
expressions = expressions_callback[]
210210
expressions === nothing && error("cannot look up methods by line number, try `using Revise` before loading other packages")
211211
try
212-
for (mod, exsigs) in Base.invokelatest(expressions, id, relpath)
213-
for (ex, mt_sigs) in exsigs
212+
for (_, exs_infos) in Base.invokelatest(expressions, id, relpath)
213+
for (ex, mt_sigs) in exs_infos
214214
lr = linerange(ex)
215215
lr === nothing && continue
216216
line lr && return mt_sigs

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ end
116116
@test whereis(m) == ("REPL[1]", 1)
117117
# Test with broken lookup
118118
oldlookup = CodeTracking.method_lookup_callback[]
119-
CodeTracking.method_lookup_callback[] = m -> error("oops")
119+
CodeTracking.method_lookup_callback[] = (_) -> error("oops")
120120
@test whereis(m) == ("REPL[1]", 1)
121121
CodeTracking.method_lookup_callback[] = oldlookup
122122

0 commit comments

Comments
 (0)