Skip to content
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

Return back CodeFormatter.MakeRange method #2306

Merged
merged 2 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [Unreleased]

### Changed
* Restore the CodeFormatter.MakeRange public API. [#2306](https://github.com/fsprojects/fantomas/pull/2306)

## [5.0.0-alpha-010] - 2022-06-27

### Changed
Expand Down
4 changes: 4 additions & 0 deletions src/Fantomas.Core/CodeFormatter.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace Fantomas.Core

open FSharp.Compiler.Syntax
open FSharp.Compiler.Text

[<Sealed>]
type CodeFormatter =
Expand Down Expand Up @@ -28,3 +29,6 @@ type CodeFormatter =
Validation.isValidFSharpCode isSignature source

static member GetVersion() = Version.fantomasVersion.Value

static member MakeRange(fileName, startLine, startCol, endLine, endCol) =
Range.mkRange fileName (Position.mkPos startLine startCol) (Position.mkPos endLine endCol)
3 changes: 3 additions & 0 deletions src/Fantomas.Core/CodeFormatter.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ type CodeFormatter =

/// Returns the version of Fantomas found in the AssemblyInfo
static member GetVersion: unit -> string

/// Make a range from (startLine, startCol) to (endLine, endCol) to select some text
static member MakeRange: fileName: string * startLine: int * startCol: int * endLine: int * endCol: int -> range