Skip to content

Indentation after function opening bracket takes 4 spaces when passed as argument #115

@XO39

Description

@XO39

Such as the body argument of the test function, when I hit Enter, it gets indented by 4 spaces instead of 2, here is an example

test('some test', () {
    var variable = 'value';
  ...
});

It should be like this:

test('some test', () {
  var variable = 'value';
  ...
});

If I just created the function, it's OK as it's less obvious, but if go back to already created functions and tried to add something in the first line of the function body, it's really annoying, this is how it looks like:

test('some test', () {
    var variable3 = 'value';
  var variable1 = 'value';
  var variable1 = 'value';
  ...
});

This is the case for all function-bodies passed as arguments:

void func(void Function() funAsArg) {
  funcAsArg();
}

func(() {
    var stuff = 'stuff'; // here it's indented with 4 spaces
}

Is there any setting for this or something I can do about it? I'm writing a lot of unit test code and I'm getting a little bit frustrated because of this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions