Open gortok opened 3 years ago
Excellent idea! I'm going to need to think about implementation a bit though because the line number in the file doesn't necessarily line up with what the Razor engine sees due to stripping out front matter. My first thought is that there are actually a bunch of places where knowing that offset could be valuable for debugging - perhaps a universal ContentOffset
value inside the IContentProvider
might work well here 🤔. Then any logging that needs to be done relative to line numbers can add the offset to get the real line number of the file on disk (and any modules that remove content can increment it).
During link validation for a .cshtml file (Razor); I noted that it would tell me the location of the file it couldn't validate, but not the line number:
Recommend that the line number is included in the ValidateRelativeLink function, for ease of finding the line for the error.