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

Let binding in hash directive disappears #1205

Closed
2 of 3 tasks
WalternativE opened this issue Oct 27, 2020 · 0 comments · Fixed by #1208
Closed
2 of 3 tasks

Let binding in hash directive disappears #1205

WalternativE opened this issue Oct 27, 2020 · 0 comments · Fixed by #1208

Comments

@WalternativE
Copy link
Contributor

Issue created from fantomas-online

Code

let loadFile n =
  let file =
    System.IO.Path.Combine(contentDir,
                           (n |> System.IO.Path.GetFileNameWithoutExtension)
                           + ".md").Replace("\\", "/")

  ()

let loader (projectRoot: string) (siteContent: SiteContents) =
#if WATCH
  let disableLiveRefresh = false
#else
  let disableLiveRefresh = true
#endif
  disableLiveRefresh

Result

let loadFile n =
    let file =
        System
            .IO
            .Path
            .Combine(contentDir,
                     (n |> System.IO.Path.GetFileNameWithoutExtension)
                     + ".md")
            .Replace("\\", "/")

    ()

let loader (projectRoot: string) (siteContent: SiteContents) =
    #if WATCH

    #else
    let disableLiveRefresh = true
    #endif
    disableLiveRefresh

Problem description

If I have a hash directive with two execution paths, formatting will throw away the whole content of the first execution path.

Extra information

  • The formatted result breaks by code (semantically - the code still compiles)
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas Master at 10/26/2020 19:07:04 - be9212d

Default Fantomas configuration

@nojaf nojaf linked a pull request Oct 31, 2020 that will close this issue
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