This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS] support fields with case/switch/default labels.
ClosedPublic

Authored by mprobst on Aug 1 2017, 7:10 AM.

Details

Summary

case: and default: would normally parse as labels for a switch block.
However in TypeScript, they can be used in field declarations, e.g.:

interface I {
  case: string;
}

This change special cases parsing them in declaration lines to avoid wrapping
them.

Diff Detail

Repository
rL LLVM

Event Timeline

mprobst created this revision.Aug 1 2017, 7:10 AM
djasper accepted this revision.Aug 3 2017, 11:07 PM

Looks good.

This revision is now accepted and ready to land.Aug 3 2017, 11:07 PM
This revision was automatically updated to reflect the committed changes.