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

indentations in computation expressions not working #300

Open
ruffianeo opened this issue May 12, 2022 · 0 comments
Open

indentations in computation expressions not working #300

ruffianeo opened this issue May 12, 2022 · 0 comments

Comments

@ruffianeo
Copy link

Description

Statements in computation expressions, which should indent the following lines, but do not, include (those I found so far):

  • for
  • then
  • else

They seem to work outside computation expressions.

Repro steps

  1. use emacs in fsharp-mode and type the following (and be amazed by the non-indenting!):
module issues

let indent_in_computation_expressions_not_working () =
    seq {
        for i = 0 to 10 do
        if i % 2 = 0
        then
        yield "even"
        else
        yield "odd"
        }
  1. in fsi (dotnet fsi): #load "issues.fs"

#load "issue.fs";;
[Loading /home/.../dev/fs/issue.fs]
/home/.../dev/fs/issue.fs(8,9): warning FS0058: Possible incorrect indentation: this token is offside of context started at position (6:9). Try indenting this token further or using standard formatting conventions.
/home/.../dev/fs/issue.fs(8,9): warning FS0058: Possible incorrect indentation: this token is offside of context
started at position (6:9). Try indenting this token further or using standard formatting conventions.

Expected behavior

The indenting should be right, but it is as shown above.

module issues

let indent_in_computation_expressions_not_working () =
    seq {
        for i = 0 to 10 do
            if i % 2 = 0
            then
                yield "even"
            else
                yield "odd"
        }

Actual behavior

module issues

let indent_in_computation_expressions_not_working () =
    seq {
        for i = 0 to 10 do
        if i % 2 = 0
        then
        yield "even"
        else
        yield "odd"
        }

Known workarounds

use C-c> to indent every line in such a block individually.

Related information

  • Operating system linux
  • Branch
  • Emacs version GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
    of 2021-03-28, modified by Debian
  • .NET Runtime, CoreCLR or Mono Version dotnet --version
    5.0.202
  • Performance information, links to performance testing scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants