Skip to content

Language version tag inside file should affect style #1599

@munificent

Description

@munificent

The formatter uses the language version of the file it's parsing to determine the style. That version usually comes in externally either through a surrounding package_config.json file, --language-version= CLI argument etc. But it can also be overridden by the file itself using a language version comment like // @dart=1.2.

A comment like that will correct affect the language version that the formatter parses the code at, but it doesn't use that version to determine whether you get the new tall style or not. If you run the formatter on:

// @dart=3.6
main() {
  f(1 // c
  );
}

It outputs:

// @dart=3.6

main() {
  f(
    1, // c
  );
}

It should be:

// @dart=3.6

main() {
  f(1 // c
      );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions