It could make sense (can be a follow up PR/issue to do it later) to investigate if we can remove locator.line_index and instead use source_file everywhere. We could even consider implementing Located on source file, which should allow us to replace most Locator usages.
Originally posted by @MichaReiser in #18356 (comment)