Skip to content

dartfmt removes empty lines in enums. #606

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

Closed
peter-ahe-google opened this issue Mar 22, 2017 · 1 comment
Closed

dartfmt removes empty lines in enums. #606

peter-ahe-google opened this issue Mar 22, 2017 · 1 comment

Comments

@peter-ahe-google
Copy link

I have this enum declaration:

enum ErrorKind {
  AbstractNotSync,
  AsciiControlCharacter,
  AsyncAsIdentifier,
  AwaitAsIdentifier,
  AwaitForNotAsync,
  AwaitNotAsync,
  BuiltInIdentifierAsType,
  BuiltInIdentifierInDeclaration,
  EmptyNamedParameterList,
  EmptyOptionalParameterList,
  Encoding,
  ExpectedBlockToSkip,
  ExpectedBody,
  ExpectedButGot,
  ExpectedClassBody,

  /// This error code can be used to support non-compliant (with respect to
  /// Dart Language Specification) Dart VM native clauses. See
  /// [dart_vm_native.dart].
  ExpectedClassBodyToSkip,

  ExpectedDeclaration,
  ExpectedExpression,
  ExpectedFunctionBody,
  ExpectedHexDigit,
  ExpectedIdentifier,
  ExpectedOpenParens,
  ExpectedString,
  ExpectedType,
  ExtraneousModifier,
  ExtraneousModifierReplace,
  FactoryNotSync,
  GeneratorReturnsValue,
  InvalidAwaitFor,
  InvalidInlineFunctionType,
  InvalidSyncModifier,
  InvalidVoid,
  MissingExponent,
  NonAsciiIdentifier,
  NonAsciiWhitespace,
  OnlyTry,
  PositionalParameterWithEquals,
  RequiredParameterWithDefault,
  SetterNotSync,
  StackOverflow,
  UnexpectedDollarInString,
  UnexpectedToken,
  UnmatchedToken,
  UnsupportedPrefixPlus,
  UnterminatedComment,
  UnterminatedString,
  UnterminatedToken,
  YieldAsIdentifier,
  YieldNotGenerator,

  Unspecified,
}

After running dartfmt, the the empty lines have been removed:

enum ErrorKind {
  AbstractNotSync,
  AsciiControlCharacter,
  AsyncAsIdentifier,
  AwaitAsIdentifier,
  AwaitForNotAsync,
  AwaitNotAsync,
  BuiltInIdentifierAsType,
  BuiltInIdentifierInDeclaration,
  EmptyNamedParameterList,
  EmptyOptionalParameterList,
  Encoding,
  ExpectedBlockToSkip,
  ExpectedBody,
  ExpectedButGot,
  ExpectedClassBody,

  /// This error code can be used to support non-compliant (with respect to
  /// Dart Language Specification) Dart VM native clauses. See
  /// [dart_vm_native.dart].
  ExpectedClassBodyToSkip,
  ExpectedDeclaration,
  ExpectedExpression,
  ExpectedFunctionBody,
  ExpectedHexDigit,
  ExpectedIdentifier,
  ExpectedOpenParens,
  ExpectedString,
  ExpectedType,
  ExtraneousModifier,
  ExtraneousModifierReplace,
  FactoryNotSync,
  GeneratorReturnsValue,
  InvalidAwaitFor,
  InvalidInlineFunctionType,
  InvalidSyncModifier,
  InvalidVoid,
  MissingExponent,
  NonAsciiIdentifier,
  NonAsciiWhitespace,
  OnlyTry,
  PositionalParameterWithEquals,
  RequiredParameterWithDefault,
  SetterNotSync,
  StackOverflow,
  UnexpectedDollarInString,
  UnexpectedToken,
  UnmatchedToken,
  UnsupportedPrefixPlus,
  UnterminatedComment,
  UnterminatedString,
  UnterminatedToken,
  YieldAsIdentifier,
  YieldNotGenerator,
  Unspecified,
}
@munificent
Copy link
Member

Should be a simple fix. When I added support for enums, there weren't too many uses of it in the wild to use as motivating examples for how sophisticated the rules needed to be.

munificent added a commit that referenced this issue Mar 24, 2017
@munificent munificent self-assigned this Mar 24, 2017
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