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
2 changes: 1 addition & 1 deletion src/Revise.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module Revise

using OrderedCollections, CodeTracking, JuliaInterpreter, LoweredCodeUtils

using CodeTracking: PkgFiles, basedir, srcfiles, line_is_decl, basepath
using CodeTracking: PkgFiles, basedir, srcfiles, basepath
using JuliaInterpreter: whichtt, is_doc_expr, step_expr!, finish_and_return!, get_return,
@lookup, moduleof, scopeof, pc_expr, is_quotenode_egal,
linetable, codelocs, LineTypes, isassign, isidentical
Expand Down
10 changes: 4 additions & 6 deletions src/lowered.jl
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,10 @@
# Get the line number from the body
stmt3 = pc_expr(frame, pc3)::Expr
lnn = nothing
if line_is_decl
sigcode = @lookup(frame, stmt3.args[2])::Core.SimpleVector
lnn = sigcode[end]
if !isa(lnn, LineNumberNode)
lnn = nothing
end
sigcode = @lookup(frame, stmt3.args[2])::Core.SimpleVector
lnn = sigcode[end]
if !isa(lnn, LineNumberNode)
lnn = nothing

Check warning on line 380 in src/lowered.jl

View check run for this annotation

Codecov / codecov/patch

src/lowered.jl#L380

Added line #L380 was not covered by tests
end
if lnn === nothing
bodycode = stmt3.args[end]
Expand Down
8 changes: 2 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ using Revise.OrderedCollections: OrderedSet
using Test: collect_test_logs
using Base.CoreLogging: Debug,Info

using Revise.CodeTracking: line_is_decl

# In addition to using this for the "More arg-modifying macros" test below,
# this package is used on CI to test what happens when you have multiple
# *.ji files for the package.
Expand Down Expand Up @@ -1589,8 +1587,7 @@ end
io = IOBuffer()
if isdefined(Base, :methodloc_callback)
print(io, methods(triggered))
mline = line_is_decl ? 1 : 2
@test occursin(filename * ":$mline", String(take!(io)))
@test occursin(filename * ":1", String(take!(io)))
end
write(filename, """
# A comment to change the line numbers
Expand Down Expand Up @@ -1625,8 +1622,7 @@ end
@test occursin(targetstr, String(take!(io)))
if isdefined(Base, :methodloc_callback)
print(io, methods(triggered))
mline = line_is_decl ? 2 : 3
@test occursin(basename(filename * ":$mline"), String(take!(io)))
@test occursin(basename(filename * ":2"), String(take!(io)))
end

push!(to_remove, filename)
Expand Down
Loading