askama icon indicating copy to clipboard operation
askama copied to clipboard

CompileError should retain span information

Open TedDriggs opened this issue 3 years ago • 2 comments

The current CompileError enum only accepts strings, so it cannot preserve spans that were available during AST parsing. This means errors are less precise than they could be; they highlight the entire struct, rather than the relevant meta-item.

TedDriggs avatar Oct 12 '21 17:10 TedDriggs

Hello @TedDriggs , Please share some examples :) .

Thanks,

grv07 avatar Oct 17 '21 13:10 grv07

You can compare errors from this branch to the ones in main: https://github.com/djc/askama/pull/537; try changing ext to ex in a test to see the difference.

TedDriggs avatar Oct 18 '21 22:10 TedDriggs