-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate emitQualifiedExpression functions
Summary: ## Context Before, we had two paths for `emitQualifiedExpression`: * `emitQualifiedExpressionOnePerLine` - breaks expressions with `UNIFIED` * `emitQualifiedExpressionSeveralInOneLine` - breaks grouped expressions with `INDEPENDENT`, and then the remaining with `UNIFIED` This had a few problems: 1. The `OnePerLine` was really a misnomer, since it didn't actually put them one-per-line if it all fit on one line 2. It was hard to modify the logic, since it's not obvious how to keep changes in sync I noticed that they could be combined if `OnePerLine` was treated as a special case of the `SeveralInOneLine` - when there are no grouped expressions. ## New problems Combining these functions has two issues: 1. Now we're keeping track of `textLength`, which further complicates the larger function 2. We have this `simple` boolean which helps deal with the differences between the two cases, mostly having to do with indentation. Both of these had to be included to avoid causing any behavior changes, but I want to deal with them by removing them in the next diff, since they add complexity and (I think) little value. ## Next steps Now that the two code paths are consolidated, I can start changing behavior as described in T80900127! Reviewed By: strulovich, hick209 Differential Revision: D33399531 fbshipit-source-id: 8f86d1cd0c9aa89cae04afbae8b3f10fde6edfef
- Loading branch information
1 parent
61a9024
commit 5164ad9
Showing
1 changed file
with
68 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters