Skip to content

should definition(Expr, meth) fall back to parsing, when Revise isn't loaded? #47

@oxinabox

Description

@oxinabox

When Revise isn't loaded
it seems that definition(String, method) works (to my surprise),
but definition(Expr, method) returns nothing.

Seems like we could have a fallback to try parsing the definition(String, method),
if we were going to return nothing.

julia> using CodeTracking

julia> definition(String, @which abs(1))
("abs(x::Signed) = flipsign(x,x)", 136)

julia> definition(Expr, @which abs(1))

julia> Meta.parse(first(definition(String, @which abs(1))))
:(abs(x::Signed) = begin
          #= none:1 =#
          flipsign(x, x)
      end)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions