Skip to content

Mark Range.Zero as obsolete in favor of Range.range0 #18664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 6, 2025

Conversation

Martin521
Copy link
Contributor

@Martin521 Martin521 commented Jun 5, 2025

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

  • Test cases added
  • Performance benchmarks added in case of performance changes
  • Release notes entry updated

Copy link
Contributor

github-actions bot commented Jun 5, 2025

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/10.0.100.md

@github-project-automation github-project-automation bot moved this from New to In Progress in F# Compiler and Tooling Jun 6, 2025
@T-Gro T-Gro merged commit ee71c6a into dotnet:main Jun 6, 2025
39 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in F# Compiler and Tooling Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants