Make `Range` and `SourceFile` optional in `Diagnostic` and `Message`
Open
diagnostics
internal
- Dominant language
- Rust
- Stars
- 49.6k
- Forks
- 2.4k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 445
Description
There are some cases where we can't produce a relevant span or may not be able to read the source into a string, e.g. [`toml` sometimes doesn't emit spans](https://github.com/charliermarsh/ruff/pull/4496/files#r1198653173), `IOError` or files larger than 4GB. We should therefore make `Range` and `SourceFile` optional in `Diagnostic` and `Message`.
Contributor guide
Assessment
This issue has not been assessed yet.