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

Consecutive #load statements are merged into one line if namespace is declared below #2014

Closed
3 tasks
peterhirn opened this issue Jan 8, 2022 · 1 comment · Fixed by #2059
Closed
3 tasks
Labels
bug (soundness) good first issue Long hanging fruit: easy issue to get your feet wet!

Comments

@peterhirn
Copy link

Issue created from fantomas-online

Code

#load "Types.fsx"
#load "Project.fsx"
#load "Utils.fsx"
#load "Git.fsx"

namespace MyNamespace

Result

#load "Types.fsx"#load "Project.fsx"#load "Utils.fsx"#load "Git.fsx"

namespace MyNamespace

Problem description

Consecutive #load statements are merged into one line if namespace is declared below, but not if namespace is declared above, eg.

namespace MyNamespace

#load "Types.fsx"
#load "Project.fsx"
#load "Utils.fsx"
#load "Git.fsx"

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas 4.6 branch at 1/1/1990

    { config with
                EndOfLine = crlf
                MaxValueBindingWidth = 40 }

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

@nojaf
Copy link
Contributor

nojaf commented Jan 10, 2022

Hello, thank you for reporting this bug.

It appears that ParsedHashDirective as children of the ParsedImplFileInput are not being separate by a newline.

See:

col sepNone hs genParsedHashDirective

This problem probably goes away when you replace sepNone with sepSpace.

Are you interested in submitting a PR for this?

@nojaf nojaf added the good first issue Long hanging fruit: easy issue to get your feet wet! label Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug (soundness) good first issue Long hanging fruit: easy issue to get your feet wet!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants