Skip to content

Commit

Permalink
CodePrinter: Apply SpaceBeforeArgument to PascalCase funcs
Browse files Browse the repository at this point in the history
Fixes #554.
  • Loading branch information
VelocityRa committed Nov 7, 2019
1 parent 24ace6a commit 134e48d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Fantomas/CodePrinter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ type ASTContext =

let rec addSpaceBeforeParensInFunCall functionOrMethod arg =
match functionOrMethod, arg with
| SynExpr.LongIdent(_, LongIdentWithDots s, _, _), _ ->
let parts = s.Split '.'
not <| Char.IsUpper parts.[parts.Length - 1].[0]
| SynExpr.LongIdent(_, _, _, _), ConstExpr(Const "()", _) ->
true
| SynExpr.Ident(_), ConstExpr(Const "()", _)
| SynExpr.Ident(_), SynExpr.Ident(_) ->
true
| SynExpr.Ident(Ident s), _ ->
Expand All @@ -57,9 +57,7 @@ let rec addSpaceBeforeParensInFunCall functionOrMethod arg =
let addSpaceBeforeParensInFunDef functionOrMethod args =
match functionOrMethod, args with
| "new", _ -> false
| (s:string), _ ->
let parts = s.Split '.'
not <| Char.IsUpper parts.[parts.Length - 1].[0]
| (_:string), _ -> true
| _ -> true

let rec genParsedInput astContext = function
Expand Down

0 comments on commit 134e48d

Please sign in to comment.