Skip to content

Commit

Permalink
- update fcs to 'Add trivia information to SynConst.Measure', commit …
Browse files Browse the repository at this point in the history
…7b5e12842d673b7daa467e0091378bf4acc95e4f

- add test
- add CHANGELOG entry
  • Loading branch information
dawedawe committed Jul 22, 2023
1 parent aff9da8 commit 88c9b9f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [Unreleased]

### Changed
* Update FCS to 'Add trivia information to SynConst.Measure', commit 7b5e12842d673b7daa467e0091378bf4acc95e4f

### Fixed
* Left out lhs in SynMeasure.Divide should not be restored as SynMeasure.One. [#2926](https://github.com/fsprojects/fantomas/issues/2926)

## 6.1.1 - 2023-06-29

### Changed
Expand Down
3 changes: 1 addition & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ Some common use cases include:

<!-- Versions -->
<PropertyGroup>
<FCSRepo>dawedawe/fsharp</FCSRepo>
<FCSCommitHash>3da13f3b373b680df1b08ee342ef290a79016438</FCSCommitHash>
<FCSCommitHash>7b5e12842d673b7daa467e0091378bf4acc95e4f</FCSCommitHash>
<StreamJsonRpcVersion>2.8.28</StreamJsonRpcVersion>
<FSharpCoreVersion>6.0.1</FSharpCoreVersion>
</PropertyGroup>
Expand Down
7 changes: 2 additions & 5 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,6 @@ let fsharpCompilerHash =
let xDoc = XElement.Load(__SOURCE_DIRECTORY__ </> "Directory.Build.props")
xDoc.XPathSelectElements("//FCSCommitHash") |> Seq.head |> (fun xe -> xe.Value)

let fcsRepo =
let xDoc = XElement.Load(__SOURCE_DIRECTORY__ </> "Directory.Build.props")
xDoc.XPathSelectElements("//FCSRepo") |> Seq.head |> (fun xe -> xe.Value)

let updateFileRaw (file: FileInfo) =
let lines = File.ReadAllLines file.FullName
let updatedLines =
Expand All @@ -217,7 +213,8 @@ let downloadCompilerFile commitHash relativePath =
file.Directory.Create()
let fs = file.Create()
let fileName = Path.GetFileName(relativePath)
let url = $"https://raw.githubusercontent.com/{fcsRepo}/{commitHash}/{relativePath}"
let url =
$"https://raw.githubusercontent.com/dotnet/fsharp/{commitHash}/{relativePath}"
let! response =
Http.AsyncRequestStream(
url,
Expand Down
17 changes: 16 additions & 1 deletion src/Fantomas.Core.Tests/SynConstTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ let ``single digit constant`` () =
|> should equal "1"

[<Test>]
let ``left out lhs in SynMeasure.Divide should not be restored as SynMeasure.One`` () =
let ``left out lhs in SynMeasure.Divide should not be restored as SynMeasure.One, 2926`` () =
formatSourceString
false
"""
Expand All @@ -741,3 +741,18 @@ let ``left out lhs in SynMeasure.Divide should not be restored as SynMeasure.One
"""
234< / kg>
"""

[<Test>]
let ``explicit SynMeasure.One in SynMeasure.Divide should be preserved`` () =
formatSourceString
false
"""
234<1/kg>
"""
config
|> prepend newline
|> should
equal
"""
234<1 / kg>
"""
2 changes: 1 addition & 1 deletion src/Fantomas.Core/ASTTransformer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2659,7 +2659,7 @@ let mkMemberDefn (creationAide: CreationAide) (md: SynMemberDefn) =
memberDefn = SynBinding(
attributes = ats
xmlDoc = px
valData = SynValData(Some { MemberKind = SynMemberKind.Constructor }, _, ido)
valData = SynValData(Some { MemberKind = SynMemberKind.Constructor }, _, ido, _)
headPat = SynPat.LongIdent(
longDotId = SynLongIdent(id = [ newIdent ])
argPats = SynArgPats.Pats [ SynPat.Paren _ as pat ]
Expand Down

0 comments on commit 88c9b9f

Please sign in to comment.