Mark Range.Zero as obsolete in favor of Range.range0 #18664
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a follow-up to this discussion.
This is a breaking change (change of the service surface area), but welcomed by at least one key user.
I also checked Ionide, FSAC, Fantomas and found no uses of Range.Zero that could not simply be replaced by range0.
Background:
Range.range0 points to line 1, column 0 of a special file named unknownFileName = "unknown" that (due to the way the code in range.fs is initialized) always gets file index 0. Range.range0 is used 266 times in the compiler.
Range.Zero points to line 0, column 0 of fileIndex 0. Range.Zero is used 42 times in the compiler.
So, the difference is line 1 vs line 0.
Both Range.Zero and Range.range0 exist since the beginning of this repo, reason unknown.
Checklist