Like ResourcePath.from_file_path, but accounting for symlinks.
Several packages, including PackageDev and AutomaticPackageReloader, try to determine the resource path of a file path supplied via view.file_name() or some other “external” source. ResourcePath.from_file_path can't do this reliably because it only looks at the syntax of the path, so that if the argument is a path elsewhere in the filesystem that's symlinked under Packages, then ResourcePath.from_file_path won't find it.
It might be convenient to provide a function to reliably return all resource paths that point to the same file as a given file path. (There may be more than one such resource path.) I don't think there's any faster way than to stat every resource file, which could be slow, but hopefully not disruptively slow if used sparingly.
I'd be interested in some benchmarks here tbh.