Skip to content

Commit

Permalink
Merge pull request #3092 from dawedawe/fix_2998
Browse files Browse the repository at this point in the history
Fix another exn in (|UppercaseExpr|LowercaseExpr|)
  • Loading branch information
dawedawe authored Jun 1, 2024
2 parents 9925f66 + 32caa36 commit 753676d
Show file tree
Hide file tree
Showing 3 changed files with 22 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

## 6.3.7 - 2024-06-01

### Fixed
* Fix case determination issue with ExprAppNode and ExprParenNode. [#2998](https://github.com/fsprojects/fantomas/issues/2998)

## 6.3.6 - 2024-06-01

### Fixed
Expand Down
15 changes: 15 additions & 0 deletions src/Fantomas.Core.Tests/DynamicOperatorTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,18 @@ let doc2 = X?a("arg")?B("barg")?c("carg")
let doc1 = x?a("arg")?B("barg")?c("carg")
let doc2 = X?a ("arg")?B ("barg")?c ("carg")
"""

[<Test>]
let ``case determination issue with ExprParenNode uppercase with config lower, 2998`` () =
formatSourceString
"""
let statusBarHeight = (window?getComputedStyle document.documentElement)?getPropertyValue "--statusBarHeight"
"""
config
|> prepend newline
|> should
equal
"""
let statusBarHeight =
(window?getComputedStyle document.documentElement)?getPropertyValue "--statusBarHeight"
"""
2 changes: 2 additions & 0 deletions src/Fantomas.Core/CodePrinter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ let rec (|UppercaseExpr|LowercaseExpr|) (expr: Expr) =
| Expr.TypeApp node -> (|UppercaseExpr|LowercaseExpr|) node.Identifier
| Expr.Dynamic node -> (|UppercaseExpr|LowercaseExpr|) node.FuncExpr
| Expr.AppSingleParenArg node -> (|UppercaseExpr|LowercaseExpr|) node.FunctionExpr
| Expr.Paren node -> (|UppercaseExpr|LowercaseExpr|) node.Expr
| Expr.App node -> (|UppercaseExpr|LowercaseExpr|) node.FunctionExpr
| _ -> failwithf "cannot determine if Expr %A is uppercase or lowercase" expr

let (|ParenExpr|_|) (e: Expr) =
Expand Down

0 comments on commit 753676d

Please sign in to comment.