jkrumbiegel / Chain.jl

A Julia package for piping a value through a series of transformation expressions using a more convenient syntax than Julia's native piping functionality.
MIT License
368 stars 16 forks source link

Line numbers aren't propagating in errors #29

Open pdeffebach opened 3 years ago

pdeffebach commented 3 years ago

When using @chain, line numbers are given at the level of the @chain command, not sub-commands. This makes it hard to debug. Consider the following script

using Chain

foo(x, y) = x * y

x = [1, 2]

@chain x begin
    identity
    identity
    identity
    foo([3, 4])
end

The stacktrace says the error occurs starting on line 7. This makes it hard to debug long @chains. We should try to ensure line number propogation within the chain block.

jkrumbiegel commented 3 years ago

works for me in vscode:

grafik

Line number in stack trace points to foo(x, y) which is also correct

pdeffebach commented 3 years ago

Huh. That's very interesting. I will try to explore this more. You were running from include?

jkrumbiegel commented 3 years ago

No alt+enter in vscode