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

Hash directive not between namespace and module #681

Closed
nojaf opened this issue Feb 15, 2020 · 0 comments · Fixed by #750
Closed

Hash directive not between namespace and module #681

nojaf opened this issue Feb 15, 2020 · 0 comments · Fixed by #750

Comments

@nojaf
Copy link
Contributor

nojaf commented Feb 15, 2020

Issue created from fantomas-ui

The #if DEBUG directive not correct anymore after formatting.

Code

namespace global

#if DEBUG

module Dbg =

    open System
    open System.Text
        
    let seq fn = Seq.iter fn

    let iff condition fn = if condition() then fn()

    let tee fn a =
        fn a
        a

    let teePrint x = tee (printfn "%A") x
    let print x = printfn "%A" x
#else
module Dbg =
    let tee (f: 'a -> unit) (x: 'a) = x
    let teePrint x = x
    let print _ = ()
#endif

Result

#if DEBUG

namespace global

module Dbg =

    open System
    open System.Text

    let seq fn = Seq.iter fn

    let iff condition fn =
        if condition() then fn()

    let tee fn a =
        fn a
        a

    let teePrint x = tee (printfn "%A") x
    let print x = printfn "%A" x
#else
namespace global

module Dbg =
    let tee (f: 'a -> unit) (x: 'a) = x
    let teePrint x = x
    let print _ = ()
#endif

Options

Fantomas Next - 3.2.0-2/10/2020

Name Value
IndentOnTryWith false
IndentSpaceNum 4
KeepNewlineAfter false
MaxIfThenElseShortWidth 40
PageWidth 120
ReorderOpenDeclaration false
SemicolonAtEndOfLine false
SpaceAfterComma true
SpaceAfterSemicolon true
SpaceAroundDelimiter true
SpaceBeforeArgument true
SpaceBeforeColon false
StrictMode false

Encountered while trying #666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant