Skip to content

Commit

Permalink
Return back CodeFormatter.MakeRange method (#2306)
Browse files Browse the repository at this point in the history
* Return back CodeFormatter.MakeRange method

* update Changelog
  • Loading branch information
DedSec256 committed Jun 27, 2022
1 parent 4c4080a commit f6b0770
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
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

0 comments on commit f6b0770

Please sign in to comment.