This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS] more precisely detect enums.
ClosedPublic

Authored by mprobst on Mar 13 2015, 2:47 PM.

Details

Reviewers
djasper
Summary

The current enum detection is overly aggressive. As NestingLevel only applies per line (?) it classifies many if not most object literals as enum declarations and adds superfluous line breaks into them. This change narrows the heuristic by requiring an assignment just before the open brace and requiring the line to start with an identifier.

Diff Detail

Event Timeline

mprobst updated this revision to Diff 21957.Mar 13 2015, 2:47 PM
mprobst retitled this revision from to clang-format: [JS] more precisely detect enums..
mprobst updated this object.
mprobst edited the test plan for this revision. (Show Details)
mprobst added a reviewer: djasper.
mprobst added subscribers: Unknown Object (MLST), klimek.
djasper accepted this revision.Mar 15 2015, 6:58 AM
djasper edited edge metadata.

Submitted as r232320.

This revision is now accepted and ready to land.Mar 15 2015, 6:58 AM
djasper closed this revision.Mar 15 2015, 6:58 AM