krasimir added inline comments.
================ Comment at: include/clang/Format/Format.h:1524 + /// best-effort analysis, and could be imprecise. + unsigned Line = 0; +}; ---------------- krasimir wrote: > djasper wrote: > > Hm. Something we might need to be thinking about here is whether this > > should be the line before or after formatting. So specifically, if I format: > > > > int a > > = 1; > > f( > > > > Then, this gets reformatted to: > > > > int a = 1; > > f( > > > > Would we want the Line to be 2 or 3? > I'd go with the original line, because I think it might be more useful and > because it's easier to implement. Even better: the line after formatting is functionally dependent on the line before formatting and the replacements. I see two use-cases: clients that refuse to format in case of syntax error, then they can just use the original line, and clients that apply the partial replacements, which can compute the line after formatting from them and the original line. https://reviews.llvm.org/D32298 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits