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

parenthesis expression in then should further indent inner expression #1777

Closed
1 of 3 tasks
nojaf opened this issue Jun 12, 2021 · 0 comments · Fixed by #1808
Closed
1 of 3 tasks

parenthesis expression in then should further indent inner expression #1777

nojaf opened this issue Jun 12, 2021 · 0 comments · Fixed by #1808

Comments

@nojaf
Copy link
Contributor

nojaf commented Jun 12, 2021

Issue created from fantomas-online

Code

if kind = shiftFlag then (
                    if errorSuppressionCountDown > 0 then 
                        errorSuppressionCountDown <- errorSuppressionCountDown - 1
#if DEBUG
                        if Flags.debug then Console.WriteLine("shifting, reduced errorRecoveryLevel to {0}\n", errorSuppressionCountDown)
#endif
                    let nextState = actionValue action                                     
                    if not haveLookahead then failwith "shift on end of input!"
                    let data = tables.dataOfToken lookaheadToken
                    valueStack.Push(ValueInfo(data, lookaheadStartPos, lookaheadEndPos))
                    stateStack.Push(nextState)                                                                
#if DEBUG
                    if Flags.debug then Console.WriteLine("shift/consume input {0}, shift to state {1}", report haveLookahead lookaheadToken, nextState)
#endif
                    haveLookahead <- false

                ) 

Result

if kind = shiftFlag then
    (if errorSuppressionCountDown > 0 then
         errorSuppressionCountDown <- errorSuppressionCountDown - 1
#if DEBUG
         if Flags.debug then
             Console.WriteLine("shifting, reduced errorRecoveryLevel to {0}\n", errorSuppressionCountDown)
#endif
    let nextState = actionValue action

    if not haveLookahead then
        failwith "shift on end of input!"

    let data = tables.dataOfToken lookaheadToken
    valueStack.Push(ValueInfo(data, lookaheadStartPos, lookaheadEndPos))
    stateStack.Push(nextState)
#if DEBUG
    if Flags.debug then
        Console.WriteLine("shift/consume input {0}, shift to state {1}", report haveLookahead lookaheadToken, nextState)
#endif
    haveLookahead <- false

    )

Problem description

The code should be further indented inside the parenthesis.

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 Master at 06/09/2021 15:42:35 - a79ebea

Default Fantomas configuration

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

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

Successfully merging a pull request may close this issue.

1 participant