Skip to content

Strip Salsa package line numbers out of user-declared functions using Salsa macros #35

@NHDaly

Description

@NHDaly
julia> using Salsa

julia> @derived foo(rt) = 2
mefoo (generic function with 1 method)

julia> methods(foo)
# 1 method for generic function "foo":
[1] foo(rt) in Main at /Users/nathandaly/work/Delve/packages/Salsa/src/Salsa.jl:619

This should not list Salsa.jl as its line number.

Same for inputs:

julia> @declare_input x(rt)::Int
(x, set_x!, delete_x!)

julia> methods(x)
# 1 method for generic function "x":
[1] x(rt) in Main at /Users/nathandaly/work/Delve/packages/Salsa/src/Salsa.jl:812

julia> methods(set_x!)
# 1 method for generic function "set_x!":
[1] set_x!(rt, value::Int64) in Main at /Users/nathandaly/work/Delve/packages/Salsa/src/Salsa.jl:816

julia> methods(delete_x!)
# 1 method for generic function "delete_x!":
[1] delete_x!(rt) in Main at /Users/nathandaly/work/Delve/packages/Salsa/src/Salsa.jl:820

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions